Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » context menu Collapse All
Subject Author Date
Seth Strong Oct 25, 2006 - 2:03 PM

I made a Prof-UIS project using the window. I also let it make me a control bar with a resizable dialog. When using the context menu or the matching View menu, I can check or uncheck the toolbar to have it show or hide respectively. What’s the trick to having the control bar respond the same way so that in the context menu, the control bar has a check by its name, and if there is no check, the control bar is hidden?

Thanks,
Seth

Seth Strong Oct 26, 2006 - 11:21 AM

Thank you.

Technical Support Oct 26, 2006 - 10:04 AM

You can show the checked/unchecked state for any control bar only if you are not using the auto hide feature. You should have the CMainFrame::OnUpdateControlBarMenu() and CMainFrame::OnBarCheck() methods implemented in the following way:

void CMainFrame::OnUpdateControlBarMenu(CCmdUI* pCmdUI)
{
 CExtControlBar::DoFrameBarCheckUpdate( this, pCmdUI, true );
}
 
BOOL CMainFrame::OnBarCheck(UINT nID)
{
 return CExtControlBar::DoFrameBarCheckCmd( this, nID, true );
}
Please note that the last parameters both in the CExtControlBar::DoFrameBarCheckUpdate() and CExtControlBar::DoFrameBarCheckCmd() methods are set to true.

The SDI sample demonstrates how this works.