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 » Popup Menu Collapse All
Subject Author Date
Simon Chung Sep 8, 2003 - 3:02 AM

How can I disable or customize the popup menu on right clicking a control bar?
Thanks for your help.

Sergiy Lavrynenko Sep 18, 2003 - 12:51 PM

Hi,

Sorry for the delay with answering you.

You can dynamically construct any built-in Prof-UIS menus. This feature is available in any version of the library. It is demonstrated in the Prof-Studio sample of the trial/commercial version. The library notifies the frame window about context menu events via the CExtControlBar::g_nMsgConstructPopupMenu registered windows message. For details, please see the CMainFrame::OnConstructPopupMenuCB() method in the Prof-Studio sample. The WPARAM parameter is a pointer to the CExtControlBar::POPUP_MENU_EVENT_DATA structure, which describes the context menu event. The CExtControlBar::POPUP_MENU_EVENT_DATA::__PMED_... enumeration constants are used to specify the type of the event (they are stored in the CExtControlBar::POPUP_MENU_EVENT_DATA::m_nHelperNotification property).

NOTE:

  • CExtControlBar::POPUP_MENU_EVENT_DATA::m_pPopupMenuWnd stores a pointer to the CExtPopupMenuWnd object which can be modified

  • The CExtControlBar::POPUP_MENU_EVENT_DATA::m_bPostNotification boolean property is false if the menu is empty (i.e. is not constructed yet). It is true if the menu contains default items (i.e. the popup has been constructed by Prof-UIS and you can modify/insert/append new menu items)

  • Your message handler should return NOT 0 if you have completely constructed your custom menu

  • Your message handler should return 0 so that Prof-UIS will construct the default menu

Best regards, Sergiy.