The SFTBOX_ROW structure is used with GetRowInfo and SetRowInfo to retrieve and set row header attributes and as part of the SFTBOX_ITEM structure (for a virtual data source).
typedef struct tagSftBoxROW {
COLORREF colorBg, colorFg; // colors (SFTBOX_NOCOLOR if default wanted)
COLORREF colorBgSel, colorFgSel; // colors if selected
HBITMAP obsoletehBmp; // not used
short flag; // misc flag
short flag2;
#define SFTBOX_ROW_COLORSOVERRIDETHEME 0x01 // set if this row header's colors override Windows theme colors
short res1; // reserved
DWORD res2; // reserved
SFT_PICTURE RowPicture1; // row header picture
} SFTBOX_ROW, * LPSFTBOX_ROW;
typedef const SFTBOX_ROW * LPCSFTBOX_ROW;The background color used to draw the row header when the item is not selected. Specify SFTBOX_NOCOLOR to use the default background color.
The foreground color used to draw the row header text when the item is not selected. Specify SFTBOX_NOCOLOR to use the default text color.
The background color used to draw the row header when the item is selected. Specify SFTBOX_NOCOLOR to use the default background color.
The foreground color used to draw the row header text when the item is selected. Specify SFTBOX_NOCOLOR to use the default text color.
Not used. Set to NULL.
The row header text and picture position. The text alignment and the vertical picture alignment override the default defined using SetRowHeaderStyle.
One value of each of the following tables can be combined and assigned to the flag member.
| flag | Horizontal row header picture alignment |
|---|---|
| SFTBOX_BMP_LEFT | The row header picture is displayed to the left of the row header text. If no horizontal row header picture alignment value is specified, SFTBOX_BMP_LEFT is assumed. |
| SFTBOX_BMP_CENTER | The row header picture is displayed in the center of the row header, the row header text is not shown. |
| SFTBOX_BMP_RIGHT | The row header picture is displayed to the right of the row header text. |
| flag | Vertical row header picture alignment |
|---|---|
| not specified | The default alignment value defined using SetRowHeaderStyle applies. |
| SFTBOX_BMP_VCENTER | The row header picture is vertically centered within the row header. |
| SFTBOX_BMP_TOP | The row header picture is vertically aligned with the top of the row header. |
| SFTBOX_BMP_BOTTOM | The row header picture is vertically aligned with the bottom of the row header. |
| flag | Horizontal row header text alignment |
|---|---|
| not specified | The default alignment value defined using SetRowHeaderStyle applies. |
| SFTBOX_TEXT_LEFT | The row header text is left aligned within the row header. |
| SFTBOX_TEXT_CENTER | The row header text is centered within the row header. |
| SFTBOX_TEXT_RIGHT | The row header text is right aligned within the row header. |
| flag | Vertical row header text alignment |
|---|---|
| not specified | The default alignment value defined using SetRowHeaderStyle applies. |
| SFTBOX_TEXT_TOP | The row header text is aligned with the top of the row header. |
| SFTBOX_TEXT_VCENTER | The row header text is vertically centered within the row header. |
| SFTBOX_TEXT_BOTTOM | The row header text is aligned with the bottom of the row header. |
Defines row header attributes.
| flag2 | Description |
|---|---|
| 0 | None. |
| SFTBOX_ROW_COLORSOVERRIDETHEME | Defines whether an application can override Windows themes and the row header colors are used to render the row header. If set, the defined colors (colorBg, colorFg, colorBgSel, colorFgSel) are used instead of Windows themes. If all colors are set to their default value (SFTBOX_NOCOLOR), Windows themes are used. |
res1, res2
Reserved. Must be set to 0.
Defines the row header picture displayed next to the row header text. The picture position is defined using the flag member. h1 Comments
The SFTBOX_ROW structure is used with GetRowInfo and SetRowInfo and as part of the SFTBOX_ITEM structure (for a virtual data source).
An RGB value or a GetSysColor index value can be specified for all color values. If a color index is used, the high-order bit must be set (e.g., COLOR_WINDOW | 0x80000000L).
A row header may have an associated row header picture without the picture actually being visible. The row header picture doesn't become visible until the row header picture size has been registered using SetRowInfo by setting the index member of the SFTBOX_ROWINFOPARM structure to -1.
Only one picture is used to register the picture size. After registering the picture size, any number of pictures may be used.
In a fixed height combo box control, all row header pictures used for all row headers must be the same size. A new picture size can be registered at any time, but all row header pictures in use must be replaced by pictures of the new size.
In a variable height combo box control (see SFTBOXSTYLE_VARIABLE), row header pictures can be of varying sizes. The largest picture size must be registered using SetRowInfo.
Row header text can be retrieved using GetRowText and modified using SetRowText.
Pointer typedefs: LPSFTBOX_ROW is a pointer to a SFTBOX_ROW structure, LPCSFTBOX_ROW is a pointer to a constant SFTBOX_ROW structure.
See Also C/C++ API | Categories | Notifications