The following method of the of the CExtControlBar
class docks the resizable control bar relative to the sides of the main frame window:
virtual bool DockControlBarInnerOuter(
UINT nDockBarID,
bool bInner,
CFrameWnd * pDockSite = NULL, // can be NULL only if bar already was at least once docked
bool bRecalcLayout = true
);
The newly docked bar will occupy the entire row/column at the side of the main frame window specified by the
nDockBarID
parameter which can be
AFX_IDW_DOCKBAR_TOP
,
AFX_IDW_DOCKBAR_BOTTOM
,
AFX_IDW_DOCKBAR_LEFT
, or
AFX_IDW_DOCKBAR_RIGHT
. The
bInner
flag indicates where the newly docked resizable control bar should appear relative to the already docked bars. The
pDockSite
parameter is a pointer to the main frame window.
The following two methods of the of the
CExtControlBar
class dock the resizable control bar relative to an already docked bar:
bool DockControlBarLTRB(
CExtControlBar * pBarTarget,
UINT nDockBarID = AFX_IDW_DOCKBAR_BOTTOM,
bool bRecalcLayout = true
);
virtual bool DockControlBarLTRB(
int nPercentToOccupy, // greater then zero and less than one hundred
CExtControlBar * pBarTarget,
UINT nDockBarID = AFX_IDW_DOCKBAR_BOTTOM,
bool bRecalcLayout = true
);
The
nDockBarID
parameter specifies the side of the already docked bar to occupy by the bar being docked (values are the same as described above). The
nPercentToOccupy
value specifies the percent of space to occupy. The first method assumes 50%.
You can also detect the exact location of any bar. This is based on analyzing the run-time classes of the windows in the chain of resizable bar’s parents up to the main frame window or floating mini frame window. There are two types of compound bar containers: tabbed groups (the
CExtDynTabControlBar
window with the
CExtDockDynTabBar
container for other bars inside) and linear groups (the
CExtDynControlBar
window with the
CExtDockDynBar
container for other bars inside) for organizing columns of bars inside rows of bars and vice versa. The main rule for re-dockable bars is: the parent of the
CControlBar
window is the
CDockBar
window. The main frame window contains an array of the
CExtDockBar
dock bars which are containers for all the Prof-UIS bars. Four outer
CExtDockOuterBar
dock bars are designed especially for toolbars and other fixed size bars. All the other inner dock bar circles with four
CExtDockBar
dock bars in each are created dynamically and used for resizable control bars only. The
CExtDockBar
contains a set of the
CExtControlBar
windows. Some of the
CExtControlBar
windows can be the
CExtDynTabControlBar
windows if they are tab groups or the
CExtDynControlBar
windows if they are linear containers. Both tabbed and linear container are used as a parent window for one inner dock bar window that is parent for nested
CExtControlBar
windows and so on. Each dock bar window has the
m_arrBars
array of child control bars. This array allows you to detect the order and location of each bar.