Rollout User-Interface Controls Common Properties

All defined user-interface controls have a local variable constructed for them in the rollout and a value representing the control is placed in that variable. These values typically contain state information relevant to the item, such as if a check box is checked, the current spinner value, the items in a list box, and so on. This information is made available to you as various named properties on the item values. You use standard MAXScript property access to read and set these values, for example:

frab_x.enabled = true

enable the frab_x spinner

foo.text = "Don't do it"

set foo button text

first_item = baz.items[1]

get item list from listbox baz

$bar.pos.x = x_spinner.value

get current value from spinner x_spinner

All of the user-interface common properties except for caption (the label string value is used as the caption) can be specified as parameters when the user-interface item is constructed. For example:

button foo "Press Me!" enabled:false

The following properties are common to all user-interface items:

<ui_item>.caption        String

The meaning of this property varies depending on the specific user-interface item type. If the user-interface item has a caption, this property contains the caption string. For the various types of buttons, it is the text inside the button. The default value of the caption is the label string specified in the item definition.

<ui_item>.text           String

For all the user-interface items except edittext and combobox, the text property is an alias of the caption property. For edittext and combobox user-interface items, it is the text in the edit box. The default text property value for edittext user-interface items is a null string (""). The default text property value for combobox user-interface items is the selected item's text.

<ui_item>.enabled        Boolean    default: true

Sets whether the item is enabled for interaction when the rollout is initially opened. Disabled items appear unavailable in the rollout. All items are enabled by default, so you typically use this parameter to disable those items that should not initially be available to the user. For example, you might have some spinners that change the properties on a scene object that should not be changed until the user has picked the object, typically with a pickbutton in the rollout. You would disable the spinner in its definition, as in the following example, and enable it once the user picked an object.

spinner frab_x "Frabulate x-axis:" range:[0,100,0] enabled:false

...

frab_x.enabled=true

<ui_item>.pos            Point2     default: varies

This forces the user-interface item to a fixed [x,y] pixel position in the rollout, with [0,0] at the top-left corner.

Note: Due to limitations in 3ds max, you cannot specify a node using a Pickbutton in the Create panel, for example in a scripted Geometry plugin. The work-around is to only enable the Pickbutton when the object is open in the Modify Panel.

See also