BCGControlBar Pro for MFC
CBCGPTabbedControlBar

Detailed Description

The CBCGPTabbedControlBar class implements the functionality of a tabbed window with detachable tabs that behaves as a docking control bar.

This class can be created automatically by the framework when the user attaches one control bar to another while points to the caption of the second control bar. In this case it replaces the second control bar in its container.

All tabbed control bars that were created by the framework have ID -1.

You can create a CBCGPTabbedControlBar object as a regular docking control bar and then use AddTab() to attach additional tabs.

See also
CBCGPDockingControlBar, CBCGPBaseTabbedBar, CBCGPOutlookBar

Example:

Copy
CBCGPTabbedControlBar* pTabbededBar = new CBCGPTabbedControlBar(TRUE);
if (!pTabbededBar->Create (_T(""), this, CRect(0, 0, 200, 200),
TRUE, (UINT) -1, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI))
{
TRACE0("Failed to create tabbed bar\n");
return FALSE; // fail to create
}
pTabbededBar->AddTab(&m_wndPane1);
pTabbededBar->AddTab(&m_wndPane2);
pTabbededBar->AddTab(&m_wndPane3);
pTabbededBar->EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(pTabbededBar);
/*
Another way to create a tabbed control bar object is using CBCGDockingControlBar::AttachToTabWnd.
AttachToTabWnd creates a tabbed control bar object dynamically according to the runtime class
information set by CBCGPDockingControlBar::SetTabbedControlBarRTC. Also, you can pass the
CBRS_BCGP_REGULAR_TABS style to the CBCGPDockingControlBar::CreateEx.
The following example creates a tabbed control bar dynamically, attaches two control bars and makes the second tab non-detachable:
*/
DockControlBar(&m_wndPane1);
CBCGPTabbedControlBar* pTabbedBar = NULL;
m_wndPane2.AttachToTabWnd(&m_wndPane1, DM_SHOW, TRUE, (CBCGPDockingControlBar**) &pTabbedBar);
m_wndPane3.AttachToTabWnd(pTabbedBar, DM_SHOW, TRUE, (CBCGPDockingControlBar**) &pTabbedBar);
pTabbedBar->GetUnderlinedWindow ()->EnableTabDetach(1, FALSE);
// It's recommended to dock the first control bar before you attach the second control bar to it creating a tabbed control bar.
+ Inheritance diagram for CBCGPTabbedControlBar:

Public Member Functions

 GetTabAreaReturns the size and position of the tab area of the tabbed window.
 
 GetTabWndReturns a pointer to underlined tabbed window.
 
 IsTabLocationBottomDetermines the tab location.
 
- Public Member Functions inherited from CBCGPBaseTabbedBar
 AddTabAdds a new tab to a tabbed bar.
 
 ApplyRestoredTabInfoApplies information loaded from registry to a tabbed control bar
 
 CanSetCaptionTextToTabNameTells whether the caption of the tabbed control bar should display the same text as the active tab.
 
 EnableSetCaptionTextToTabNameTurns on or off the ability to synchronize the caption text with the label of the active tab.
 
 FindBarByIDGiven a control bar ID returns a pointer to a control bar.
 
 FindBarByTabNumberGiven the zero-based tab index returns a control bar that resides in the tab.
 
 GetTabsNumReturns the number of tabs in a tab window.
 
 GetUnderlinedWindowGives the access to the underlined (wrapped) tab window.
 
 GetVisibleTabsNumReturns the number of visible tabs.
 
 IsHideSingleTabDetermines whether the tabbed control bar is in the mode when a single tab is not shown.
 
 RemoveControlBarRemoves a control bar from the tabbed control bar.
 
 SetAutoDestroySets auto destroy mode.
 
 ShowTabShows or hides a control bar residing in a tab.
 
