Menu.Show
Description
- Shows a command list as a menu, positioned according to specified keyword.
Syntax
- Menu.Show(clname, position)
Parameters
- clname
- (string) name of the command list to use for the menu
- position
- (string) one of the following position keywords:
-
Possible Values
- centerUnderMouse
- Centers the menu under the mouse.
- centerScreen
- Centers the menu on the screen.
- offset n1 n2
- Shows the menu positioned n1 pixels to the left & n2 pixels above the mouse.
- n1 & n2 can be negative, which would position the menu to the right & below the cursor respectively.
- Note
- If the config setting "Force cursor over new opened menus" (in PProConf > Command Lists > Setup > All Menus) is checked, this setting will not have any effect.
- screen n1 n2
- Shows the menu at screen position (n1, n2), where:
- n1 = pixels from left
-
- n2 = pixels from top
-
- horButton
- Shows the menu aligned under/above the last button pressed on a horizontal bar.
- horButtonCenter
- Shows the menu centered under/above the last button pressed on a horizontal bar.
- verButton
- Shows the menu aligned left/right of the last button pressed on a horizontal bar.
Examples
- Menu.Show("Locations", "offset 20 20")
- Shows the command list named "Locations", positioned 20px above & 20px to the left of the mouse.
- Menu.Show("Locations", "centerScreen")
- Shows the command list named "Locations", positioned in the centre of the screen.
Notes
- Use the Format command to add submenus and separators to a menu.
- The position keywords "horbutton" and "verbutton" perform the same alignment as a Menu.ShowAtButton() command, however, by using Menu.Show(), you can more precisely specify the menu's bar alignment.
See Also
-
PowerPro Help CHM > Built-in Commands > *Menu > Showing menus