Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

SFTTREE_COLORS Structure

The SFTTREE_COLORS structure is used with GetCtlColors and SetCtlColors to retrieve and set a tree control's color attributes.

typedef struct tagSftTreeTreeColors {
    COLORREF colorBg;                   // background color
    COLORREF colorFg;                   // foreground color
    COLORREF colorFgGrayed;             // grayed text foreground color
    COLORREF colorSelBg;                // selection background color
    COLORREF colorSelFg;                // selection foreground color
    COLORREF colorDarkEdge;             // 3D dark edge
    COLORREF colorLightEdge;            // 3D light edge
    COLORREF colorColHdrBg;             // column header background color
    COLORREF colorColHdrFg;             // column header foreground color
    COLORREF colorColHdrFgGrayed;       // column header grayed text color
    COLORREF colorColHdrDarkEdge;       // column header 3D dark edge
    COLORREF colorColHdrLightEdge;      // column header 3D light edge
    COLORREF colorRowHdrBg;             // row header background color
    COLORREF colorRowHdrFg;             // row header foreground color
    COLORREF colorRowHdrSelBg;          // row header selected background color
    COLORREF colorRowHdrSelFg;          // row header selected foreground color
    COLORREF colorRowHdrFgGrayed;       // row header grayed text color
    COLORREF colorRowHdrDarkEdge;       // row header 3D dark edge
    COLORREF colorRowHdrLightEdge;      // row header 3D light edge
    COLORREF colorRowColHdrBg;          // row/column header background color
    COLORREF colorRowColHdrFg;          // row/column header foreground color
    COLORREF colorRowColHdrFgGrayed;    // row/column header grayed text color
    COLORREF colorRowColHdrDarkEdge;    // row/column header 3D dark edge
    COLORREF colorRowColHdrLightEdge;   // row/column header 3D light edge
    COLORREF colorGridVert;             // vertical gridline color
    COLORREF colorGridHorz;             // horizontal gridline color
    COLORREF colorDropHighlight;        // drop highlight color
    COLORREF colorTreeLines;            // tree line color
    COLORREF colorTreeLinesGrayed;      // tree line color (disabled control)
    COLORREF colorOddBg;                // background color in odd rows
    COLORREF colorOddFg;                // foreground color in even rows
    COLORREF colorToolTipBg;            // tooltip background color
    COLORREF colorToolTipFg;            // tooltip foreground color
    COLORREF colorSelBgNoFocus;         // selection background color - nofocus
    COLORREF colorSelFgNoFocus;         // selection foreground color - nofocus
    COLORREF selectionOutlineBorder;    // selection outline colors
    COLORREF selectionInnerBorder;
    COLORREF selectionInnerFill1;
    COLORREF selectionInnerFill2;
    COLORREF selectionFlybyOutlineBorder;// selection outline colors
    COLORREF selectionFlybyInnerBorder;
    COLORREF selectionFlybyInnerFill1;
    COLORREF selectionFlybyInnerFill2;
    COLORREF nofocusOutlineBorder;      // selection outline colors when control doesn't have the input focus
    COLORREF nofocusInnerBorder;
    COLORREF nofocusInnerFill1;
    COLORREF nofocusInnerFill2;
    COLORREF flybyOutlineBorder;        // flyby highlighting outline colors
    COLORREF flybyInnerBorder;
    COLORREF flybyInnerFill1;
    COLORREF flybyInnerFill2;
    COLORREF droptargetOutlineBorder;   // drop target outline colors
    COLORREF droptargetInnerBorder;
    COLORREF droptargetInnerFill1;
    COLORREF droptargetInnerFill2;
    COLORREF colorColFtrBg;             // column footer background color
    COLORREF colorColFtrFg;             // column footer foreground color
    COLORREF colorColFtrFgGrayed;       // column footer grayed text color
    COLORREF colorColFtrDarkEdge;       // column footer 3D dark edge
    COLORREF colorColFtrLightEdge;      // column footer 3D light edge
    COLORREF colorRowColFtrBg;          // row/column footer background color
    COLORREF colorRowColFtrFg;          // row/column footer foreground color
    COLORREF colorRowColFtrFgGrayed;    // row/column footer grayed text color
    COLORREF colorRowColFtrDarkEdge;    // row/column footer 3D dark edge
    COLORREF colorRowColFtrLightEdge;   // row/column footer 3D light edge
    COLORREF colorEdgeVertical;         // vertical edge around headers, footers
    COLORREF colorEdgeHorizontal;       // horizontal edge around row headers, row and column headers
    COLORREF colorSortIndicator;        // sort indicator color (non-themed only)
} SFTTREE_COLORS, * LPSFTTREE_COLORS;