- Public Member Functions inherited from CBCGPDockingControlBar
 CBCGPDockingControlBarConstructs the object.
 
 AttachToTabWndAttaches the control bar to another control bar creating a tabbed control bar.
 
 CanAcceptBarDetermines whether another control bar can be docked to this control bar.
 
 CanBeAttachedCalled by the framework to determine if the control bar can be docked to another control bar or frame window.
 
 CreateCreates the Windows control and attaches it to the CBCGPDockingControlBar object.
 
 CreateCreates the Windows control and attaches it to the CBCGPDockingControlBar object.
 
 CreateExCreates the Windows control and attaches it to the CBCGPDockingControlBar object.
 
 CreateTabbedControlBarCalled by the framework when it needs to create a tabbed control bar from this control bar.
 
 DockToWindowDocks the docking control bar to another docking control bar.
 
 EnableAutohideAllEnables/disables auto-hide mode
 
 EnableGripperShows or hides the caption (gripper).
 
 GetCaptionGets a panes' caption.
 
 GetCaptionHeightReturns the current caption's height.
 
 GetDefaultSliderReturns a pointer to the default slider of the control bar's container.
 
 GetIconIndexReturn a docking pane icon index.
 
 GetPaneInfoCalled by the framework to obtain the docking pane information displayed in Windows Navigator (invoked by Ctrl+Tab).
 
 GetTabbedControlBarRTCReturns a pointer to the runtime class information of a tabbed window to be created when another control bar is docked to this control bar as a new tab.
 
 GetTabCustomLabelGets a tab custom label.
 
 HitTestCalled by the framework to get a hit-test value from the point.
 
 IsAutohideAllEnabledIndicates whether the docking control bar can be put into autohide mode along with other control bars in container, when the user presses pin button holding Ctrl key.
 
 IsAutoHideModeDetermines whether a control bar is in autohide mode or not.
 
 IsDockedDetermines whether the control bar is docked or not.
 
 IsHideInAutoHideModeCalled by the framework to determine the control bar behavior in autohide mode when the control bar is shown or hidden by ShowControlBar().
 
 IsVisibleDetermines whether the control bar is visible or not.
 
 IsVisibleInWindowsNavigatorCalled by the framework to check whether this pane should be visible in Windows Navigator.
 
 OnAfterDockFromMiniFrameCalled by the framework when a docking bar has been docked to frame window from floating state.
 
 SetIconIndexSets the docking pane icon index.
 
 SetTabbedControlBarRTCSets the runtime class information of a tabbed window to be created when two docking control bars produce a tabbed window.
 
 SetTabCustomLabelSets a tab custom label.
 
 ShowControlBarShows or hides a control bar.
 
 SlideCalled by the framework to begin showing or hiding of a control bar in autohide mode.
 
 UnDockControlBarUndocks a control bar from the main frame window or from multiminiframe window container.
 
- Public Member Functions inherited from CBCGPControlBar
 AdjustSizeImmediateImmediately recalculates layout of a control bar.
 
 CalcInsideRectCalculates the inside rectangle of a control bar taking into account the borders and grippers.
 
 CanBeDockedDetermines whether a control bar can be docked at the specified dock bar.
 
 CanBeTabbedDocumentTells whether control bar can be converted to tabbed document.
 
 CreateCreates the Windows control bar and attaches it to the CBCGPControlBar object.
 
 CreateDefaultMiniframeCreates a mini-frame window for a control bar when it's being floated.
 
 CreateExCreates the Windows control bar and attaches it to the CBCGPControlBar object.
 
 DockControlBarDocks the control bar to a dock bar.
 
 DoesAllowSiblingBarsIndicates whether it is possible to dock another control bar at the same row where this control bar is docked.
 
 GetBordersReturns the width of the control bar borders.
 
 GetExclusiveRowModeTells whether the control bar is in exclusive row mode or not.
 
 OnAfterFloatCalled by the framework when a control bar has floated.
 
 OnShowControlBarMenuCalled by the framework when a special control bar menu is about to be displayed.
 
 SetBordersSets the border values of the control bar.
 
 SetBordersSets the border values of the control bar.
 
 SetExclusiveRowModeEnables or disables the exclusive row mode.
 
 SetMiniFrameRTCSets the runtime class information about the default mini-frame window.
 
