Example showing how to create menus in macros

Share your macros, knowledge, solutions, services, ...
Post Reply
Petr
Posts: 106
Joined: Tue Oct 18, 2016 1:12 pm

Example showing how to create menus in macros

Post by Petr » Fri Nov 25, 2016 1:05 pm

The macro shows how to create menu (submenu) in macros.

Code: Select all

<#> Start of the macro
<cmds>

<#> Show message 
<msg>(100,100,"What color do you like?","Message",0)

<#> Add items to menu and submenu 
<menu_additem>("Red")
<menu_additem>("Blue")
<menu_additem>("White")
<menu_additem>("---")
<menu_additem>(".Other")
<menu_additem>(".Green")
<menu_additem>(".Black")
<menu_additem>(".Yellow")
<menu_additem>("..Yet another")
<menu_additem>("..Tell me what?")
<menu_additem>(".")
<menu_additem>(".")
<menu_additem>("---")
<menu_additem>("I do not like colors")

<#> Show menu at position x,y (current position of mouse pointer -1,-1) 
<menu_show>(-1,-1,vSelectedItem,1,0)

<msgoff>

<#> Remove leading . characters in a case the selected item is from submenu
<var_oper>(vSelectedItem,"%vSelectedItem%",STR_TRIMLEFT,".","", "0")

<#> Show message with selected menu item 
<msg>(-100,-100,"You have selected: %vSelectedItem%","Message",1)

<#> End of the macro

Post Reply