Menu Command, Shortcut Keys, and Resources

Menu Command, Shortcut Keys, and Resources

Postby dpaterso » Sun Feb 12, 2006 6:55 am

Just discovered something interesting.

The shortcut key underline or prompt on a menu item is only displayed if the user presses the Alt key i.e. the current menu item is highlighted and the letter that you have defined using '&' as the shortcut key is underlined. If you just use the mouse to select menu items these shortcut key underlines or prompts are not dispayed.

OK so far.

But if you use the 'Resource' statement to display a small bitmap to the left of your menu item then that menu item has the shortcut key underline or prompt displayed always - regardless of whether or not you are using the mouse or have used the Alt key to access the menu.

The end result is that if you have used your mouse to access the menu only those menuitems that use a resource to display a bitmap to the left of the menuitem have the shortcut key underline or prompt displayed.

Any reason for this?

By the way: what is the correct / recommended size of bitmap to use for a menuitem prompt resource?

Regards,

Dale.
dpaterso
 
Posts: 142
Joined: Tue Jan 24, 2006 9:45 am
Location: South Africa

Postby Antonio Linares » Sun Feb 12, 2006 8:15 am

Dale,

The Windows API does not natively support to display a bitmap on a menuitem, so we use "ownerdraw" menuitems to paint the bitmap and the text on it. Thats where the difference comes from. We may need to check if there is a message that provides a chance to paint or not the shortcut underscore.

The bitmap size should be 16x16 pixels.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42071
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby James Bott » Sun Feb 12, 2006 8:19 am

This is an XP issue. XP by default has the alt key underlines turned off until you press the Alt key. You can change this, right-click on the desktop, then Appearance, Effects. Then uncheck the box.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 41 guests