RectControl.ConstructContextualMenu Event

Fires whenever it is appropriate to display a ContextualMenu for the control. This is the recommended way to handle contextual menus because this event figures out whether the user has requested the contextual menu, regardless of how he did it.

Syntax
result = ConstructContextualMenu( Base, x, y )

Parameters
Base | MenuItem
x | Integer
y | Integer

Return Value
Result | Boolean

# Notes

Depending on platform, it might be in the MouseUp or MouseDown event and it might be a right+click or by pressing the contextual menu key on the keyboard, for example.

Returns a Boolean. Base is analogous to the menu bar for the contextual menu. Any items you add to Base will be shown as menu items. If you return False, the event is passed up the parent hierarchy. If you return True, the contextual menu is displayed. The parameters x and y are the mouse locations. If the event was fired because of a non-mouse event, then x and y are both set to -1. See the example of a contextual menu in the examples.