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>.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.

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.

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 = ...

...

)

gw = newRolloutFloater "Grinning" 300 220

addRollout grin gw