popupbutton
popupbutton
LIST
,
INITIAL
,
CHOICE

The popupbutton statement displays a pop-up menu in response to clicking on a button.

Parameters

This statement has three parameters:

list – Carriage return separated array of choices to appear in pop-up menu.

initial – Initial choice to be selected in pop-up menu (or `""` if no choice).

choice – Item user selected in pop-up menu (or `""` if no choice). Note: If the menu was constructed with identifiers you can also use the info(“menuidentifier”) function to determine the chosen menu item.

Description

This statement can be used to produce a pop-up menu in response to clicking on a button. The menu will pop-up over the button that was pressed. It is intended that this statement be used in a procedure that is triggered by a button on a form (or any form object that triggers a procedure). The procedure must be triggered on mouse down, not mouse up.

Here is an example that displays a pop-up menu with three colors when the button is clicked.

    local colorChoice
    popupbutton "Red"+cr()+"Green"+cr()+"Blue","Red",colorChoice
    // colorChoice now contains the color name

See Also

- popup -- makes a pop-up menu appear anywhere on the screen.
- Popup Menu Button Object -- is used to create popup menus anywhere on a form.
- popupatmouse -- displays a pop-up menu at the current mouse location.
- popupbelowbutton -- displays a pop-up menu in response to clicking on a button.
- popupbynumber -- makes a pop-up menu appear anywhere on the screen.
- popupclick -- displays a pop-up menu at the current mouse location.
- popupdoublefieldchoices -- displays a pop-up menu listing values in a specified field, with submenus containing values from a second field.
- popupfieldchoices -- displays a pop-up menu listing values in a specified field.

History

Version | Status | Notes
10.0 | No Change | Carried over from Panorama 6.0.