typedef const SFTTREE_COLORS * LPCSFTTREE_COLORS;

Members

colorBg

The default background color used to draw items that are not selected. Columns can override the default background color using SetColumns. Cells can override the default background color using SetCellInfo. If a selected item uses a selection style (see SetSelectionStyle) that uses the colorSelBg value for only portions of the item, the color colorBg is used for the remainder of the item.

colorFg

The default foreground color used to draw items that are not selected. Columns can override the default foreground color using SetColumns. Cells can override the default foreground color using SetCellInfo. If an item is disabled (see SetItemStatus), the colorFgGrayed value is used instead of colorFg. If a selected item uses a selection style (see SetSelectionStyle) that uses the colorSelFg value for only portions of the item, the color colorFg is used for the remainder of the item.

colorFgGrayed

The default foreground color used to draw items that are disabled. Cells can override the foreground color for disabled items using SetCellInfo.

colorSelBg

The default background color used to draw items (rows) that are selected. Columns can override the default background color using SetColumns. Cells can override the background color using SetCellInfo. If a selected item uses a selection style (see SetSelectionStyle) that uses the colorSelBg value for only portions of the item, the color colorBg is used for the remainder of the item.

colorSelFg

The default foreground color used to draw items that are selected. Columns can override the default foreground color using SetColumns. Cells can override the foreground color using SetCellInfo. If an item is disabled (see SetItemStatus), the colorFgGrayed value is used instead of the colorSelFg value. If a selected item uses a selection style (see SetSelectionStyle) that uses the colorSelFg value for only portions of the item, the colorFg value is used for the remainder of the item.

colorDarkEdge

The color used to draw the shadow edge of items when items are displayed in a 3D fashion (see SetShow3D).

colorLightEdge

The color used to draw the highlighted edge of items when items are displayed in a 3D fashion (see SetShow3D).

colorColHdrBg

The default background color for column headers. Individual column headers can override the color using SFTTREE_COLUMN_EX, headerColorBg.

colorColHdrFg

The default foreground color for column headers. Individual column headers can override the color using SFTTREE_COLUMN_EX, headerColorFg.

colorColHdrFgGrayed

The foreground color used to draw disabled column headers. SetColumns is used to enable and disable individual column headers. Individual column headers can override the color using SFTTREE_COLUMN_EX, headerColorFgDisabled.

colorColHdrDarkEdge

The color used to draw the dark edge of the column header. All column headers use the same shadow color and cannot be defined individually.

colorColHdrLightEdge

The color used to draw the highlighted edge of the column headers. All column headers use the same highlight color and cannot be defined individually.

colorRowHdrBg

The default background color used to draw row headers of items that are not selected. Items can override the row header background color using SetRowInfo.

colorRowHdrFg

The default foreground color used to draw row headers of items that are not selected. Items can override the row header foreground color using SetRowInfo.

colorRowHdrSelBg

The default background color used to draw an item's row header that is selected. Items can override the row header's background color using SetRowInfo.

colorRowHdrSelFg

The default foreground color used to draw an item's row header that is selected. Items can override the row header's foreground color using SetRowInfo.

colorRowHdrFgGrayed

The default foreground color used to draw an item's row header that is disabled. Items can override the row header's foreground color using SetRowInfo.

colorRowHdrDarkEdge

The color used to draw the dark edge of row headers. All row headers use the same shadow color and cannot be defined individually.

colorRowHdrLightEdge

The color used to draw the highlighted edge of row headers. All row headers use the same highlight color and cannot be defined individually.

colorRowColHdrBg

The row/column header's background color.

colorRowColHdrFg

The row/column header's foreground color.

colorRowColHdrFgGrayed

The foreground color used to draw a disabled row/column header.

colorRowColHdrDarkEdge

The color used to draw the dark edge of the row/column header.

colorRowColHdrLightEdge

The color used to draw the highlighted edge of the row/column header.

colorGridVert

The color used to draw vertical grid lines. If colorGridVert is set to SFTTREE_NOCOLOR, a suitable default color is used based on the operating system and current Windows theme used.

colorGridHorz

The color used to draw horizontal grid lines. If colorGridHorz is set to SFTTREE_NOCOLOR, a suitable default color is used based on the operating system and current Windows theme used.

colorDropHighlight

The color used to display the drop target item of a drag & drop operation. The drop target is displayed using colorDropHighlight based on the values specified using SetDropHighlightStyle and SetDropHighlight.

colorTreeLines

The color used to draw connecting tree lines.

colorTreeLinesGrayed

The color used to draw connecting tree lines when an item (see SetItemStatus) or the control is disabled (see EnableWindow).

colorOddBg

