ExampleDIALOG "WARNING","Reactor Meltdown Imminent",Btn;SET ("BACKGROUND":2)
DIALOG "STRING","Enter your Operator ID:";RETURN ("VALUE":Resp$),TIMEOUT 10
DIM Speeds$(0:2)[20]
Speeds$(1)="Slow"
DIALOG "LIST","Pick your speed:",Btn;SET ("WIDTH":250,"HEIGHT":80,"ITEMS":Speeds$(*)), RETURN (SELECTION":Resp)
SyntaxDIALOG dialog_type, prompt_str, selected_btn [; { SET (set_atr_list ) | RETURN ( ret_atr_list) | TIMEOUT timeout_val ] [, ...]
set_atr_list = { sstr_exp: { num_exp | str_exp } | mstr_exp:{num_ary | str_ary} | atr_ary(*):{num_ary | str_ary}(*) } [, ...]
ret_atr_list = { sstr_exp: { num_exp | str_exp } | mstr_exp:{num_ary | str_ary} | atr_ary(*):{num_ary | str_ary}(*) } [, ...]
DescriptionYou create a DIALOG from a PANEL widget that contains a prompt string, a single widget, and some button widgets.
Types of Dialogs
DIALOG ButtonsUse the DIALOG BUTTONS attribute to create the buttons in the dialog. These buttons appear in a single row at the bottom of the dialog, in the same order (left to right on the screen) in which they appear in the attribute array. Use the DEFAULT BUTTON attribute to specify one of these buttons as the default button,. Both DIALOG BUTTONS and DEFAULT BUTTON have different default values, depending on the type of dialog created.
Selected button OptionIf you specify the optional variable for selected button, the DIALOG will return theindex number of the button pressed or -1 to indicate a timeout occurred. The DIALOG BUTTONS array is always treated as base 0 regardless of how it was dimensioned.
SET OptionThe SET option specifies the initial values for the attributes and the initial values to be displayed by the contained widget (for example, the contents of the STRING widget in the STRING dialog).
RETURN OptionThe RETURN option includes the variables that will receive the final values of the dialog attributes just before the dialog is destroyed. These variables are used primarily to communicate the state of the contained widget back to the program when the user terminates the dialog. For example, you can find out what the user typed into a STRING dialog from the RETURN VALUE attribute to a string variable in your program.
Specifying the same variable for the same attribute in both the SET and RETURN attribute lists is a common practice when the dialog's purpose is to allow the user to modify an existing quantity. If you use the same variable in the RETURN attribute list, the user's modification will change the program variable.
TIMEOUT OptionTIMEOUT will wait the specified number of seconds for user input before continuing. If the user does not push a button in the dialog within the allotted time, the DIALOG statement will: copy the current state of the dialog attributes (and -1 for the selected button) into the variables specified in return attribute list, and then dismiss (destroy) the dialog.
|