Dynamic pop up menu

4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next

version 11


Dynamic pop up menu (menu{; default{; xCoord{; yCoord}}}) ItemRef

ParameterTypeDescription
menuMenuRefMenu reference
defaultItemRefReference of item selected by default
xCoordNumberX coordinate of top left corner
yCoordNumberY coordinate of top left corner
Function resultItemRefReference of selected menu item

Description

The Dynamic pop up menu causes a hierarchical pop-up menu to appear at the current location of the mouse or at the location set by the optional xCoord and yCoord parameters.

The hierarchical menu used must have been created using the Create menu command. The reference returned by Create menu must then be passed in the menu parameter.

In conformity with standard interface rules, this command must generally be called in response to a right mouse click or when the button is held down a certain period of time (contextual menu for example).

The optional default parameter can be used to set an item of the popup menu as selected by default whenever the menu appears. In this parameter, pass a menu item reference. This reference must have been set beforehand using the SET MENU ITEM REFERENCE command. If you do not pass this parameter, the first item of the menu will be selected by default.

The optional xCoord and yCoord parameters can be used to specify the location of the pop-up menu to be displayed. In the xCoord and yCoord parameters, pass the horizontal and vertical coordinates, respectively, of the top left corner of the menu. These coordinates must be expressed in pixels in the local coordinate system of the current form. Both parameters must be passed together; if only one of them is passed, it will be ignored.

If you want to display a pop-up menu associated with a 3D button, then do not pass the optional xCoord and yCoord parameters. In this case, 4D automatically calculates the location of the menu with respect to the button according to the interface standards of the current platform.

If a menu item has been selected, the command returns its reference (such as it has been defined using the SET MENU ITEM REFERENCE command). Otherwise, the command returns an empty string.

Note: The existing Pop up menu command ("User Interface" theme) can be used to create pop-up menus based on text.

See Also

Get menu item reference, Get selected menu item reference, Pop up menu, SET MENU ITEM REFERENCE.


4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next