The background color used to draw items in odd numbered rows that are not selected. Cells can override the background color using SetCellInfo. Specify SFTTREE_NOCOLOR to use the default background color colorBg.

colorOddFg

The foreground color used to draw items in odd numbered rows that are not selected. Cells can override the foreground color using SetCellInfo. Specify SFTTREE_NOCOLOR to use the default foreground color colorFg.

colorToolTipBg

The background color used to draw a ToolTip or ScrollTip. Specify SFTTREE_NOCOLOR to use the default background color. For cell ToolTips, the default is the background color of the cell or column. For ScrollTips, the default is defined using Control Panel (see GetSysColor(COLOR_INFOBK)).

colorToolTipFg

The foreground color used to draw a ToolTip or ScrollTip. Specify SFTTREE_NOCOLOR to use the default foreground color. For cell ToolTips, the default is the foreground color of the cell or column. For ScrollTips, the default is defined using Control Panel (see GetSysColor(COLOR_INFOTEXT)).

colorSelBgNoFocus

The background color used to draw a selected item when the tree control does not have the input focus. If the tree control has the input focus, the color colorSelBg is used instead. This color value is only used if SetNoFocusStyle(SFTTREE_NOFOCUS_KEEPSEL) is used.

colorSelFgNoFocus

The foreground color used to draw a selected item when the tree control does not have the input focus. If the tree control has the input focus, the color colorSelFg is used instead. This color value is only used if SetNoFocusStyle(SFTTREE_NOFOCUS_KEEPSEL) is used.

selectionOutlineBorder

The outermost border color used to render the rounded selection outline rectangle of a selected item. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE).

selectionInnerBorder

The inner border color used to render the rounded selection outline rectangle of a selected item. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE).

selectionInnerFill1

The starting color (top) used to gradient fill the inside of the rounded selection outline rectangle of a selected item. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE).

selectionInnerFill2

The ending color (bottom) used to gradient fill the inside of the rounded selection outline rectangle of a selected item. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE).

selectionFlybyOutlineBorder

The outermost border color used to render the rounded selection outline rectangle of a selected item that is highlighted due to flyby highlighting. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE).

selectionFlybyInnerBorder

The inner border color used to render the rounded selection outline rectangle of a selected item that is highlighted due to flyby highlighting. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE).

selectionFlybyInnerFill1

The starting color (top) used to gradient fill the rounded selection outline rectangle of a selected item that is highlighted due to flyby highlighting. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE).

selectionFlybyInnerFill2

The ending color (bottom) used to gradient fill the rounded selection outline rectangle of a selected item that is highlighted due to flyby highlighting. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE) and if SetNoFocusStyle(SFTTREE_NOFOCUS_KEEPSEL) is defined.

nofocusOutlineBorder

The outermost border color used to render the rounded selection outline rectangle of a selected item, when the tree control does not have the input focus. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE) and if SetNoFocusStyle(SFTTREE_NOFOCUS_KEEPSEL) is defined.

nofocusInnerBorder

The inner border color used to render the rounded selection outline rectangle of a selected item, when the tree control does not have the input focus. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE) and if SetNoFocusStyle(SFTTREE_NOFOCUS_KEEPSEL) is defined.

nofocusInnerFill1

The starting color (top) used to gradient fill the inside of the rounded selection outline rectangle of a selected item, when the tree control does not have the input focus. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE) and if SetNoFocusStyle(SFTTREE_NOFOCUS_KEEPSEL) is defined.

nofocusInnerFill2

The ending color (bottom) used to gradient fill the inside of the rounded selection outline rectangle of a selected item, when the tree control does not have the input focus. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE) and if SetNoFocusStyle(SFTTREE_NOFOCUS_KEEPSEL) is defined.

flybyOutlineBorder

The outermost border color used to render the rounded selection outline rectangle of an item that is highlighted due to flyby highlighting. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE).

flybyInnerBorder

The inner border color used to render the rounded selection outline rectangle of an item that is highlighted due to flyby highlighting. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE).

flybyInnerFill1

The starting color (top) used to gradient fill the rounded selection outline rectangle of an item that is highlighted due to flyby highlighting. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE).

flybyInnerFill2

The ending color (bottom) used to gradient fill the rounded selection outline rectangle of an item that is highlighted due to flyby highlighting. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE).

droptargetOutlineBorder

The outermost border color used to render the rounded selection outline rectangle of an item that is the current drop target item (see SetDropHighlight). This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE).

droptargetInnerBorder

The inner border color used to render the rounded selection outline rectangle of an item that is the current drop target item (see SetDropHighlight). This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE).

droptargetInnerFill1

The starting color (top) used to gradient fill the rounded selection outline rectangle of an item that is the current drop target item (see SetDropHighlight). This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE).

