File: wx195.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 (160 lines) | stat: -rw-r--r-- 7,487 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<HTML>
<head><title>wxRegion</title></head>

<BODY BGCOLOR=#FFFFFF>
<A NAME="wxregion"></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="wx194.htm#wxrecordset"><img align=center src="back.gif" BORDER=0 ALT="Previous"></A> <A HREF="wx196.htm#wxregioniterator"><img align=center src="forward.gif" BORDER=0 ALT="Next"></A> </CENTER><HR>

<H2>wxRegion</H2>
<P>
A wxRegion represents a simple or complex region on a device context or window. It uses
reference counting, so copying and assignment operations are fast.<P>
<B><FONT COLOR="#FF0000">Derived from</FONT></B><P>
<A HREF="wx107.htm#wxgdiobject">wxGDIObject</A><BR>

<A HREF="wx158.htm#wxobject">wxObject</A><P>
<B><FONT COLOR="#FF0000">Include files</FONT></B><P>
&lt;wx/region.h&gt;<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx196.htm#wxregioniterator">wxRegionIterator</A><P>
<B><FONT COLOR="#FF0000">Members</FONT></B><P>
<A HREF="#wxregionconstr">wxRegion::wxRegion</A><BR>
<A HREF="#topic787">wxRegion::~wxRegion</A><BR>
<A HREF="#wxregionclear">wxRegion::Clear</A><BR>
<A HREF="#wxregioncontains">wxRegion::Contains</A><BR>
<A HREF="#wxregiongetbox">wxRegion::GetBox</A><BR>
<A HREF="#wxregionintersect">wxRegion::Intersect</A><BR>
<A HREF="#wxregionisempty">wxRegion::IsEmpty</A><BR>
<A HREF="#wxregionunion">wxRegion::Union</A><BR>
<A HREF="#wxregionxor">wxRegion::Xor</A><BR>
<A HREF="#wxregionassign">wxRegion::operator =</A><BR>
<P>

<HR>
<A NAME="wxregionconstr"></A>
<H3>wxRegion::wxRegion</H3>
<P>
<B></B> <B>wxRegion</B>()<P>
Default constructor.<P>
<B></B> <B>wxRegion</B>(<B>long</B><I> x</I>, <B>long</B><I> y</I>, <B>long</B><I> width</I>, <B>long</B><I> height</I>)<P>
Constructs a rectangular region with the given position and size.<P>
<B></B> <B>wxRegion</B>(<B>const wxPoint&amp;</B><I> topLeft</I>, <B>const wxPoint&amp;</B><I> bottomRight</I>)<P>
Constructs a rectangular region from the top left point and the bottom right point.<P>
<B></B> <B>wxRegion</B>(<B>const wxRect&amp;</B><I> rect</I>)<P>
Constructs a rectangular region a wxRect object.<P>
<B></B> <B>wxRegion</B>(<B>const wxRegion&amp;</B><I> region</I>)<P>
Constructs a region by copying another region.<P>

<HR>
<A NAME="topic787"></A>
<H3>wxRegion::~wxRegion</H3>
<P>
<B></B> <B>~wxRegion</B>()<P>
Destructor.<P>

<HR>
<A NAME="wxregionclear"></A>
<H3>wxRegion::Clear</H3>
<P>
<B>void</B> <B>Clear</B>()<P>
Clears the current region.<P>

<HR>
<A NAME="wxregioncontains"></A>
<H3>wxRegion::Contains</H3>
<P>
<B>wxRegionContain</B> <B>Contains</B>(<B>long&amp; </B><I>x</I>, <B>long&amp; </B><I>y</I>) <B>const</B><P>
Returns a value indicating whether the given point is contained within the region.<P>
<B>wxRegionContain</B> <B>Contains</B>(<B>const wxPoint&amp;</B><I> pt</I>) <B>const</B><P>
Returns a value indicating whether the given point is contained within the region.<P>
<B>wxRegionContain</B> <B>Contains</B>(<B>long&amp; </B><I>x</I>, <B>long&amp; </B><I>y</I>, <B>long&amp; </B><I>width</I>, <B>long&amp; </B><I>height</I>) <B>const</B><P>
Returns a value indicating whether the given rectangle is contained within the region.<P>
<B>wxRegionContain</B> <B>Contains</B>(<B>const wxRect&amp; </B><I>rect</I>) <B>const</B><P>
Returns a value indicating whether the given rectangle is contained within the region.<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
The return value is one of wxOutRegion, wxPartRegion and wxInRegion.<P>
On Windows, only wxOutRegion and wxInRegion are returned; a value wxInRegion then indicates that
all or some part of the region is contained in this region.<P>

