The BCGControlBar Library Professional Edition (Pro Version) introduces non MFC-based docking architecture. It means that all control bars aren't derived from CControlBar anymore. The base class for all control bars in Pro Version is CBCGPBaseControlBar (that in its turn derived from CBCGPWnd).
The main idea behind the Pro Version architecture does not differ from MFC so much. Even more, we were trying to make the Pro Version highly compatible with MFC (and BCGControlBar Library Standard Edition).
Below you can see the picture of an application built with the Pro Version:
The application main frame window is usually represented by CBCGPFrameWnd or CBCGPMDIFrameWnd. The main frame is called "dock site". All control bars may have three types of parents: "dock site", "dock bar" or "miniframe window". Control bars may be divided to two general types: non resizable control bars (such as status bars and toolbars) and resizable control bars. Under "resizable" control bars we mean bars that may be resized by splitters (or "sliders"), may form "containers" (one control bar can be docked to another control bar and create a splitter between them) and can't be attached (docked) to dock bars. All non resizable control bars should be derived from CBCGPControlBar. All resizable control bars should be derived from CBCGPDockingControlBar (this class implements the base ability to be docked at the dock site, be placed in container, to become autohide and so on).
The main frame window or dock site is the owner of all control bars and miniframe windows. It contains an embedded member of the CBCGPDockManager class (the docking manager later). The docking manger maintains a list of all control bars that belong to the dock site. The list is ordered in the way that the bars created at the outer edges of the dock site come first. When it's required to recalculate the layout, it loops over this list, adjusts layout of each control bar to the current bounding rectangle (of the dock site) and subtracts the control bar area. You can call mainframeclass::AdjustDockingLayout or RecalcLayout every time you need to adjust the docking layout and this call will be redirected to the docking manager.
Each main frame may have "dock bars" placed along the borders (aligned to the borders). Dock bar is a control bar of a CBCGPDockBar class. Dock bar can accept CBCGPControlBar-derived objects (usually toolbars). Dock bars should be created during initialization of the main frame window by calling mainframeclass::EnableDocking (DWORD dwDockStyle). If you want to enable "auto hide" bars at some sides of the main frame window you should call mainframeclass::EnableAutoHideBars(DWORD dwDockStyle). This call will create CBCGPAutoHideDockBar objects next to each dock bar. You can still use CBRS_ styles to specify docking alignment. Each dock bar is divided (contains a list of) to "dock rows". Dock rows are represented by the CBCGPDockBarRow class. Each dock row contains a list of toolbars. When a toolbar is being docked (by mouse, for example) or moved from one row to another within the same dock bare, the framework creates a new row and resizes the dock bar accordingly or places the toolbar on the existing row.
When a control bar is floating it resides on the miniframe window. Miniframe windows are presented by two classes: CBCGPMiniFrameWnd (can contain only one control bar) and CBCGPMultiMiniFrameWnd (can contain several control bars). A miniframe window is created automatically by the framework when a control bar is being floated. To make control bar floating in code you can call CBCGPBaseControlBar::FloatControlBar (). Take a note, when a control bar becomes floating its parent is changed automatically and set to miniframe window. When a control bar is being docked its parent is changed back to a dock bar (for toolbars) or dock site (for resizable control bars).
Sliders (or splitters) are represented by the CBCGPSlider class. Sliders are created automatically by the framework when a docking control bar is docked to the dock site or to another control bar. When the bar is docked to the dock site the new slider is called "default slider". It contains all information regarding the layout of the docking control bars it resizes. Default sliders are placed in the general list of control bars maintained by the dock manager and control all layout operation performed on the "contained" docking control bars.
All resizable control bars, when docked one to other, are maintained in "containers". Containers are represented by the CBCGPBarContainer class. Each container has pointers to the "left" bar, "right" bar, "left" sub-container, "right" sub-container and splitter between left and right parts. In this way we're able to build a tree of several control bars and splitters and thus achieve very complicated layouts of control bars that can be resized together. The CBCGPBarContainerManager class maintains the tree of containers (it contains a pointer to the root container). Also, it maintains two lists of control bars and sliders that were placed in this tree. Bar container managers are usually embedded into default sliders and miniframe windows carrying multiple control bars.
Each docking control bar automatically enabled to have "autohide" ability. When the user clicks the pin button located on the caption of the docking control bar, the bar is switched to autohide mode. The framework creates a new toolbar of CBCGPAutoHideToolbar type and a new button of CBCGPAutoHideButton type, places the toolbar on the autohide dock bar (according to the current bar alignment), attaches the autohide button to the toolbar and attaches the pointer to the docking control bar to the button. At this point the docking control bar is placed in the special list of autohide bars maintained by the dock manager.
The CBCGPBaseTabWnd class implements the base functionality of tabbed window with detachable tabs. The CBCGPBaseTabbedBar is derived from CBCGPDockingControlBar and maintains a pointer to a CBCGPBaseTabWnd object. In this way we achieve the ability to dock and resize tabbed control bars. Use CBCGPDockingControlBar::AttachToTabWnd to create docking tabbed control bars on the fly.
Outlook bar control is also based on tabbed bars in the Pro Version (CBCGPOutlookBar is derived from CBCGPBaseTabbedBar).
You can create a new control bar applying a combination of several new styles:
The CBCGPBaseControlBar implements the following virtual Boolean methods to reflect these flags: CBCGPBaseControlBar::CanBeClosed, CBCGPBaseControlBar::CanAutoHide, CBCGPBaseControlBar::CanFloat. You can override them in the derived classes to customize this behavior.
Outlook bars behave as a regular tabbed control bar. When you dock one control bar to another, the resulted style will be defined according to the following styles specified when the second docking control bar was created:
CBCGPDockingControlBar has SetTabbedControlBarRTC method. You can use it to customize control bars that will be created as a result of the docking to a tab window.