MAXScript Tools and Interaction with 3ds Max > Creating MAXScript Tools > Scripted Utilities and Rollouts >

# Rollout Floater Windows

| Creating User Interfaces - Quick Navigation

MAXScript lets you create modeless floating dialog windows known as Rollout Floaters and populate them with rollouts defined using 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> ] [border:<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.

If the optional rolledUp: keyword argument is specified, the rollout will be initially rolled up (closed) when the argument is True or rolled down (open) when False.

If the optional border: keyword argument is specified and set to False in 3ds Max 2009 and higher, the rollout will have no border. If the keyword argument is not supplied or set to True, a border will be drawn around the rollout.

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

NEW in 3ds Max 2014: Get/Set the visibility of the Rollout Floater.

When set to True (default), the Rollout Floater will be displayed.

When set to False, the Rollout Floater will not be drawn, but it and its rollouts will still be accessible through MAXScript.

NoteThis can be used as an alternative to placing the Rollout Floater off-screen, a hack sometimes used in older versions of 3ds Max. Since 3ds Max 2014, any off-screen dialogs will be automatically moved back into view!

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

FOR 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