|
|
|
|
|
- Using syntax with the wizard
- Features of the dialog box
- Miscellaneous
- Emulation
- Background application: Specific to Android 10 and higher
Dialog (Function) In french: Dialogue Displays a message box and returns the value of the button clicked by the user. Remarks: - This is a modal warning window. To continue running the application, the user must validate one of the buttons.
To avoid blocking the application, use DialogAsynchronous. - WINDEV allows you to apply the skin template of your project to this dialog box. For more details, see Customizing dialog boxes.
SWITCH Dialog("Voulez-vous enregistrer les modifications dans le fichier %1?", MySource)
CASE 1:
Procédure_Sauve()
END
IF Dialog(StringBuild("Voulez-vous enregistrer les modifications dans le fichier %1?", ...
MySource), ["Oui - Enregistrer","Non"], 1, 2, dlgIconQuestion) = 1 THEN
Procédure_Sauve()
END
Syntax
Syntax using the wizard Hide the details
<Result> = Dialog(<Message ID> [, <Parameter 1> [, <Parameter N>]])
<Result>: Integer Identifies the answer selected by the user. This answer depends on the selected message. The different values corresponding to the different answers are automatically included in comments in the code editor when selecting the message. <Message ID>: Integer Identifies the question asked to the user as well as the different possible answers. <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.
Direct syntax Hide the details
<Result> = Dialog(<Question> , <Captions of buttons> [, <Default button> [, <Cancellation button> [, <Icon>]]])
<Result>: Integer Identifies the answer selected by the user. This answer depends on the selected message. <Question>: Character string Question asked to the user. <Captions of buttons>: Array Name of the Array variable containing the captions of the buttons. <Default button>: Integer Index of the button selected by default. This parameter is set to 1 by default. <Cancellation button>: Integer Index of the cancellation button. By default, this parameter corresponds to the index of the last button. <Icon>: Character string or Integer constant Displayed icon. This parameter can correspond to: - the path of file corresponding to the displayed icon.
- one of the following constants:
| | dlgIconError | Icon representing an error. | dlgIconInfo (Default value) | Icon representing an information. | dlgIconQuestion | Icon representing a question. |
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 "Dialog(".
- 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.
Business / UI classification: UI Code
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|