The DragDrop class / ui.DragDrop methods |
Define the type of Drag & Drop operation.
Drag & drop actions can be of different kinds; you can do a copy of the dragged object, or move the dragged object from the source to the destination.
Use the setOperation() method to define/force the type of drag & drop operation or to deny/cancel the drag & drop process.
Parameter Value | Description |
---|---|
NULL | To deny/cancel the drag & drop process. |
copy | To allow drag & drop as a copy of the source object. |
move | To allow drag & drop as a move of the source object. |
The setOperation() method can be called in different drag & drop triggers.
A common usage is to deny drag & drop by passing NULL in the ON DRAG_ENTER and/or ON DRAG_OVER blocks because the dragged object does not correspond to the type of objects the target can receive.
This method is also used in ON DRAG_START to force a specific type of drag & drop operation (copy or move), or to deny drag start if the context does not allow a drag & drop action.
When called in the ON DRAG_ENTER block, the method forces a specific drag & drop operation.