This class represents a target for a drag and drop operation. A DataObject
can be associated with it and by default, this object will be filled with the data from the
drag source, if the data formats supported by the data object match the drag source data
format.
There are various virtual handler functions defined in this class which may be overridden
to give visual feedback or react in a more fine-tuned way, e.g. by not accepting data on
the whole window area, but only a small portion of it. The normal sequence of calls is
on_enter, possibly many times on_drag_over,
on_drop and finally on_data.
See Drag and drop overview and DataObject overview
for more information.
None
DragResultDragResult is defined as follows:
enum DragResult { DragError, // error prevented the d&d operation from completing DragNone, // drag target didn’t accept the data DragCopy, // the data was successfully copied DragMove, // the data was successfully moved (MSW only) DragLink, // operation is a drag-link DragCancel // the operation was cancelled by user (not an error) };DropSource,
TextDropTarget, FileDropTarget,
DataFormat, DataObject
Constructor. data is the data to be associated with the drop target.
destructor()Destructor. Deletes the associated data object, if any.
This method may only be called from within on_data.
By default, this method copies the data from the drop source to the
DataObject associated with this drop target,
calling its DataObject#set_data method.
Called after on_drop returns true. By default this
will usually get_data and will return the suggested
default value def.
Called when the user drops a data object on the target. Return false to veto the operation.
Return true to accept the data, false to veto the operation.
Called when the mouse enters the drop target. By default, this calls on_drag_over.
Returns the desired operation or DragNone
. This is used for optical feedback
from the side of the drop source, typically in form of changing the icon.
Called when the mouse is being dragged over the drop target. By default,
this calls functions return the suggested return value def.
Returns the desired operation or DragNone
. This is used for optical feedback
from the side of the drop source, typically in form of changing the icon.
Called when the mouse leaves the drop target.
Sets the data DataObject associated with the
drop target and deletes any previously associated data object.
[This page automatically generated from the Textile source at 2023-06-09 00:45:29 +0000]