|
|
|
|
|
- Properties specific to Toast variables
- WLanguage functions that use Toast variables
Toast (Variable type) In french: Toast
The Toast type is used to define all the advanced characteristics of a toast notification. You can define and change the characteristics of this toast using different WLanguage properties. Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable. MonToast is Toast
MonToast.Title = "Le saviez-vous ?"
MonToast.Text = "Les FAA sont un truc génial."
MonToast.Button[1].Caption = "En savoir plus..."
MonToast.Button[1].ActionClick = FoncAide
MonToast.ActionClose = clicFerme
ToastDisplay(MonToast)
INTERNAL PROCEDURE FoncAide
Open("FEN_Aide")
END
INTERNAL PROCEDURE clicFerme(nBouton)
Trace("Clic fermeture, bouton " + nBouton)
END
MonToast is Toast
MonToast.DisplayDuration = toastLong
MonToast.VerticalAlignment = vaBottom
MonToast.HorizontalAlignment = haCenter
ToastDisplayIW(FI_TOAST_SUPPR, MonToast, PRODUIT.NOM)
PROCEDURE FI_TOAST_SUPPR(nomProduit)
LIB_TEXTE = StringBuild("Le produit %1 a été supprimé", nomProduit)
Properties Properties specific to Toast variables The following properties can be used to handle a toast notification: | | | Property name | Type | Effect |
---|
ActionClose | WLanguage procedure | Action to be performed when the toast is closed. This property corresponds to the name of the procedure to be executed when the button in the toast is clicked. This procedure takes the number of the clicked button as an optional parameter. If no button has been clicked to close the toast (toast closed via a timer, click on the toast, parent window closed, etc.), this parameter is set to 0. | New in SaaS | Integer or constant | Toast animation to be performed when closing the toast. This property can take the following values: - -1: No animation.
- 0 (Default value): Default animation, defined in project options ("Field animations" button in the "Advanced" tab of the project description window).
- animFade crossfade animation: toast opacity changes from 1 to 100%.
| New in SaaS | Integer or constant | Toast animation for opening the toast. This property can take the following values: - -1: No animation.
- 0 (Default value): Default animation, defined in project options ("Field animations" button in the "Advanced" tab of the project description window).
- animFade crossfade animation: toast opacity changes from 100% to 1.
| New in SaaS | Integer | Rounding size to be applied to the corners of the toast. If this value is 0, the toast is rectangular. By default, this property is set to 24. | Button[n] | | Buttons displayed in the toast. | Button[n].ActionClick | | Action to perform when the button is clicked on. This property corresponds to the name of the procedure to be executed when the button in the toast is clicked. | Button[n].Caption | | Button caption. Note: you can use the gPen function to change the color of the text displayed in the toast. For example: MonToast.Bouton[3].Libellé = gPen(LightYellow) +
"Ne plus demander"
| HorizontalAlignment | Integer constant | Horizontal alignment of the toast, relative to the window: - chCenter (Default): Display the toast in the center of the window.
- chRight Displays the toast on the right of the window.
- chLeft Displays the toast on the left of the window.
| VerticalAlignment | Integer constant | Vertical alignment of the toast, relative to the window: - cvBas (Default): Display the toast at the bottom of the window.
- cvTop Displays the toast at the top of the window.
- cvMiddle Displays the toast in the middle of the window.
| BackgroundColor | Integer | Background color used for toast display. This parameter can correspond to: | DisplayDuration | Integer constant | Toast display time: - toastCourt (Default): The toast will be displayed for a short period of time.
- toastLong The toast will be displayed for a long time.
Note The exact display time depends on the device used. | CloseOnClick | Boolean | Toast closing mode: - True: Toast closes automatically when clicked,
- False Toast closes after the specified display time.
| New in SaaS | Character string | Path to image displayed at top left of toast. | New in SaaS | Integer | Margin between edge of toast and edge of parent window (in pixels). By default, this property is set to 8. | Opacity | Integer | Toast opacity level. The value of this property is between 0 and 100: - 0, default: slightly transparent toast.
- 1, transparent toast,
- 100, completely opaque toast (no transparency).
| Overlayable | Boolean | - True (default): If several toasts are displayed, the toasts are stacked.
- False If more than one toast is displayed, the toasts are displayed one below the other (version 24 compatibility).
| Text | Character string | Text displayed in the toast. | Title | Character string | Toast title.
|
Remarks WLanguage functions that use Toast variables
Related Examples:
|
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.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|