AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Controles, páginas y ventanas / Funciones de arrastrar y soltar
  • Programmed Drag and Drop
DnDCacheData (Example)
Programmed Drag and Drop
This example presents all the procedures required to manage a programmed Drag and Drop.
// -- Initialize the target control (EDT_Find)
EDT_Find..DndTarget = dndProgram
DnDEvent("OnDrop", EDT_Find, dndDrop)
DnDEvent("OnRollover", EDT_Find, dndDragOver)
PROCEDURE OnDragOver()
// Modify the cursor to indicate the copy
IF DnDIsDataAvailable(CF_TEXT) THEN DnDCursor(dndCopy)
PROCEDURE OnDrop()
// Allow the text copy if text
IF DnDIsDataAvailable(CF_TEXT) THEN
EDT_Find = DnDGetData(CF_TEXT)
END
//- - Initialize the PETAL1 control
FLOWER1..DnDSource = dndProgram
DnDEvent("Start", "FLOWER1", dndBeginDrag)
PROCEDURE Start()
// Associate the "Petal" data to the "Flower" data type
// Place in the buffer of Drag and Drop
DnDCacheData("Flower", "Petal")
// Force the copy mode to avoid deleting the source
DnDForce(dndCopy)
//- - Initialize the FLOWER1 control
Recipient..DnDTarget = dndProgram
DnDEvent("OnDrop", "Recipient", dndDrop)
PROCEDURE OnDrop()
Str is string
IF DnDIsDataAvailable("Flower") THEN // "Flower" data available
Str = DnDGetData("Flower") // Retrieve the data
IF Str = "Petal" THEN
Info("A petal is added to the flower")
ListAdd(LIST_Petal, "Petal")
END
END
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/05/2022

Señalar un error o enviar una sugerencia | Ayuda local