description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: CBaseTabbedPane Class |
CBaseTabbedPane Class |
11/04/2016 |
|
|
f22c0080-5b29-4a0a-8f74-8f0a4cd2dbcf |
Extends the functionality of the CDockablePane Class to support the creation of tabbed windows.
class CBaseTabbedPane : public CDockablePane
Name | Description |
---|---|
CBaseTabbedPane::CBaseTabbedPane |
Default constructor. |
Name | Description |
---|---|
CBaseTabbedPane::AddTab | Adds a new tab to a tabbed pane. |
CBaseTabbedPane::AllowDestroyEmptyTabbedPane | Specifies whether an empty tabbed pane can be destroyed. |
CBaseTabbedPane::ApplyRestoredTabInfo | Applies tab settings, which are loaded from the registry, to a tabbed pane. |
CBaseTabbedPane::CanFloat | Determines whether the pane can float. (Overrides CBasePane::CanFloat.) |
CBaseTabbedPane::CanSetCaptionTextToTabName | Determines whether the caption for the tabbed pane should display the same text as the active tab. |
CBaseTabbedPane::ConvertToTabbedDocument | (Overrides CDockablePane::ConvertToTabbedDocument.) |
CBaseTabbedPane::DetachPane | Converts one or more dockable panes to MDI tabbed documents. |
CBaseTabbedPane::EnableSetCaptionTextToTabName | Enables or disables the ability of the tabbed pane to synchronize caption text with the label text on the active tab. |
CBaseTabbedPane::FillDefaultTabsOrderArray | Restores the internal tab order to a default state. |
CBaseTabbedPane::FindBarByTabNumber | Returns a pane that resides in a tab when the tab is identified by a zero-based tab index. |
CBaseTabbedPane::FindPaneByID | Returns a pane that is identified by the pane ID. |
CBaseTabbedPane::FloatTab | Floats a pane, but only if the pane currently resides in a detachable tab. |
CBaseTabbedPane::GetDefaultTabsOrder | Returns the default order of tabs in the pane. |
CBaseTabbedPane::GetFirstVisibleTab | Retrieves a pointer to the first displayed tab. |
CBaseTabbedPane::GetMinSize | Retrieves the minimum allowed size for the pane. (Overrides CPane::GetMinSize.) |
CBaseTabbedPane::GetPaneIcon | Returns a handle to the pane icon. (Overrides CBasePane::GetPaneIcon.) |
CBaseTabbedPane::GetPaneList | Returns a list of panes that are contained in the tabbed pane. |
CBaseTabbedPane::GetTabArea | Returns the bounding rectangles for the top and bottom tab areas. |
CBaseTabbedPane::GetTabsNum | Returns the count of tabs in a tab window. |
CBaseTabbedPane::GetUnderlyingWindow | Gets the underlying (wrapped) tab window. |
CBaseTabbedPane::GetVisibleTabsNum | Returns the count of displayed tabs. |
CBaseTabbedPane::HasAutoHideMode | Determines whether the tabbed pane can be switched to auto-hide mode. |
CBaseTabbedPane::IsHideSingleTab | Determines whether the tabbed pane is hidden if only one tab is displayed. |
CBaseTabbedPane::LoadSiblingPaneIDs |
Used internally during serialization. |
CBaseTabbedPane::RecalcLayout | Recalculates layout information for the pane. (Overrides CPane::RecalcLayout.) |
CBaseTabbedPane::RemovePane | Removes a pane from the tabbed pane. |
CBaseTabbedPane::SaveSiblingBarIDs |
Used internally during serialization. |
CBaseTabbedPane::Serialize |
(Overrides CDockablePane::Serialize.) |
CBaseTabbedPane::SerializeTabWindow |
Used internally during serialization. |
CBaseTabbedPane::SetAutoDestroy | Determines whether the tabbed control bar will be destroyed automatically. |
CBaseTabbedPane::SetAutoHideMode | Toggles the docking pane between displayed and auto-hide mode. (Overrides CDockablePane::SetAutoHideMode.) |
CBaseTabbedPane::ShowTab | Shows or hides a tab. |
This class is an abstract class and cannot be instantiated. It implements the services that are common to all kinds of tabbed panes.
Currently, the library includes two derived tabbed pane classes: CTabbedPane Class and CMFCOutlookBar Class.
A CBaseTabbedPane
object wraps a pointer to a CMFCBaseTabCtrl Class object. CMFCBaseTabCtrl Class then becomes a child window of the tabbed pane.
For more information about how to create tabbed panes, see CDockablePane Class, CTabbedPane Class, and CMFCOutlookBar Class.
CBaseTabbedPane
Header: afxBaseTabbedPane.h
Adds a new tab to a tabbed pane.
virtual BOOL AddTab(
CWnd* pNewBar,
BOOL bVisible = TRUE,
BOOL bSetActive = TRUE,
BOOL bDetachable = TRUE);
pNewBar
[in, out] A pointer to the pane to add. This pointer may become invalid after you call this method. For more information, see the Remarks section.
bVisible
[in] TRUE to make the tab visible; otherwise, FALSE.
bSetActive
[in] TRUE to make the tab the active tab; otherwise, FALSE.
bDetachable
[in] TRUE to make the tab detachable; otherwise, FALSE.
TRUE if the pane was successfully added as a tab and was not destroyed in the process. FALSE if the pane being added is an object of type CBaseTabbedPane
. For more information, see the Remarks section.
Call this method to add a pane as a new tab on a tabbed pane. If pNewBar points to an object of type CBaseTabbedPane
, all its tabs are copied onto the tabbed pane and then pNewBar is destroyed. Thus, pNewBar becomes an invalid pointer and should not be used.
Specifies whether an empty tabbed pane can be destroyed.
virtual BOOL AllowDestroyEmptyTabbedPane() const;
TRUE if an empty tabbed pane can be destroyed; otherwise, FALSE. The default implementation always returns TRUE.
If an empty tabbed pane is not allowed to be destroyed, the framework hides the pane instead.
Loads tab settings from the registry and applies them to a tabbed pane.
virtual void ApplyRestoredTabInfo(BOOL bUseTabIndexes = FALSE);
bUseTabIndexes
[in] This parameter is used internally by the framework.
This method is called by the framework when it reloads docking state information from the registry. The method obtains information about tab order and tab names for a tabbed pane.
Specifies whether the tabbed pane can float.
virtual BOOL CanFloat() const;
TRUE if the pane can float; otherwise, FALSE.
Determines whether the caption for the tabbed pane should display the same text as the active tab.
virtual BOOL CanSetCaptionTextToTabName() const;
TRUE if the caption text of the tabbed pane is set to the text of the active tab; otherwise, FALSE.
The method is used to determine whether the text displayed on the tabbed pane caption duplicates the label of the active tab. You can enable or disable this functionality by calling CBaseTabbedPane::EnableSetCaptionTextToTabName.
Converts one or more dockable panes to MDI tabbed documents.
virtual void ConvertToTabbedDocument(BOOL bActiveTabOnly = TRUE);
bActiveTabOnly
[in] When you convert a tabbed pane, specify TRUE to convert only the active tab. Specify FALSE to convert all tabs in the pane.
Detaches a pane from the tabbed pane.
virtual BOOL DetachPane(
CWnd* pBar,
BOOL bHide = FALSE);
pBar
[in] Pointer to the pane to detach.
bHide
[in] Boolean parameter that specifies whether the framework hides the pane after it is detached.
TRUE if the framework successfully detaches the pane; FALSE if pBar is NULL or refers to a pane that is not in the tabbed pane.
The framework floats the detached pane if possible. For more information, see CBasePane::CanFloat.
Enables or disables the ability of the tabbed pane to synchronize caption text with the label text on the active tab.
virtual void EnableSetCaptionTextToTabName(BOOL bEnable);
bEnable
[in] TRUE to synchronize the tabbed pane caption with the active tab caption; otherwise, FALSE.
Restores the internal tab order to a default state.
void FillDefaultTabsOrderArray();
This method is called when the framework restores an Outlook bar to an initial state.
Returns a pane identified by the pane ID.
virtual CWnd* FindPaneByID(UINT uBarID);
uBarID
[in] Specifies the ID of the pane to find.
A pointer to the pane if it was found; otherwise, NULL.
This method compares all tabs in the pane and returns the one with the ID specified by the uBarID parameter.
Returns a pane that resides in a tab.
virtual CWnd* FindBarByTabNumber(
int nTabNum,
BOOL bGetWrappedBar = FALSE);
nTabNum
[in] Specifies the zero-based index of the tab to retrieve.
bGetWrappedBar
[in] TRUE to return the underlying (wrapped) window of the pane instead of the pane itself; otherwise FALSE. This only applies to panes derived from CDockablePaneAdapter.
If the pane is found, then a valid pointer to the pane being searched for is returned; otherwise, NULL.
Call this method to retrieve the pane residing in the tab specified by the nTabNum parameter.
Floats a pane, but only if the pane currently resides in a detachable tab.
virtual BOOL FloatTab(
CWnd* pBar,
int nTabID,
AFX_DOCK_METHOD dockMethod,
BOOL bHide = FALSE);
pBar
[in, out] A pointer to the pane to float.
nTabID
[in] Specifies the zero-based index of the tab to float.
dockMethod
[in] Specifies the method to use to make the pane float. For more information, see the Remarks section.
bHide
[in] TRUE to hide the pane before floating; otherwise, FALSE.
TRUE if the pane floated; otherwise, FALSE.
Call this method to float a pane that currently resides in a detachable tab.
If you want to detach a pane programmatically, specify DM_SHOW for the dockMethod parameter. If you want to float the pane in the same position where it floated previously, specify DM_DBL_CLICK as the dockMethod parameter.
Returns the default order of tabs in the pane.
const CArray<int,int>& GetDefaultTabsOrder();
A CArray
object that specifies the default order of tabs in the pane.
The framework calls this method when an Outlook bar is reset to an initial state.
Retrieves a pointer to the first displayed tab.
virtual CWnd* GetFirstVisibleTab(int& iTabNum);
iTabNum
[in] A reference to an integer. This method writes the zero-based index of the first displayed tab to this parameter, or -1 if no displayed tab is found.
If successful, a pointer to the first displayed tab; otherwise, NULL.
Retrieves the minimum allowed size for the pane.
virtual void GetMinSize(CSize& size) const;
size
[out] A CSize
object that is filled with the minimum allowed size.
If consistent handling of minimum pane sizes is active ( CPane::m_bHandleMinSize), size is filled with the minimum allowed size for the active tab. Otherwise, size is filled with the return value of CPane::GetMinSize.
Retrieves the minimum allowed size for the pane.
virtual void GetMinSize(CSize& size) const;
size
[out] A CSize
object that is filled with the minimum allowed size.
If consistent handling of minimum pane sizes is active ( CPane::m_bHandleMinSize), size is filled with the minimum allowed size for the active tab. Otherwise, size is filled with the return value of CPane::GetMinSize.
Returns a list of panes that are contained in the tabbed pane.
virtual void GetPaneList(
CObList& lst,
CRuntimeClass* pRTCFilter = NULL);
lst
[out] A CObList
that is filled with the panes that are contained in the tabbed pane.
pRTCFilter
[in] If it is not NULL, the returned list contains only panes that are of the specified runtime class.
Returns the bounding rectangles for the top and bottom tab areas.
virtual void GetTabArea(
CRect& rectTabAreaTop,
CRect& rectTabAreaBottom) const = 0;
rectTabAreaTop
[out] Receives the screen coordinates of the upper tab area.
rectTabAreaBottom
[out] Receives the screen coordinates of the lower tab area.
Call this method to determine the bounding rectangles, in screen coordinates, for the upper and lower tab areas.
Returns the count of tabs in a tab window.
virtual int GetTabsNum() const;
The number of tabs in the tabbed pane.
Gets the underlying (wrapped) tab window.
virtual CMFCBaseTabCtrl* GetUnderlyingWindow();
A pointer to the underlying tab window.
Returns the count of visible tabs.
virtual int GetVisibleTabsNum() const;
The number of visible tabs, which will be greater than or equal to zero.
Call this method to determine the number of visible tabs in the tabbed pane.
Determines whether the tabbed pane can be switched to autohide mode.
virtual BOOL HasAutoHideMode() const;
TRUE if the pane can be switched to autohide mode; otherwise, FALSE.
If autohide mode is disabled, no pin button is displayed on the tabbed pane caption.
Determines whether the tabbed pane is hidden if only one tab is displayed.
virtual BOOL IsHideSingleTab() const;
TRUE if the tab window is not shown when there is only one visible tab; otherwise, FALSE.
If the pane is not displayed because only one tab is open, you can call this method to determine whether the tabbed pane is working correctly.
Removes a pane from the tabbed pane.
virtual BOOL RemovePane(CWnd* pBar);
pBar
[in, out] A pointer to the pane to remove from the tabbed pane.
TRUE if the pane was successfully removed from the tabbed pane and if the tabbed pane is still valid. FALSE if the last pane has been removed from the tabbed pane and the tabbed pane is about to be destroyed. If the return value is FALSE, do not use the tabbed pane any more.
Call this method to remove the pane specified by the pBar parameter from the tabbed pane.
Determines whether the tabbed control bar will be destroyed automatically.
void SetAutoDestroy(BOOL bAutoDestroy = TRUE);
bAutoDestroy
[in] TRUE if the tabbed pane was created dynamically and you are not controlling its lifetime; otherwise, FALSE.
Set the auto-destroy mode to TRUE if you create a tabbed pane dynamically and if you are not controlling its lifetime. If auto-destroy mode is TRUE, the tabbed pane will be destroyed automatically by the framework.
Shows or hides a tab.
virtual BOOL ShowTab(
CWnd* pBar,
BOOL bShow,
BOOL bDelay,
BOOL bActivate);
pBar
[in] A pointer to the pane to show or hide.
bShow
[in] TRUE to show the pane; FALSE to hide the pane.
bDelay
[in] TRUE to delay the adjustment of the tab layout; otherwise, FALSE.
bActivate
[in] TRUE to make the tab the active tab; otherwise, FALSE.
TRUE if the tab was either shown or hidden successfully; otherwise, FALSE.
When you call this method, a pane is either shown or hidden, depending on the value of the bShow parameter. If you hide a tab and it is the last visible tab in the underlying tab window, the tabbed pane is hidden. If you show a tab when there were previously no tabs visible, the tabbed pane is shown.
Recalculates layout information for the pane.
virtual void RecalcLayout();
If the pane is floating, this method notifies the framework to resize the pane to the current size of the mini-frame.
If the pane is docked, this method does nothing.
Sets the auto-hide mode for detachable panes in the tabbed pane.
virtual CMFCAutoHideToolBar* SetAutoHideMode(
BOOL bMode,
DWORD dwAlignment,
CMFCAutoHideToolBar* pCurrAutoHideBar = NULL,
BOOL bUseTimer = TRUE);
bMode
[in] TRUE to enable auto-hide mode; FALSE to enable regular docking mode.
dwAlignment
[in] Specifies the alignment of the auto-hide pane that is to be created. For a list of possible values, see CPane::MoveByAlignment.
pCurrAutoHideBar
[in, out] A pointer to the current auto-hide toolbar. Can be NULL.
bUseTimer
[in] Specifies whether to use the auto-hide effect when the user switches the pane to auto-hide mode, or to hide the pane immediately.
A pointer to the auto-hide toolbar that is created when switching to auto-hide mode, or NULL if no toolbar is created.
The framework calls this method when a user chooses the pin button to switch the tabbed pane to auto-hide mode or to regular docking mode.
Auto-hide mode is set for each detachable pane in the tabbed pane. Panes that are non-detachable are ignored. For more information, see CMFCBaseTabCtrl::EnableTabDetach.
Call this method to switch a tabbed pane to auto-hide mode programmatically. The pane must be docked to the main frame window ( CDockablePane::GetDefaultPaneDivider must return a valid pointer to the CPaneDivider).