CreateDialog

CreateDialog has been enhanced. The prototype is now:

CreateDialog <Rollout> [<height> <width> <position_x> <position_y>]\

[pos:<Point2>] [width:<integer>] [height:<integer>] \

[bgcolor:<color>] [fgcolor:<color>] \

[bitmap:<bitmap>] {bmpstyle:<bmpstyle> \

[menu:<RCMenu>] [style:<array>] [modal:<boolean>]

Modal dialog support added to MAXScript scripter dialogs, those created with the CreateDialog() function. A new keyword argument can be supplied to the CreateDialog() function, modal:<boolean>, to control whether the dialog is modal or not. Defaults to modal:false.

A modal dialog ignores all user interactions except those within the dialog. Call DestroyDialog() to close it, presumably in a scripted OK button, or the like. The user can also close a modal scripted dialog by hitting the <escape> key.

Parameters

<Rollout>

The rollout definition to create the dialog from.

[pos:<Point2>]  -- default:dialog will center within MAX.

Placement of the upper left corner of the dialog relative to the upper left corner of the screen.

[width:<integer>]  -- default:200

Width of the dialog box.

[height:<integer>]  -- default:dynamic on control extents

Height of the dialog box.

[bgcolor:<color>]  -- default:(<system button color>)

Background color of the dialog.

[fgcolor:<color>]  -- default:(color 0 0 0)

Forground color of the dialog (static text color)

[bitmap:<bitmap>]  -- default:undefined

Background bitmap for the dialog.

[bmpstyle:<key>]  -- default:#bmp_center

The way that the background bitmap is displayed.

Can be one of the following:

#bmp_center

#bmp_tile

#bmp_stretch

[menu:<RCMenu>]  -- default:undefined

Menu that will apear in the title bar area of the dialog.

[style:<array>] -- default:#(#style_titlebar, #style_border, #style_sysmenu)

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.

Note: If the style keyword parameter is not specifed, the default styles of #style_titlebar, #style_border, #style_sysmenu are used.

Events

on <Rollout> open do

Called when the dialog is opening.

on <Rollout> close do

Called when the dialog is closing.

on <Rollout> moved <Point2> do

Called when the dialog is being moved.

on <Rollout> resized <Point2> do

Called when the dialog is being resized.

on <Rollout> mousemove <Point2> do

Called when the mouse is being moved within the dialogs client area.

on <Rollout> lbuttondown <Point2> do

Called when the left mouse button is pressed down within the dialog.

on <Rollout> lbuttonup <Point2> do

Called when the left mouse button is released.

on <Rollout> lbuttondblclk <Point2> do

Called when left mouse button is double clicked within the dialog.

on <Rollout> mbuttondown <Point2> do

Called when middle mouse button is pressed down within the dialog.

on <Rollout> mbuttonup <Point2> do

Called when the middle mouse button is released.

on <Rollout> mbuttondblclk <Point2> do

Called when middle mouse button is double clicked within the dialog.

on <Rollout> rbuttondown <Point2> do

Called when right mouse button is pressed down within the dialog.

on <Rollout> rbuttonup <Point2> do

Called when the right mouse button is released.

on <Rollout> rbuttondblclk <Point2> do

Called when right mouse button is double clicked within the dialog.

Note: The <Point2> value passed to the event handlers is the position of the mouse within the dialog client window. A value of [0,0] corresponds to the top left corner of the clientwindow. The top left corner of the dialog window

Associated Methods

<Point2> GetDialogPos <Rollout>

Returns the position of the Dialog built from the rollout relative to the upper left corner of the screen in Point2 format.

SetDialogPos <Rollout> <Point2>

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.

See also