SftTabs/DLL 6.0

SFTTABS_TAB

Softel vdm, Inc.

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

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)
    // 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 */
    // 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. Windows Mobile Edition: 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:

0

The default transition effect defined using SFTTABS_CONTROL, defaultAnimationStyleShow and defaultAnimationTimeShow is used.

SFTTABS_ANIMATE_NONE

No transition effect. The default transition effect defined using SFTTABS_CONTROL, defaultAnimationStyleShow and defaultAnimationTimeShow is ignored.

milliseconds

The amount of elapsed time to be used for the transition effect, in milliseconds.

Windows Mobile Edition: Not supported.

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_LEFT

Rolls the page into view, starting at the left edge.

SFTTABS_ROLL_FROM_RIGHT

Rolls the page into view, starting at the right edge.

SFTTABS_ROLL_FROM_TOP

Rolls the page into view, starting at the top edge.

SFTTABS_ROLL_FROM_BOTTOM

Rolls the page into view, starting at the bottom edge.

SFTTABS_SLIDE_FROM_LEFT

Slides the page into view, starting at the left edge.

SFTTABS_SLIDE_FROM_RIGHT

Slides the page into view, starting at the right edge.

SFTTABS_SLIDE_FROM_TOP

Slides the page into view, starting at the top edge.

SFTTABS_SLIDE_FROM_BOTTOM

Slides the page into view, starting at the bottom edge.

SFTTABS_EXPAND_CENTER

Displays the page, expanding it from the center outwards.

Windows Mobile Edition: Not supported.

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.

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.

 

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.

Example

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

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


Feedback / comments / error reports for this topic
© 2016 - Softel vdm, Inc. - www.softelvdm.com