************* wx.DropSource ************* Inheritance diagram for `wx.DropSource`: | .. inheritance-diagram:: wx.DropSource | Description =========== This class represents a source for a drag and drop operation. 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) ================================== ============================================ .. seealso:: `wx.DropTarget `_, `wx.TextDropTarget `_, `wx.FileDropTarget `_ Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `DoDragDrop <#DoDragDrop>`_ * `GetDataObject <#GetDataObject>`_ * `GiveFeedback <#GiveFeedback>`_ * `SetCursor <#SetCursor>`_ * `SetData <#SetData>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `DataObject <#DataObject>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(win, copy=wx.NullCursor, move=wx.NullCursor, none=wx.NullCursor) Constructor for `wx.DropSource`. **Parameters:** * `win` (`wx.Window `_) * `copy` (`wx.Cursor `_) * `move` (`wx.Cursor `_) * `none` (`wx.Cursor `_) | **Returns:** `wx.DropSource `_ -------- .. method:: DoDragDrop(flags=wx.Drag_CopyOnly) Do it (call this in response to a mouse button press, for example). This starts the drag-and-drop operation which will terminate when the user releases the mouse. **Parameters:** * `flags` (int): If ``wx.Drag_AllowMove`` is included in the flags, data may be moved and not only copied (default). If ``wx.Drag_DefaultMove`` is specified (which includes the previous flag), this is even the default operation | **Returns:** `int` -------- .. method:: GetDataObject() Returns the `wx.DataObject` object that has been assigned previously. | **Returns:** `wx.DataObject `_ -------- .. method:: GiveFeedback(effect) Overridable: you may give some custom UI feedback during the drag and drop operation in this function. It is called on each mouse move, so your implementation must not be too slow. **Parameters:** * `effect` (int): The effect to implement. One of ``wx.DragCopy``, ``wx.DragMove``, ``wx.DragLink`` and ``wx.DragNone``. | **Returns:** `bool` -------- .. method:: SetCursor(res, cursor) Set the icon to use for a certain drag result. **Parameters:** * `res` (int): The drag result to set the icon for. * `cursor` (`wx.Cursor `_): The icon to show when this drag result occurs. -------- .. method:: SetData(data) Sets the data `wx.DataObject `_ associated with the drop source. This will not delete any previously associated data. **Parameters:** * `data` (`wx.DataObject `_) -------- Properties ^^^^^^^^^^ .. attribute:: DataObject See `GetDataObject <#GetDataObject>`_ and `SetData <#SetData>`_