This object is functional also for Web panels
If the user opens the local menu of the graphic item
, then the PmiItem.onMenuFill
event is called. In this event the PmMenu
object can be filled (available in the parameter pEvent.Menu
Then the local menu is opened with filled content.
Once the user selects the item then the menu is closed and the PmiItem.onMenuSelect event is fired. In this event it is possible to detect which menu item was selected and execute the corresponding action.
Calling the item local menu
- If the user clicks by the right mouse button over the graphic item.
- In script using the ShowMenu
method (in special cases).
Application system menu
work the same way. However it is called by the Alt-space
keys or by clicking the mouse on the application icon. The the PmRoot.onSystemMenuFill
events are called.
The fact that the script creates the local menu of the graphic item at the moment of calling the menu, means that the local menu can hold different content at each calling.
: 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 AddMenu