droptargetInnerFill2

The ending color (bottom) used to gradient fill the rounded selection outline rectangle of an item that is the current drop target item (see SetDropHighlight). This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE).

colorColFtrBg

The default background color for column footers. Individual columns can override the color using SFTTREE_COLUMN_EX, footerColorBg.

colorColFtrFg

The default foreground color for column footers. Individual columns can override the color using SFTTREE_COLUMN_EX, footerColorFg.

colorColFtrFgGrayed

The foreground color used to draw disabled column footers. SetColumns is used to enable and disable individual column footers. Individual column footers can override the color using SFTTREE_COLUMN_EX, footerColorFgDisabled.

colorColFtrDarkEdge

The color used to draw the dark edge of the column footers. All column footers use the same shadow color and cannot be defined individually.

colorColFtrLightEdge

The color used to draw the highlighted edge of the column footers. All column footers use the same highlight color and cannot be defined individually.

colorRowColFtrBg

The row/column footer's background color.

colorRowColFtrFg

The row/column footer's foreground color.

colorRowColFtrFgGrayed

The foreground color used to draw a disabled row/column footer.

colorRowColFtrDarkEdge

The color used to draw the dark edge of the row/column footer.

colorRowColFtrLightEdge

The color used to draw the highlighted edge of the row/column footer.

colorEdgeVertical

The color used to draw the vertical edge around column headers, column footers, row headers, row/column headers and row/column footers. Depending on whether Windows themes are used, this color may not be used.

colorEdgeHorizontal

The color used to draw the horizontal edge around column headers, column footers, row headers, row/column headers and row/column footers. Depending on whether Windows themes are used, this color may not be used.

colorSortIndicator

The color used to draw the sort indicator in column headers. Depending on whether Windows themes are used, this color may not be used.

Comments

The SFTTREE_COLORS structure is used with GetCtlColors and SetCtlColors to retrieve and set a tree control's color attributes.

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).

Many color settings have no effect when Windows themes are used.

Examples

C

        SftTree_SetRowColHeaderStyle(g_hwndTree, ES_LEFT | SFTTREE_HEADER_UP);/* Row/column header style */
        Sft_InitPicture(&Pic);
        Sft_SetPictureSizeOnly(&Pic, PIC_SIZEX, PIC_SIZEY);/* Row/column header picture */
        SftTree_SetRowColHeaderPicture(g_hwndTree, &Pic);/* Row/column picture */
        SftTree_SetRowColHeaderPictureStyle(g_hwndTree, SFTTREE_BMP_RIGHT);/* Row/column picture alignment */
        SftTree_SetCharSearchMode(g_hwndTree, SFTTREE_CHARSEARCH_ALLCHARS, -1);/* Consider all characters typed */
        /* Change the default colors */
        {
            SFTTREE_COLORS Colors;
            SftTree_GetCtlColors(g_hwndTree, &Colors);/* Get current color settings */
            Colors.colorTreeLines = COLOR_3DDKSHADOW | 0x80000000L;/* Tree line color */
            Colors.colorSelBgNoFocus = COLOR_BTNFACE | 0x80000000L;/* Selection background color (no input focus) */
            Colors.colorSelFgNoFocus = COLOR_BTNTEXT | 0x80000000L;/* Selection foreground color (no input focus) */
            SftTree_SetCtlColors(g_hwndTree, &Colors);/* Set new colors */
        }

C++

    m_Tree.SetRowColHeaderStyle(ES_LEFT | SFTTREE_HEADER_UP);/* Row/column header style */
    Sft_InitPicture(&Pic);               /* Initialize */
    Sft_SetPictureSizeOnly(&Pic, PIC_SIZEX, PIC_SIZEY);/* Row/column header picture */
    m_Tree.SetRowColHeaderPicture(&Pic);       /* Row/column picture */
    m_Tree.SetRowColHeaderPictureStyle(SFTTREE_BMP_RIGHT);/* Row/column picture alignment */
    m_Tree.SetCharSearchMode(SFTTREE_CHARSEARCH_ALLCHARS, -1);/* Consider all characters typed */
    /* Change the default colors */
    {
        SFTTREE_COLORS Colors;
        m_Tree.GetCtlColors(&Colors);    /* Get current color settings */
        Colors.colorTreeLines = COLOR_3DDKSHADOW | 0x80000000L;/* Tree line color */
        Colors.colorSelBgNoFocus = COLOR_BTNFACE | 0x80000000L;/* Selection background color (no input focus) */
        Colors.colorSelFgNoFocus = COLOR_BTNTEXT | 0x80000000L;/* Selection foreground color (no input focus) */
        m_Tree.SetCtlColors(&Colors);    /* Set new colors */
    }

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