// Caution: This example must not be copied directly. // The following code is generated by the wizard. SWITCH Dialog("Do you want to save the modifications in the %1? file", MySource)// Yes CASE 1: Procedure_Save()END

Versions 20 and later

// Caution: This example must not be copied directly. // The following code is generated by the wizard. IF Dialog("Do you want to save the modifications in the %1? file", MySource), ... ["Yes - Save","No"], 1, 2, dlgIconQuestion) = 1 THENProcedure_Save()END

New in version 20

// Caution: This example must not be copied directly. // The following code is generated by the wizard. IF Dialog("Do you want to save the modifications in the %1? file", MySource), ... ["Yes - Save","No"], 1, 2, dlgIconQuestion) = 1 THENProcedure_Save()END

// Caution: This example must not be copied directly. // The following code is generated by the wizard. IF Dialog("Do you want to save the modifications in the %1? file", MySource), ... ["Yes - Save","No"], 1, 2, dlgIconQuestion) = 1 THENProcedure_Save()END

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 Identifier>: 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 configurable elements (identified by %1, %2, ...), this parameter is used to give the requested value. Therefore, <Parameter 1> will replace %1.

<Parameter 2>: Optional character string

If the selected message contains configurable elements (identified by %1, %2, ...), this parameter is used to give the requested value. Therefore, <Parameter 2> will replace %2.

Identifies the answer selected by the user. This answer depends on the selected message.

<Question>: Character string (with quotes)

Question asked to the user.

<Captions of buttons>: Array

Name of Array variable containing the captions of buttons.

<Default button>: Integer

Subscript of button selected by default. This parameter is set to 1 by default.

<Cancelation button>: Integer

Subscript of cancelation button. By default, this parameter corresponds to the subscript of last button.

<Icon>: Character string (with quotes) or Integer constant

Icon displayed. 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 the syntax with 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&gt). 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.

Characteristics of dialog box

The title of the dialog box corresponds to the title of the current window (or page). To comply with the system specifications, the title of dialog box is empty by default. To define this title, use NextTitle. To comply with the system specifications, the title of dialog box is empty by default. To define this title, use NextTitle.

The skin template of current project is automatically applied to the dialog box. In order for the skin template of project to be applied to the dialog box, you must:

apply the skin template to the dialog boxes ("Apply the theme of skin template to the system windows" in the "Style" tab of the description window of project).apply the skin template to the dialog boxes ("Customize the system windows (Info, YesNo, Confirm, Dialog)" in the "Style" tab of the description window of project).

make sure that the "WinDevMessageBox" window is found in the project.

The dialog box displayed is using the system style (the skin template of project is not applied).

The characteristics of dialog box are as follows:

The displayed dialog box is using the system style.

The dialog box must not contain more than 3 buttons. The additional buttons will not be displayed.

The position of buttons depends on the Android version. From Android version 4.1, the validation button is positioned on the right. To modify the order of buttons, display the wizard for editing a question and uncheck "Use the order defined by the system for the validation/cancelation buttons".

The displayed dialog box is a native iPhone/iPad dialog box.

To customize this dialog box (as well as all system dialog boxes of your application), check "Apply the theme of skin template to the system information windows" in the "Style" tab of project description. See Customizing the dialog boxes for more details.To customize this dialog box (as well as all system dialog boxes of your application), check "Customize the system windows (Info, YesNo, Confirm, Dialog)" in the "Style" tab of project description. See Customizing the dialog boxes for more details.

Various

DelayBeforeClosing is used to limit the display duration of the message. The dialog box is automatically closed. For the question or confirmation dialog boxes, the expected answer corresponds to the default button.

in the process for resizing windows. Otherwise, the application will be locked.

in the process for changing the orientation of windows.

in the "Move to the foreground" process associated with the project. Note: However, the function can be used in the "Move to the foreground" process of a window.

in a thread.

Versions 24 and later Special cases:

If your project is using cached sessions, this function must not be used in the "Initializing the project" process. This function must be used in the "Initializing the project after connection to the site" process.

This function must not be used in a scheduled WEBDEV task.

New in version 24 Special cases:

If your project is using cached sessions, this function must not be used in the "Initializing the project" process. This function must be used in the "Initializing the project after connection to the site" process.

This function must not be used in a scheduled WEBDEV task.

Special cases:

If your project is using cached sessions, this function must not be used in the "Initializing the project" process. This function must be used in the "Initializing the project after connection to the site" process.