showContextMenu__
showContextMenu__(menu: MenuItem; conwin: Window input; mouse: Boolean; x: Integer; y: Integer);
The showContextMenu__ method of the Window, ListBox, Table, and JadeEditor classes is a helper method that can be called from contextMenu events to display a menu using the event details. If the event was generated by the mouse, the x and y positions are converted to be relative to the form for the call to Form class popupMenu method. If the event was generated by the use of the keyboard, the required x and y positions will be generated by the method.
The parameters for the showContextMenu__ method are listed in the following table.
Parameter | Description |
---|---|
menu | The context menu to display. If this parameter is null, no menu is displayed. |
conwin |
The window being right‑clicked or the control with the focus when the keyboard menu key is pressed. When the mouse is used, the x and y positions are relative to the start position of this window. |
mouse |
Contains true if the mouse generated the event or false if the keyboard generated it. If the mouse parameter is true, the context menu is positioned at the specified x and y positions relative to the window specified in the conwin parameter. If the mouse parameter is false, for:
|
x |
The left position in pixels to display the context menu relative to the window specified in the conwin parameter when the mouse parameter is true, or ignored if the mouse parameter is false. |
y |
The top position in pixels to display the context menu relative to the window specified in the conwin parameter when the mouse parameter is true, or ignored if the mouse parameter is false. |
The following example shows the use of the showContextMenu__ method.
lstCustomers_contextMenu(listbox:ListBox input; conwin: Window input; mouse: Boolean; x: Integer; y: Integer):Boolean updating;
begin listbox.showContextMenu__(mnuEditMenu, conwin, mouse, x, y); return false; end;
2022.0.01 and higher