ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Dashboard functions
  • New widget
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
Adds and displays a widget (internal window or page) in a Dashboard control.
Caution: Widgets added programmatically are not automatically displayed. You must use <Dashboard>.InitialConfiguration before the Dashboard control is displayed for the first time.
Example
WINDEVAndroidiPhone/iPadMac Catalyst
// Add 2 elements
DASH_MyDashboard.AddWidget(IW_Sales, "Sales")
DASH_MyDashboard.AddWidget(IW_MonthlyStat, "Monthly statistics for July", "201307")
WINDEVAndroidiPhone/iPadMac Catalyst
nIndex is int 
// Adds a widget that expects parameters
nIndex = DASH_Dashboard.AddWidget(IW_Widget_Clock, "Clock "+ ...
COMBO_AddWidget[COMBO_AddWidget].DisplayedValue, ...
COMBO_AddWidget[COMBO_AddWidget].DisplayedValue)
// Display this widget upon request
IF YesNo(Yes, "Do you want to display this widget?") = Yes THEN
DASH_Dashboard[nIndex].Visible = True
ELSE
ToastDisplay("The widget was added to the dashboard as ""hidden""." + ...
"Switch to edit mode to add it.", ...
toastShort, vaMiddle, haCenter)
END
WEBDEV - Server code
WgtIndex is int 
// Adds a widget that expects parameters
WgtIndex = DASH_TimeZones.AddWidget(IP_Time, "Time" + GetIdentifier(),  "Paris", +0)
DASH_TimeZones.InitialConfiguration(WgtIndex)
// Adds a widget that expects parameters
WgtIndex = DASH_TimeZones.AddWidget(IP_Time, "Time" + GetIdentifier(),  "Honolulu", -12)
DASH_TimeZones.InitialConfiguration(WgtIndex)
// Adds a widget that expects parameters
WgtIndex = DASH_TimeZones.AddWidget(IP_Time, "Time" + GetIdentifier(),  "Sydney", +9) 
DASH_TimeZones.InitialConfiguration(WgtIndex)
Syntax
<Result> = <Dashboard control>.AddWidget(<Widget> , <Caption> [, <Parameter 1> [... [, <Parameter N>]]])
<Result>: Integer
Index of the added element. This index can be used to handle the widget.
<Dashboard control>: Control name
Name of the Dashboard control to be used.
<Widget>: Name of internal window or internal page
  • WINDEVAndroidiPhone/iPadMac Catalyst Name of the internal window to be added to the Dashboard control.
  • WEBDEV - Server code Name of the internal page to be added to the Dashboard control.
<Caption>: Character string
Widget caption. This caption will be displayed in the context menu of the Dashboard control and it will allow the user to handle the widget.
<Parameter 1>: Type of value sent to the window or page (optional)
First parameter that will be passed to the "Global declarations" event of the internal window or internal page to open. This parameter is passed by reference and it is considered as being a variable global to the internal window or internal page.
Caution: Only the simple types are available.
<Parameter N>: Type of value sent to the window or page (optional)
Nth parameter that will be passed to the "Global declarations" event of the internal window or internal page to open. This parameter is passed by reference and it is considered as being a variable global to the internal window or internal page.
Caution: Only the simple types are available.
Remarks

New widget

The widget is declared in addition to the widgets defined in the Dashboard control description.
This widget can be made visible:
  • by using <Dashboard>.InitialConfiguration before the first display.
  • by the end user via the popup menu.
  • by using the following syntax:
    DASH_Dashboard[Index].Visible = True
    where <Index> is the widget number returned by <Dashboard>.AddWidget.
Related Examples:
WD Dashboard Training (WINDEV): WD Dashboard
[ + ] The "WD Dashboard" example is an educational example for using the Dashboard control.
This example explains how to:
- handle the control in "edit" mode,
- save/load a configuration,
- configure the control (initial configuration, addition/deletion of widgets, ...),
- refresh a widget,
- etc.
Component: wd290obj.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/12/2023

Send a report | Local help