Show / Hide Table of Contents

Method popupMenu.showSimple


Overload

Creates and shows a simple popup menu. Without images, actions, submenus. Returns item id or 0.

public static int showSimple(Strings items, PMFlags flags = 0, POINT? xy = null, RECT? excludeRect = null, AnyWnd owner = default, bool rawText = false)
Parameters
items  (Strings)

Menu items, like "One|Two|Three" or new("One", "Two", "Three") or string array or List. Item id can be optionally specified like "1 One|2 Two|3 Three", unless rawText true. If missing, uses id of previous non-separator item + 1. Example: "One|Two|100 Three Four" (1|2|100|101). For separators use null or empty strings: "One|Two||Three|Four".

flags  (PMFlags)

Enum: ByCaret, ScreenCenter, WindowCenter, Underline, AlignCenterH, AlignRight, AlignCenterV, AlignBottom, AlignRectBottomTop.

xy  (POINT?)

Menu position in screen. If null (default), uses mouse position by default. It depends on flags.

excludeRect  (RECT?)

The menu should not overlap this rectangle in screen.

owner  (AnyWnd)

Owner window. The menu will be automatically closed when destroying its owner window.

rawText  (bool)

Don't parse id from text.

Returns
int

id of the selected item when closed, or 0 if canceled.

Remarks

Adds menu items and calls popupMenu.Show. Returns when the menu closes. All parameters except items are the same as in popupMenu.Show.

See Also

dialog.showList