ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Dialog Box functions
  • Using syntax with the wizard
  • Features of the dialog box
  • Miscellaneous
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
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.
  • WINDEV WINDEV allows you to apply the skin template of your project to this dialog box. For more details, see Customizing dialog boxes.
Example
// 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:
  1. In the code editor, type "DialogAsynchronous(".
  2. Click "Wizard". The wizard starts. Go to the next step.
  3. Choose an existing question or create a new question (<Click here to create a new question>). Go to the next step.
  4. 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.
  5. 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.
  6. 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.

Features of the dialog box

  • The title of the dialog box corresponds to the title of the current window (or page).
  • To modify or define the title of dialog box, use NextTitle.
  • WINDEV The skin template of current project is automatically applied to the dialog box.

Miscellaneous

  • WINDEV DelayBeforeClosing limits how long the message is displayed. The dialog box is automatically closed. For question or confirmation dialog boxes, the default button corresponds to the expected answer.
Component: wd290obj.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/21/2023

Send a report | Local help