ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / Drag and drop functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
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, ...
Attention: Widget added for current session. To store the added widget, you must use DashAddWidget.
Example
// -- Initialisation de IMG_Widget_Calendrier
// L'image est source de Drag and Drop
MySelf.DndSource = dndProgram
// Définit une procédure pour le "début de glisser"
// Cette procédure utilise la fonction DnDDonneElémentTDB pour définir le widget à dropper
DnDEvent(onDndDebut, MySelf, dndBeginDrag)
PROCEDURE onDndDebut()
// Selon le champ source, il faut définir le widget à dropper
SWITCH _DND.SourceControl
	// Indique que le drop sur le champ Tableau de bord doit ajouter le widget "Horloge" 
	// en utilisant la fenêtre interne "FI_Widget_Horloge"
	CASE IMG_Widget_Calendrier.Nom
		DnDCacheDashElement("FI_Widget_Calendrier", "Horloge")

	OTHER CASE
		Error("Seule l'image IMG_Widget_Calendrier est autorisée pour le 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.
Please note: Only 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.
Please note: Only 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: wd300obj.dll
Minimum version required
  • Version 19
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/28/2025

Send a report | Local help