Hide

SftTabs/DLL 6.5 - Tab Control

Display
Print

SFTTABS_TAB Structure

Describes one tab label, including its colors, picture and text components.

typedef struct tagSftTabsTab {
typedef struct tagSftTabsTab {
    /* modifiable fields */
    COLORREF colorBg, colorFg;          /* color */
    COLORREF colorBgSel, colorFgSel;
    SFTTABS_GRAPH graph;                /* graphics */
    BOOL fEnabled;                      /* enabled/disabled status */

    SFTTABS_DWORD_PTR userData;         /* userdata */

    SFTTABS_DWORD_PTR lpTabData;        /* reserved for C, C++ class implementation */
    HWND hwndSubDlg;                    /* reserved for C, C++ class implementation */

    COLORREF colorFlybyFg;              /* Flyby foreground color */
    COLORREF colorClientArea;           /* Client area color */

    // the following inserted fields have rendered 4.0 incompatible with 3.5
    DWORD animationTimeShow;            /* # of milliseconds for animation */
    DWORD animationStyleShow;           /* type of animation */
    DWORD animationTimeHide;            /* # of milliseconds for animation */
    DWORD animationStyleHide;           /* type of animation */

    // the following inserted fields have rendered 4.5 incompatible with 4.0
    HIMAGELIST hImageList;              /* imagelist used for this tab */
    BOOL fHidden;                       /* hide tab if True */
    // the following inserted fields have rendered 5.0 incompatible with 4.5
    COLORREF colorBgStart, colorBgEnd;  /* gradient fill background color */
    COLORREF colorBgSelStart, colorBgSelEnd;/* gradient fill background color, active tab */
    COLORREF colorClientAreaStart, colorClientAreaEnd;/* gradient fill client area color */
    // the following inserted fields have rendered 6.0 incompatible with 5.0
    SFT_PICTURE TabPicture;             // tab picture
    SFT_PICTURE TabPictureDisabled;     // tab picture (disabled)
    SFT_PICTURE TabPictureHot;          // tab picture (hot)
    // the following inserted fields have rendered 6.5 incompatible with 6.0
    short fHasCloseButton;              /* tab has a tab close button - uses TabPicture2.... images*/
    short gap2;                         /* gap between tab label and second tab image */
    SFT_PICTURE TabPicture2;            /* tab picture 2 */
    SFT_PICTURE TabPicture2Active;      /* tab picture 2, active tab */
    SFT_PICTURE TabPicture2Disabled;    /* tab picture 2 (disabled) */
    SFT_PICTURE TabPicture2Hot;         /* tab picture 2 (hot) */
    // end of inserted incompatible area

    /* read/only information */
    int x, y;                           /* position (top left corner) */
    int cx, cy;                         /* width and height */
    int cxVis, cyVis;                   /* width and height of visible portion */

    LPTSTR lpszText;                    /* label text */
    LPTSTR lpszToolTip;                 /* tool tip text (formerly res10) */

    // the following inserted fields have rendered 4.5 incompatible with 4.0
    int iTab;                           /* tab index (visible tabs only in aTab[] */
    int iRealTab;                       /* tab index (all tabs in aRealTab[] */
    // the following inserted fields have rendered 6.0 incompatible with 5.0
    RECT rectPic, rectText;             /* location of the tab's tab picture and tab label */
    // the following inserted fields have rendered 6.5 incompatible with 6.0
    RECT rectPic2;                      /* location of the tab's tab picture2 */
    // end of inserted incompatible area

    SFTTABS_DWORD_PTR res11;            /* reserved */

} SFTTABS_TAB, * LPSFTTABS_TAB;

typedef const SFTTABS_TAB * LPCSFTTABS_TAB;

Members

colorBg

The background color of the tab when the tab is not the active tab. Use a color value or SFTTABS_NOCOLOR, the default window background color. If fTextOnly is TRUE (see SFTTABS_CONTROL), this background color is only used as background color of the tab text. The remainder of the tab will be filled with the tab control's background color. This value can be modified using SetTabInfo. When using themes, this color value is ignored.

colorFg

The foreground text color of the tab when the tab is not the active tab. Use a color value or SFTTABS_NOCOLOR, the default window text color. This value can be modified using SetTabInfo. When using themes, this color value is ignored.

colorBgSel

The background color of the tab when the tab is the active tab. Use a color value or SFTTABS_NOCOLOR, the default window background color. If fTextOnly is TRUE (see SFTTABS_CONTROL), this background color is only used as background color of the tab text. The remainder of the tab will be filled with the tab control's background color. This value can be modified using SetTabInfo. When using themes, this color value is ignored.

colorFgSel

The foreground text color of the tab when the tab is the active tab. Use a color value or SFTTABS_NOCOLOR, the default window text color. This value can be modified using SetTabInfo. When using themes, this color value is ignored.

graph

The picture component. See SFTTABS_GRAPH for more information. This value can be modified using SetTabInfo.

fEnabled

The tab status. Set to TRUE to enable the tab or FALSE to disable. A disabled tab will be shown with its picture bitmap component drawn in a "grayed" fashion. Icons are always drawn with their original colors, never grayed. The text portion will be shown grayed if the default colors (SFTTABS_NOCOLOR) are defined, otherwise the specified colors will be used. This value can be modified using SetTabInfo. When using themes, a disabled tab may not be distinguishable from an enabled tab.

Tabs can also be completely hidden using the fHidden member.

userData

An application defined value associated with the tab. This value can be modified using SetTabInfo.

lpTabData

Stores a pointer used for the C and C++ implementation of tabbed dialogs. For C, the pointer points to a function of type SFTTABS_TABCALLBACK. This callback routine is called by SftTabs/DLL to create and destroy the page associated with this tab. For C++, the pointer points to the C++ object based on CSftTabsPage. This value can be modified using SetTabInfo, SetTabDialog or SetTabWindowPage.

hwndSubDlg

Stores a window handle used for the C and C++ implementation of tabbed dialogs. The window handle describes the page attached to the tab. This value can be modified using SetTabInfo.

colorFlybyFg

The foreground color used for flyby highlighting (if enabled). If SFTTABS_NOCOLOR is specified, the default is RGB(0,0,128). When using themes, this color value is ignored.

colorClientArea

The background color used to fill the client area. The client area is not visible if child windows or child dialogs use the entire client area, which is normally the case in tabbed dialogs and windows. However, tabbed dialogs will automatically use this color as background color for the tab page (see Background). The client area (or frame) of rows appearing behind the current client area use the color of the row's first tab if fUseClientAreaColor in the SFTTABS_CONTROL structure is set to TRUE. When using themes, this color value is ignored.

animationTimeShow

Defines the amount of time to be used for the transition effect when displaying the tab page attached to this tab (if any). Use one of the following values:

0The default transition effect defined using SFTTABS_CONTROL, defaultAnimationStyleShow and defaultAnimationTimeShow is used.
SFTTABS_ANIMATE_NONENo transition effect. The default transition effect defined using SFTTABS_CONTROL, defaultAnimationStyleShow and defaultAnimationTimeShow is ignored.
millisecondsThe amount of elapsed time to be used for the transition effect, in milliseconds.

animationStyleShow

Defines the desired visual transition effect. This value is ignored if animateTimeShow is not a positive number defining an elapsed time. Use one of the following values:

SFTTABS_ROLL_FROM_LEFTRolls the page into view, starting at the left edge.
SFTTABS_ROLL_FROM_RIGHTRolls the page into view, starting at the right edge.
SFTTABS_ROLL_FROM_TOPRolls the page into view, starting at the top edge.
SFTTABS_ROLL_FROM_BOTTOMRolls the page into view, starting at the bottom edge.
SFTTABS_SLIDE_FROM_LEFTSlides the page into view, starting at the left edge.
SFTTABS_SLIDE_FROM_RIGHTSlides the page into view, starting at the right edge.
SFTTABS_SLIDE_FROM_TOPSlides the page into view, starting at the top edge.
SFTTABS_SLIDE_FROM_BOTTOMSlides the page into view, starting at the bottom edge.
SFTTABS_EXPAND_CENTERDisplays the page, expanding it from the center outwards.

animationTimeHide

Reserved for future use. Must be set to 0.

animationStyleHide

Reserved for future use. Must be set to 0.

hImageList

The ImageList control used for this tab if the graph member of the SFTTABS_TAB structure defines a tab picture located in an ImageList control. If hImageList is NULL, the default ImageList control defined using the SFTTABS_CONTROL structure is used instead.

fHidden

The tab visibility. Set to TRUE to hide the tab or FALSE to show. A hidden tab is never displayed. Its tab page is completely hidden also and the user cannot make the tab visible. Only the application can make a hidden tab visible. This is not equivalent to a tab that is currently not visible because the tab may have scrolled off the edge of the control. This value can be modified using SetTabInfo.

Hidden tabs are best used in situations where certain groups of users should not have access to all tabs of a tab control, without being aware that additional tabs may exist. Otherwise, disabling a tab is possible using the fEnabled member. A disabled tab is still visible to the end user.

colorBgStart

The background color (starting color when using a gradient fill along with colorBgEnd) of the tab when the tab is not the active tab. Use a color value or SFTTABS_NOCOLOR, the default window background color. If fTextOnly is TRUE (see SFTTABS_CONTROL), this background color is only used as background color of the tab text. The remainder of the tab will be filled with the tab control's background color. This value can be modified using SetTabInfo. When using themes, this color value is ignored.

If both colorBgStart and colorBgEnd are defined, the tab is rendered using a gradient fill when the tab is not the current tab. On display devices that do not support gradient fills or if fewer than 65K colors are available, colorBg is used instead.

colorBgEnd

The background color (ending color when using a gradient fill along with colorBgStart) of the tab when the tab is not the active tab. Use a color value or SFTTABS_NOCOLOR, the default window background color. If fTextOnly is TRUE (see SFTTABS_CONTROL), this background color is only used as background color of the tab text. The remainder of the tab will be filled with the tab control's background color. This value can be modified using SetTabInfo. When using themes, this color value is ignored.

If both colorBgStart and colorBgEnd are defined, the tab is rendered using a gradient fill when the tab is not the current tab. On display devices that do not support gradient fills or if fewer than 65K colors are available, colorBg is used instead.

colorBgSelStart

The background color (starting color when using a gradient fill along with colorBgSelEnd) of the tab when the tab is the active tab. Use a color value or SFTTABS_NOCOLOR, the default window background color. If fTextOnly is TRUE (see SFTTABS_CONTROL), this background color is only used as background color of the tab text. The remainder of the tab will be filled with the tab control's background color. This value can be modified using SetTabInfo. When using themes, this color value is ignored.

If both colorBgSelStart and colorBgSelEnd are defined, the tab is rendered using a gradient fill when the tab is the current tab. On display devices that do not support gradient fills or if fewer than 65K colors are available, colorBg is used instead.

colorBgSelEnd

The background color (ending color when using a gradient fill along with colorBgSelStart) of the tab when the tab is the active tab. Use a color value or SFTTABS_NOCOLOR, the default window background color. If fTextOnly is TRUE (see SFTTABS_CONTROL), this background color is only used as background color of the tab text. The remainder of the tab will be filled with the tab control's background color. This value can be modified using SetTabInfo. When using themes, this color value is ignored.

If both colorBgSelStart and colorBgSelEnd are defined, the tab is rendered using a gradient fill when the tab is the current tab. On display devices that do not support gradient fills or if fewer than 65K colors are available, colorBg is used instead.

colorClientAreaStart

The background color (starting color when using a gradient fill along with colorClientAreaEnd) used to fill the client area. The client area is not visible if child windows or child dialogs use the entire client area, which is normally the case in tabbed dialogs and windows. However, tabbed dialogs will automatically use this color as background color for the tab page (see Background). The client area (or frame) of rows appearing behind the current client area use the color of the row's first tab if fUseClientAreaColor in the SFTTABS_CONTROL structure is set to TRUE. When using themes, this color value is ignored.

colorClientAreaEnd

The background color (ending color when using a gradient fill along with colorClientAreaStart) used to fill the client area. The client area is not visible if child windows or child dialogs use the entire client area, which is normally the case in tabbed dialogs and windows. However, tabbed dialogs will automatically use this color as background color for the tab page (see Background). The client area (or frame) of rows appearing behind the current client area use the color of the row's first tab if fUseClientAreaColor in the SFTTABS_CONTROL structure is set to TRUE. When using themes, this color value is ignored.

TabPicture

Defines the tab picture displayed for the tab. The SFT_PICTURE structure is used to define the exact image and image type used (a bitmap, icon or ImageList image, GDI+ image, etc.). If the TabPicture member defines a picture, only the SFTTABS_GRAPH structure's location member is used to define the position of the graphic. The remaining members of the SFTTABS_GRAPH structure are ignored.

The TabPictureHot and TabPictureDisabled members can be used to define a hot (flyby highlighting) or disabled tab (see fEnabled).

TabPictureHot

Defines the tab picture displayed for the tab when the tab is hot (flyby highlighting). This member is optional. If no tab picture is defined, the default TabPicture member is used instead.

If the TabPicture member doesn't define a picture, the TabPictureHot and TabPictureDisabled members are ignored.

TabPictureDisabled

Defines the tab picture displayed for the tab when the tab is disabled (see fEnabled). This member is optional. If no tab picture is defined, the default TabPicture member is used instead.

If the TabPicture member doesn't define a picture, the TabPictureHot and TabPictureDisabled members are ignored.

fHasCloseButton

Defines whether the second tab picture is shown for this tab. If the fHasCloseButton member is set to FALSE, the TabPicture2 member is ignored and the second tab image is never shown.

gap2

Defines the gap between the tab label (or the first tab image) and the second tab image (in pixels).

TabPicture2

Defines the second tab picture displayed for the tab. This is typically used for a tab Close button. It is only displayed if the tab is the current tab or the mouse cursor is located on the tab. The SFT_PICTURE structure is used to define the exact image and image type used (a bitmap, icon or ImageList image, GDI+ image, etc.). If the TabPicture2 member defines a picture, only the SFTTABS_GRAPH structure's location member is used to define the position of the graphic. The remaining members of the SFTTABS_GRAPH structure are ignored.

If the fHasCloseButton member is set to FALSE, the TabPicture2 member is ignored and the second tab image is never shown.

The TabPicture2Hot and TabPicture2Disabled members can be used to define the second tab picture for a hot (flyby highlighting) or disabled tab (see fEnabled). If not specified, the default second tab image is used instead (see TabPicture2).

TabPicture2Active

Defines the second tab picture displayed for the tab when the tab is the current tab. If not specified, the default second tab image is used instead (see TabPicture2).

If the TabPicture2 member doesn't define a picture, the TabPicture2Active member is ignored.

TabPicture2Hot

Defines the second tab picture displayed for the tab when the tab is hot (flyby highlighting). This member is optional. If no second tab picture is defined, the default TabPicture2 member is used instead.

If the TabPicture2 member doesn't define a picture, the TabPicture2Hot and TabPicture2Disabled members are ignored.

TabPicture2Disabled

Defines the second tab picture displayed for the tab when the tab is disabled (see fEnabled). This member is optional. If no second tab picture is defined, the default TabPicture2 member is used instead.

If the TabPicture2 member doesn't define a picture, the TabPicture2Hot and TabPicture2Disabled members are ignored.

cx, cy

Current theoretical width and height of the tab. A tab may be truncated in a scrollable tab control. In this case, the cx and cy members hold the full, untruncated size of the tab.

cxVis, cyVis

Current actual width and height of the tab. A tab may be truncated in a scrollable tab control. In this case, the cxVis and cyVis members hold the size of the visible portion of the tab.

lpszText

The tab text. This value can be modified using SetTabLabel.

lpszToolTip

The tab's ToolTip text. This value can be modified using SetToolTip.

iTab

The zero-based index of the tab. This includes visible and hidden tabs.

iRealTab

The zero-based index of the tab. This only includes visible tabs. Hidden tabs are not included.

rectPic

The location of the tab picture (if present) in pixels, relative to the top, left corner of the control.

rectText

The location of the tab label (if present) in pixels, relative to the top, left corner of the control.

rectPic2

The location of the second tab picture (if present) in pixels, relative to the top, left corner of the control.

Comments

The SFTTABS_TAB structure describes one tab label, including its colors, picture and text components.

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

The SFTTABS_TAB structure can be defined using the SftTabs/DLL Wizard.

This example changes a tab's background color.

C

SFTTABS_TAB Tab;
SftTabs_GetTabInfo(hwndTab, 2, &Tab);
Tab.colorBg = RGB(255, 0, 0);
SftTabs_SetTabInfo(hwndTab, 2, &Tab);

C++

SFTTABS_TAB Tab;
m_Tab.GetTabInfo(2, &Tab);
Tab.colorBg = RGB(255, 0, 0);
m_Tab.SetTabInfo(2, &Tab);

Examples

C

    FALSE,                               /* don't display clientarea border - select styles only */
    SFTTABS_TABS_LEFT,                   /* alignment of tabs on all rows */
    SFTTABS_LAYOUT_DISTRIBUTE,           /* distribution of tabs on rows */
    0, 0,                                /* minimum and maximum number of rows for autoflow layout (none specified) */
    FALSE,                               /* reorderable tabs */
    FALSE,                               /* drag & drop */
};

