actionscript 3 - What is the mnemonic index in the context of an application menu? -
i have menu bar across top of application , each of menu items has property on called mnemonic index
. it's value -1. documentation provide help. mnemonic index in relation menu item , for?
the environment i'm working in flex , adobe air. it's property on nativemenu , nativemenuitem.
a mnemonic single key, not used in combination ctrl, alt, or shift keys, activates menu command in open menu. character in menu item on windows contain underscore, i.e. r, g, b:
menu item mnemonics relevant on windows, os-x not support mnemonics in menu items.
note: know on windows 7 (and under) supported, not sure if supported (show) under windows 8.1/10:
var root:nativemenu = new nativemenu(); var stackroot:nativemenuitem = root.addsubmenu(new nativemenu(), "stack"); var stack:nativemenu = new nativemenu(); stackroot.submenu = stack; var overflow1:nativemenuitem = new nativemenuitem("overflow1"); overflow1.mnemonicindex = 1; overflow1.keyequivalent = "a"; overflow1.addeventlistener(event.select, selectcommand); stack.additem(overflow1); var overflow2:nativemenuitem = new nativemenuitem("overflow2"); overflow2.mnemonicindex = 2; overflow2.keyequivalent = "b"; overflow2.addeventlistener(event.select, selectcommand); stack.additem(overflow2); var overflow3:nativemenuitem = new nativemenuitem("overflow3"); overflow3.mnemonicindex = 3; overflow3.keyequivalent = "c"; overflow3.addeventlistener(event.select, selectcommand); stack.additem(overflow3); if (nativeapplication.supportsmenu) { nativeapplication.nativeapplication.menu = root; } else { stage.nativewindow.menu = root; }
Comments
Post a Comment