AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de Windows / Funciones de cuadros de diálogo
  • Using syntax with the wizard
  • Features of the dialog box
  • Miscellaneous
  • Emulation
  • Aplicación en segundo plano: Caso específico a partir de Android 10
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Otros
Procedimientos almacenados
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.
    WINDEVAndroidiPhone/iPad To avoid blocking the application, use DialogAsynchronous.
  • WINDEV WINDEV allows you to apply the skin template of your project to this dialog box. For more details, see Customize dialog boxes.
Ejemplo
// Attention: Cet exemple ne doit pas être copié directement.
// Le code suivant est généré par l'assistant.
SWITCH Dialog("Voulez-vous enregistrer les modifications dans le fichier %1?", MySource)
// Oui
CASE 1: 
Procédure_Sauve()
END
// Attention: Cet exemple ne doit pas être copié directement.
// Le code suivant est généré par l'assistant.
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
Sintaxis

Syntax using the wizard Ocultar los detalles

<Result> = Dialog(<Message identifier> [, <Parameter 1> [, <Parameter N>]])
<Result>: entier
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>: entier
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 Ocultar los detalles

<Result> = Dialog(<Question> , <Captions of buttons> [, <Default button> [, <Cancellation button> [, <Icon>]]])
<Result>: entier
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>: entier
Index of the button selected by default. This parameter is set to 1 by default.
<Cancellation button>: entier
Index of the cancellation button. By default, this parameter corresponds to the index of the last button.
<Icon>: Character string 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.
Observaciones

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.

Features of the dialog box

  • El título del cuadro de diálogo corresponde al título de la ventana (o página) actual.
    AndroidiPhone/iPad Para cumplir con las especificaciones del sistema, el título del cuadro de diálogo está vacío. Para definir el título, utilice la función NextTitle.
  • Para modificar o definir el título del cuadro de diálogo, utilice la función NextTitle.
  • WINDEVWINDEV Mobile The skin template of current project is automatically applied to the dialog box.
    Java 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 ("Personalizar ventanas del sistema (Info, YesNo, Confirm, Dialog)" in the "Style" tab of the project description window).
    • make sure that the "WinDevMessageBox" window is found in the project.
    Universal Windows 10 App The dialog box displayed uses the system style (the skin template of project is not applied).
  • Android The dialog box features are as follows:
    • The displayed dialog box uses the system style.
    • The dialog box must not contain more than 3 buttons. The additional buttons will not be displayed.
    • The position of the buttons varies according to 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 "Utilizar orden definido por el sistema para los botones validar/cancelar".
  • iPhone/iPad The displayed dialog box is a native iPhone/iPad dialog box.
WINDEV Para personalizar este cuadro de diálogo (y todos los cuadros de diálogo del sistema en la aplicación), seleccione la opción "Personalizar ventanas del sistema (Info, YesNo, Confirm, Dialog)" en la pestaña "Estilo" de la descripción del proyecto. Para obtener más información, consulte Personalizar cuadros de diálogo.

Miscellaneous

  • WINDEVJava 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.
  • WINDEVAndroidJava To allow the user to type a value in a dialog box, use Seizure.
  • iPhone/iPad This function must not be used:
    • in the "Resize" event of the window. Otherwise, the application will be locked.
    • in the "Change the orientation" event of the window.
    • in the "Move to the foreground" event associated with the project.
      Remark: However, the function can be used in the "Move to the foreground" event of a window.
    • in a thread.
  • WEBDEV - Código Servidor Special cases:
    • If your project uses pre-launched sessions, this function must not be used in the project initialization event. It must be used in the "Initialize project after connecting to the site" event.
    • This function must not be used in a scheduled WEBDEV task.
WINDEV

Emulation

A dialog box can be emulated by EmulateDialog.
Android

Aplicación en segundo plano: Caso específico a partir de Android 10

A partir de Android 10, no se puede abrir una ventana si la aplicación está en segundo plano.
La función Dialog puede abrir una ventana. Si se utiliza esta función cuando la aplicación está en segundo plano, se producirá un error fatal.
Consejos:
  • Para saber si la aplicación está en segundo plano, utilice la función InBackgroundMode.
  • Si una aplicación necesita interactuar con el usuario cuando está en segundo plano, se puede mostrar una notificación (con el tipo Notification). La aplicación volverá al primer plano cuando se haga clic en la notificación, si la propiedad ActivateApplication se establece en True. También es posible abrir una ventana desde el procedimiento pasado a la propiedad ActionClick.
Para obtener más información, consulte Android 10: Comportamiento de aplicaciones en segundo plano.
Clasificación Lógica de negocio / UI: Código UI
Componente: wd290obj.dll
Versión mínima requerida
  • Versión 10
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 29/02/2024

Señalar un error o enviar una sugerencia | Ayuda local