2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: dnd.h
|
2008-04-21 01:40:12 +00:00
|
|
|
// Purpose: interface of wxDropSource and wx*DropTarget
|
2008-03-08 13:52:38 +00:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
2010-07-13 13:29:13 +00:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2012-04-29 23:22:18 +00:00
|
|
|
/**
|
|
|
|
Possible flags for drag and drop operations.
|
|
|
|
*/
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
wxDrag_CopyOnly = 0, ///< Allow only copying.
|
|
|
|
wxDrag_AllowMove = 1, ///< Allow moving too (copying is always allowed).
|
|
|
|
wxDrag_DefaultMove = 3 ///< Allow moving and make it default operation.
|
|
|
|
};
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
|
|
|
@class wxTextDropTarget
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
A predefined drop target for dealing with text data.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxcore}
|
|
|
|
@category{dnd}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-04-21 01:40:12 +00:00
|
|
|
@see @ref overview_dnd, wxDropSource, wxDropTarget, wxFileDropTarget
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxTextDropTarget : public wxDropTarget
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructor.
|
|
|
|
*/
|
|
|
|
wxTextDropTarget();
|
|
|
|
|
|
|
|
/**
|
2008-04-21 01:40:12 +00:00
|
|
|
See wxDropTarget::OnDrop(). This function is implemented appropriately
|
|
|
|
for text, and calls OnDropText().
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-10-29 15:34:31 +00:00
|
|
|
virtual bool OnDrop(wxCoord x, wxCoord y);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Override this function to receive dropped text.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param x
|
2008-03-09 12:33:59 +00:00
|
|
|
The x coordinate of the mouse.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param y
|
2008-03-09 12:33:59 +00:00
|
|
|
The y coordinate of the mouse.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param data
|
2008-03-09 12:33:59 +00:00
|
|
|
The data being dropped: a wxString.
|
2008-04-21 01:40:12 +00:00
|
|
|
|
|
|
|
Return @true to accept the data, or @false to veto the operation.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-09-29 10:52:37 +00:00
|
|
|
virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& data) = 0;
|
2008-03-08 13:52:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
|
2008-04-21 01:40:12 +00:00
|
|
|
/**
|
|
|
|
Result returned from a wxDropSource::DoDragDrop() call.
|
|
|
|
*/
|
|
|
|
enum wxDragResult
|
|
|
|
{
|
|
|
|
wxDragError, ///< Error prevented the D&D operation from completing.
|
|
|
|
wxDragNone, ///< Drag target didn't accept the data.
|
|
|
|
wxDragCopy, ///< The data was successfully copied.
|
|
|
|
wxDragMove, ///< The data was successfully moved (MSW only).
|
|
|
|
wxDragLink, ///< Operation is a drag-link.
|
|
|
|
wxDragCancel ///< The operation was cancelled by user (not an error).
|
|
|
|
};
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
|
|
|
@class wxDropTarget
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-04-21 01:40:12 +00:00
|
|
|
This class represents a target for a drag and drop operation. A
|
|
|
|
wxDataObject 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(), OnDragOver()
|
|
|
|
possibly many times, OnDrop() and finally OnData().
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxcore}
|
|
|
|
@category{dnd}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-04-21 01:40:12 +00:00
|
|
|
@see @ref overview_dnd, @ref overview_dataobject, wxDropSource,
|
|
|
|
wxTextDropTarget, wxFileDropTarget, wxDataFormat, wxDataObject
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-08 14:43:31 +00:00
|
|
|
class wxDropTarget
|
2008-03-08 13:52:38 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2008-03-09 12:33:59 +00:00
|
|
|
Constructor. @a data is the data to be associated with the drop target.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
wxDropTarget(wxDataObject* data = NULL);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor. Deletes the associated data object, if any.
|
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual ~wxDropTarget();
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-21 01:40:12 +00:00
|
|
|
This method may only be called from within OnData(). By default, this
|
|
|
|
method copies the data from the drop source to the wxDataObject
|
|
|
|
associated with this drop target, calling its wxDataObject::SetData()
|
|
|
|
method.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2012-04-02 16:07:24 +00:00
|
|
|
virtual bool GetData() = 0;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-21 01:40:12 +00:00
|
|
|
Called after OnDrop() returns @true. By default this will usually
|
|
|
|
GetData() and will return the suggested default value @a def.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2012-04-02 16:07:24 +00:00
|
|
|
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def) = 0;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-21 01:40:12 +00:00
|
|
|
Called when the mouse is being dragged over the drop target. By
|
|
|
|
default, this calls functions return the suggested return value @a def.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param x
|
2008-03-09 12:33:59 +00:00
|
|
|
The x coordinate of the mouse.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param y
|
2008-03-09 12:33:59 +00:00
|
|
|
The y coordinate of the mouse.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param def
|
2008-04-21 01:40:12 +00:00
|
|
|
Suggested value for return value. Determined by SHIFT or CONTROL
|
|
|
|
key states.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-05-11 01:38:53 +00:00
|
|
|
@return The desired operation or wxDragNone. This is used for optical
|
2008-04-21 01:40:12 +00:00
|
|
|
feedback from the side of the drop source, typically in form
|
|
|
|
of changing the icon.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-04-21 01:40:12 +00:00
|
|
|
virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-21 01:40:12 +00:00
|
|
|
Called when the user drops a data object on the target. Return @false
|
|
|
|
to veto the operation.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param x
|
2008-03-09 12:33:59 +00:00
|
|
|
The x coordinate of the mouse.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param y
|
2008-03-09 12:33:59 +00:00
|
|
|
The y coordinate of the mouse.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-05-11 01:38:53 +00:00
|
|
|
@return @true to accept the data, or @false to veto the operation.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2012-04-02 16:07:24 +00:00
|
|
|
virtual bool OnDrop(wxCoord x, wxCoord y) = 0;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Called when the mouse enters the drop target. By default, this calls
|
|
|
|
OnDragOver().
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param x
|
2008-03-09 12:33:59 +00:00
|
|
|
The x coordinate of the mouse.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param y
|
2008-03-09 12:33:59 +00:00
|
|
|
The y coordinate of the mouse.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param def
|
2008-04-21 01:40:12 +00:00
|
|
|
Suggested default for return value. Determined by SHIFT or CONTROL
|
|
|
|
key states.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-05-11 01:38:53 +00:00
|
|
|
@return The desired operation or wxDragNone. This is used for optical
|
2008-04-21 01:40:12 +00:00
|
|
|
feedback from the side of the drop source, typically in form
|
|
|
|
of changing the icon.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-04-21 01:40:12 +00:00
|
|
|
virtual wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult def);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Called when the mouse leaves the drop target.
|
|
|
|
*/
|
|
|
|
virtual void OnLeave();
|
|
|
|
|
|
|
|
/**
|
2008-04-21 01:40:12 +00:00
|
|
|
Sets the data wxDataObject associated with the drop target and deletes
|
|
|
|
any previously associated data object.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void SetDataObject(wxDataObject* data);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
|
|
|
@class wxDropSource
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
This class represents a source for a drag and drop operation.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxcore}
|
|
|
|
@category{dnd}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-04-21 01:40:12 +00:00
|
|
|
@see @ref overview_dnd, @ref overview_dataobject, wxDropTarget,
|
|
|
|
wxTextDropTarget, wxFileDropTarget
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-08 14:43:31 +00:00
|
|
|
class wxDropSource
|
2008-03-08 13:52:38 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2008-04-21 01:40:12 +00:00
|
|
|
This constructor requires that you must call SetData() later.
|
|
|
|
|
2008-11-08 15:17:16 +00:00
|
|
|
Note that the type of @a iconCopy and subsequent parameters
|
2012-01-12 18:15:12 +00:00
|
|
|
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
|
2008-03-08 13:52:38 +00:00
|
|
|
programs instead of directly using either of these types.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2009-03-15 01:19:09 +00:00
|
|
|
@onlyfor{wxmsw,wxosx}
|
2008-11-08 15:17:16 +00:00
|
|
|
|
|
|
|
@param win
|
|
|
|
The window which initiates the drag and drop operation.
|
|
|
|
@param iconCopy
|
|
|
|
The icon or cursor used for feedback for copy operation.
|
|
|
|
@param iconMove
|
|
|
|
The icon or cursor used for feedback for move operation.
|
|
|
|
@param iconNone
|
|
|
|
The icon or cursor used for feedback when operation can't be done.
|
|
|
|
*/
|
|
|
|
wxDropSource(wxWindow* win = NULL,
|
2012-05-03 23:30:27 +00:00
|
|
|
const wxCursor& iconCopy = wxNullCursor,
|
|
|
|
const wxCursor& iconMove = wxNullCursor,
|
|
|
|
const wxCursor& iconNone = wxNullCursor);
|
2008-11-08 15:17:16 +00:00
|
|
|
|
|
|
|
/**
|
2012-01-12 18:15:12 +00:00
|
|
|
The constructor taking a wxDataObject.
|
2008-11-08 15:17:16 +00:00
|
|
|
|
|
|
|
Note that the type of @a iconCopy and subsequent parameters
|
2012-01-12 18:15:12 +00:00
|
|
|
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
|
2008-11-08 15:17:16 +00:00
|
|
|
programs instead of directly using either of these types.
|
|
|
|
|
2009-03-15 01:19:09 +00:00
|
|
|
@onlyfor{wxmsw,wxosx}
|
2008-11-08 15:17:16 +00:00
|
|
|
|
|
|
|
@param data
|
|
|
|
The data associated with the drop source.
|
|
|
|
@param win
|
|
|
|
The window which initiates the drag and drop operation.
|
|
|
|
@param iconCopy
|
|
|
|
The icon or cursor used for feedback for copy operation.
|
|
|
|
@param iconMove
|
|
|
|
The icon or cursor used for feedback for move operation.
|
|
|
|
@param iconNone
|
|
|
|
The icon or cursor used for feedback when operation can't be done.
|
|
|
|
*/
|
|
|
|
wxDropSource(wxDataObject& data, wxWindow* win = NULL,
|
2012-05-03 23:30:27 +00:00
|
|
|
const wxCursor& iconCopy = wxNullCursor,
|
|
|
|
const wxCursor& iconMove = wxNullCursor,
|
|
|
|
const wxCursor& iconNone = wxNullCursor);
|
2008-11-08 15:17:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
This constructor requires that you must call SetData() later.
|
|
|
|
|
2012-01-12 18:15:12 +00:00
|
|
|
This is the wxGTK-specific version of the constructor taking wxIcon
|
|
|
|
instead of wxCursor as the other ports.
|
2008-11-08 15:17:16 +00:00
|
|
|
|
|
|
|
@onlyfor{wxgtk}
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param win
|
2008-03-09 12:33:59 +00:00
|
|
|
The window which initiates the drag and drop operation.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param iconCopy
|
2008-03-09 12:33:59 +00:00
|
|
|
The icon or cursor used for feedback for copy operation.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param iconMove
|
2008-03-09 12:33:59 +00:00
|
|
|
The icon or cursor used for feedback for move operation.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param iconNone
|
2008-03-09 12:33:59 +00:00
|
|
|
The icon or cursor used for feedback when operation can't be done.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
wxDropSource(wxWindow* win = NULL,
|
2012-05-03 23:30:27 +00:00
|
|
|
const wxIcon& iconCopy = wxNullIcon,
|
|
|
|
const wxIcon& iconMove = wxNullIcon,
|
|
|
|
const wxIcon& iconNone = wxNullIcon);
|
2008-10-04 20:49:51 +00:00
|
|
|
|
2008-04-21 01:40:12 +00:00
|
|
|
/**
|
2012-01-12 18:15:12 +00:00
|
|
|
The constructor taking a wxDataObject.
|
2008-10-04 20:49:51 +00:00
|
|
|
|
2012-01-12 18:15:12 +00:00
|
|
|
This is the wxGTK-specific version of the constructor taking wxIcon
|
|
|
|
instead of wxCursor as the other ports.
|
2008-04-21 01:40:12 +00:00
|
|
|
|
2008-11-08 15:17:16 +00:00
|
|
|
@onlyfor{wxgtk}
|
|
|
|
|
2008-10-04 20:49:51 +00:00
|
|
|
@param data
|
|
|
|
The data associated with the drop source.
|
2008-04-21 01:40:12 +00:00
|
|
|
@param win
|
|
|
|
The window which initiates the drag and drop operation.
|
|
|
|
@param iconCopy
|
|
|
|
The icon or cursor used for feedback for copy operation.
|
|
|
|
@param iconMove
|
|
|
|
The icon or cursor used for feedback for move operation.
|
|
|
|
@param iconNone
|
|
|
|
The icon or cursor used for feedback when operation can't be done.
|
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
wxDropSource(wxDataObject& data, wxWindow* win = NULL,
|
2012-05-03 23:30:27 +00:00
|
|
|
const wxIcon& iconCopy = wxNullIcon,
|
|
|
|
const wxIcon& iconMove = wxNullIcon,
|
|
|
|
const wxIcon& iconNone = wxNullIcon);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-21 01:40:12 +00:00
|
|
|
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.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param flags
|
2012-04-29 23:22:18 +00:00
|
|
|
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.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-05-11 01:38:53 +00:00
|
|
|
@return The operation requested by the user, may be ::wxDragCopy,
|
2008-04-21 01:40:12 +00:00
|
|
|
::wxDragMove, ::wxDragLink, ::wxDragCancel or ::wxDragNone if
|
2008-03-09 12:33:59 +00:00
|
|
|
an error occurred.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the wxDataObject object that has been assigned previously.
|
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
wxDataObject* GetDataObject();
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-21 01:40:12 +00:00
|
|
|
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.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param effect
|
2008-04-21 01:40:12 +00:00
|
|
|
The effect to implement. One of ::wxDragCopy, ::wxDragMove,
|
|
|
|
::wxDragLink and ::wxDragNone.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-05-11 01:38:53 +00:00
|
|
|
@return @false if you want default feedback, or @true if you implement
|
2008-09-03 20:36:54 +00:00
|
|
|
your own feedback. The return value is ignored under GTK.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
virtual bool GiveFeedback(wxDragResult effect);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set the icon to use for a certain drag result.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param res
|
2008-03-09 12:33:59 +00:00
|
|
|
The drag result to set the icon for.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param cursor
|
2008-03-09 12:33:59 +00:00
|
|
|
The ion to show when this drag result occurs.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void SetCursor(wxDragResult res, const wxCursor& cursor);
|
|
|
|
|
|
|
|
/**
|
2008-04-21 01:40:12 +00:00
|
|
|
Sets the data wxDataObject associated with the drop source. This will
|
|
|
|
not delete any previously associated data.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void SetData(wxDataObject& data);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
|
|
|
@class wxFileDropTarget
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-04-21 01:40:12 +00:00
|
|
|
This is a drop target which accepts files (dragged from File Manager or
|
|
|
|
Explorer).
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxcore}
|
|
|
|
@category{dnd}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-04-21 01:40:12 +00:00
|
|
|
@see @ref overview_dnd, wxDropSource, wxDropTarget, wxTextDropTarget
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxFileDropTarget : public wxDropTarget
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructor.
|
|
|
|
*/
|
|
|
|
wxFileDropTarget();
|
|
|
|
|
|
|
|
/**
|
2008-04-21 01:40:12 +00:00
|
|
|
See wxDropTarget::OnDrop(). This function is implemented appropriately
|
|
|
|
for files, and calls OnDropFiles().
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-10-29 15:34:31 +00:00
|
|
|
virtual bool OnDrop(wxCoord x, wxCoord y);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Override this function to receive dropped files.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param x
|
2008-03-09 12:33:59 +00:00
|
|
|
The x coordinate of the mouse.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param y
|
2008-03-09 12:33:59 +00:00
|
|
|
The y coordinate of the mouse.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param filenames
|
2008-03-09 12:33:59 +00:00
|
|
|
An array of filenames.
|
2008-04-21 01:40:12 +00:00
|
|
|
|
|
|
|
Return @true to accept the data, or @false to veto the operation.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
virtual bool OnDropFiles(wxCoord x, wxCoord y,
|
2008-10-27 21:26:54 +00:00
|
|
|
const wxArrayString& filenames) = 0;
|
2008-03-08 13:52:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
// ============================================================================
|
|
|
|
// Global functions/macros
|
|
|
|
// ============================================================================
|
|
|
|
|
2009-01-05 20:48:06 +00:00
|
|
|
/** @addtogroup group_funcmacro_gdi */
|
2008-03-20 06:00:05 +00:00
|
|
|
//@{
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
2008-03-20 06:00:05 +00:00
|
|
|
This macro creates either a cursor (MSW) or an icon (elsewhere) with the
|
|
|
|
given @a name (of type <tt>const char*</tt>). Under MSW, the cursor is
|
|
|
|
loaded from the resource file and the icon is loaded from XPM file under
|
|
|
|
other platforms.
|
|
|
|
|
|
|
|
This macro should be used with wxDropSource::wxDropSource().
|
|
|
|
|
2008-05-11 01:38:53 +00:00
|
|
|
@return wxCursor on MSW, otherwise returns a wxIcon
|
2008-03-20 06:00:05 +00:00
|
|
|
|
|
|
|
@header{wx/dnd.h}
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-20 06:00:05 +00:00
|
|
|
#define wxDROP_ICON(name)
|
|
|
|
|
|
|
|
//@}
|
2008-03-08 13:52:38 +00:00
|
|
|
|