Get label of selected AutoHotKey GUI menu item - menu

I want to create small menu for special characters, directly inserting selected character into text.
For example, this small popup menu opens on F9 as a context menu:
Menu, Ctx1, Add, €, InsertMenuLabel
Menu, Ctx1, Add, ¥, InsertMenuLabel
Menu, Ctx1, Add, ¢, InsertMenuLabel
Menu, Ctx1, Add, £, InsertMenuLabel
F9:
Menu, Ctx1, Show, %A_GuiX%, %A_GuiY%
Return
How do simply retrieve label of menu item which was selected? In the following code, how can I carry menu item label into %MenuItemLabel%?)
InsertMenuLabel:
Send %MenuItemLabel%
Return
I know this can be done using individual branch for each menu item (InsertChar1 ... InsertChar4) but it is not elegant.

I think I found it:
InsertMenuLabel:
Send %A_ThisMenuItem%
Return

Related

Menu button on keyboard to get Excel Context Menu

Normally on an excel file, when I click the Menu button on the keyboard, the normal context menu like below first screenshot will show. However I got a new computer and it gives me a totally different context menu like below 2nd screenshot. How can I change excel to show me the context menu like the first screenshot when I click the menu button on the keyboard? Many thanks.

Add Git buttons on the Toolbar in Android Studio (merge, rebase, new branch)

If you often create, merge, rebase, compare branches, you should know how to add icons from Main menu to the Toolbar. Sometimes clicking Git buttons is difficult inside menus, see screenshots.
Where is that "New branch" command inside a list of branches?
First, you should separate the Toolbar from Main menu, if it was not done before. View > Appearance > Toolbar.
Right-click on empty space in the Toolbar and press "Customize Menus and Toolbars...".
Expand "Main Toolbar" in the tree.
Scroll down and expand "MainToolBarSettings", "VCS Actions", click "Rollback", then in the top press "plus" and click "Add Action..." Here we will add new buttons.
In a window find "new branch". Select several commands with Ctrl click in Windows. Press "OK" and "OK".
Now you will see 3 new buttons in the Toolbar.

Python + GTK - Scrolled menu bugged

Basically, when we click on a combobox near to the bottom edge of the screen, the first item of the menu begins at the same vertical position of the combobox, leaving a blank space on top of this.
This way the menu is created with the size to hold all the menu items, but since the first element of these is not put at the top of the menu, the menu has to scroll to see them.
Link to the image: http://postimg.org/image/767ukjphz/
It's not a bug in my code. The menu is created correctly. The bug is in the GTK libraries.
So, what do you suggest me?, how can I resolve this situation?, maybe moving to menu position?

Include a divider between menu item groups. JavaFX

How to insert a divider between groups of a menu items. For example:
Group 1:
Save,
Save As
Group 2
Open
Import
My hack is adding a disabled menu item in the middle, with a string value of "---------". So my current menu is something like this
"Save"
"Save As"
"--------"
"Open"
"Import"
Is there a more proper, elegant, way to do this?
Use the JavaFX SeparatorMenuItem.

PrimeFaces splitbutton removal

My splitButton should not have any text on the button but I have menu items. I have to remove the button instead leaving blank except menu option.
Use Menu Button.If you dont have any text on the menu button, Its shows only down arrow icon for menu options.

Resources