- Public Member Functions inherited from CBCGPBaseControlBar
 AddControlBarAdds a control bar to docking manager.
 
 AdjustDockingLayoutRedirects a call to docking manager to adjust docking layout.
 
 AdjustLayoutCalled by the framework when a control bar should adjust its internal layout according to a new size or position.
 
 CanBeClosedDetermines whether the control bar may be hidden.
 
 CanBeResizedDetermines whether this control bar can be resized.
 
 CanFocusSpecifies whether a control bar can receive focus.
 
 CreateExCreates a Windows control.
 
 DoesAllowDynInsertBeforeDetermines whether it is possible to dynamically insert a control bar before this control bar.
 
 EnableDockingEnables docking to the main frame.
 
 GetBarStyleReturns the control bar style.
 
 GetBCGStyleReturns the library specific control bar styles.
 
 GetCurrentAlignmentReturns the current control bar alignment.
 
 GetDockModeReturns the current dock mode for the control bar.
 
 GetDockRowReturns a pointer to a dock bar row.
 
 GetDockSiteReturns a pointer to dock site.
 
 GetEnabledAlignmentReturns the enabled alignment.
 
 GetParentMiniFrameReturns a pointer to the parent mini-frame window.
 
 GetParentTabWndRetrieves a pointer to the parent tabbed window.
 
 HideInPrintPreviewModeTells the framework whether control bar should be hidden in print preview mode.
 
 IsHorizontalDetermines whether the control bar is docked horizontally.
 
 IsMDITabbedTells whether control bar is placed on MDI child window as tabbed document.
 
 OnControlBarContextMenuCalled by the framework when it needs to build a menu with the list of control bars.
 
 OnRemoveFromMiniFrameCalled by the framework when a control bar is being removed from its parent mini-frame window.
 
 SetBarAlignmentSets the current alignment for a control bar.
 
 SetBarStyleSets a control bar style
 
 SetDockModeSets a new docking method for a control bar.
 

Static Public Member Functions

 EnableTabAutoColorEnables or disables automatic coloring of tabs.
 
 ResetTabsResets all tabbed control bars.
 
 SetTabAutoColorsSets a custom list of colors to be used when the auto color feature is enabled.
 
- Static Public Member Functions inherited from CBCGPDockingControlBar
 GetDragSencitivityReturns the drag sensitivity of a docking control bar.
 

Static Public Attributes

 m_bTabsAlwaysTopSpecifies the default tab location for all tabbed control bars in the application.
 
 m_pTabWndRTCSpecifies runtime class information of a custom CBCGPTabWnd - derived object.
 
- Static Public Attributes inherited from CBCGPDockingControlBar
 m_bDisableAnimationIf TRUE, the autohide animation will be disabled. If FALSE, autohide animation will be enabled.
 
 m_bHideInAutoHideModeDetermines the control bar behavior in autohide mode.
 
 m_nSlideStepsSpecifies the number of steps to show or hide in autohide mode.
 
- Static Public Attributes inherited from CBCGPControlBar
 m_bHandleMinSizeEnables consistent handling of minimal size.
 

Additional Inherited Members

- Public Types inherited from CBCGPDockingControlBar
enum  CaptionType
 
- Public Attributes inherited from CBCGPControlBar
 m_recentDockInfoContains the recent docking information.
 
- Protected Member Functions inherited from CBCGPDockingControlBar
 CheckAutoHideConditionCalled be the framework to determine whether the docking control bar should be hidden (in autohide mode).
 
 CheckStopSlideConditionCalled by the framework to determine when an autohide docking control bar should stop sliding.
 
 DrawCaptionDraws the docking control bar caption (gripper).
 
 OnPressButtonsCalled when the user presses a caption button other than HTCLOSE_BCG and HTMAXBUTTON buttons.
 
 OnScrollClientCalled by the framework when it needs to scroll content of a docking control bar.
 
 OnSlideCalled by the framework to render the autohide effect when the control bar is being shown or hidden.
 
 ScrollHorzAvailableCalled by the framework to determine whether a docking control bar can be scrolled horizontally.
 
 ScrollVertAvailableCalled by the framework to determine whether a docking control bar can be scrolled vertically.
 
- Protected Member Functions inherited from CBCGPControlBar
 OnBeforeDockCalled by the framework when the control bar is about to be docked.
 
- Protected Member Functions inherited from CBCGPBaseControlBar
 DoPaintPaints the control bar.
 
- Static Protected Attributes inherited from CBCGPDockingControlBar
 m_sizeDragSencitivitySpecifies the drag sensitivity of a docking control bar.