There are two types of control bar commands:
1) Visibility change. These commands can always be applied to a toolbar, a dialog bar, a menu bar and a status bar. You can also use it for resizable control bars in Prof-UIS but only if the auto-hide feature is not enabled.
2) Forcibly activate and show. This behavior is used by resizable control bars which can be switched into the auto-hide mode like the resizable bars of Visual Studio .NET / 2005 / 2008.
Most of Prof-UIS samples based on a frame window. There are two methods in the main application window, CMainFrame::OnBarCheck()
and CMainFrame::OnUpdateControlBarMenu()
handler methods, which process control bar commands. Here is how these methods should look if the auto-hide feature is on:
BOOL CMainFrame::OnBarCheck(UINT nID)
{
return
CExtControlBar::DoFrameBarCheckCmd(
this,
nID,
false // DO NOT use visibility toggling commands for resizable bars
);
}
void CMainFrame::OnUpdateControlBarMenu(CCmdUI* pCmdUI)
{
CExtControlBar::DoFrameBarCheckUpdate(
this,
pCmdUI,
false // DO NOT use visibility toggling commands for resizable bars
);
}
And the following version should be used if your frame does not invoke the
CExtControlBar::FrameInjectAutoHideAreas()
method in its
CMainFrame::OnCreate()
method and, as a result, the auto-hide feature is not used with resizable control bars:
BOOL CMainFrame::OnBarCheck(UINT nID)
{
return
CExtControlBar::DoFrameBarCheckCmd(
this,
nID,
true // USE visibility toggling commands for resizable bars
);
}
void CMainFrame::OnUpdateControlBarMenu(CCmdUI* pCmdUI)
{
CExtControlBar::DoFrameBarCheckUpdate(
this,
pCmdUI,
true // USE visibility toggling commands for resizable bars
);
}
Your resizable bars support the auto-hide. This means you should not invoke
CFrameWnd::ShowControlBar()
for resizable control bars without analyzing their auto-hidden state. If you want to make some control bar simply visible, not hidden and not auto-hidden, you should first invoke the
CExtControlBar::AutoHideModeGet()
method to check bar’s auto-hidden state, return it to the simple docked mode if needed by using the
CExtControlBar::AutoHideModeSet()
method and show or hide it using the
CFrameWnd::ShowControlBar()
method if also needed. Please note the
CExtControlBar::AutoHideModeSet()
and
CFrameWnd::ShowControlBar()
methods invoked for some resizable bar which is in the tabbed bar group affect all the bars in the same group.