Method XbpMenu():popUp() Foundation
Displays and activates a popup menu.
:popUp( [<oXbp>], <aPos>, ;
[<nDefaultItem>], [<nControl>] ) --> lSuccess
This method returns the value .T. (true) if the XbpMenu object could be displayed, otherwise .F. (false) is returned.
An XbpMenu object is either used as a submenu within a menu system or as an independent context menu. Context menus are generally displayed after the right mouse button is clicked. The :popUp() method of the XbpMenu object is used to display and activate the popup menu. The display position depends on the <oXbp> and <aPos> parameters. The value specified for the <oXbp> parameter is generally the third message parameter of the AppEvent() function which is also the third parameter of the callback code block for the right mouse click event. The values specified in the <aPos> parameter are generally the first message parameter since this is the position of the mouse pointer (see the example).
The behavior of the popup menu depends on the constant specified for the <nControl> parameter. The constants listed in the following table define the behavior of the popup menu. These differ from other #define constants, in that they can be added to create many possible combinations.
Constant | Description |
---|---|
XBPMENU_PU_MOUSE_LB *) | Menu reacts to the left mouse button |
XBPMENU_PU_MOUSE_RB *) | Menu reacts to the right mouse button |
|
The default for controlling popup menus corresponds to the XBPMENU_PU_DEFAULT constant which includes all of the constants marked with *) in the table above. Using the default value, popup menus are entirely visible, selection can occur using either the keyboard or any mouse button, and the menu remains visible on the screen until a selection is made or a key is pressed.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.