Hotkeys for menu items
BlitzPlus Forums/BlitzPlus Programming/Hotkeys for menu items
| ||
Does anyone know how to make the hotkey shortcuts show up next to menu items? (like "Edit">>>"Copy Ctrl+Z") It'd be easy enough to half-ass, I'm just curious whether there's a simpler way to do it. |
| ||
http://blitzbasic.com/bpdocs/command.php?name=HotKeyEvent&ref=gui_cat |
| ||
:/ I'd figured that much out, it's making the shortcuts appear in the menu that's the difficulty. I'd hate to have to make my own menu gadget just for that. |
| ||
http://blitzbasic.com/bpdocs/command.php?name=WindowMenu&ref=gui_cat; Now the Edit menu edit=CreateMenu("&Edit",0,menu) ; Main menu with Alt Shortcut - Use & to specify the shortcut key CreateMenu "&Copy",4,edit ; Child menu with Alt Shortcut CreateMenu "&Paste",5,edit ; Another Child menu with Alt Shortcut CreateMenu "Cu&t",6,edit ; Another Child menu with Alt Shortcut Anything not supported, you will need to "subclass" (whatever the B+ equivalent is) and use the API via userlibs. |
| ||
Thanks, I see it now. The answer was in the documentation for CreateMenu, sorry for the trouble. One other question, how do you remove menu items after they have been added? Alternatively a method for reseting a menu to clear all of its sub-menus would be sufficient. |
| ||
RTFM ;) Although I have paid somebody to write a couple of apps for me in B+, I don't own B+. Any info I am giving you is directly from the online manual ;) |