|
|
|
|
- Using syntax with the wizard
- Features of the dialog box
- Miscellaneous
- Application in the background: Specific case from Android 10
DialogAsynchronous (Function) In french: DialogueAsynchrone Displays a non-blocking message box and calls a WLanguage procedure with the value of the button clicked by the user. Remarks: - This is a non-blocking dialog box. The WLanguage code that follows the call to DialogAsynchronous continues to run. To close the window, the user must validate one of the buttons. When the user clicks one of the buttons, the code of a WLanguage procedure is run.
- In the WLanguage code following the call to the function, another modal window cannot be opened before closing the dialog box.
// 1: Save // 2: Do not save DialogAsynchronous("Do you want to save the changes made to %1?", ... MyProcedure_Dialog, sFile) INTERNAL PROCEDURE MyProcedure_Dialog(nResult) IF nResult = 1 THEN ToastDisplay("save") END END Syntax
Syntax using the wizard Hide the details
DialogAsynchronous(<Message ID> , <WLanguage procedure> [, <Parameter 1> [... [, <Parameter N>]]])
<Message ID>: Integer Identifies the question asked to the user as well as the different possible answers. <WLanguage procedure>: Name of the procedure or lambda procedure Name of the WLanguage procedure ("callback") called when the user clicks one of the buttons in the dialog window. This procedure is used to find out the value of the button that was clicked, and to run a specific process if necessary. For more details on this procedure, see Parameters of the procedure used by DialogAsynchronous. This WLanguage procedure can correspond to: - a name of a global or local procedure,
- a name of an internal procedure,
- a lambda procedure.
<Parameter 1>: Optional character string If the selected message contains elements with parameters (identified by %1, %2, etc.), this parameter is used to give the desired value to the first element. Thus, the value of <Parameter 1> will replace %1. <Parameter N>: Optional character string If the selected message contains elements with parameters (identified by %1, %2, etc.), this parameter is used to give the Nth desired value to element N. Thus, the value of <Parameter N> will replace %N. Remarks Using syntax with the wizard To use this syntax, you must use the wizard proposed when writing the function name in the code editor ("<Wizard>" option proposed by the assisted input). This wizard allows you to specify the different parameters of the dialog box that will be used. This function cannot be used if the dialog window is not created by the wizard. To start the wizard: - In the code editor, type "DialogAsynchronous(".
- Click "Wizard". The wizard starts. Go to the next step.
- Choose an existing question or create a new question (<Click here to create a new question>). Go to the next step.
- If you have chosen to create a question, a screen is displayed. This screen allows you to enter the different parameters of the dialog box used to ask the question. You can specify:
- The text of the question,
- The image of dialog box,
- The different buttons allowing the user to answer.
- Validate the screen for defining the question. The corresponding code is automatically inserted into the code editor. Press the ENTER key again. The entire code is added in the code editor. The characteristics of dialog box can be modified via the icon found beside the question text.
- Enter the name of the WLanguage procedure used.
Remark: To write the WLanguage code corresponding to the WLanguage procedure, the different options corresponding to the buttons of the dialog box are indicated as comment before the call to DialogAsynchronous. This function must not be used: - in the "Resizing" event of the window. Otherwise, the application will be locked.
- in the "Changing the orientation" event of the window.
- in the "Move to the foreground" event associated with the project.
Remark: However, the function can be used in the "Move to the foreground" event of a window. - in a thread.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|