PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Overview
  • Handling the Dashboard control by programming
  • Adding a widget
  • Running a procedure defined for an internal window or page (used in Widget)
  • Handling a Widget by programming
  • Drag and Drop of a Widget to a Dashboard control
  • Properties specific to the Dashboard controls
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
To handle a Dashboard control by programming, WINDEV, WEBDEV and WINDEV Mobile propose the functions for dashboard management.
This help page explains how to handle a Dashboard control by programming.
Linux Remark: The Dashboard control is available in Linux in the Linux WEBDEV sites only. The Dashboard control is not available in the WINDEV applications for Linux.
Handling the Dashboard control by programming

Adding a widget

Widgets are added into a Dashboard control by programming via DashAddWidget. This function is used to add a widget. This widget is invisible by default. It can be displayed by using Visible. If the widget is not made visible directly, the user can make it visible via the popup menu of edit mode.
Examples:
  • Adding a simple widget (without parameters):
    // Ajoute un Widget simple
    nIndice = DashAddWidget(TDB_TableauDeBord, FI_Widget_AlerteStock, ...
    "Alerte stock")
  • Adding a widget with parameters:
    nIndice is int
     
    // Ajoute un widget qui attend des paramètres
    nIndice = DashAddWidget(TDB_TableauDeBord, FI_Widget_Horloge, ...
    "Horloge " + COMBO_AjoutWidget[COMBO_AjoutWidget].ValeurAffichée, ...
    COMBO_AjoutWidget[COMBO_AjoutWidget].ValeurAffichée)
     
    // Affiche ce widget à la demande
    IF YesNo(Yes, "Souhaitez-vous afficher ce widget?") = Yes THEN
    TDB_TableauDeBord[nIndice].Visible = True
    ELSE
    ToastDisplay("Widget ajouté au tableau de bord en ""caché"". "+ ...
    "Passez en mode édition pour l'ajouter", toastShort, vaMiddle, haCenter)
    END
Special case: adding a Widget into the initial configuration
By default, the Dashboard control displays the Widgets as they have been defined in the window or page editor.
To add Widgets by programming when loading the Dashboard control, all you have to do is use:
Caution: In this case, these functions must be used in the event "Initializing" of the Dashboard control.
Examples:
  • Adding a simple widget (without parameters)
    // --- Initialisation du champ TDB_TableauDeBord
    // - alerte de stock
    // Ajoute le widget
    nIndice = DashAddWidget(MySelf, FI_Widget_AlerteStock, "Alerte stock")
    // Configure le widget (calé à gauche)
    DashInitialConfiguration(MySelf, nIndice, 5, 1)
  • Adding a widget with parameters
    // --- Initialisation du champ TDB_TableauDeBord
     
    dDate is Date
    nIndice is int
    nX, nY are int
     
    // Ajoute des informations dans la configuration initiale:
    // - chiffres clés des 3 derniers mois
    nX = 1 ; nY = 3
    FOR i = 1 TO 3
    // Ajoute le widget
    nIndice = DashAddWidget(MySelf, FI_Widget_ChiffreClé, ...
    StringBuild("Chiffres clés de %1", ...
    DateToString(dDate, "Mmm AAAA")), dDate)
    // Configure le widget (calé à gauche)
    DashInitialConfiguration(MySelf, nIndice, nX, nY)
    // Le prochain sera plus bas
    nY++
    dDate.Month--
    END
Remark: To refresh a Widget with parameters, we advise you to:
  • Add an optional event for refreshing the Widget in the events of the internal window or page.
  • Enter the code used to refresh the Widget. This code can be used for example to update the elements displayed in the internal window or page.
  • Refresh the Widget with DashDisplay.

Running a procedure defined for an internal window or page (used in Widget)

To run a procedure defined in the internal window or page used as Widget, use the following syntaxes:
  • Syntax that is using the name of internal window or page:
    NomFenêtreInterne.NomProcédure(Param1, Param2, ...)

    For example:
    FI_Widget_ChiffreClé.NouvelleDate(SAI_Date)
  • Syntax that is using a Control variable (if the same internal window or page is used several times in the Dashboard control):
    NomVariable est un Champ <- NomTableauDeBord[IndiceWidget]
    NomVariable.NomProcédure(Param1, Param2, ...)

    For example:
    X is Control <-TDB_TableauDeBord[4]
    X.NouvelleDate(SAI_Date)
Handling a Widget by programming
To handle a Widget by programming, use one of the following syntaxes:
  • Syntax 1: Direct use of the Dashboard control:
    NomTableauDeBord[IndiceWidget]

    For example:
    Trace(TDB_MonTableauDeBord[1].Libellé)
  • Syntax 2: Using a Control variable :
    NomVariable est un Champ <- NomTableauDeBord[IndiceWidget]

    For example:
    X is Control <-TDB_TableauDeBord[4]
    Trace(X.Libellé)
The properties that can be used on the Widgets are identical to the ones that can be used on internal windows or pages. For more details, see Properties associated with the internal windows and Properties associated with the internal pages.
Drag and Drop of a Widget to a Dashboard control
Properties specific to the Dashboard controls
The following properties are used to manage a Dashboard control by programming.
Versions 18 and later
CompactOption
New in version 18
CompactOption
CompactOption
The CompactOption property is used to:
  • find out whether the options found in a Check Box, Radio Button or Dashboard control are in compacted mode.
  • switch the options found in a Check Box, Radio Button or Dashboard control to compacted mode.
Versions 17 and later
ElementHeight
New in version 17
ElementHeight
ElementHeight
The Property HeightElement makes it possible to:
  • Find out or modify the height of the elements in an Organization Chart control.
  • Find out or modify the height of the cells in a Dashboard control.
Versions 17 and later
ElementWidth
New in version 17
ElementWidth
ElementWidth
The Property WidthElement makes it possible to:
  • Find out or modify the width of the elements in an Organization Chart control.
  • Find out or modify the width of the cells in a Dashboard control.
Versions 19 and later
MarginHeight
New in version 19
MarginHeight
MarginHeight
The Property MarginHeight allows:
  • Find out the vertical margin between the Widgets found in a Dashboard control.
  • Modify the vertical margin between the Widgets found in a Dashboard control.
Versions 19 and later
MarginWidth
New in version 19
MarginWidth
MarginWidth
The Property MarginWidth allows:
  • Find out the horizontal margin between the widgets found in a Dashboard control.
  • Modify the horizontal margin between the widgets found in a Dashboard control.
To find out the entire list of WLanguage properties that can be used with a Dashboard control, see Properties associated with the Dashboard control.
Minimum version required
  • Version 19
This page is also available for…
Comments
Click [Add] to post a comment