popupclick
LIST
,
INITIAL
,
CHOICE
The popupclick statement displays a pop-up menu at the current mouse location.
Parameters
This statement has three parameters:
list – Carriage return separated array of choices to appear in pop-up menu. You can also use the menu( function to construct the menu, allowing styles, submenus, etc.
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 at the current mouse position. 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
popupclick "Red"+cr()+"Green"+cr()+"Blue","Red",colorChoice
if colorChoice = "" return endif // do nothing if user pulled off mouse
// colorChoice now contains the color name
if colorChoice="Red"
.. do something redish
elseif colorChoice="Green"
.. do something greenish
elseif colorChoice="Blue"
.. do something blueish
endif
You can also use the menu( and menuitem( functions to create the menu, as shown in this example. This is more complicated but gives you more control – you can give menu items different colors or styles, or even include submenus in your pop-up menu.
local colorChoice
let colorMenu = menu("Colors")+
menuitem("Red","color","770000")+
menuitem("Green","color","007700")+
menuitem("Blue","color","000077")
popupclick colorMenu,"Red",colorChoice
if colorChoice = "" return endif // do nothing if user pulled off mouse
// colorChoice now contains the color name
if colorChoice="Red"
.. do something redish
elseif colorChoice="Green"
.. do something greenish
elseif colorChoice="Blue"
.. do something blueish
endif
See Also
- Action Menu -- simple way to create your own menu items.
- arraymenuitems( -- converts a carriage return delimited array into a series of menu items.
- checkedarraymenuitems( -- converts a carriage return delimited array into a series of menu items, some of which may be checked.
- checkedmenuitem( -- creates a single menu item with an optional checkmark.
- Construct Menu -- used to automatically construct complex form applications, including calendars, lists, mailing labels, and more.
- Edit Menu -- edit text and data, to search (and replace), and to undo and recent actions.
- Field Menu -- manages fields, including adding and removing fields, setting field properties, sorting, morphing, hiding and showing.
- File Menu -- create, locate, open, close and save databases, import and export text, printing.
- filemenubar -- creates a custom menu bar or context menu for the current database (see Custom Menus).
- globalmenubar -- creates a custom menu bar or context menu for all windows (intended only for internal use by ProVUE Development).
- Help Menu -- contains items that will help you learn and use Panorama.
- info("menuidentifier") -- returns the identifier of the most recently chosen menu item (if any).
- LMSL -- is the specification language for Live Menus.
- Mark Menu -- allows you to set bookmarks in source code to help navigate to specific spots in a long program.
- menu( -- creates a menu (see Custom Menus).
- menuitem( -- creates a single menu item (see Custom Menus).
- menuitems( -- converts a semicolon separated array into a live menu specification.
- Menus -- overview of Panorama X menu bars.
- menuseparator( -- generates a menu item separator
- noactionmenu( -- suppresses the *Action* menu.
- noinstrumentationmenu( -- supresses the *Instrumentation* menu.
- nowizardmenu( -- suppresses the *Wizards* menu.
- Objects Menu -- used to select, modify and arrange graphics objects in a form.
- Panorama Menu -- get and set information about Panorama itself, including the version number, licensing information, and memory usage.
- 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.
- 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.
- Program Menu -- assists with running and debugging code, and with developing custom dialogs.
- Records Menu -- add and remove database records.
- Search Menu -- is used search for data, to select records, and to find and replace text within the current field.
- Source Menu -- used to assist in editing program code.
- standardactionmenu( -- generates a Custom Menu specification for Panorama's standard Action menu.
- standardclassicsetupmenu( -- generates a customizable Custom Menu specification for Panorama's classic Setup menu.
- standardconstructgraphicsmenu( -- generates a Custom Menu specification for Panorama’s standard Construct menu (in Graphics Mode).
- standardeditmenu( -- generates a customizable Custom Menu specification for Panorama's standard Edit menu.
- standardfieldsmenu( -- generates a customizable Custom Menu specification for Panorama's standard Fields menu.
- standardfilemenu( -- generates a customizable Custom Menu specification for Panorama's standard File menu.
- standardhelpmenu( -- generates a customizable Custom Menu specification for Panorama's standard Help menu.
- standardinstrumentationmenu( -- generates a Custom Menu specification for Panorama’s standard Instrumentation menu.
- standardpanoramamenu( -- generates a Custom Menu specification for Panorama's standard Panorama menu.
- standardrecordsmenu( -- generates a customizable Custom Menu specification for Panorama's standard Records menu.
- standardsearchmenu( -- generates a customizable Custom Menu specification for Panorama's standard Search menu.
- standardsetupmenu( -- generates a customizable Custom Menu specification for Panorama's standard Setup menu.
- standardsortmenu( -- generates a customizable Custom Menu specification for Panorama's standard Sort menu.
- standardtextmenu( -- generates a customizable Custom Menu specification for Panorama's standard Text menu.
- standardviewmenu( -- generates a Custom Menu specification for Panorama's standard View menu.
- standardwindowmenu( -- generates a customizable Custom Menu specification for Panorama's standard Window menu.
- submenu( -- creates a submenu (see Custom Menus).
- Window Menu -- controls the back to front arrangement of windows, it allows you to hide, show, or customize the toolbar (see Toolbar, and allows you minimize or zoom the window to full screen.
- windowmenubar -- creates a custom menu bar or context menu for the current window (see Custom Menus).
History
10.0 | No Change | Carried over from Panorama 6.0. |