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 General Discussion » Dynamically changing menus... how to? Collapse All
Subject Author Date
Mirco Alexis Feb 10, 2004 - 3:59 AM

I hardly get it.


I’d appreciate any help in understanding how to add/remove dynamically menu items and submenus.


Thanks and congratulations.


Mirco

Technical Support Feb 10, 2004 - 7:27 AM

Dear Micro,


Prof-UIS allows you to dynamically construct any menu in the application. The library notifies the frame window that the menu is about to be created via the CExtControlBar::g_nMsgPrepareMenu registered window message. The WPARAM parameter is a pointer to the CExtPopupMenuWnd::MsgPrepareMenuData_t structure which describes the menu. CExtPopupMenuWnd::MsgPrepareMenuData_t::m_pPopup keeps a pointer to the CExtPopupMenuWnd object, which can be modified. By analyzing menu items, you should detect whether the popup menu is one that you want to modify.


The above described technique is implemented in the DrawCli sample. Please take a look at the CMainFrame::OnExtMenuPrepare() method. It handles the message dealing with dynamic menu construction and redirects it to the active view window. The latter handles this message in the CDrawView::OnExtMenuPrepare() method by modifying the menu before it is drawn.

Mirco Alexis Feb 10, 2004 - 8:26 AM

Thanks for your quick and helpful reply.


I can see indeed how to modify/insert popup menus, but not how to update the main menu items. Moreover, what is still somehow unclear is the role of the Command Manager in these dynamic updates.


Thanks again,


Mirco