Inheritance diagram for wx.DropTarget:
This class represents a target for a drag and drop operation. A wx.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 OnEnter, possibly many times OnDragOver, OnDrop.
The return values of most of the DnD operations, termed wx.DragResult, can be sketched as follows:
Flag | Description |
---|---|
wx.DragError | Error prevented the d&d operation from completing |
wx.DragNone | Drag target didn’t accept the data |
wx.DragCopy | The data was successfully copied |
wx.DragMove | The data was successfully moved (MSW only) |
wx.DragLink | Operation is a drag-link |
wx.DragCancel | The operation was cancelled by user (not an error) |
Constructor.
Parameters:
Returns:
By default, this method copies the data from the drop source to the wx.DataObject associated with this drop target, calling its SetDataObject method.
Returns:
bool
Called when the user drops a data object on the target.
Return False to veto the operation.
Parameters:
Returns:
bool
Called when the mouse enters the drop target.
By default, this calls OnDragOver.
Parameters:
Returns:
int
Called when the mouse is being dragged over the drop target.
By default, this calls functions return the suggested return value default.
Parameters:
Returns:
bool
Sets the data wx.DataObject associated with the drop target and deletes any previously associated data object.
Parameters: