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 » Show or Hide Panels - toolbar order Collapse All
Subject Author Date
Christoph Luedi Apr 17, 2007 - 1:42 AM

I noted that all toolbars are automaticall added to the "Show or Hide Panels" system menu. But I have not found out how I can influence the order of the menu items, I want to have them in a different order. And how are the separators added? I know that I can create the menu myself with the CExtControlBar::g_nMsgConstructPopupMenu message, but since I only want to change the order, I hope there is an easier alternative.

Christoph Luedi Apr 26, 2007 - 3:02 PM

Aha, the constructors! Thanks, as i hoped that’s much simpler to change the order than implementing the said function! :-)

Technical Support Apr 17, 2007 - 2:31 AM

We would also like to add the following. By default, the order of control bars corresponds to the order in which the constructors of control bars are called. You can change this order by handling the CExtControlBar::g_nMsgConstructPopupMenu registered message, which allows you to construct any built-in menu displayed over control bars and floating mini frames. Fo r example, there is a CMainFrame::OnConstructPopupMenuCB() method in the ProfStudio sample that rebuilds most of the build-in menus and you can see toolbar commands put into a separate sub menu and control bar commands into a set of menu trees.

Suhai Gyorgy Apr 17, 2007 - 1:56 AM

Snippets from same FAQ: "The CExtControlBar::g_nMsgConstructPopupMenu registered windows message is sent twice to the main frame window for each of built-in pop-up menus." ... "When it is sent for the second time, you can modify the pop-up menu created by default." From code:

if( p_pmed->m_bPostNotification )
   {
      // p_pmed->m_pPopupMenuWnd contains default items
      // you can change this menu here
   }