ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Toast functions
  • Operating mode
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Opens a toast notification whose content is based on an internal window.
Example
// Displays a toast without the product name
MyToast is Toast
MyToast.DisplayDuration = toastLong
MyToast.VerticalAlignment = vaBottom
MyToast.HorizontalAlignment = haCenter
ToastDisplayIW(IW_TOAST_DELETE, MyToast, PRODUCT.NAME)
 
//------------------------------------
// Global declarations of the internal window
PROCEDURE IW_TOAST_DELETE(ProductName)
STC_TEXT = StringBuild("The product %1 has been deleted", ProductName)
Syntax

Display a toast based on an internal window (via the Toast variable) Hide the details

ToastDisplayIW(<Internal window> [, <Toast> [, <Parameter 1> [... [, <Parameter N>]]]])
<Internal window>: Name of the internal window
Name of the internal window used for the toast.
If this is the only parameter specified, the toast based on the internal window will be displayed at the default position (bottom) with the default display time (short).
<Toast>: Toast optional variable
Name of the Toast variable that describes the characteristics of the toast.
Remark: The Title, Text, and Button properties of the Toast variable are not taken into account.
<Parameter 1>: Type corresponding to the parameter (optional)
First parameter to be passed to the internal window. This parameter is passed to the "Global declarations" event of the internal window
<Parameter N>: Type corresponding to the parameter (optional)
Nth parameter to be passed to the internal window. This parameter is passed to the "Global declarations" event of the internal window

Defining and displaying a toast based on an internal window Hide the details

ToastDisplayIW(<Internal window> [, <Display duration> [, <Vertical alignment> [, <Horizontal alignment> [, <Background color>]]]])
<Internal window>: Name of the internal window
Name of the internal window used for the toast.
If this is the only parameter specified, the toast based on the internal window will be displayed at the default position (bottom) with the default display time (short).
<Display duration>: Optional integer
Constant indicating the display duration of the 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.

Remark: The exact display duration depends on the device used.
<Vertical alignment>: Optional integer
Constant indicating the vertical alignment of message. This alignment is relative to the window.
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.
<Horizontal alignment>: Optional integer
Constant indicating the horizontal alignment of the message. This alignment is relative to the window.
haCenter
(Default value)
The Toast message is displayed in the center.
haLeftThe Toast message is displayed on the left.
haRightThe Toast message is displayed on the right.
<Background color>: Optional integer
Background color used to display the message. This parameter can be: Caution: To change the background color of the internal window, you must use a "Transparent" background in the editor.
Remarks

Operating mode

  • The content of the controls in the internal window (text, etc.) must be initialized before calling ToastDisplayIW. The first syntax allows you to pass parameters to the internal window if necessary.
  • If ToastDisplayIW is used to display several toasts at once, the different toasts and will be displayed one after the other (when the first toast is closed, the next toast will be displayed). This behavior can be changed using the Overlayable property of the Toast variable.
  • By default, the size of the toast corresponds the size of the source internal window. This size can be modified/adapted in the "Initialization" event of the source internal window.
Related Examples:
WD Toasts Training (WINDEV): WD Toasts
[ + ] This example shows how to use the ToastDisplay and ToastDisplayIW functions as well as Toast variables. A Toast is a temporary message used to inform the user without interrupting the application.
Component: wd290obj.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/23/2023

Send a report | Local help