Appendix A: System Routines — Dialog
345
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
Dialog
Declaration:
WORD
Dialog
(DIALOG *
Dlg
, short
x0
, short
y0
, char *
FieldBuf
,
WORD *
OptionList
)
Category(ies):
Dialog
Description:
Open a dialog box and handle all keys pressed by the user until the dialog
box is closed, returning any modified dialog box items in
FieldBuf
or
OptionList
.
Dlg
points to a DIALOG structure as built by the resource
compiler or dynamically by
DialogNew
and
DialogAdd
.
Inputs:
Dlg
— Pointer to a DIALOG structure.
x0
,
y0
— Specifies the upper left corner of the dialog. If
x0
is
equal to
L
1 then the dialog box is centered
horizontally. If
y0
is equal to
L
1 then the dialog box is
centered vertically.
FieldBuf
— Points to a buffer for any edit fields in the dialog box
or NULL if there are no edit fields. The indexes into
FieldBuf
are specified by each edit field.
OptionList
— An array of WORDs, with an entry for each pop-up
field. The initial value for each of these fields as well
as the value selected by the user is stored in this
array. The index into
OptionList
is specified by each
pop-up field.
Note that both
FieldBuf
and
OptionList
are modified by
Dialog
whether the
user presses
¸
to accept the dialog box or
N
to cancel it. Copies of
either structure are not made. It is left to the caller to use the changes in
these structures if the dialog box is accepted or to toss them if the dialog
box is canceled.
Outputs:
KB_ENTER — User pressed
¸
to close dialog box.
KB_ESC — User pressed
N
to close dialog box.
DB_MEMFULL — Not enough memory to open the menu for the dialog
box.
Assumptions:
If
Dlg
points to a dynamically created dialog box, the heap block that stores
the DIALOG structure must be locked.
Side Effects:
May cause heap compression.
Availability:
All versions of the TI
-
89 / TI
-
92 Plus.
(continued)