ON DRAG_START block

Syntax

ON DRAG_START (dnd-object)
   instruction [...]

Usage

The ON DRAG_START block is executed when the end user begins the drag operation. If this dialog trigger has not been defined, default dragging is enabled for this dialog.

In the ON DRAG_START block, the program typically specifies the type of drag & drop operation by calling ui.DragDrop.setOperation() with "move" or "copy". This call will define the default and unique drag operation. If needed, the program can allow another type of drag operation with ui.DragDrop.addPossibleOperation(). The end user can then choose to move or copy the dragged object, if the drag & drop target allows it.

If the dragged object can be dropped outside the program, the MIME type and drag/drop data must be defined with ui.DragDrop.setMimeType() and ui.DragDrop.setBuffer() methods.

Example:
DEFINE dnd ui.DragDrop 
...
DISPLAY ARRAY arr TO sr.* ...
  ...
  ON DRAG_START (dnd)
    CALL dnd.setOperation("move") -- Move is the default operation 
    CALL dnd.addPossibleOperation("copy") -- User can toggle to copy if needed 
    CALL dnd.setMimeType("text/plain")
    CALL dnd.setBuffer(arr[arr_curr()].cust_name)
    ...
END DISPLAY