Add shortcut to menu item tip

BlitzPlus Forums/BlitzPlus Programming/Add shortcut to menu item tip

Wiebo(Posted 2003) [#1]
I just found this out, and I haven't seen it documented so I just though I would put it here. When you create a menuitem, and you want to add a text indicating the keyboard shortcut for that option, just insert a TAB in the item text, like this:
MENYKEYS = CreateMenu ( "Keyboard Shortcuts" + Chr$(9) + "F1", MENU_KEYS, MENUHELP )
It will send the last text to the right side of the menu item. All text will be aligned as well, so one tab is enough! I thought is was kinda neat =]


Mark Tiffany(Posted 2003) [#2]
Um, documented in the online version of the docs
here.

Chr$(8) and Chr$(9) seem interchangeable for this purpose, although 9 makes more sense as it is the tab char, and 8 is backspace!


Wiebo(Posted 2003) [#3]
ah cool! I didn't check the online docs. silly me.


Snarty(Posted 2003) [#4]
Chr$(8) : Backspace = Right Aligned Shortcuts
Chr$(9) : Tab = Left Aligned Shortcuts

I use Chr$(8).


Wiebo(Posted 2003) [#5]
I will too =] good tip.


Mark Tiffany(Posted 2003) [#6]
aha! docs updated with Snarty's info. ;-)