The gettextdialog statement displays a configurable modal dialog that asks the user to enter an item of text.
Parameters
This statement has three parameters:
input – is a field or variable where the user’s input will be placed. If this is a field, it should be a text field. The input field or variable should be assigned a value before the gettextdialog statement is used. This value will be displayed as the default value in the dialog.
option – The name of an option that modifies the dialog’s appearance and/or operation. See below for descriptions of each available option. The option can be specified in either upper or lower case.
value – The option value.
Description
This statement displays a dialog with a single area for text entry. The user may enter something, then press a button to dismiss the dialog. The program can determine what button was pressed by using the info(“dialogtrigger”) function.
The appearance and operation of the dialog can be modified by adding one or more pairs of option/value parameters to the gettextdialog statement, like this:
gettextdialog text,option1,value1,option2,value2,option3,value3,option4,value4
Each of the available options are described below.
This option specifies a prompt that appears above the text editing area.
gettextdialog City,"Prompt","Please enter the name of the city","Button","Ok"
This option specifies a second prompt line that appears above the text editing area. The main prompt is displayed in bold, the subprompt is displayed in regular text.
gettextdialog CustomerCode,
"Prompt","Please enter the customer ID code",
"Subprompt","Format should be nnn-nnnn",
"Button","Ok","AbortButton","Cancel"
This option sets up a button. You can have up to three buttons on the dialog. The first button specified is the default button. This example specifies a dialog with two buttons.
gettextdialog ID,
"Prompt","Enter your user ID",
"Button","Login",
"Button","New Account"
This option sets up a button. If the user presses a button that has been designated a AbortButton, the dialog will be aborted without changing the field or variable specified in the first parameter. You can, however, still use info(“dialogtrigger”) to check to see what button was pressed.
let userid = ""
gettextdialog userid,
"Prompt","Enter your user ID",
"Button","Login",
"AbortButton","Cancel"
if info("dialogtrigger") = "Cancel" rtn endif
// continue with login code
This option specifies the height of the text editing area in the dialog (in points). The default is 24, which is high enough for one line of text. This example will create a dialog that allows up to 4 lines of text to be edited.
gettextdialog "Notes","Button","Update","AbortButton","Cancel","Height",96,"Prompt","Edit Notes"
This option specifies the width of the text editing area in the dialog (in points). The default is 400. If you make this less than 300 points, a gap will appear between the text area and the right edge of the dialog. This example will create a dialog that allows up to 4 lines of text to be edited in an extra wide area.
gettextdialog "Notes",
"Button","Update","AbortButton","Cancel",
"Height",96,"Width",600,"Prompt","Edit Notes"
This true/false (or yes/no) option specifies whether the dialog should be opened as a “sheet” attached to the current window. If this option is true, like this:
gettextdialog ID,
"Prompt","Enter your user ID",
"Sheet","YES",
"Button","Login","AbortButton","Cancel",
"Width",300
then the dialog will be attached to the current window, as shown here.
If this option is false (or omitted), like this:
gettextdialog ID,
"Prompt","Enter your user ID",
"Sheet","NO",
"Button","Login","AbortButton","Cancel",
"Width",300
then the dialog will appear in it’s own separate alert, and you won’t be able to do anything else in any Panorama window until this dialog is taken care of.
See Also
History
Version | Status | Notes |
10.2 | Updated | The new "sheet" option allows the dialog to display as a sheet attached to the current window, instead of as a standalone alert. |
10.0 | New | New in this release. |