Detect a drag & drop operation change

During a drag & drop process, the end user (or the target application) can decide to modify the type of the operation, to indicate whether the dragged object has to be copied or moved from the source to the target. For example, in a typical file explorer, by default files are moved when doing a drag & drop on the same disk. To make a copy of a file, you must press the Ctrl key while doing the drag & drop with the mouse.

In the drop target dialog, you can detect such operation changes in the ON DRAG_OVER trigger and query the ui.DragDrop object for the current operation with ui.DragDrop.getOperation(). In the drag source dialog, you typically check ui.DragDrop.getOperation() in the ON DRAG_FINISHED trigger to know what sort of operation occurred, to keep ("copy" operation) or delete ("move" operation) the original dragged object.

This example tests the current operation in the drop target list and displays a message accordingly:
DEFINE dnd ui.DragDrop 
...
DISPLAY ARRAY arr TO sr.* ...
  ...
  ON DRAG_ENTER (dnd)
    ...
  ON DRAG_OVER (dnd)
    CASE dnd.getOperation()
    WHEN "move"
      MESSAGE "The object will be moved to row ", dnd.getLocationRow()
    WHEN "copy"
      MESSAGE "The object will be copied to row ", dnd.getLocationRow()
    END CASE
    ...
  ON DROP (dnd)
    ...
END DISPLAY