PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Using syntax with the wizard
  • Characteristics of dialog box
  • Miscellaneous
  • Emulation
  • Application in the background: Android 10 specific case
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Displays a message box and returns the value of the button clicked by the user.
Remarks:
  • This is a blocking warning window. To continue running the application, the user must validate one of the buttons.
    Versions 25 and later
    AndroidiPhone/iPad To avoid blocking the application, use DialogAsynchronous.
    New in version 25
    AndroidiPhone/iPad To avoid blocking the application, use DialogAsynchronous.
    AndroidiPhone/iPad To avoid blocking the application, use DialogAsynchronous.
Versions 19 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 19
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
// 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(StringBuild("Do you want to save the modifications in %1?", ...
MySource), ["Yes - Save","No"], 1, 2, dlgIconQuestion) = 1 THEN
Procedure_Save()
END
New in version 20
// Caution: This example must not be copied directly.
// The following code is generated by the wizard.
IF Dialog(StringBuild("Do you want to save the modifications in %1?", ...
MySource), ["Yes - Save","No"], 1, 2, dlgIconQuestion) = 1 THEN
Procedure_Save()
END
// Caution: This example must not be copied directly.
// The following code is generated by the wizard.
IF Dialog(StringBuild("Do you want to save the modifications in %1?", ...
MySource), ["Yes - Save","No"], 1, 2, dlgIconQuestion) = 1 THEN
Procedure_Save()
END
Syntax

Syntax using the wizard Hide the details

<Result> = Dialog(<Message identifier> [, <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 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 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.
Versions 20 and later

Direct syntax Hide the details

<Result> = Dialog(<Question> , <Captions of buttons> [, <Default button> [, <Cancelation button> [, <Icon>]]])
<Result>: Integer
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:
    dlgIconErrorIcon representing an error.
    dlgIconInfo
    (Default value)
    Icon representing an information.
    dlgIconQuestionIcon representing a question.
New in version 20

Direct syntax Hide the details

<Result> = Dialog(<Question> , <Captions of buttons> [, <Default button> [, <Cancelation button> [, <Icon>]]])
<Result>: Integer
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:
    dlgIconErrorIcon representing an error.
    dlgIconInfo
    (Default value)
    Icon representing an information.
    dlgIconQuestionIcon representing a question.

Direct syntax Hide the details

<Result> = Dialog(<Question> , <Captions of buttons> [, <Default button> [, <Cancelation button> [, <Icon>]]])
<Result>: Integer
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:
    dlgIconErrorIcon representing an error.
    dlgIconInfo
    (Default value)
    Icon representing an information.
    dlgIconQuestionIcon 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:
  1. In the code editor, type "Dialog(".
  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.

Characteristics of dialog box

  • The title of the dialog box corresponds to the title of the current window (or page).
    AndroidiPhone/iPad To comply with the system specifications, the title of dialog box is empty by default. To define this title, use NextTitle.
  • To modify or define the title of dialog box, use NextTitle.
  • WINDEV Mobile The skin template of current project is automatically applied to the dialog box.
    Universal Windows 10 App The dialog box displayed uses the system style (the skin template of project is not applied).
  • Android 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 change the order of the buttons, open the question edit wizard and uncheck "Use the order defined by the system for the validation/cancellation buttons".
  • iPhone/iPad The displayed dialog box is a native iPhone/iPad dialog box.

Miscellaneous

  • Windows Mobile DelayBeforeClosing limits how long the message is displayed. The dialog box is automatically closed. For the question or confirmation dialog boxes, the expected answer corresponds to the default button.
  • Android To allow the user to type a value in a dialog box, use Input.
  • iPhone/iPad This function must not be used:
    • in the event "Resizing" of the window. Otherwise, the application will be locked.
    • in the event "Changing the orientation" of the window.
    • in the event "Move to the foreground" associated with the project.
      Remark: However, the function can be used in the event "Move to the foreground" of a window.
    • in a thread.
Windows Mobile

Emulation

A dialog box can be emulated by EmulateDialog.
Versions 25 and later
Android

Application in the background: Android 10 specific case

From Android 10, it is no longer possible to open a window when the application is in the background.
Dialog can open a window. If this function is used while the application is in the background, a fatal error will occur.
Tips:
  • It is possible to determine if the application is in the background using InBackgroundMode.
  • If an application needs to interact with the user while it is in the background, the solution is to display a notification (via the Notification type). When the notification is clicked on, the application will be brought back to the foreground if ..ActivateApplication is set to True. It is also possible to open a window from the procedure passed to ..ActionClick.
New in version 25
Android

Application in the background: Android 10 specific case

From Android 10, it is no longer possible to open a window when the application is in the background.
Dialog can open a window. If this function is used while the application is in the background, a fatal error will occur.
Tips:
  • It is possible to determine if the application is in the background using InBackgroundMode.
  • If an application needs to interact with the user while it is in the background, the solution is to display a notification (via the Notification type). When the notification is clicked on, the application will be brought back to the foreground if ..ActivateApplication is set to True. It is also possible to open a window from the procedure passed to ..ActionClick.
Android

Application in the background: Android 10 specific case

From Android 10, it is no longer possible to open a window when the application is in the background.
Dialog can open a window. If this function is used while the application is in the background, a fatal error will occur.
Tips:
  • It is possible to determine if the application is in the background using InBackgroundMode.
  • If an application needs to interact with the user while it is in the background, the solution is to display a notification (via the Notification type). When the notification is clicked on, the application will be brought back to the foreground if ..ActivateApplication is set to True. It is also possible to open a window from the procedure passed to ..ActionClick.
Business / UI classification : UI Code
Component : wd250obj.dll
Minimum version required
  • Version 10
This page is also available for…
Comments
FECHAR PROGRAMA
// CLOSING WIN_MENU
s_REPOSTA is string=""
s_REPOSTA=Dialog("Deseja fazer cópia de segurança?",["SIM","NAO","VOLTAR"])
SWITCH s_REPOSTA
CASE 1
Open(WIN_Backup_backup_Dados)
HCloseConnection(Matos_hyperfil_server)
EndProgram()
CASE 2
HCloseConnection(Matos_hyperfil_server)
EndProgram()
CASE 3
ReturnToCapture(WIN_MENU)
OTHER CASE
END
// BLOG COM VIDEO E EXEMPLO
http://windevdesenvolvimento.blogspot.com.br/2017/10/windev-1274-dialog.html

https://www.youtube.com/watch?v=29aTZpUp1iU



De matos
20 Oct. 2017