The tabbed bar group is also a kind of resizable control bar which is implemented in the CExtDynTabControlBar
class. This class is created by Prof-UIS when the user drag-and-drops control bars into tabbed groups, loads the state of control bars in tabbed groups from the registry or your code invokes the CExtControlBar::DockControlBarIntoTabbedContainer()
method. The CExtDynTabControlBar
class is derived from the CExtControlBar
class and has its own set of buttons. You can create a CExtDynTabControlBar
-derived class and implement all your custom buttons in it as you already did this in your CExtControlBar
-derived class. To use your tabbed bar in the library, you need to handle the CExtControlBar::g_nMsgCreateTabbedBar
registered windows message in the main frame window like as follows:
ON_REGISTERED_MESSAGE(
CExtControlBar::g_nMsgCreateTabbedBar,
OnMsgCreateTabbedBar
)
LRESULT OnMsgCreateTabbedBar(
WPARAM wParam,
LPARAM lParam
)
{
lParam; // unused parameter
CExtDynTabControlBar ** ppBar =
(CExtDynTabControlBar **)wParam;
ASSERT( ppBar != NULL );
(*ppBar) = new C_YOUR_DynTabControlBar;
return 0;
}
If you use dynamic resizable control bars (the
CExtDynamicControlBar
class) managed by the dynamic bar site (the
CExtDynamicBarSite
class, which is typically a base class of your main frame), then you should not implement the message handler method for the
CExtControlBar::g_nMsgCreateTabbedBar
registered windows message. Just override the
CExtDynamicBarSite::OnDbsCreateTabbedBarInstance()
virtual method instead:
CExtDynamicTabbedControlBar *
CMainFrame::OnDbsCreateTabbedBarInstance() const
{
CExtDynamicTabbedControlBar * pBar =
new C_YOUR_DynTabControlBar;
return pBar;
}
The
CExtDynamicTabbedControlBar
class is derived from
CExtDynTabControlBar
and should be used as abase class of your
C_YOUR_DynTabControlBar
class in case of dynamic resizable control bars.