WD Drag and drop
EXTERN "WINCONST.WL"
// ----------------------------------------------------------------
// --------------------- GLOBAL VARIABLES -----------------------
// ----------------------------------------------------------------
gnNumSelectedRow is int
gbCtrlDown is boolean
gnNumIdentifierEventDragAndDropWindows is system int
// ----------------------------------------------------------------
// Initialize the DnD for the first tab (DND with the treeviews)
// ----------------------------------------------------------------
Tree_Entries..DndSource=dndProgram
Tree_REE_MainCourse..DndSource=dndProgram
Tree_Ree_desserts..DndSource=dndProgram
Table_Menus..DndTarget=dndProgram
// Event on Drag and Drop
DnDEvent(ProcHoverTreeViewTable,Table_Menus,dndDragOver)
DnDEvent(ProcDropTreeViewTable,Table_Menus,dndDrop)
// ----------------------------------------------------------------
// Initialize the DnD for the second tab (DND with the list boxes)
// ----------------------------------------------------------------
// The list of contacts is the source list
LST_CONTACT..DndSource=dndProgram
// The "recipient" lists are targets in relation to the list of contacts
// and sources in relation to the bin
LST_RECIPIENTS..DndTarget=dndProgram
LST_CC..DndTarget=dndProgram
LST_BCC..DndTarget=dndProgram
LST_RECIPIENTS..DndSource=dndProgram
LST_CC..DndSource=dndProgram
LST_BCC..DndSource=dndProgram
// the bin is a target
IMG_TRASHCAN..DndTarget=dndProgram
// hover the target lists
DnDEvent(ProcRollover,LST_RECIPIENTS,dndDragOver)
DnDEvent(ProcRollover,LST_CC,dndDragOver)
DnDEvent(ProcRollover,LST_BCC,dndDragOver)
// hover the bin
DnDEvent(ProcRollover,IMG_TRASHCAN,dndDragOver)
// drop in one of the target lists
DnDEvent(ProcDrop,LST_RECIPIENTS,dndDrop)
DnDEvent(ProcDrop,LST_CC,dndDrop)
DnDEvent(ProcDrop,LST_BCC,dndDrop)
// drop in the bin
DnDEvent(ProcDrop,IMG_TRASHCAN,dndDrop)
// Initialize the treeview table
TVT_Initialize()
// Implement the D&D
MySelf..DndTarget = dndProgram
MySelf..DndSource = dndProgram
// Implement the events
DnDEvent("TVT_DND_Drag", MySelf, dndBeginDrag)
DnDEvent("TVT_DND_Rollover", MySelf, dndDragOver)
DnDEvent("TVT_DND_Drop", MySelf, dndDrop)