Update cookies preferences
Promotic

Object PmMenu

Description:
The context menu of the Pmg object or the system menu of the application.
Properties and methods:
AddMenu()Adds one item to the menu
Note:
This object is functional also in Web panels.

If the user opens the context menu of the Pmg object, then the PmgObject.onMenuFill event is triggered. In this event the PmMenu object can be filled (available in the pEvent.Menu parameter).
Then the context menu is opened with filled content.
Once the user selects the item then the menu is closed and the PmgObject.onMenuSelect event is triggered. In this event it is possible to detect which menu item was selected and execute the corresponding action.
 
Calling the Pmg object context menu:
- If the user clicks by the right mouse button over the Pmg object.
- If the "Open the context menu also by the left mouse button" configurator is set then by left mouse button clicking or by pressing the space key.
- In script by the ShowMenu method (in special cases).


Application system menu work the same way. However it is called by the Alt-space key or by clicking the mouse on the application icon.
The PmaRoot.onSystemMenuFill and PmaRoot.onSystemMenuSelect events are called.

The fact that the script creates the context menu of the Pmg object at the moment of calling the menu, means that the context menu can hold different content at each calling.

Caution: The PmMenu object is valid only in the processing of the onMenuFill event. It is not allowed to save the reference to this object for the later use.

See: Example in the description of the AddMenu object

History:
Pm8.03.24: Multi level menu can now be created: it is now possible to add a submenu by method AddMenu("id", "text", "type:menu;")
PROMOTIC 9.0.31 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.