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 » Shortcut keys in popup menus Collapse All
Subject Author Date
Paul Cowan Nov 9, 2007 - 7:39 AM

Popup menus should not have shortcut keys (as per the MS UI Guidelines document), yet CExtPopupMenuWnd seems to automatically add the shortcuts to popups. How do I not have the shortcuts added?

Technical Support Nov 19, 2007 - 11:37 AM

We are sorry for the delay with this reply. We implemented the both features:

1) You can now hide keyboard accelerators in menu items by specifying TPMX_HIDE_KEYBOARD_ACCELERATORS when invoking CExtPopupMenuWnd::TrackPopupMenu() . This flag is used in context menus in the DRAWCLI sample.

2) The CExtReportGridWnd control now supports item-by-item horizontal scrolling.

Paul Cowan Nov 13, 2007 - 7:00 AM

A new flag to disable the shortcut keys would be nice. We prefer not to modify your code as it makes updates harder to use.

Technical Support Nov 13, 2007 - 2:45 AM

We think the popup menu code should be left intact. We can add some new TPMX_*** flags for CExtPopupMenuWnd::TrackPopupMenu() to hide shortcut keys or we can add a per-menu item option.

Paul Cowan Nov 12, 2007 - 8:45 AM

That is how I figured it worked.

As MS UI Guidelines say popup menus should not have short cut key, it would be nice to have a way of turning them off in the CExtPopupMenuWnd class. I changed the CExtPopupMenuWnd::MENUITEMDATA::SetAccelText function to not set m_sAccelText and I no longer have the short cuts.

Technical Support Nov 9, 2007 - 1:54 PM

Command items in Prof-UIS menus do not keep menu text nor shortcut text by default. They get this data from CExtCmdItem command description objects stored in the command manager. If you updated the command manager from two menus containing a ID_EDIT_COPY command and one item has the string &Edit while another has the string &Edit\tCtrl+C,the command manager will try to gather maximum possible details about the ID_EDIT_COPY command and it will remember the Ctrl+C accelerator text in the CExtCmdItem object which describes the ID_EDIT_COPY command. This means if you need the ID_EDIT_COPY command in some of your menus without accelerator keys displayed, then you should make this menu item having some other unique command identifier which have no accelerator description in the command manager.


Paul Cowan Nov 9, 2007 - 11:11 AM

I have non-customizable popup menus and context menus. I know about the text after the \t. The problem is I don’t have the short-cut key in the resource for the pop-up menu, but it is in the standard menu. Once I add a short-cut to any menu, all menus get it.

Technical Support Nov 9, 2007 - 10:42 AM

There are two cases:

1) Customizable applications. We have the following two groups of menus: (1) popup menus displayed from the menu bar and from toolbars and (2) ribbon bar popup menus. All these popup menus are controlled by the customize site and shortcut keys are displayed automatically. The shortcut key text is stored in the accelerator table. To remove shortcut key text from menu items, you should remove the appropriate entries from the accelerator table.

2) Non-customizable popup menus and context menus. The shortcut keys are displayed if you specify them in the menu item text either manually or in the menu resource. To remove shortcut key text from menu items, you should simply remove part of the text in a menu item starting from the \t character.