The CreateDialog function lets you turn an existing rollout definition into a floating Dialog.
Other than a RolloutFloater which is a container of one or more rollouts, a Dialog is a special display form of the rollout rollout itself.
It provides advanced features like a modal display option, background bitmap display and mouse event handlers.
The syntax for creating dialogs is:
CreateDialog <Rollout> [<width> <height> <position_x> <position_y>]\ [pos:<Point2>] [width:<integer>] [height:<integer>] \ [bgcolor:<color>] [fgcolor:<color>] \ [bitmap:<bitmap>] {bmpstyle:<bmpstyle> \ [menu:<RCMenu>] [style:<array>] [modal:<boolean>] \ [escapeEnable:<boolean>] [lockHeight:<boolean>] [lockWidth:<boolean>] \ [parent:<HWND>]
When the optional modal: keyword is set to True, the dialog ignores all user interactions except those within the dialog.
Call DestroyDialog() to close it, presumably in a scripted OK button.
The user can also close a modal scripted dialog by hitting the Escape key as long as escapeEnable keyword is set to False or not supplied.
When the optional escapeEnable keyword is set to True, MAXScript escape checker will be disabled for the dialog, preventing the "** Interrupted **" message from appearing.
If the optional lockHeight keyword is True , the height of the dialog cannot be interactively changed.
If the optional lockWidth keyword is True , the width of the dialog cannot be interactively changed.
The rollout definition to create the dialog from.
Placement of the upper left corner of the dialog relative to the upper left corner of the screen.
Background color of the dialog.
Forground color of the dialog (static text color)
Background bitmap for the dialog.
The way that the background bitmap is displayed.
Menu that will appear in the title bar area of the dialog.
Array of style flags, can be one or more of the following:
#style_border: Creates a window with a double border but no title.
#style_titlebar: Creates a dialog with a title bar.
#style_toolwindow: Creates a tool window, which has a title bar and is intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font.
#style_resizing: Creates a window with a thick frame that can be used to size the window.
#style_minimizebox: Creates a window that has a minimize button.
#style_maximizebox: Creates a window that has a maximize button.
#style_sysmenu: Creates a window that has a window menu in its title bar.
#style_sunkenedge: Specifies that a window has a 3D look, in the form of a border with a sunken edge.
parent:<HWND> -- default:<MAX_HWND>
Parents the dialog to the specified window.
When not supplied, the parent will be set to the 3ds Max Window Handle, causing the dialog to minimize/maximize with the 3ds Max UI.
When set to a valid HWND, the dialog will become a Child dialog of the specified Parent and will minimize/restore with it, and will always stay in front of the Parent even when the Parent has focus.
Since the rollout class provides a .hwnd property, it is easy to parent one dialog to another:
Called when the dialog is opening.
Called when the dialog is closing.
Called when the dialog is being moved.
Called when the dialog is being resized.
Called when the mouse is being moved within the dialogs client area.
Called when the left mouse button is pressed down within the dialog.
Called when the left mouse button is released.
Called when left mouse button is double clicked within the dialog.
Called when middle mouse button is pressed down within the dialog.
Called when the middle mouse button is released.
Called when middle mouse button is double clicked within the dialog.
Called when right mouse button is pressed down within the dialog.
Called when the right mouse button is released.
Called when right mouse button is double clicked within the dialog.
Returns the position of the Dialog built from the rollout relative to the upper left corner of the screen in Point2 format.
Sets the position of the dialog built from the rollout relative to the upper left corner of the screen.
Rollout: The rollout used to build the Dialog.
Point2: Position where the Dialog is placed.
Returns the size of the window's client area. Equivalent to point2 <rollout>.width <rollout>.heigh
Sets the bitmap background for the dialog associated with the rollout. If the rollout is not in a dialog, no action is taken. A value of 'undefined' for the bitmap will clear the current bitmap.
Gets the bitmap background for the dialog associated with the rollout. If the rollout is not in a dialog, 'undefined' is returned