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 » CExtPopupMenuWnd changes from V2.30 to 2.50 Collapse All
Subject Author Date
Neville Franks Jan 22, 2006 - 6:24 PM

The behaviour of CExtPopupMenuWnd::LoadMenu() has changed between V2.30 to 2.50 and this is causing me a problem as folows: The text I set for the PopUp Menu items in the .RC file is ignored and the text from the main menu is used instead. ie. Where I’m using the same command ID on both menus. I don’t want to create different ID’s etc. for the popup menu, just so I can get the correct text. Setting bNoRefToCmdMngr = true doesn’t fix this and disables most menu items.


On a related issue, how do I enable an accelerator key on a Popup menu item. I’ve added the key to the Accelerator resource, but it doesn’t work. I also created a new ACCELERATORS resource for the Popup menu but that didn’t work either. If the menu item is in the main menu then the accelerator is displayed, but in this case it is only on the popup menu.

Technical Support Jan 25, 2006 - 4:20 AM

The general behavior of the CExtPopupMenuWnd class method has not changed. The LoadMenu() method can additionally create popup menus without any reference to the command manager but this should be used only for the menus which work like standalone selectors for some set of items, i.e. popup menus which work like replacement for popup list boxes with a dynamic number of items.

Both in case of Prof-UIS 2.30 and 2.50 we recommend to use two different command identifiers for two menu items if you want to see different text/icons in menus for them. It is not difficult to connect one command handler or updater method for both commands. The first is generated by the Visual Studio wizard and appears automatically in your code. The second will appear when you add the additional line to the message map manually.

The newly created accelerator may not be visible only if you use customizable toolbars in menus in your application where the CExtCustomizeSite::Serialize() method restores the accelerator table at startup. You can reset the newly created accelerators in the Customize dialog or remove your app settings manually in the registry.