]>
Commit | Line | Data |
---|---|---|
dface61c JS |
1 | \section{\class{wxDropSource}}\label{wxdropsource} |
2 | ||
3 | \overview{Overview}{wxdndoverview} | |
4 | ||
5 | This class represents a source for a drag and drop operation. | |
6 | ||
7 | \wxheading{Derived from} | |
8 | ||
f59d80ca | 9 | None |
dface61c | 10 | |
954b8ae6 JS |
11 | \wxheading{Include files} |
12 | ||
13 | <wx/dnd.h> | |
14 | ||
dface61c JS |
15 | \wxheading{Types} |
16 | ||
17 | \index{wxDragResult}wxDragResult is defined as follows: | |
18 | ||
19 | {\small\begin{verbatim} | |
20 | enum wxDragResult | |
f59d80ca | 21 | { |
dface61c JS |
22 | wxDragError, // error prevented the d&d operation from completing |
23 | wxDragNone, // drag target didn't accept the data | |
24 | wxDragCopy, // the data was successfully copied | |
25 | wxDragMove, // the data was successfully moved | |
26 | wxDragCancel // the operation was cancelled by user (not an error) | |
f59d80ca RR |
27 | }; |
28 | \end{verbatim} | |
dface61c JS |
29 | } |
30 | ||
31 | \wxheading{See also} | |
32 | ||
33 | \helpref{Drag and drop overview}{wxdndoverview}, \helpref{wxDropTarget}{wxdroptarget}, | |
34 | \helpref{wxTextDropTarget}{wxtextdroptarget}, \helpref{wxFileDropTarget}{wxfiledroptarget} | |
35 | ||
36 | \latexignore{\rtfignore{\wxheading{Members}}} | |
37 | ||
38 | \membersection{wxDropSource::wxDropSource}\label{wxdropsourcewxdropsource} | |
39 | ||
06ad8636 | 40 | \func{}{wxDropSource}{\param{wxWindow*}{ win = NULL}} |
dface61c JS |
41 | |
42 | Default/wxGTK-specific constructor. If you use the default constructor you must | |
f59d80ca | 43 | call \helpref{SetData}{wxdropsourcesetdata} later. |
dface61c | 44 | |
f59d80ca | 45 | Note that {\it win} is required by the GTK port and therefore should always be set. |
dface61c | 46 | |
dface61c JS |
47 | \membersection{wxDropSource::\destruct{wxDropSource}}\label{wxdropsourcedtor} |
48 | ||
49 | \func{virtual }{\destruct{wxDropSource}}{\void} | |
50 | ||
51 | \membersection{wxDropSource::SetData}\label{wxdropsourcesetdata} | |
52 | ||
06ad8636 | 53 | \func{void}{SetData}{\param{wxDataObject\&}{ data}} |
dface61c | 54 | |
f59d80ca RR |
55 | Sets the data \helpref{wxDataObject}{wxdataobject} associated with the |
56 | drop source. This will not delete any previously associated data. | |
dface61c JS |
57 | |
58 | \membersection{wxDropSource::DoDragDrop}\label{wxdropsourcedodragdrop} | |
59 | ||
fc9c7c09 | 60 | \func{virtual wxDragResult}{DoDragDrop}{\param{bool }{allowMove = FALSE}} |
dface61c JS |
61 | |
62 | Do it (call this in response to a mouse button press, for example). | |
63 | ||
fc9c7c09 | 64 | If {\bf allowMove} is FALSE, data can only be copied. |
dface61c JS |
65 | |
66 | \membersection{wxDropSource::GiveFeedback}\label{wxdropsourcegivefeedback} | |
67 | ||
fc9c7c09 | 68 | \func{virtual bool}{GiveFeedback}{\param{wxDragResult }{effect}, \param{bool }{scrolling}} |
dface61c JS |
69 | |
70 | Overridable: you may give some custom UI feedback during the drag and drop operation | |
71 | in this function. It is called on each mouse move, so your implementation must not be too | |
72 | slow. | |
73 | ||
74 | \wxheading{Parameters} | |
75 | ||
fc9c7c09 | 76 | \docparam{effect}{The effect to implement. One of wxDragCopy, wxDragMove and wxDragNone. } |
dface61c | 77 | |
fc9c7c09 | 78 | \docparam{scrolling}{TRUE if the window is scrolling. MSW only. } |
dface61c JS |
79 | |
80 | \wxheading{Return value} | |
81 | ||
82 | Return FALSE if you want default feedback, or TRUE if you implement your own | |
fc9c7c09 | 83 | feedback. The return values is ignored under GTK. |
dface61c | 84 |