]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/dropsrc.tex
Several changes and updates
[wxWidgets.git] / docs / latex / wx / dropsrc.tex
CommitLineData
dface61c
JS
1\section{\class{wxDropSource}}\label{wxdropsource}
2
3\overview{Overview}{wxdndoverview}
4
5This class represents a source for a drag and drop operation.
6
7\wxheading{Derived from}
8
9\helpref{wxObject}{wxobject}
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}
20enum wxDragResult
21 {
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)
27 };
28\end{verbatim}%
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
42Default/wxGTK-specific constructor. If you use the default constructor you must
43call \helpref{wxDropSource::SetData}{wxdropsourcesetdata} later.
44
b666df2c 45{\it win} is required by wxGTK and therefore should always be set.
dface61c 46
06ad8636 47\func{}{wxDropSource}{\param{wxDataObject\& }{data}, \param{wxWindow*}{ win = NULL}}
dface61c
JS
48
49\wxheading{Parameters}
50
51\docparam{data}{A reference to the \helpref{data object}{wxdataobject} associated with the drop source.}
52
53\docparam{win}{Only used by wxGTK. TODO}
54
55\membersection{wxDropSource::\destruct{wxDropSource}}\label{wxdropsourcedtor}
56
57\func{virtual }{\destruct{wxDropSource}}{\void}
58
59\membersection{wxDropSource::SetData}\label{wxdropsourcesetdata}
60
06ad8636 61\func{void}{SetData}{\param{wxDataObject\&}{ data}}
dface61c
JS
62
63Sets the data \helpref{data object}{wxdataobject} associated with the drop source.
64
65\membersection{wxDropSource::DoDragDrop}\label{wxdropsourcedodragdrop}
66
67\func{virtual wxDragResult}{DoDragDrop}{\param{bool }{bAllowMove = FALSE}}
68
69Do it (call this in response to a mouse button press, for example).
70
b666df2c
RR
71If {\bf bAllowMove} is FALSE, data can only be copied. Under GTK, data
72is always copied.
dface61c
JS
73
74\membersection{wxDropSource::GiveFeedback}\label{wxdropsourcegivefeedback}
75
76\func{virtual bool}{GiveFeedback}{\param{wxDragResult }{effect}, \param{bool }{bScrolling}}
77
78Overridable: you may give some custom UI feedback during the drag and drop operation
79in this function. It is called on each mouse move, so your implementation must not be too
80slow.
81
82\wxheading{Parameters}
83
b666df2c 84\docparam{effect}{The effect to implement. One of wxDragCopy, wxDragMove. MSW only. }
dface61c 85
b666df2c 86\docparam{bScrolling}{TRUE if the window is scrolling. MSW only. }
dface61c
JS
87
88\wxheading{Return value}
89
90Return FALSE if you want default feedback, or TRUE if you implement your own
91feedback.
92