Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

SFTTREE_ROW Structure

The SFTTREE_ROW structure is used with GetRowInfo and SetRowInfo and as part of the SFTTREE_ITEM structure (for a virtual data source).

typedef struct tagSftTreeROW {
    COLORREF colorBg;                   // row header background color
    COLORREF colorFg;                   // row header foreground color
    COLORREF colorBgSel;                // row header background color if selected
    COLORREF colorFgSel;                // row header foreground color if selected
#if defined(SFTTREE_OBSOLETE_4)
    HBITMAP hBmp;                       // bitmap (NULL if none wanted)
#else
    HBITMAP obsoletehBmp;               // bitmap (NULL if none wanted)
#endif
    short flag;                         // misc. flag
    short flag2;
#define SFTTREE_ROW_COLORSOVERRIDETHEME 0x01 // set if this row header's colors override windows theme colors
    SFT_PICTURE RowPicture1;            // row header picture
} SFTTREE_ROW, * LPSFTTREE_ROW;
typedef const SFTTREE_ROW * LPCSFTTREE_ROW;

Members

colorBg

The background color used to draw the row header when the item is not selected. Specify SFTTREE_NOCOLOR to use the default background color.

colorFg

The foreground color used to draw the row header text when the item is not selected. Specify SFTTREE_NOCOLOR to use the default text color.

colorBgSel

The background color used to draw the row header when the item is selected. Specify SFTTREE_NOCOLOR to use the default background color.

colorFgSel

The foreground color used to draw the row header text when the item is selected. Specify SFTTREE_NOCOLOR to use the default text color.

hBmp

The row header picture, displayed next to the row header text. Specify NULL to omit the row header picture. This member is provided for compatibility with older SftTree/DLL versions. The RowPicture1 member should be used instead. This member is only accessible if the preprocessor symbol SFTTREE_OBSOLETE_4 is defined.

flag

The row header text and picture position. This value overrides the default defined using SetRowHeaderStyle.

One value of each of the following tables can be combined and assigned to the flag member.

flagHorizontal row header picture alignment
not specifiedThe default alignment value defined using SetRowHeaderStyle applies.
SFTTREE_BMP_LEFTThe row header picture is displayed to the left of the row header text.
SFTTREE_BMP_CENTERThe row header picture is displayed in the center of the row header, the row header text is not shown.
SFTTREE_BMP_RIGHTThe row header picture is displayed to the right of the row header text.
flagVertical row header picture alignment
not specifiedThe default alignment value defined using SetRowHeaderStyle applies.
SFTTREE_BMP_VCENTERThe row header picture is vertically centered within the row header.
SFTTREE_BMP_TOPThe row header picture is vertically aligned with the top of the row header.
SFTTREE_BMP_BOTTOMThe row header picture is vertically aligned with the bottom of the row header.
flagHorizontal row header text alignment
not specifiedThe default alignment value defined using SetRowHeaderStyle applies.
SFTTREE_TEXT_LEFTThe row header text is left aligned within the row header.
SFTTREE_TEXT_CENTERThe row header text is centered within the row header.
SFTTREE_TEXT_RIGHTThe row header text is right aligned within the row header.
flagVertical row header text alignment
not specifiedThe default alignment value defined using SetRowHeaderStyle applies.
SFTTREE_TEXT_TOPThe row header text is aligned with the top of the row header.
SFTTREE_TEXT_VCENTERThe row header text is vertically centered within the row header.
SFTTREE_TEXT_BOTTOMThe row header text is aligned with the bottom of the row header.

RowPicture1

Defines the row header picture displayed next to the row header text. If the hBmp member defines a bitmap, RowPicture1 is ignored.

flag2

Defines row header attributes.

flag2Description
0None.
SFTTREE_ROW_COLORSOVERRIDETHEMEDefines 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 (SFTTREE_NOCOLOR), Windows themes are used.

Comments

The SFTTREE_ROW structure is used with GetRowInfo and SetRowInfo and as part of the SFTTREE_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 SFTTREE_ROWINFOPARM structure to -1.

Only one picture is used to register the picture size. After registering the picture size, any number of picture may be used.

In a fixed height tree control, all row header picture used for all row headers must be the same size. A new picture size can be registered at any time, but all row header picture in use must be replaced by pictures of the new size.

In a variable height tree control, 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.

See Also C/C++ API | Categories | Notifications