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 mensajes toast
  • Managing threads
  • Successive calls
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 "Toast" message.
Toasts are a short messages that appear on the screen for a few seconds before fading out without any user intervention. A toast does not take focus, is not modal and does not interrupt application execution.
The display of toasts is recommended for conveying information to the user without blocking execution of the application (e.g. displaying a message to indicate the end of a download).
Toast messages in Android
Linux This function is available for Linux WEBDEV websites only.
Novedad versión 2025
WINDEV Default toast display improved. By default:
  • the corners of the toast are automatically rounded.
  • an outer margin is defined between the edge of the toast and the edge of the parent don.
  • toast opening and closing animation corresponds to the animation defined in the project options ("Field animations" option, in the "Advanced" tab of the project description).
Ejemplo
WINDEVAndroidiPhone/iPad
MyToast is Toast
MyToast.Title = "Did you know?"
MyToast.Text = "AAFs are really cool."
MyToast.Button[1].Caption = "Learn more..."
MyToast.Button[1].ActionClick = FuncHelp
MyToast.ActionClose = clickClose
ToastDisplay(MyToast)
INTERNAL PROCEDURE FuncHelp
	Open ("WIN_Help")
END
INTERNAL PROCEDURE clickClose(nButton)
	Trace("Click to close. Button: " + nButton)
END
ToastDisplay("This is a Toast message.")
ToastDisplay("This is a Toast message.", toastLong, vaMiddle, haCenter, LightGreen)
WINDEV
// Define the font used (gxxx functions)
ToastDisplay(gFontBold() + gFont("Batang") + gFontSize(18) + ...
	gPen(LightYellow) + "Custom message", toastShort, vaBottom, haRight, DarkRed)
Sintaxis
WINDEVAndroidiPhone/iPad

Displaying a toast based on a Toast variable Ocultar los detalles

ToastDisplay(<Toast>)
<Toast>: Toast variable
Name of the Toast variable that defines the toast to be displayed.
Note: The Toast variable can be used to define a number of parameters.

Defining and displaying a toast Ocultar los detalles

ToastDisplay(<Message> [, <Display duration> [, <Vertical alignment> [, <Horizontal alignment> [, <Background color>]]]])
<Message>: Character string
Message to display. This message can be multiline
<Display duration>: Optional integer
Constant indicating the display duration of Toast message:
toastLongThe Toast message will be displayed during a long period of time.
toastShort
(Default value)
The Toast message will be displayed during a short period of time.

Note The exact display time depends on the device used.
<Vertical alignment>: Optional integer
Constant indicating the vertical alignment of message. This alignment is relative:
  • AndroidiPhone/iPad to the screen.
  • WINDEV to the window.
  • WEBDEV - Código ServidorWEBDEV - Código NavegadorPHP to the page.
vaBottom
(Default value)
The Toast message is displayed at the bottom.
vaMiddleThe Toast message is displayed in the middle.
vaTopThe Toast message is displayed at the top.

Android Starting with Android 11, it is no longer possible to set the position of toast messages. This parameter is ignored.
<Horizontal alignment>: Optional integer
Constant indicating the horizontal alignment of the message. This alignment is relative:
  • AndroidiPhone/iPad to the screen.
  • WINDEV to the window.
  • WEBDEV - Código ServidorWEBDEV - Código NavegadorPHP to the page.
haCenter
(Default value)
The Toast message is displayed in the center.
iPhone/iPad The toast will always be centered horizontally.
haLeftThe Toast message is displayed on the left.
iPhone/iPad This constant is not available.
haRightThe Toast message is displayed on the right.
iPhone/iPad This constant is not available.

Android Starting with Android 11, it is no longer possible to set the position of toast messages. This parameter is ignored.
<Background color>: Optional integer
Background color used to display the message. This parameter can correspond to:
Android This parameter is not available.
Observaciones

Managing threads

ToastDisplay can be called from a WLanguage thread (to notify the user of events that occurred during the thread execution for example).

Successive calls

If ToastDisplay is called several times, each toast is displayed once the previous toast has disappeared. This behavior can be changed using the Overlayable property of the Toast variable. This property restores the behaviour of version 24: the toasts are superimposed one on top of the other.
iPhone/iPad If ToastDisplay is called several times, only the last call to the function will be taken into account.
Clasificación Lógica de negocio / UI: Código UI
Componente: wd300obj.dll
Versión mínima requerida
  • Versión 16
Esta página también está disponible para…
Comentarios
Notification
https://repository.windev.com/resource.awp?file_id=281474976710849;notificationdisplay
BOLLER
30 08 2019
Exemplo Toastdisplay
Exemplo Toastdisplay

ToastDisplay("Mensagem que apareça",toastLong,vaTop,haCenter,LightBlue)

ToastDisplay("Outra Mensagem")

//Blog com Video e Exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/07/curso-windev-funcoes-dialogo-4_12.html
https://www.youtube.com/watch?v=m3471CzfOIk
De matos AMARILDO
12 07 2016

Última modificación: 28/03/2025

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