Several properties are available for scripted utilities and rollouts which provide access to the current state of the rollout.
If true , the rollout is open, false it is rolled up. You can assign true or false to this property to open or roll up the rollout.
Scroll position of panel the rollout is in.
Get/Set the Height of the rollout in pixels.
Get / Set the Width of the rollout.
Returns an array of all controls in the rollout.
Returns True when the rollout is in extended viewport
Returns True when the rollout is registered as a dialog bar
Returns True when the rollout is currently displayed in a dialog created via createDialog <rollout>. Always valid.
This property gets/sets whether the dialog is minimized, maximized, or normal. This property will return 'undefined' if the rollout is a not in a dialog, or the dialog is a dialogBar or is in a viewport.
This property is valid if the rollout is in a dialog and is not a dialogBar or in a viewport. When setting this property, values that the dialogs's creation style settings don't support are ignored. For example, if you set the property value to #maximized and #style_maximizebox was not specified in createDialog's style argument, no action occurs.
Returns true if the rollout is currently displayed, false otherwise.
If the rollout is being displayed by a scripted plugin or a Custom Attribute, the property will contain the scripted plugin or CA instance. This property was added in 3ds Max 8 to make it easier to access the variables in a scripted plugin or CA instance when a debugger break occurs in a rollout event handler. In this case, the owner of the event handler is the rollout, so you can access the scripted plugin or CA instance via getVar owner.owner .
<rollout>.hwnd Integer, read-only
Contains the Window HWND handle of the rollout if the rollout is open, or 0 if it is closed.
Returns an array of all rollouts in the floater.
True if floater is in extended viewport.
True if floater is registered as a dialog bar.
This property gets/sets whether the dialog is minimized, maximized, or normal. This property will return 'undefined' if the rollout is a not in a dialog, or the dialog is a dialogBar or is in a viewport.
This property is valid for Rolloutfloaters that are not a dialogBar nor in a viewport.
Several methods are available for opening and closing utilities, and adding and removing rollouts in the Utilities panel. These methods are:
Opens the utility’s main rollout in the Utilities panel. This is equivalent to selecting the utility from the Utilities list in MAXScript’s Utilities panel rollout.
Closes the utility’s main rollout in the Utilities panel. This is equivalent to clicking the Close button in this rollout.
Adds the rollout to the Utilities panel. The rolledUp: parameter on the addRollout() function specifies whether the rollout is added in a rolled-up state. This defaults to false , so the rollout is added fully opened. The extra rollouts are arranged in the order of addRollout() calls, so take care in sequencing these to ensure the order you want.
Returns the size of the window's client area. Equivalent to
point2 <rollout>.width <rollout>.height
Removes the rollout from the Utilities panel.
See Managing Multiple Rollouts in a Scripted Utility for more information on the addRollout() and removeRollout() methods.
In addition to the event handlers you specify for particular user-interface items in a rollout, you can define handler functions that are called when an entire rollout is first opened ( open ) or explicitly closed ( close ) by the user. These event handlers are useful for initialization code or for cleaning up when a rollout closes, and are necessary when managing multiple rollouts in one scripted utility. If a rollout floater window is resized or moved, an event handler ( resized or moved, respectively) is called on the first rollout in the rollout floater window. An additional event handler ( oktoclose ) is called to verify that it is OK to close a rollout.
Called when the rollout or utility is opened.
Called when the rollout or utility is closed.
Called when the user clicks the rollout’s Close button so the script writer can decide whether to allow the close to proceed. If the expression evaluates to the value true , the rollout is allowed to close. If the expression evaluates to the value false, the action attempting the close is ignored and the rollout or utility is left open.
In the following example the utility will not close unless the "OK To Close" check button is pressed:
Called when dialog/rollout floater/rollout has focus and F1 is pressed.
If a rollout or a rollout control in a rollout has focus, the code looks to see if a 'help' event handler is defined for that rollout.
If not, if the rollout is in a rollout floater, the floater will get the message and will check for the 'help' event handler on the first rollout in the floater, and if present will call it.
If the rollout is in a subrollout, MAXScript explicitly performs the same check and calls the handler on the first rollout in the subrollout.
If no 'help' event handler is found, the message ends up in the 3ds Max window, and the 3ds Max help will be called.
Called when the rollout or utility is rolled up or down. The argument will contain true when the rollout is rolled down (open) and false when the rollout is rolled up (closed).
Called on first rollout in a rollout floater window when it is resized either by the user or by a script changing the size property of the rollout floater window. Changing the rollout floater window size in the resized event handler expression will not cause the resized event handler to be called again. The value of < arg > is the current width and height of the rollout floater window.
Called on first rollout in a rollout floater window when it is moved either by the user or by a script changing the pos property of the rollout floater window. The value of < arg > is the current position of the rollout floater window on the screen in pixels.
The following example keeps a log file of its actions, and uses the rollout open and close handlers to open and close the log file:
In the following example the on resized event handler is called when the rollout floater window is resized. Because the event is generated only for the first rollout in a rollout floater window, the on b resized event handler is never called.