The text should be rendered vertically in the caption. If it is not the case, then we can review your sample application.
The way to show expand buttons we described in the previous post works only for the simple resizable control bars (the CExtControlBar
class). In case of dynamic control bars (CExtDynamicControlBar
), you need to declare a similar CExtDynamicControlBar
-derived class which has the DECLARE_DYNCREATE
/IMPLEMENT_DYNCREATE
implementation in the class declaration/implementation. This will let you use a pointer to the runtime class (MFC’s CRunTimeClass
object) of the defined custom dynamic resizable control bar class when invoking CExtDynamicBarSite::BarAlloc()
inside CMainFrame::OnCreate()
. We can help you modify your version of the MDI_DynamicBars sample application to get what you really need.
It is possible to dock three control bars (simple or dynamic) into a single column so each control bar takes approximately one third of the column height. This can be done with the following method of the CExtControlBar
class:
// dock control bar relative to other control bar using
// space percent specification (extended version)
virtual bool DockControlBarLTRB(
int nPercentToOccupy, // greater then zero and less then one hundred
CExtControlBar * pBarTarget,
UINT nDockBarID = AFX_IDW_DOCKBAR_BOTTOM,
bool bRecalcLayout = true
);
Let’s assume we have three bars specified with
m_wndBar1
,
m_wndBar2
, and
m_wndBar3
and
m_wndBar1
is already docked somewhere. First of all, we need to dock
m_wndBar2
so it will take 66 % of the space of
m_wndBar1
at bottom:
// "this" is a pointer to the CMainFrame window
m_wndBar2.DockControlBarLTRB( 66, &m_wndBar1, this, AFX_IDW_DOCKBAR_BOTTOM );
The second step is to dock
m_wndBar3
with
m_wndBar2
. Make it take 50 % of
m_wndBar2
at bottom:
// "this" is a pointer to the CMainFrame window
m_wndBar3.DockControlBarLTRB( 50, &m_wndBar2, this, AFX_IDW_DOCKBAR_BOTTOM );
This is also described in the following FAQ:
How to dock several control bars into one row so that they share its space in certain proportions?