Dial_InputDialog (function reference)

By October 1, 2017 November 14th, 2018 Online Help, Troi Dialog Plug-in
Troi Dialog Plug-in for FileMaker Pro

Dial_InputDialog

Displays an input dialog box, in which the user can fill the input fields. Each of the up to 15 input fields can be a normal text input field, a password field, a popup menu or a checkbox.

SyntaxFunction badge

Dial_InputDialog (switches ; nr. of fields ; prompt ; button1 ; button2 ;
                   button3 ; button4 )

Parameters

switchesthis determines the behavior of the dialog and which information is returned
nr. of fieldsthe number of input fields to be shown. This can be 1 to 15
promptthe text of the dialog
button1..4the text of the 1st to the 4th button (from right to left)

Switches

If you specify an empty button text, no button will be displayed. Switches can be empty or you can add one or more of these switches:

-ReturnButtonTextreturn the *text* of the button, instead of the number

You can also add one of these switches:

-DefaultButton1…-Defaultbutton4indicates which button will be selected when the user presses the ENTER key

For each field you can also add one of these field format switches:

-Bullet1…-Bullet15this indicates for a field that it is a bullet field
-Popup1…-Popup15this indicates for a field that it is a popup field
-Checkbox1…-Checkbox15this indicates for a field that it is a checkbox field

If you don’t specify a field format switch the field will be a normal text input field.

You can also add this switch:

-KeepBulletTextthis will fill bullet fields with initial text (shown as bullets), if set with the Dial_SetInput function

You can also add one of these switches:

-StopIconshows a stop icon (indicating this is something severe which the user needs to address )
-CautionIconshows a caution icon (indicating this dialog warns the user)
-NoteIconshows a note icon (indicating this dialog gives the user information)
-CustomIconshows a custom icon. This icon needs to be set before with the Dial_IconControl function.

You can also add this switch:

-IconSize=48display the icon at 48×48 pixels

You can also add this switch:

-StopOnESCif you add this switch the user can press the ESC key to leave the dialog. The dialog returns as button number 0.

You can also add one of these switches:

-StartField1…-StartField15specifies the input field the cursor will be in at the start of the dialog

Returned Result

Data type returned

Text

Result

The number of the button that was clicked followed by the text of the input fields. By adding switches this function can also return the text of the button.

Originated in

Troi Dialog Plug-in 2.0

Compatibility

FileMaker Pro 12 to 17

Considerations

You can have up to 15 input fields.
See “Dial_SetDialogTitle” if you want to change the title of the dialog.
See “Dial_SetPosition” if you want to change the position of the dialog.
See “Dial_SetInput” to set the text to be preentered into the input fields.
See “Dial_SetLabels” to set the labels to the left of the input fields.
See “Dial_SetPopup” to set the popup values to be used for popup fields.
Note: you can display popup values from a second value list. The selected value from the first popup value list is returned. You can use this for example with a list of ItemIDs and a list of ItemDescriptions. The descriptions are shown to the user, while the itemID is returned.

You can also use the keyboard shortcuts: copy (command-C), paste (command-V), cut (command-X) and select all (command-A) in the text fields.

Example

Set Field [ result ; Dial_InputDialog ( "-NoteIcon" ; 5 ; 
				"Please enter your personal data:" ; 
				"OK" ; "Cancel" ; "Help" ; "Stop" ) ]

This will show 5 input fields to fill in, with a note icon. If the user clicked the OK button a possible result can be: “1|John|Smith|Berkeley|USA|student”.

Example 2

We assume that in your FileMaker file the following fields are defined:

result		Global, text
gErrorCode     	Global, text

Add the following script steps:

Set Field [ gErrorCode ; Dial_SetLabels ( "-Unused " ; "Name" ; "Password" ; 
					"Remember password" ; ) ]
Set Field [ gErrorCode ; Dial_SetInput ( "-Unused" ; Get ( UserName ) ; "" ; "1" ; ) ]
Set Field [ result ; Dial_InputDialog ( "-StopIcon -Bullet2 -Checkbox3" ; 3 ; 
		"Please enter your name and password:" ; 
		"OK" ; "Cancel" ; "Help" ; "Stop" ) ]

This will show a user/password dialog which also has a checkbox callled “Remember password”. The checkbox will be checked because the input for that field is set to 1.

Related functionsFunction badge

Dial_GetButton
Dial_SetDialogTitle
Dial_SetInput
Dial_SetLabels
Dial_SetPopup
Dial_SetPosition

Related topics

Troi Dialog Plug-in online help (overview)


Online Help Page for Troi Dialog Plug-in for 14 to 17 –> Dial_InputDialog (dialp4308) 2018-1114 15:05:40