SEC3DTabControl Class

class SEC3DTabControl: public SECTabControlBase

The SEC3DTabControl class implements a tab control with a three-dimensional look and feel (similar to Developer Studio’s Project Workspace window). The 3-D tabs can be positioned on the top, bottom, left or right. The SEC3DTabControl inherits its interface from SECTabControlBase and adds the implementation details that define its appearance.

Defined in: tabctrl3.h

Comments

The top, left and right tab position styles are supported only by the 3-D tabs and these do not apply to the 2-D tabs.

Create an SEC3DTabControl in two steps. First, call the constructor SEC3DTabControl to construct the SEC3DTabControl object, then call the Create function (inherited from SECTabControlBase) to create the tab control’s window and attach it to the SEC3DTabControl object.

If you create an SEC3DTabControl object within a dialog box (through a dialog resource), the SEC3DTabControl object is automatically destroyed when the user closes the dialog box.

If you create an SEC3DTabControl object within a window, you may also need to destroy it. An SEC3DTabControl object created on the stack within a window is automatically destroyed. If you create the SEC3DTabControl object on the heap by using the new function, you must call delete on the object to destroy it when the tab control window is destroyed.

To handle tab control notification messages sent by an SEC3DTabControl object to its parent (usually a class derived from CWnd), add a message-map entry and message-handler member function to the parent class for each message.

Each message-map entry takes the following form:

ON_MESSAGE( <tab control message id>, memberFxn )

where memberFxn is the name of the parent member function you have written to handle the notification and <tab control message id> is one of the following:

Tab Control MessageSend To Parent When...
TCM_TABSELA tab is selected.
TCM_TABSELCLRThe tab selection is cleared.
TCM_TABDBLCLKMouse double-clicked on a tab.

The parent's function prototype is as follows:

afx_msg LRESULT memberFxn(WPARAM wParam, LPARAM lParam);

See the TABDEMO sample in the \SAMPLES\TOOLKIT\STANDARD\TABS\TABDEMO directory for a demonstration of SEC3DTabControl.

See Also

SECTabControlBase  SEC3DTabWnd

Class Members

Constructors

SEC3DTabControl()

Constructs an SEC3DTabControl object.

Overridables

virtual void  Initialize(DWORD dwStyle)

Initializes the tab.

virtual SECTab*  CreateNewTab() const

Creates a new tab.

virtual void  RecalcLayout()

Recalculates the tab layout.

virtual void  InitializeFonts(DWORD dwStyle)

Initializes the tab font.

virtual void  OnActivateTab(int nTab)

Call when the tab is being activated or deactivated.

virtual void  DestroyGDIObjects()

Destroys all fonts, pens, and brushes used for tab control drawing.

virtual int  OnToolHitTest(CPoint point, TOOLINFO* pTI) const

Determines whether a point is in the bounding rectangle of the specified tool. If the point is in the

Operations

BOOL  SetFontActiveTab(CFont* pFont,BOOL bRedraw=TRUE)

Sets an active tab's currrent font.

BOOL  SetFontInactiveTab(CFont* pFont,BOOL bRedraw=TRUE)

Sets an inactive tab's current font.

CFont*  GetFontActiveTab()

Gets the current font of an active tab.

CFont*  GetFontInactiveTab()

Gets the current font of an inactive tab.

virtual void  SetTabIcon(int nIndex, HICON hIcon)

Sets the tab icon.

virtual void  SetTabIcon(int nIndex, UINT nIDIcon, int cx=SEC_TAB_DEFICON_CX, int cy=SEC_TAB_DEFICON_CY)

Sets the tab icon.

virtual void  SetTabIcon(int nIndex, LPCTSTR lpszResourceName, int cx=SEC_TAB_DEFICON_CX, int cy=SEC_TAB_DEFICON_CY)

Sets the tab icon.

virtual void  InvalidateTab(int nTab)

Invalidates tab for repainting.

virtual void  EnableTab(int nIndex, BOOL bEnable=TRUE)

Enables or disables the tab.

virtual BOOL  IsTabEnabled(int nIndex)

Specifies whether the tab is enabled or disabled.

void  EnableTabSizing(BOOL bVal = TRUE)

Enables/Disables the tab sizing feature.

virtual BOOL  ModifyStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags = 0)

Modifies the style. Win32 only

Queries

BOOL  TabHit(int nTab, CPoint& point) const

Indicates whether a given point is within the tab rectangle.

SEC3DTab&  GetTab(int nTab)

Returns a reference to the specified tab object.

SEC3DTab*  GetTabPtr(int nTab) const

Returns a pointer to the specified tab object.

virtual void  GetTabRect(int nTab, CRect &tabRect) const

Retrieves the tab rectangle.

int  GetLabelWidth(int nTab, BOOL bLong=FALSE)

Retrieves the width of the tab label.