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 » make menu bar always visible Collapse All
Subject Author Date
Rado Manzela Jun 18, 2007 - 1:42 AM

How can I make my main frame’s menubar daockable but disable user to hide it (or close it when it is floating)?
I need to avoid situation when user closes menu all toolbars - there is no way how to show them again in this case.
Thank you!

Technical Support Jun 18, 2007 - 9:33 AM

If you want the end user NOT to be able to hide a toolbar, you need to do two things:

1) Remove the Close button of the toolbar by overriding the OnNcAreaButtonsReinitialize() method like as follows:

class CNoCloseMenuControlBar : public CExtMenuControlBar
{
protected:    
 virtual void OnNcAreaButtonsReinitialize()
 {
  INT nCountOfNcButtons = NcButtons_GetCount();
  if( nCountOfNcButtons > 0 )
   return;
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
  NcButtons_Add( new CExtBarNcAreaButtonAutoHide(this) );
#endif
  NcButtons_Add( new CExtBarNcAreaButtonMenu(this) );
 }
};
2) The user can show and hide toolbars by toggling the corresponding menu items in the Prof-UIS build-in menus. So you should also remove the toolbar’s item from these menus:
m_wndMenuBar.m_bAppearInDockSiteControlBarPopupMenu = false;
This information is applicable to the menu bar too. Please note if the menu bar is hidden, you can always show it by pressing and releasing the ALT key.