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