PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Programmed Drag and Drop: Example
DnDGetData (Example)
Programmed Drag and Drop: Example
The following code is used to copy/paste text data (CF_TEXT constant). When the data to copy/paste is text data, this data is retrieved.
//- - Initialisation du champ cible "SAI_Rechercher"
SAI_Rechercher..DndTarget = dndProgram
// Appel de la procédure SurLâcher lorsque le bouton gauche
// de la souris est relâché sur le champ cible "SAI_Rechercher"
DnDEvent("SurLâcher", SAI_Rechercher, dndDrop)
// Appel de la procédure SurSurvol lorsque le curseur de la souris
// se déplace entre le champ source et le champ cible "SAI_Rechercher"
DnDEvent("SurSurvol", SAI_Rechercher, dndDragOver)
PROCEDURE OnRollover()
// Available type of data?
IF DnDIsDataAvailable(CF_TEXT) = True THEN
// Cursor indicating the move
DnDCursor(dndMove)
ELSE
// Cursor indicating that the move is not allowed
DnDCursor(dndNone)
END
PROCEDURE OnDrop()
ResRetrieve is string
// Available type of data?
IF DnDIsDataAvailable(CF_TEXT) = True THEN
// The move is allowed (but not the copy)
DnDAccept(dndMove)
ResRetrieve = DnDGetData(CF_TEXT)
ELSE
// No action is allowed
DnDAccept(dndNone)
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment