List box

Syntax

int list(items [text] [caption] [x y] [timeoutS] [default] [flags] [hwndowner])

 

Parameters

items - list of items, like "item1[]item2[]item3". Item that begins with & is initially selected.

text - text above the list.

caption - dialog title bar text.

x y - coordinates. Negative - relative to the right or bottom edge. Default: 0 0 (screen center).

timeoutS - max time (seconds) to show dialog. Default: 0 (infinite). To stop countdown, click the list box.

default - return this value on timeout. Default: 0 (Cancel).

flags:

1 Activate listbox window.
2 Numbered. Each line begins with a number. It will be returned instead of line index.

hwndowner (QM 2.2.1) - owner window handle. The dialog box will be on top of the owner window. It will be activated. The owner window, if belongs to the same thread, will be disabled. Default: 0.

 

Remarks

Displays dialog box with list. Each line in items string adds one item to the list. Returns 1-based index of selected item, or 0 on Cancel.

 

Tips

Use function ShowMenu or DynamicMenu to show standard menu.

 

Example

str s = "Line1[]Line2[]Line3"
sel list(s "Lines")
	case 1 out "Line1"
	case 2 out "Line2"
	case 3 out "Line3"
	case else out "Cancel"