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