File: wx81.htm

package info (click to toggle)
wxwin2-doc 2.01-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 6,540 kB
  • ctags: 5,968
  • sloc: cpp: 15,157; makefile: 434; sh: 6
file content (99 lines) | stat: -rw-r--r-- 4,124 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<HTML>
<head><title>wxDropSource</title></head>

<BODY BGCOLOR=#FFFFFF>
<A NAME="wxdropsource"></A><CENTER>
<A HREF="wx.htm"><img align=center src="contents.gif" BORDER=0 ALT="Contents"></A> <A HREF="wx22.htm#classref"><img align=center src="up.gif" BORDER=0 ALT="Up"></A> <A HREF="wx80.htm#wxdropfilesevent"><img align=center src="back.gif" BORDER=0 ALT="Previous"></A> <A HREF="wx82.htm#wxdroptarget"><img align=center src="forward.gif" BORDER=0 ALT="Next"></A> </CENTER><HR>

<H2>wxDropSource</H2>
<P>
<A HREF="wx312.htm#wxdndoverview">Overview</A><P>
This class represents a source for a drag and drop operation.<P>
<B><FONT COLOR="#FF0000">Derived from</FONT></B><P>
<A HREF="wx158.htm#wxobject">wxObject</A><P>
<B><FONT COLOR="#FF0000">Include files</FONT></B><P>
&lt;wx/dnd.h&gt;<P>
<B><FONT COLOR="#FF0000">Types</FONT></B><P>
wxDragResult is defined as follows:<P>
<FONT SIZE=2><PRE>

enum wxDragResult
  
    wxDragError,    // error prevented the d&amp;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)
  ;
</PRE>
</FONT><P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx312.htm#wxdndoverview">Drag and drop overview</A>, <A HREF="wx82.htm#wxdroptarget">wxDropTarget</A>, 
<A HREF="wx243.htm#wxtextdroptarget">wxTextDropTarget</A>, <A HREF="wx91.htm#wxfiledroptarget">wxFileDropTarget</A><P>
<B><FONT COLOR="#FF0000">Members</FONT></B><P>
<A HREF="#wxdropsourcewxdropsource">wxDropSource::wxDropSource</A><BR>
<A HREF="#wxdropsourcedtor">wxDropSource::~wxDropSource</A><BR>
<A HREF="#wxdropsourcesetdata">wxDropSource::SetData</A><BR>
<A HREF="#wxdropsourcedodragdrop">wxDropSource::DoDragDrop</A><BR>
<A HREF="#wxdropsourcegivefeedback">wxDropSource::GiveFeedback</A><BR>
<P>

<HR>
<A NAME="wxdropsourcewxdropsource"></A>
<H3>wxDropSource::wxDropSource</H3>
<P>
<B></B> <B>wxDropSource</B>(<B>wxWindow*</B><I> win = NULL</I>)<P>
Default/wxGTK-specific constructor. If you use the default constructor you must
call <A HREF="wx81.htm#wxdropsourcesetdata">wxDropSource::SetData</A> later.<P>
<I>win</I> is required by wxGTK and therefore should always be set.<P>
<B></B> <B>wxDropSource</B>(<B>wxDataObject&amp; </B><I>data</I>, <B>wxWindow*</B><I> win = NULL</I>)<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>data</I><UL><UL>
A reference to the <A HREF="wx61.htm#wxdataobject">data object</A> associated with the drop source.</UL></UL>
<P>
<I>win</I><UL><UL>
Only used by wxGTK. TODO</UL></UL>
<P>

<HR>
<A NAME="wxdropsourcedtor"></A>
<H3>wxDropSource::~wxDropSource</H3>
<P>
<B>virtual </B> <B>~wxDropSource</B>()<P>

<HR>
<A NAME="wxdropsourcesetdata"></A>
<H3>wxDropSource::SetData</H3>
<P>
<B>void</B> <B>SetData</B>(<B>wxDataObject&amp;</B><I> data</I>)<P>
Sets the data <A HREF="wx61.htm#wxdataobject">data object</A> associated with the drop source.<P>

<HR>
<A NAME="wxdropsourcedodragdrop"></A>
<H3>wxDropSource::DoDragDrop</H3>
<P>
<B>virtual wxDragResult</B> <B>DoDragDrop</B>(<B>bool </B><I>bAllowMove = FALSE</I>)<P>
Do it (call this in response to a mouse button press, for example).<P>
If <B>bAllowMove</B> is FALSE, data can only be copied. Under GTK, data
is always copied.<P>

<HR>
<A NAME="wxdropsourcegivefeedback"></A>
<H3>wxDropSource::GiveFeedback</H3>
<P>
<B>virtual bool</B> <B>GiveFeedback</B>(<B>wxDragResult </B><I>effect</I>, <B>bool </B><I>bScrolling</I>)<P>
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.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>effect</I><UL><UL>
The effect to implement. One of wxDragCopy, wxDragMove. MSW only. </UL></UL>
<P>
<I>bScrolling</I><UL><UL>
TRUE if the window is scrolling. MSW only. </UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
Return FALSE if you want default feedback, or TRUE if you implement your own
feedback.<P>

</BODY></HTML>