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
  • Features of the dialog box
  • Line break in the dialog box
  • Miscellaneous
  • Emulation
  • Aplicación en segundo plano: Caso concreto de Android 10
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Displays a message in a standard dialog box that proposes "Yes", "No", "Cancel" and returns the user's choice.
Confirmation example
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 ConfirmAsynchronous.
  • WINDEV WINDEV allows you to apply the skin template of your project to this dialog box. For more details, see Customizing dialog boxes.
Ejemplo
WINDEVReportes y ConsultasAndroidiPhone/iPadJavaCódigo de Usuario (UMC)
Res is int 
NextTitle("Modifying the form")
Res = Confirm("Some modifications have been made to the form.", ...
	"Do you want to save them before you close the form?")
SWITCH Res 
	CASE Yes: SauveFiche() // Save processing
	CASE No: Close()
	CASE Cancel: SetFocusAndReturnToUserInput()
END
WEBDEV - Código Navegador
Res is boolean
Res = Confirm("Do you want to load this page?") 
IF Res = True THEN
	// User validation
ELSE
	// No user validation
	SetFocusAndReturnToUserInput("VALIDBTN")
END
Sintaxis
WINDEVWEBDEV - Código ServidorReportes y ConsultasWindowsLinuxAndroidiPhone/iPadJavaCódigo de Usuario (UMC)

Displaying a Confirm dialog box Ocultar los detalles

<Result> = Confirm([<Selected button>, ] <Text> [, <Line 2> [... [, <Line n>]]])
<Result>: Integer constant
Identifies the button selected by the user:
No0The user selected [NO].
Yes1The user selected [YES].
Cancel2The user selected [CANCEL].
<Selected button>: Optional integer constant
Button selected by default in the dialog box:
No0selected by default.
Yes
(Default value)
1selected by default.
Cancel2selected by default.
<Text>: Character string
Text to display.
<Line 2>: Optional character string
Text displayed on the second line.
<Line n>: Optional character string
Text displayed on the Nth line.
WEBDEV - Código Navegador

Displaying a Confirm dialog box on the browser Ocultar los detalles

<Result> = Confirm(<Text> [, <Line 2> [... [, <Line n>]]])
<Result>: Boolean
  • True if the user validated,
  • False otherwise.
<Text>: Unicode string
Text to display.
<Line 2>: Optional Unicode character string
Text displayed on the second line.
<Line n>: Optional Unicode character string
Text displayed on the Nth line.
Observaciones

Features of the dialog box

  • The message is aligned to the left.
  • The text of the buttons changes according to the language used by Windows at runtime (or used by the browser, in the case of a WEBDEV website).
  • The maximum number of characters cannot exceed 4096. If a larger string is passed as parameter, it will be truncated.
  • The icon displayed (exclamation mark in a WINDEV application, question mark in a WEBDEV application) cannot be modified.
  • 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.
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.
WEBDEV - Código Servidor Para personalizar este cuadro de diálogo (y todos los cuadros de diálogo del sistema en el sitio), seleccione la opción "Aplicar tema a los cuadros de diálogo (YesNo y OKCancel)" en la pestaña "Tema" de la ventana de descripción del proyecto.

Line break in the dialog box

The CR string (Carriage Return) can be used to force a break to the next line. For example:
Confirm("The XXX form was modified." + CR + ...
	"Do you want to save it before exiting?")
is equivalent to:
Confirm("The XXX form was modified.", ...
	"Do you want to save it before exiting?")
You also have the ability to use the syntax of multiline strings. For example:
Confirm(
[
The XXX form has been modified.

Do you want to save changes before closing?
])

Miscellaneous

  • Timers (TimerSys) are not stopped when this function is called.
  • WINDEV Windows events are not stopped when this function is called.
  • 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.
  • The text of the buttons is displayed in the system language.
  • WEBDEV - Código Servidor If your project uses pre-launched sessions, this function must not be used in the project initialization event. This function must be used in the "Initialization in pre-launched session mode" event.
  • 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.
      Note: The function can also be used in the "Bring to foreground" event of a window..
    • in a thread.
WINDEV

Emulation

A confirmation message can be emulated by EmulateConfirm.
Android

Aplicación en segundo plano: Caso concreto 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 Confirm 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 las aplicaciones en segundo plano.
Componente: wd300obj.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Exemplo Confirm
Exemplo Confirm

Res is int
NextTitle("Modifica o Formulario")
Res = Confirm("Primeira Linha."+CR+"TESTE","Seguda Linha?")
SWITCH Res
CASE Yes:
Info("ok")
CASE No:
Close()
CASE Cancel:
ReturnToCapture()
END

//Blog com Video e Exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/07/curso-windev-funcoes-dialogo-1-confirm.html
https://www.youtube.com/watch?v=jjBIYgdVK1s
De matos AMARILDO
08 07 2016

Última modificación: 25/03/2025

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