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 » PopupMenuItems icons Collapse All
Subject Author Date
Eugen Rata Jul 7, 2005 - 4:35 PM

Hello
Thank you for your previous answers, they helped me 100%. I got what I needed.
But I got another question.
I have a toolbar where I have a button which has a popup menu. That menu is build dynamicaly as described in your FAQ: first I create a command in command manager, set a text for that command and an icon, then insert a menu item. this works excelent. But the problem comes when a menu item is a popup, since there is no command associated with it I cannot set an icon for it.
So, the question is, how to set an icon for a menu item which has style POPUP. Just check this image
http://eugenr.com/d/mnu.png
You see there the items with no icon. I need to set an icon for them. Is it possible to do it?
P.S. The menus are created using standard MFC CMenu class, then runtime assigned their handle to needed toolbar button.
Thx

Technical Support Jul 8, 2005 - 5:14 AM

Pop-up menu items and a separator have no command identifiers. In fact, the command identifier of any pop-up item is equal to -1 and the command identifier of any separator is always 0 . To assign icons to pop-up menu items, use CExtPopupMenuWnd::ItemSetPopupIcon() method. Of course, you should know the exact location of pop-up menu items in the menu tree before calling this method. This (associating icons with pop-up menu items) is usually done when you construct your pop-up menu.