static const SFTTABS_TAB Page6_Tab1_Tab0 = {   /*&1 */
    SFTTABS_NOCOLOR, SFTTABS_NOCOLOR,    /* background, foreground color */
    SFTTABS_NOCOLOR, SFTTABS_NOCOLOR,    /* background, foreground color (when selected) */
    { SFTTABS_GRAPH_NONE, 0 },           /* location */
    TRUE,                                /* enabled/disabled */
    0,                                   /* userdata */
    (SFTTABS_DWORD_PTR) Page6Page_Callback,          /* create/destroy callback */
    NULL,                                /* reserved */

C++

    FALSE,                               /* don't display clientarea border - select styles only */
    SFTTABS_TABS_LEFT,                   /* alignment of tabs on all rows */
    SFTTABS_LAYOUT_DISTRIBUTE,           /* distribution of tabs on rows */
    0, 0,                                /* minimum and maximum number of rows for autoflow layout (none specified) */
    FALSE,                               /* reorderable tabs */
    FALSE,                               /* drag & drop */
};

static const SFTTABS_TAB Tab0 = {   /*The First One */
    SFTTABS_NOCOLOR, RGB(0,0,255),       /* background, foreground color */
    SFTTABS_NOCOLOR, RGB(0,0,255),       /* background, foreground color (when selected) */
    { SFTTABS_GRAPH_LEFT, 0 },           /* location */
    TRUE,                                /* enabled/disabled */
    0,                                   /* userdata */
    0,                                   /* reserved */
    NULL,                                /* reserved */

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


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.