|
|
|
|
- Properties specific to Toast variables
- WLanguage functions that use Toast variables
Toast (Type of variable) In french: Toast
The Toast type is used to define all the advanced characteristics of a toast notification. The characteristics of this toast can be defined and changed using different WLanguage properties. Remark: 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].Libellé = "En savoir plus..." MonToast.Button[1].ActionClic = FoncAide MonToast.ActionClose = clicFerme ToastDisplay(MonToast) INTERNAL PROCÉDURE FoncAide Open("FEN_Aide") END INTERNAL PROCÉDURE clicFerme(nBouton) Trace("Clic fermeture, bouton " + nBouton) END // Affiche un toast avec le nom produit supprimé MonToast is Toast MonToast.DisplayDuration = toastLong MonToast.VerticalAlignment = vaBottom MonToast.HorizontalAlignment = haCenter ToastDisplayIW(FI_TOAST_SUPPR, MonToast, PRODUIT.NOM) //------------------------------------ // Déclarations globales de la fenêtre interne PROCÉDURE FI_TOAST_SUPPR(nomProduit) LIB_TEXTE = StringBuild("Le produit %1 a été supprimé", nomProduit) Remarks Properties specific to Toast variables The following properties can be used to handle a toast notification: | | | | Property name | Type used | Effect |
---|
New in version 28ActionClose | | | 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. | 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. Remark: it is possible to 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 message, relative to the window: - haCenter (Default value): The Toast message is displayed in the center.
- haRight: The Toast message is displayed on the right.
- haLeft: The Toast message is displayed on the left.
| VerticalAlignment | | Integer constant | Vertical alignment of the message, relative to the window: - vaBottom (Default value): The Toast message is displayed at the bottom.
- vaTop: The Toast message is displayed at the top.
- vaMiddle: The Toast message is displayed in the middle.
| BackgroundColor | | entier | Background color used to display the message. This parameter can be: | DisplayDuration | | Integer constant | Display duration of toast notification: - toastShort (Default value): The Toast message will be displayed during a short period of time.
- toastLong: The Toast message will be displayed during a long period of time.
Remark: The exact display duration depends on the device used. | CloseOnClick | | Boolean | Toast closing mode: - True: the toast closes automatically if the user clicks on it,
- False: the toast closes after the specified display time.
| Opacity | | entier | Opacity level of the toast with a value between 1 and 100: - 1, for a toast without opacity,
- 100, for a toast with maximum opacity.
By default, the opacity level is 0 (corresponds to an opacity of 100). | Overlayable | | Boolean | - True (default value): if several toasts are displayed, they overlap each other.
- False: if several toasts are displayed, they overlap each other (compatible version 24).
| Text | | Character string | Message to display. | Title | | Character string | Toast title. |
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…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|