A dropdownlist item is used to place a drop-down list in the rollout. The user can click open the list and scroll or click again to select an item in the list. The syntax is:
dropdownlist <name> [ <caption> ] [items:<array_of_strings>] [selection:<number>] [height:<number>]
The default alignment of dropdownList items is #left.
rollout ddl_test "Drop-Down List"
dropdownlist scale_dd "Scale" items:#("1/2", "1/4", "1/8", "1/16")
on scale_dd selected i do
format "You selected '%'!\n" scale_dd.items[i]
The array of text strings that are the items in the list.
The 1-based number of the currently selected item in the list. Defaults to 1.
The overall height of the dropdownlist in number of item lines. Defaults to 10 lines. To have a dropdownlist exactly display N items in the list, set height to N+2.
The minimum height value is clamped to 1 line.
The item string array.
The currently selected item number, 1-based. If the items list is an empty array, this value is 0.
The text of the currently selected item. Can be set to replace individual items without resetting the entire items array. If the items list is an empty array, this value is undefined.
Get/set the width of the dropdownlist in pixels.
Get/set the height of the dropdownlist in pixels.
on <dropdownlist> selected <arg> do <expr>
Called when the user selects an item in the drop-down list. The <arg> argument will contain the new current selection item number.
label l "L"
createDialog test 200 200
you will get 5 items in the dropdown list. Change height to 5, and you get 3.
Rollout User-Interface Items Common Properties
Rollout User-Interface Items Common Layout Parameters
Rollout User-Interface Control Types