Rollout Floater Windows

MAXScript lets you create modeless dialog windows and populate them with rollouts defined using global rollout definitions or utility rollout definitions. The user can resize a rollout floater window vertically by dragging on the lower window edge.

There are two functions and a special class in support of this, as follows:

newRolloutFloater <title_string> <width_integer> <height_integer> [<top_integer> <left_integer>]

Creates and opens a new rollout floater window with the title and width and height given. If you don't supply top and left coordinates, the window will open centered in the screen. The width of the 3ds Max command panel is 218, in case you want to duplicate its width for precisely accommodating Utilities panel rollouts.

This method returns a RolloutFloater value to which you add rollouts.

 

closeRolloutFloater <rolloutFloater>

Closes the rollout floater window. The user can also do this by clicking the close box on the window. Once closed, the window is no longer usable. All the close handlers in the rollout floater window's rollouts are called and they are released for use in other rollout floater windows or scripted utilities.

The existing functions for adding and removing rollouts to the Utilities panel are extended to work with rollout floater windows:

addRollout <rollout> [ <rolloutFloater> ] [ rolledUp:<boolean> ]

If the optional second argument is specified, it must be a RolloutFloater value as returned from the newRolloutFloater() function. The rollout specified by the first argument is appended after any rollouts previously in the window.

removeRollout <rollout> [ <rolloutFloater> ]

Removes the rollout from the given rollout floater window.

In both functions above, if the optional <rolloutFloater> is not supplied the rollout is added to, or removed from, the Utilities panel, as described in Managing Multiple Rollouts in a Scripted Utility.

Rollout floater windows have the following properties:

<rolloutFloater>.title String

The Title of the floater.

Note:

You cannot change the title of a rollout floater registered as a dialog bar

<rolloutFloater>.size Point2

The current size of the rollout floater window in pixels. The first component of the Point2 is the width, the second the height. This property is read/write.

<rolloutFloater>.pos Point2

The current screen position of the rollout floater window in pixels. This property is read/write.

Note:

If a rollout floater is in an extended viewport, the size and position properties report the size and position of the viewport. The properties cannot be set for this case.

When a rollout floater window is resized, either by the user or by a script changing the size property, a resized event is generated for the first rollout in the rollout floater window. Likewise, when a rollout floater window is moved, either by the user or by a script changing the pos property, a moved event is generated for the first rollout in the rollout floater window. The event handler for the resized and moved events are described in Utility and Rollout properties, Methods, and Event Handlers.

<rolloutFloater>.inViewport   Boolean, read-only.

Returns true if the floater is in extended viewport.

<rolloutFloater>.open   Boolean, read-only.

Returns true if the floater is open.

<rolloutFloater>.dialogBar Boolean, read-only.

Returns true if the rollout floater is used as a dialog bar.

<rolloutFloater>.rollouts Array of rollouts in floater, read-only

Returns an array of all rollouts in the floater.

 

Example:

rollout grin "Grin Control"

(

slider happy "Happy" orient:#vertical across:5

slider sad "Sad" orient:#vertical

slider oo "OO" orient #vertical

slider ee "EE" orient #vertical

slider oh "OH" orient:#vertical

on happy changed val do object.xform1.center = ...

on sad changed val do object.xform2.gizmo.rotation = ...

...

)

theNewFloater = newRolloutFloater "Grinning" 300 220

addRollout grin theNewFloater