#include <wx/dnd.h>
This class represents a source for a drag and drop operation.
<>< =''>:</>&;&;< =''>\ </></>
wxDropSource::wxDropSource | ( | wxWindow * | win = NULL, |
const wxCursor & | iconCopy = wxNullCursor, | ||
const wxCursor & | iconMove = wxNullCursor, | ||
const wxCursor & | iconNone = wxNullCursor ) |
This constructor requires that you must call SetData() later.
Note that the type of iconCopy and subsequent parameters differs between different ports: these are cursors under Windows and OS X but icons for GTK. You should use the macro wxDROP_ICON() in portable programs instead of directly using either of these types.
win | The window which initiates the drag and drop operation. |
iconCopy | The icon or cursor used for feedback for copy operation. |
iconMove | The icon or cursor used for feedback for move operation. |
iconNone | The icon or cursor used for feedback when operation can't be done. |
wxDropSource::wxDropSource | ( | wxDataObject & | data, |
wxWindow * | win = NULL, | ||
const wxCursor & | iconCopy = wxNullCursor, | ||
const wxCursor & | iconMove = wxNullCursor, | ||
const wxCursor & | iconNone = wxNullCursor ) |
The constructor taking a wxDataObject.
Note that the type of iconCopy and subsequent parameters differs between different ports: these are cursors under Windows and OS X but icons for GTK. You should use the macro wxDROP_ICON() in portable programs instead of directly using either of these types.
data | The data associated with the drop source. |
win | The window which initiates the drag and drop operation. |
iconCopy | The icon or cursor used for feedback for copy operation. |
iconMove | The icon or cursor used for feedback for move operation. |
iconNone | The icon or cursor used for feedback when operation can't be done. |
wxDropSource::wxDropSource | ( | wxWindow * | win = NULL, |
const wxIcon & | iconCopy = wxNullIcon, | ||
const wxIcon & | iconMove = wxNullIcon, | ||
const wxIcon & | iconNone = wxNullIcon ) |
This constructor requires that you must call SetData() later.
This is the wxGTK-specific version of the constructor taking wxIcon instead of wxCursor as the other ports.
win | The window which initiates the drag and drop operation. |
iconCopy | The icon or cursor used for feedback for copy operation. |
iconMove | The icon or cursor used for feedback for move operation. |
iconNone | The icon or cursor used for feedback when operation can't be done. |
wxDropSource::wxDropSource | ( | wxDataObject & | data, |
wxWindow * | win = NULL, | ||
const wxIcon & | iconCopy = wxNullIcon, | ||
const wxIcon & | iconMove = wxNullIcon, | ||
const wxIcon & | iconNone = wxNullIcon ) |
The constructor taking a wxDataObject.
This is the wxGTK-specific version of the constructor taking wxIcon instead of wxCursor as the other ports.
data | The data associated with the drop source. |
win | The window which initiates the drag and drop operation. |
iconCopy | The icon or cursor used for feedback for copy operation. |
iconMove | The icon or cursor used for feedback for move operation. |
iconNone | The icon or cursor used for feedback when operation can't be done. |
|
virtual |
Starts the drag-and-drop operation which will terminate when the user releases the mouse.
Call this in response to a mouse button press, for example.
flags | If wxDrag_AllowMove is included in the flags, data may be moved and not only copied as is the case for the default wxDrag_CopyOnly. If wxDrag_DefaultMove is specified (which includes the previous flag), moving is not only possible but becomes the default operation. |
wxDataObject * wxDropSource::GetDataObject | ( | ) |
Returns the wxDataObject object that has been assigned previously.
|
virtual |
You may give some custom UI feedback during the drag and drop operation by overriding this function.
It is called on each mouse move, so your implementation must not be too slow.
effect | The effect to implement. One of wxDragCopy, wxDragMove, wxDragLink and wxDragNone. |
void wxDropSource::SetCursor | ( | wxDragResult | res, |
const wxCursor & | cursor ) |
void wxDropSource::SetData | ( | wxDataObject & | data | ) |
Sets the data wxDataObject associated with the drop source.
This will not delete any previously associated data.
void wxDropSource::SetIcon | ( | wxDragResult | res, |
const wxIcon & | icon ) |
Set the icon to use for a certain drag result.
res | The drag result to set the icon for. |
icon | The icon to show when this drag result occurs. |