SECTabWndBase Class
class SECTabWndBase: public CWnd
The SECTabWndBase class defines the interface of a tabbed window.
Defined in: tabwndb.h
Comments
A tabbed window is a window containing multiple embedded child windows (or pages) and a row of tabs. When a tab is activated (via a mouse press), SECTabWndBase shows and activates the CWnd-derived window associated with the tab.
What is the relationship between SECTabControl and SECTabWndBase? As stated previously, an SECbWndBase contains a list of pages and a row of tabs. The latter is implemented as a single instance of tab control of type SECTabControl. The single tab control object manages and displays an array of tabs. This tab control is sized and positioned by its SECTabWndBase parent such that no overlap exists between the pages and the tab control. So, an SECTabWndBase contains an instance of an SECTabControl (and zero or more pages). This organization allows the SECTabControl to be used in a different context.
There are currently two implementations of the SECTabWndBase interface: SECTabWnd and SEC3DTabWnd. SECTabWnd implements a two-dimensional look and SEC3DTabWnd implements a three-dimensional look and feel with optional icon. The two-dimensional tabbed window is more space efficient, while the three-dimensional tabbed window gives a more elegant look and simpler usage model.
NOTE: You cannot instantiate SECTabWndBase directly as it is an abstract base class. Instead, you must instance one of SEC3DTabWnd or SEC3DTabWnd.
The TABDEMO sample in the \SAMPLES\TOOLKIT\STANDARD\TABS\TABDEMO directory demonstrates the SECTabWndBase class.
See Also
SECTabControlBase SECTabWnd SEC3DTabWndSECWorkbook
Class Members
Public Members
Operations
virtual SECTab* InsertTab(CWnd* pWnd, int nIndex, LPCTSTR lpszLabel)
Inserts a new tab with the given label before the currently active tab.
virtual SECTab* InsertTab(CRuntimeClass* pViewClass, int nIndex, LPCTSTR lpszLabel, CCreateContext* pContext = NULL, UINT nID = -1)
Inserts a new tab with the given label before the currently active tab.
virtual SECTab* AddTab(CWnd* pWnd, LPCTSTR lpszLabel)
Appends a new tab to the end of the existing array of tabs.
virtual SECTab* AddTab(CRuntimeClass* pViewClass, LPCTSTR lpszLabel, CCreateContext* pContext = NULL, UINT nID = -1)
Appends a new tab to the end of the existing array of tabs.
virtual void SetTabIcon(int nIndex, HICON hIcon)
Specifies the icon for a given tab.
virtual void SetTabIcon(int nIndex, UINT nIDIcon, int cx=SEC_TAB_DEFICON_CX, int cy=SEC_TAB_DEFICON_CY)
Specifies the icon for a given tab.
virtual void SetTabIcon(int nIndex, LPCTSTR lpszResourceName, int cx=SEC_TAB_DEFICON_CX, int cy=SEC_TAB_DEFICON_CY)
Specifies the icon for a given tab.
virtual void RemoveTab(CWnd* pWnd)
Removes the tab at the specifed index.
virtual void RemoveTab(int nIndex)
Removes the tab at the specifed index.
virtual void RenameTab(CWnd* pWnd, LPCTSTR lpszLabel)
Gives a new name to the tab at the specified index.
virtual void RenameTab(int nIndex, LPCTSTR lpszLabel)
Gives a new name to the tab at the specified index.
virtual BOOL ActivateTab(CWnd* pWnd, int nIndex)
Causes the specified tab to become the active tab.
virtual BOOL ActivateTab(CWnd* pWnd)
Causes the specified tab to become the active tab.
virtual BOOL ActivateTab(int nIndex)
Causes the specified tab to become the active tab.
virtual void ClearSelection()
All tabs are marked as unselected.
virtual void ScrollToTab(CWnd* pWnd)
The specified tab is scrolled into view.
virtual void ScrollToTab(int nIndex)
The specified tab is scrolled into view.
Queries
int GetTabCount() const
Returns the number of tabs
BOOL GetTabInfo(int nIndex, LPCTSTR& lpszLabel, BOOL& bSelected, CWnd*& pWnd, void*& pExtra) const
Returns information about the tab with the supplied index.
BOOL FindTab(const CWnd* const pWnd, int& nTab) const
Returns the index of the tab which is associated with the specified window.
BOOL GetActiveTab(CWnd*& pWnd) const
If any tab is active, return its associated window.
BOOL GetActiveTab(int& nIndex) const
If any tab is active, return its index.
BOOL TabExists(CWnd* pClient) const
Checks for the existence of the tab associated with the specified window.
BOOL TabExists(int nTab) const
Checks for the existence of the tab with the supplied index.
const SECTabControlBase* GetTabControl() const
Returns a pointer to the SECTabControlBase object associated with the tab window.