SECTabControl Class

class SECTabControl: public SECTabControlBase

The SECTabControl class implements a tab control with a two-dimensional (Excel-like) look and feel. The SECTabControl inherits its interface from SECTabControlBase and adds the implementation details that define its appearance.

Defined in: tabctrl.h

Comments

Create an SECTabControl in two steps. First, call the constructor SECTabControl to construct the SECTabControl object, then call the Create member function to create the tab control’s window and attach it to the SECTabControl object.

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

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

To handle tab control notification messages sent by an SECTabControl 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 SECTabControl.

See Also

SECTabControlBase  SEC3DTabControl  SECTab  SECTabWnd

Class Members

Public Members

Constructors

SECTabControl()

Constructs an SECTabControl object.

Operations

void  ScrollToTab(int nTab)

Scrolls tabs so that index passed in is now visible.

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

Sets a selected tab’s current font.

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

Sets an unselected tab’s current font.

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

Sets an active tab’s currrent font.

CFont*  GetFontSelectedTab()

Gets the current font of a selected tab.

CFont*  GetFontUnselectedTab()

Gets the current font of an unselected tab.

CFont*  GetFontActiveTab()

Gets the current font of an active tab.

void  SetMultiSelect( BOOL bMultiSelect )

Toggles the enable multi-selection parameter of the tab control.

BOOL  GetMultiSelect()

Returns value indicating whether multi-selection is enabled or not.

Overridable

virtual void  Initialize(DWORD dwStyle)

Initializes tab control with the style specified.

virtual void  DrawTab(CDC *pDC, int nTab, CRgn &tabRgn)

Draws specified tab by reference to a CRgn region with clipping as determined by a pointer to a CDC.

virtual void  InvalidateTab(int nTab)

Invalidates specified tab for redrawing.

virtual void  RecalcLayout()

Recalculates tab control’s layout.

Queries

virtual BOOL  TabHit(int nTab, CPoint& point) const

Determines if point passed in resides inside tab at index nTab.