Plus sign in menu

J. Landman Gay jacque at hyperactivesw.com
Tue Dec 22 15:33:33 EST 2009


Devin Asay wrote:
> Hello all,
> 
> In lots of Mac apps, and probably some Windows apps, the way to increase 
> and decrease font size in a document is with Cmd + and Cmd - (plus and 
> minus signs). Both Safari and Mail work this way, for example. The menu 
> shortcuts have a minus and plus sign in them. But you don't have to do 
> Cmd-Shift for the increase size shortcut to work.
> 
> I'm building an app in which I want to use this same approach, but if I 
> set the shortcut key to Cmd and plus sign, the plus sign shows up in the 
> menu alright, but I have to use Cmd-Shift-plus key to activate it. If I 
> change the shortcut to Cmd and equal sign, the shortcut works the way I 
> want, but the equal sign appears in the menu, not the plus sign. Anyone 
> know how to trick the Rev menu routines so that a Cmd-equal appears as a 
> Cmd-plus in the menu?

Maybe the new menu tagging option would work. See "menu-item tagging" in 
the engine change log. I think you could use a hyphen as the tag and the 
plus as the accelerator:

Menu-item tagging
~~~~~~~~~~~~~~~~~

The menu item specification has been extended to allow a tag to be 
specified. It is now of the form:
   <label> [ '/' [ <accelerator> ] [ '|' <tag> ] ]
Note that the <tag> is optional as is the <accelerator> however, if you 
want an item with a tag but without the accelerator you need:
   <label> '/' '|' <tag>

The <tag> must only be composed of characters from the ASCII character set.

If a menu item has a <tag> then it is the tag string that is passed to 
menuPick rather than the <label>. This is useful for localization of 
menu items as you don't need to change the menuPick handler for each 
language supported.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the Use-livecode mailing list