<HR>
<A NAME="wxregiongetbox"></A>
<H3>wxRegion::GetBox</H3>
<P>
<B>void</B> <B>GetBox</B>(<B>long&amp; </B><I>x</I>, <B>long&amp; </B><I>y</I>, <B>long&amp; </B><I>width</I>, <B>long&amp; </B><I>height</I>) <B>const</B><P>
Returns the outer bounds of the region.<P>
<B>wxRect</B> <B>GetBox</B>() <B>const</B><P>
Returns the outer bounds of the region.<P>

<HR>
<A NAME="wxregionintersect"></A>
<H3>wxRegion::Intersect</H3>
<P>
<B>bool</B> <B>Intersect</B>(<B>long</B><I> x</I>, <B>long</B><I> y</I>, <B>long</B><I> width</I>, <B>long</B><I> height</I>)<P>
Finds the intersection of this region and another, rectangular region, specified using position and size.<P>
<B>bool</B> <B>Intersect</B>(<B>const wxRect&amp;</B><I> rect</I>)<P>
Finds the intersection of this region and another, rectangular region.<P>
<B>bool</B> <B>Intersect</B>(<B>const wxRegion&amp;</B><I> region</I>)<P>
Finds the intersection of this region and another region.<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
TRUE if successful, FALSE otherwise.<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
Creates the intersection of the two regions, that is, the parts which are in both regions. The result
is stored in this region.<P>

<HR>
<A NAME="wxregionisempty"></A>
<H3>wxRegion::IsEmpty</H3>
<P>
<B>bool</B> <B>IsEmpty</B>() <B>const</B><P>
<B>bool</B> <B>IsEmpty</B>()<P>
Returns TRUE if the region is empty, FALSE otherwise.<P>
<B>bool</B> <B>Subtract</B>(<B>const wxRect&amp;</B><I> rect</I>)<P>
Subtracts a rectangular region from this region.<P>
<B>bool</B> <B>Subtract</B>(<B>const wxRegion&amp;</B><I> region</I>)<P>
Subtracts a region from this region.<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
TRUE if successful, FALSE otherwise.<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
This operation combines the parts of 'this' region that are not part of the second region.
The result is stored in this region.<P>

<HR>
<A NAME="wxregionunion"></A>
<H3>wxRegion::Union</H3>
<P>
<B>bool</B> <B>Union</B>(<B>long</B><I> x</I>, <B>long</B><I> y</I>, <B>long</B><I> width</I>, <B>long</B><I> height</I>)<P>
Finds the union of this region and another, rectangular region, specified using position and size.<P>
<B>bool</B> <B>Union</B>(<B>const wxRect&amp;</B><I> rect</I>)<P>
Finds the union of this region and another, rectangular region.<P>
<B>bool</B> <B>Union</B>(<B>const wxRegion&amp;</B><I> region</I>)<P>
Finds the union of this region and another region.<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
TRUE if successful, FALSE otherwise.<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
This operation creates a region that combines all of this region and the second region.
The result is stored in this region.<P>

<HR>
<A NAME="wxregionxor"></A>
<H3>wxRegion::Xor</H3>
<P>
<B>bool</B> <B>Xor</B>(<B>long</B><I> x</I>, <B>long</B><I> y</I>, <B>long</B><I> width</I>, <B>long</B><I> height</I>)<P>
Finds the Xor of this region and another, rectangular region, specified using position and size.<P>
<B>bool</B> <B>Xor</B>(<B>const wxRect&amp;</B><I> rect</I>)<P>
Finds the Xor of this region and another, rectangular region.<P>
<B>bool</B> <B>Xor</B>(<B>const wxRegion&amp;</B><I> region</I>)<P>
Finds the Xor of this region and another region.<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
TRUE if successful, FALSE otherwise.<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
This operation creates a region that combines all of this region and the second region, except
for any overlapping areas. The result is stored in this region.<P>

<HR>
<A NAME="wxregionassign"></A>
<H3>wxRegion::operator =</H3>
<P>
<B>void</B> <B>operator =</B>(<B>const wxRegion&amp;</B><I> region</I>)<P>
Copies <I>region</I> by reference counting.<P>

</BODY></HTML>