class CGXHeader: public CGXStatic

The CGXHeader class implements a static text control which is used to display column and row headers. Headers typically have a 3d-button-look and a special feature is that they are drawn in a pressed state if the current cell is at the same row or column. This feature will help the user find the current cell position more easily.

The user cannot modify the text in place, but can change any style attributes with the CGXStyleSheet dialog.

Style attributes which specify the appearance of the cell are:

·Text with SetValue.
·Text color with SetColor.
·Background color with SetInterior.
·Cell frame 3d-effect (raised, inset, normal) with SetDraw3dFrame.
·Borders with SetBorder.
·Horizontal alignment with SetHorizontalAlignment.
·Vertical alignment with SetVerticalAlignment.
·Font with SetFont.
·Wordbreak with SetWrapText.

CGXStatic supports displaying bitmaps in cells. Bitmaps can be expressed through the value string in a cell. The alignment of bitmaps can be specified with SetHorizontalAlignment and SetVerticalAlignment. See CGXStatic for more information about using bitmaps in cells.

You can turn off the special feature for outlining the current cell’s position by calling

   GetParam()->GetProperties()->SetMarkColHeader(FALSE);
   GetParam()->GetProperties()->SetMarkRowHeader(FALSE);

The default id for CGXHeader controls is GX_IDS_CTRL_HEADER.

You can apply header cells to row headers with

   RowHeaderStyle()
         .SetControl(GX_IDS_CTRL_HEADER)

and to column headers with

   ColHeaderStyle()
         .SetControl(GX_IDS_CTRL_HEADER)

You can turn off row numbering or letters in the column headers with


   // turn off column letters
   GetParam()->SetNumberedColHeaders(FALSE);
   // turn off row numbers
   GetParam()->SetNumberedRowHeaders(FALSE);
 

Note: You should not apply headers to cells in the grid, as the pressed button feature for outlining the current cell position will not work properly.

#include <gxall.h>

See Also

 CGXStatic  CGXGridCore::RegisterControl  CGXStyle::SetControl  CGXGridCore::RowHeaderStyle  CGXGridCore::ColHeaderStyle  CGXStyle

CGXHeader

 Class Members