MENU CONTEXT statement  

Purpose

Create a floating context menu.

Syntax

MENU CONTEXT hContext, x&, y&, flags& TO CmdVar

Remarks

A context menu is a floating popup menu which is shown until the user makes a selection or dismisses it.  It can appear anywhere on the screen.

hContext

Handle of a menu created with MENU NEW POPUP.

x&, y&

The parameters x& and y& specify the location of the context menu, in pixels, relative to the upper left corner of the desktop.

flags&

May be combined, as appropriate, to specify the characteristics of the context menu.

%TPM_LEFTBUTTON

Tracks the left button.

%TPM_RIGHTBUTTON

Tracks the right button.

%TPM_LEFTALIGN

Left side of the menu is aligned with x&.

%TPM_CENTERALIGN

Centers horizontally with x&.

%TPM_RIGHTALIGN

Right side of the menu is aligned with x&.

%TPM_TOPALIGN

Top of the menu is aligned with y&.

%TPM_VCENTERALIGN

Centers vertically with y&.

%TPM_BOTTOMALIGN

Bottom of the menu is aligned with y&.

CmdVar

Long integer variable where the id of the selected menu item is returned.  If an optional callback is defined for a menu item with MENU ADD STRING it will be ignored when used with MENU CONTEXT.

See also

Dynamic Dialog Tools, Menus, MENU ADD STRING, MENU ADD POPUP, MENU NEW POPUP

Example

MENU NEW POPUP TO hPop&

MENU ADD STRING, hPop&, "one", 1, %mf_enabled

MENU ADD STRING, hPop&, "two", 2, %mf_enabled

MENU ADD STRING, hPop&, "three", 3, %mf_enabled

MENU CONTEXT hPop&, 500, 500, %tpm_leftbutton TO CommandVar&