Xbasic

UI_DLG_BOX Function

Syntax

Result as C = UI_DLG_BOX(C title,C dialog_format[,C code])

Arguments

Result

The value returned by the dialog. This is typically the name of the BUTTON that was pressed to close the dialog.

title

The title of the dialog. The title may also be specified dynamically using the syntax: Title = "@=" + Title_Var_Name.

dialog_format

A series of Xdialog commands that describe the appearance of the dialog box. The basic structure of the Format section is:

Argument
Description
<<%dlg%

The only optional part of this argument is the "dlg" sequence of characters (the marker), which can be any string of characters, as long as it is unique within this instance of the UI_DLG_BOX() function. The character sequence <<%dlg% is specifically recommended because it is supported by bubble help.

Xdialog_Code

One or more statements, each of which must be on a separate line from the <<%dlg% and %dlg% arguments.

%dlg%

The marker characters can be any string of characters, as long as they match those in the first argument ( <<%dlg% ).

code

Optional. Xbasic code that describes what should happen when various events happen when the user is interacting with the dialog box. For example, what should happen when the user presses a button, or when the user tabs out of a field. The basic structure of the Event Handling section is:

Description

Generic dialog get - display a dialog, returns button push, plus valus in variables.

Discussion

The UI_DLG_BOX() function displays a modal dialog box and returns a character string. The UI_MODELESS_DLG_BOX() function displays a modeless dialog box.

Example 

This example of an extremely simple dialog box with the text "Hello World."

ui_dlg_box("Title","Hello World")

Alternatively:

format = <<%dlg%
"Hello World"
%dlg%
ui_dlg_box("Title", format)

Here is what this dialog box looks like:

Here is a dialog box with a title defined after the dialog box is displayed. The "@" is the indirection operator.

dim dlg_title as C
dlg_title = "Title1"
ui_dlg_box("@=dlg_title",<<%dlg%

%dlg%,<<%code%
if a_dlg_button = "settitle" then
    dlg_title = ui_get_text("","Set new title",dlg_title)
     a_dlg_button = ""
end if
%code%)

Limitations

Desktop applications only.

See Also