User Interface Controls > Common Properties > Layout > Types > Dropdownlist |
A dropdownlist control 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.
dropdownlist <name> [<caption>] [items:<array_of_strings>] [selection:<number>] [height:<number>] [tooltip:<string>]
The default alignment of dropdownList items is #left .
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+1 .
The minimum height value is clamped to 1 line.
A string defining the tooltip to be displayed when the mouse rolls over the dropdownlist. Available in 3ds Max 2009 and higher.
Get/Set 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. (as opposed to lines as expected in the height: creation parameter!)
Get/set the tooltip of the dropdownlist. Available in 3ds Max 2009 and higher.
Called when the user selects an item in the drop-down list. The <arg> argument will contain the new current selection item number.
The event handler function selected() is named identically to the .selected property, which effectively hides the function and does not allow the user to call the handler from other parts of the script the way it is possible with all other event handlers of UI controls.
See the following entry in the Frequently Asked Questions for a workaround:
How do I call the dropdownList Selected handler as a function?
Called when the user right-clicks the Dropdownlist control.
Available in 3ds Max 2010 and higher.