1999-01-13 09:23:31 -05:00
|
|
|
\section{\class{wxDropSource}}\label{wxdropsource}
|
|
|
|
|
|
|
|
This class represents a source for a drag and drop operation.
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
See \helpref{Drag and drop overview}{wxdndoverview} and \helpref{wxDataObject overview}{wxdataobjectoverview}
|
1999-12-29 06:52:51 -05:00
|
|
|
for more information.
|
|
|
|
|
1999-01-13 09:23:31 -05:00
|
|
|
\wxheading{Derived from}
|
|
|
|
|
1999-12-29 04:48:10 -05:00
|
|
|
None
|
1999-01-13 09:23:31 -05:00
|
|
|
|
1999-02-15 15:41:29 -05:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/dnd.h>
|
|
|
|
|
1999-01-13 09:23:31 -05:00
|
|
|
\wxheading{Types}
|
|
|
|
|
|
|
|
\index{wxDragResult}wxDragResult is defined as follows:
|
|
|
|
|
2000-03-17 12:59:56 -05:00
|
|
|
\begin{verbatim}
|
1999-01-13 09:23:31 -05:00
|
|
|
enum wxDragResult
|
1999-12-29 04:48:10 -05:00
|
|
|
{
|
1999-01-13 09:23:31 -05:00
|
|
|
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
|
|
|
|
wxDragCancel // the operation was cancelled by user (not an error)
|
1999-12-29 04:48:10 -05:00
|
|
|
};
|
|
|
|
\end{verbatim}
|
1999-01-13 09:23:31 -05:00
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
1999-12-29 06:52:51 -05:00
|
|
|
\helpref{wxDropTarget}{wxdroptarget},
|
1999-01-13 09:23:31 -05:00
|
|
|
\helpref{wxTextDropTarget}{wxtextdroptarget}, \helpref{wxFileDropTarget}{wxfiledroptarget}
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
|
|
|
\membersection{wxDropSource::wxDropSource}\label{wxdropsourcewxdropsource}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
\func{}{wxDropSource}{\param{wxWindow*}{ win = NULL},\param{const wxIconOrCursor\& }{iconCopy = wxNullIconOrCursor}, \param{const wxIconOrCursor\& }{iconCopy = wxNullIconOrCursor}, \param{const wxIconOrCursor\& }{iconNone = wxNullIconOrCursor}}
|
1999-01-13 09:23:31 -05:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
\func{}{wxDropSource}{\param{wxDataObject\&}{ data}, \param{wxWindow*}{ win = NULL},\param{const wxIconOrCursor\& }{iconCopy = wxNullIconOrCursor}, \param{const wxIconOrCursor\& }{iconCopy = wxNullIconOrCursor}, \param{const wxIconOrCursor\& }{iconNone = wxNullIconOrCursor}}
|
1999-01-13 09:23:31 -05:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
The constructors for wxDataObject.
|
|
|
|
|
|
|
|
If you use the constructor without {\it data} parameter you must call
|
|
|
|
\helpref{SetData}{wxdropsourcesetdata} later.
|
|
|
|
|
|
|
|
Note that the exact type of {\it iconCopy} and subsequent parameters differs
|
|
|
|
between wxMSW and wxGTK: these are cursors under Windows but icons for GTK.
|
|
|
|
You should use the macro \helpref{wxDROP\_ICON}{wxdropicon} in portable
|
|
|
|
programs instead of directly using either of these types.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{win}{The window which initiates the drag and drop operation.}
|
|
|
|
|
|
|
|
\docparam{iconCopy}{The icon or cursor used for feedback for copy operation.}
|
|
|
|
|
|
|
|
\docparam{iconMove}{The icon or cursor used for feedback for move operation.}
|
|
|
|
|
|
|
|
\docparam{iconNone}{The icon or cursor used for feedback when operation can't be done.}
|
|
|
|
|
|
|
|
{\it win} is the window which initiates the drag and drop operation.
|
1999-01-13 09:23:31 -05:00
|
|
|
|
|
|
|
\membersection{wxDropSource::\destruct{wxDropSource}}\label{wxdropsourcedtor}
|
|
|
|
|
|
|
|
\func{virtual }{\destruct{wxDropSource}}{\void}
|
|
|
|
|
|
|
|
\membersection{wxDropSource::SetData}\label{wxdropsourcesetdata}
|
|
|
|
|
1999-01-24 18:56:51 -05:00
|
|
|
\func{void}{SetData}{\param{wxDataObject\&}{ data}}
|
1999-01-13 09:23:31 -05:00
|
|
|
|
1999-12-29 04:48:10 -05:00
|
|
|
Sets the data \helpref{wxDataObject}{wxdataobject} associated with the
|
|
|
|
drop source. This will not delete any previously associated data.
|
1999-01-13 09:23:31 -05:00
|
|
|
|
|
|
|
\membersection{wxDropSource::DoDragDrop}\label{wxdropsourcedodragdrop}
|
|
|
|
|
2002-04-28 10:30:54 -04:00
|
|
|
\func{virtual wxDragResult}{DoDragDrop}{\param{int }{flags = {\tt wxDrag\_CopyOnly}}}
|
1999-01-13 09:23:31 -05:00
|
|
|
|
2002-04-28 10:30:54 -04:00
|
|
|
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.
|
1999-01-13 09:23:31 -05:00
|
|
|
|
2002-04-28 10:30:54 -04:00
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{flags}{If {\tt wxDrag\_AllowMove} is included in the flags, data may
|
|
|
|
be moved and not only copied (default). If {\tt wxDrag\_DefaultMove} is
|
|
|
|
specified (which includes the previous flag), this is even the default
|
|
|
|
operation}.
|
|
|
|
|
|
|
|
\wxheading{Return value}
|
|
|
|
|
|
|
|
Returns the operation requested by the user, may be {\tt wxDragCopy}, {\tt
|
|
|
|
wxDragMove}, {\tt wxDragCancel} or {\tt wxDragNone} if an error occured.
|
1999-01-13 09:23:31 -05:00
|
|
|
|
|
|
|
\membersection{wxDropSource::GiveFeedback}\label{wxdropsourcegivefeedback}
|
|
|
|
|
1999-11-01 13:20:39 -05:00
|
|
|
\func{virtual bool}{GiveFeedback}{\param{wxDragResult }{effect}, \param{bool }{scrolling}}
|
1999-01-13 09:23:31 -05:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
1999-11-01 13:20:39 -05:00
|
|
|
\docparam{effect}{The effect to implement. One of wxDragCopy, wxDragMove and wxDragNone. }
|
1999-01-13 09:23:31 -05:00
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
\docparam{scrolling}{true if the window is scrolling. MSW only. }
|
1999-01-13 09:23:31 -05:00
|
|
|
|
|
|
|
\wxheading{Return value}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Return false if you want default feedback, or true if you implement your own
|
1999-11-01 13:20:39 -05:00
|
|
|
feedback. The return values is ignored under GTK.
|
1999-01-13 09:23:31 -05:00
|
|
|
|