|
|
|
|
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.
Subject |
Author |
Date |
|
Ian McIntosh
|
Jul 17, 2008 - 3:09 AM
|
Hi, I have an empty menu that I populate within OnExtMenuPrepare using
pPopup->ItemInsert(ID_MYID);
but how can I make this appear with a tick against it ?
|
|
Ian McIntosh
|
Jul 18, 2008 - 3:07 AM
|
Hi, I do NOT want to add a separator - I want to show a tick against a menu item! For example, when I right click to get a list of control bars, the open ones are listed with a tick against then. That’s what I want to do. Currently, if I use SetCheck() in the OnUpdateMyid() function, i get an orange border around the icon. This isn’t obvious enough - and particluarly the difference between checked and undefined (3rd state). So I want to show a tick instead.
|
|
Technical Support
|
Jul 18, 2008 - 8:02 AM
|
The command descriptions (CExtCmdItem ) stored in the command manager (g_CmdManager ) can have attached icon objects (CExtCmdIcon ) and can be icon-less. By default, popup menu (CExtPopupMenuWnd ) gets all the information about menu command items from the command manager. If the checked/radio-checked command contains icon, then menu command item draws icon with highlighted background. If command has no icon, then menu draws check-mark/radio-mark for menu command item. So, you should simply use commands without icons. The icon object are typically appear in the command descriptions when the command manager is updated from toolbar resource which contains command button with appropriate identifier.
You can also switch using menu command items which are not based on the command manager and not updated via MFC’s command updating mechanism. To insert such menu commands into your dynamically constructed popup menu you should use the CExtPopupMenuWnd::ItemInsertCommand() method instead of the CExtPopupMenuWnd::ItemInsert() method.
|
|
Technical Support
|
Jul 17, 2008 - 12:58 PM
|
If you need menu separator item, then you should invoke the CExtPopupMenuWnd::ItemInsert() method (or CExtPopupMenuWnd::ItemInsertCommand() ) and specify the ID_SEPARATOR value as command identifier. The ID_SEPARATOR preprocessor variable is defined in MFC and equal to zero.
|
|