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 » How do I disable popup menu items? Collapse All
Subject Author Date
Neville Franks Aug 19, 2003 - 8:31 PM

I want to disable items on a popup menu and CExtPopupMenuWnd::EnableMenuItem() is udefined.

I’m using: dwTrackFlags = TPMX_DO_MESSAGE_LOOP | TPMX_NO_WM_COMMAND | TPMX_NO_CMD_UI; so I’m not doing any menu message handling in the parent window.

I can use ItemRemove() but that’s not what I want.

Technical Support Aug 20, 2003 - 3:57 AM

Dear Neville,

This task can be done via CExtPopupMenuWnd::MENUITEMDATA type.

1) Get the menu item data for some item:
CExtPopupMenuWnd::MENUITEMDATA & _md = pPopup->ItemGetInfo( nItemIndex );

2) Enable or disable it:
_md.Enable( false or true );

Neville Franks Aug 20, 2003 - 9:33 PM

Thanks. ItemGetInfo() isn’t in the help. :(

It would nice to have the standard CMenu functions like this available as CExtPopupMenuWnd member functions.

Technical Support Aug 21, 2003 - 7:08 AM

Dear Neville,

The CExtPopupMenuWnd class provides a set of features that are not available in the standard HMENU of Win32 API: color submenus, built-in text fields and combo fields (coming soon), and command delivery for a specified window. In most cases LoadMenu() is enough. When a menu is loading, only its command ID’s and submenu structure are analyzed. At this moment, text and icon properties should be already registered in the command manager. In other words, a popup menu is designed to work with the command collection in the command manager. That is why we did not make it absolutely similar to the Win32 HMENU.

We are rewriting the documentation for CExtPopupMenuWnd class right now. It should cover all the methods and features.