ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Drag and drop functions
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
DnDCacheDashElement (Function)
In french: DnDDonneElémentTDB
Adds a widget into a Dashboard control during Drag and Drop. This Drag and Drop can be performed from an Image control, a List Box control, a Looper control, ...
Caution: The widget is added for the current session. To store the added widget, you must use DashAddWidget.
Example
// -- Initialize IMG_Widget_Calendar
// The image is the drag source
MySelf.DndSource = dndProgram
// Defines the drag start procedure
// This procedure uses DnDCacheDashElement to define the widget to be dropped
DnDEvent(onDndBegin, MySelf, dndBeginDrag)
PROCEDURE onDndBegin()
// Define the widget to drop according to the source control
SWITCH _DND.SourceControl
// Indicates that the drop on the Dashboard control must add the "Clock" widget
// by using the "IW_Widget_Clock" internal window
CASE IMG_Widget_Calendar.Name
DnDCacheDashElement("IW_Widget_Calendar", "Clock")
 
OTHER CASE
Error("Only the IMG_Widget_Calendar image is allowed for Drag and Drop")
 
END
Syntax
DnDCacheDashElement(<Widget name> , <Caption> [, <Parameter 1> [... [, <Parameter N>]]])
<Widget name>: Character string
Name of the internal window (or widget) defined as target of Drag and Drop.
<Caption>: Character string
Caption of the added widget.
<Parameter 1>: Type of value sent to the window (optional)
First parameter that will be passed to the "Global declarations" event of the internal window to open. This parameter is passed by reference and it is considered as being a variable global to the internal window.
Caution: Only the simple types are available.
<Parameter N>: Type of value sent to the window (optional)
Nth parameter that will be passed to the "Global declarations" event of the internal window to open. This parameter is passed by reference and it is considered as being a variable global to the internal window.
Caution: Only the simple types are available.
Remarks
  • This function must be used in the procedure associated with the "Begin drag" event.
  • This function initializes the Drag and Drop information required to add the element into the Dashboard control.
  • The Dashboard control must be defined as target of Drag and Drop (DndTarget).
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 19
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help