ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Dialog Box functions
  • Overview
  • Simple dialog boxes
  • Advanced dialog boxes
  • Customize dialog boxes
  • Programming dialog boxes
  • Asynchronous dialog
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
Overview
The dialog boxes are standard windows that allow you to communicate with the user. They can be used to notify an error, to ask for confirmation, ...
The dialog boxes always contain the same elements:
  • An icon used to quickly identify the type of message displayed (information, Question or Error).
  • A title displayed in the title bar.
  • One or more buttons allowing the user to choose an answer. The number and the type of these buttons depend on the type of dialog box used.
  • A text on one or more lines corresponding to the message intended for the user.
There are different dialog boxes:
  • Simple dialog boxes
    These dialog boxes contain an image, text and one or more OK, Cancel, Yes or No buttons.
  • WINDEVUniversal Windows 10 AppAndroidiPhone/iPad Advanced dialog boxes.
    These dialog boxes can display specific text in the buttons or allow user input.
You can:
Simple dialog boxes
Several types of dialog boxes are available:
  • Information or error dialog boxes. For example:
    Warning
  • Question dialog boxes. For example:
    Yes / No
  • Confirmation dialog boxes. For example:
    Dialog
Remarks:
  • The button that will be selected by default can be defined for each type of dialog box.
  • The text of the buttons is displayed in the system language.
  • Some functions may not be available depending on the platform used.
Advanced dialog boxes
Advanced dialog boxes support the following features:
  • WindowsAndroidiPhone/iPadJava direct input.
    This feature avoids creating a new window to allow the user to enter only one piece of information. You can use a simple dialog box and the Input function to enable input (edit control or check box). The user can validate or cancel the input.
  • directive questions.
    Directive questions avoid ambiguity and guide the user to provide a response: the user answers a question using buttons that clearly explain the action to be performed.
    The Dialog function opens a wizard to:
    • select a preset message from the message database.
    • create a new message via a simple window.
    The corresponding code is automatically generated when the different message characteristics are entered.
Remark: Message database for directive questions
WINDEV proposes a list of messages. These messages cannot be deleted. They constitute the message database. All the new messages are automatically added to the message database. By default, the message database is located in the WINDEV "Personal\Message" directory.
This directory can be modified in the WINDEV options:
  1. On the "Home" tab, in the "Environment" group, expand "Options" and select "General options of WINDEV".
  2. In the "Directory" tab, specify the desired directory for the message database.
To delete a message from the message database:
  1. Display the code editor.
  2. On the "Code" tab, in the "Languages" group, expand "Translate strings" and select "Directive questions".
  3. Select the message to delete and click Delete icon.
Customize dialog boxes
Dialog boxes can:
  • use the system style.
  • WINDEV include AAFs (Automatic Application Features). For example, the user will be able to associate a keyboard shortcut with each button, or to set the automatic execution of a button.
    Remark: Starting with version 28 U1 (version 280075), this feature is available by default for new projects.
  • be fully customized. This allows you to automatically apply the skin template of the current application or to use multilingual dialog boxes.
For more details, see Customizing dialog boxes.
Programming dialog boxes
The following functions are used to handle dialog boxes:
ConfirmDisplays a message in a standard dialog box that proposes "Yes", "No", "Cancel" and returns the user's choice.
DialogDisplays a message box and returns the value of the button clicked by the user.
ErrorDisplays a custom error message in a system error window.
InfoDisplays a custom message in a system information window.
InputDisplays a message allowing the user to type an information.
OKCancelDisplays a message in a standard dialog box that proposes "OK" and "Cancel" and returns the user's choice.
WarningDisplays a custom message in a system warning window.
YesNoDisplays a message in a standard dialog box that proposes "Yes" and "No" and returns the user's choice.
By default, dialog boxes are modal.
To make dialog boxes modeless, you can:
  • automatically close these dialog boxes. By default, dialog boxes are closed only when the user clicks one of their buttons. If no button is pressed, the application is blocked.
    To avoid blocking the application, use DelayBeforeClosing and specify the amount of time after which the dialog box is automatically closed.
  • use ErrorWithTimeout and InfoWithTimeout to display information or error messages without blocking the application.
  • use asynchronous dialog functions.
WINDEVAndroidiPhone/iPadIOS WidgetMac Catalyst

Asynchronous dialog

Asynchronous dialog works as follows:
  • Calling the function opens the dialog box that corresponds to that function.
  • The code that follows the call continues to run.
  • When the user clicks one of the buttons in the dialog box, the "callback" procedure of the function is executed. This procedure allows processing the user's response if necessary.
WINDEV and WINDEV Mobile include several WLanguage functions for handling asynchronous dialog boxes. These functions are identical to the standard functions. Only the word "Asynchronous" has been added to easily identify them:
ConfirmAsynchronousDisplays a non-blocking message in a standard dialog box with the answers "Yes", "No", "Cancel" and calls a WLanguage procedure with the user's response.
DialogAsynchronousDisplays a non-blocking message box and calls a WLanguage procedure with the value of the button clicked by the user.
ErrorAsynchronousDisplays a custom error message in a non-blocking system error window.
ErrorWithTimeoutAsynchronousDisplays a custom error message in a non-blocking system error window for a given amount of time.
InfoAsynchronousDisplays a non-blocking custom message in a system information window.
InfoWithTimeoutAsynchronousDisplays a custom message in a non-blocking system information window for a given amount of time.
OKCancelAsynchronousDisplays a message in a standard non-blocking dialog box with the answers "OK" and "Cancel" and calls a WLanguage procedure with the user's response.
WarningAsynchronousDisplays a custom message in a non-blocking system warning window.
YesNoAsynchronousDisplays a message in a standard non-blocking dialog box with the answers "Yes" and "No" and calls a WLanguage procedure with the user's response.
These functions are required to compile a Catalyst application. They can also be very useful in your Windows applications. They allow for non-blocking dialog with the user. The application can give information to the user or ask a question but the code continues to run, even if the user is not in front of the screen or if they need time to answer: the program keeps running.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/11/2023

Send a report | Local help