DIALOG Statement
Syntax:
DIALOG text, id, x, y, width, height[, style[, framectl]]
[data-definitions]
BEGIN
control-definition
.
.
.
END
The DIALOG statement defines a window that an application can use to create
dialog boxes. The statement defines the position and dimensions of the
dialog box on the screen, as well as the dialog-box style. The DIALOG statement
is most often used in a DLGTEMPLATE statement.
Typically, you use only one DIALOG statement in each DLGTEMPLATE statement,
and the DIALOG statement contains at least one control definition.
text
Specifies the dialog-box title if the style
specifies a title bar. This field must contain zero or more characters
enclosed in double quotation marks. Character values must be in the range
1 through 255. If a double quotation mark is required in the title, you
must include the double quotation mark twice.
id
Specifies the dialog-box identifier. This
value must be a signed integer in the range -32768 through 32767, an unsigned
integer in the range of 1 through 65535, or a simple expression that evaluates
to a value in these ranges.
x
Specifies the x-coordinate of the lower-left
corner of the dialog box. This value must be a signed integer in the range
-32768 through 32767 or an expression consisting of integers and the addition
(+) or subtraction (-) operator. The value is in dialog units, but its
exact meaning depends on the dialog style. See the "Comments" section for
details.
y
Specifies the y-coordinate of the lower-left
corner of the dialog box. This value must be a signed integer in the range
-32768 through 32767 or an expression consisting of integers and the addition
(+) or subtraction (-) operator. The value is in dialog units, but its
exact meaning depends on the dialog style. See the "Comments" section for
details.
width
Specifies the width of the dialog box.
This value must be an integer in the range 0 through 65535 or an expression
consisting of integers and the addition (+) or subtraction (-) operator.
The value is in n-character units.
height
Specifies the height of the dialog
box. This value must be an integer in the range 0 through 65535 or an expression
consisting of integers and the addition (+) or subtraction (-) operator.
The value is in 1/8-character units.
style
Specifies the dialog-box style. This
value can be any of the window, dialog-box, or frame styles. You can use
the bitwise OR (|) operator to combine styles.
framectl
Specifies the styles for frame controls
belonging to the dialog box. This value can be any of the frame-control
styles specified in the "Frame-Control Flags" table in the Presentation
Manager Programming Reference. You can use the bitwise OR (|) operator to
combine styles.
data-definitions
Specifies a CTLDATA and/or
PRESPARAMS statement. These statements define control and presentation data
for the dialog box. For more information, see CTLDATA
Statement and PRESPARAMS Statement.
control-definition
Specifies a CONTROL statement
or any one of several predefined control statements. These statements define
the style, position, and dimensions of controls in the dialog box.
Comments
The exact meaning of the coordinates depends on the style defined by the
style field. For dialog boxes with FS_SCREENALIGN style, the coordinates
are relative to the origin of the display screen. For dialog boxes with
the style FS_MOUSEALIGN, the coordinates are relative to the position of
the mouse pointer at the time the dialog box is created. For all other
dialog boxes, the coordinates are relative to the origin of the parent window.
The DIALOG statement can actually contain any combination of CONTROL, DIALOG,
and WINDOW statements. Typically, a DIALOG statement contains one or more
CONTROL statements.
Example
This example creates a dialog box that is labeled "Disk Error."
DLGTEMPLATE 1BEGIN
DIALOG "Disk Error", 100, 10, 10, 300, 110
BEGIN
CTEXT "Select One:", 1, 10, 80, 280, 12
RADIOBUTTON "Retry", 2, 75, 50, 60, 12
RADIOBUTTON "Abort", 3, 75, 30, 60, 12
RADIOBUTTON "Ignore", 4, 75, 10, 60, 12
END
END
[Back: DEFPUSHBUTTON Statement]
[Next: DLGINCLUDE Statement]