]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/region.tex
second merge of the 2.2 branch (RL)
[wxWidgets.git] / docs / latex / wx / region.tex
1 \section{\class{wxRegion}}\label{wxregion}
2
3 A wxRegion represents a simple or complex region on a device context or window. It uses
4 reference counting, so copying and assignment operations are fast.
5
6 \wxheading{Derived from}
7
8 \helpref{wxGDIObject}{wxgdiobject}\\
9 \helpref{wxObject}{wxobject}
10
11 \wxheading{Include files}
12
13 <wx/region.h>
14
15 \wxheading{See also}
16
17 \helpref{wxRegionIterator}{wxregioniterator}
18
19 \latexignore{\rtfignore{\wxheading{Members}}}
20
21 \membersection{wxRegion::wxRegion}\label{wxregionconstr}
22
23 \func{}{wxRegion}{\void}
24
25 Default constructor.
26
27 \func{}{wxRegion}{\param{long}{ x}, \param{long}{ y}, \param{long}{ width}, \param{long}{ height}}
28
29 Constructs a rectangular region with the given position and size.
30
31 \func{}{wxRegion}{\param{const wxPoint\&}{ topLeft}, \param{const wxPoint\&}{ bottomRight}}
32
33 Constructs a rectangular region from the top left point and the bottom right point.
34
35 \func{}{wxRegion}{\param{const wxRect\&}{ rect}}
36
37 Constructs a rectangular region a wxRect object.
38
39 \func{}{wxRegion}{\param{const wxRegion\&}{ region}}
40
41 Constructs a region by copying another region.
42
43 \membersection{wxRegion::\destruct{wxRegion}}
44
45 \func{}{\destruct{wxRegion}}{\void}
46
47 Destructor.
48
49 \membersection{wxRegion::Clear}\label{wxregionclear}
50
51 \func{void}{Clear}{\void}
52
53 Clears the current region.
54
55 \membersection{wxRegion::Contains}\label{wxregioncontains}
56
57 \constfunc{wxRegionContain}{Contains}{\param{long\& }{x}, \param{long\& }{y}}
58
59 Returns a value indicating whether the given point is contained within the region.
60
61 \constfunc{wxRegionContain}{Contains}{\param{const wxPoint\&}{ pt}}
62
63 Returns a value indicating whether the given point is contained within the region.
64
65 \constfunc{wxRegionContain}{Contains}{\param{long\& }{x}, \param{long\& }{y}, \param{long\& }{width}, \param{long\& }{height}}
66
67 Returns a value indicating whether the given rectangle is contained within the region.
68
69 \constfunc{wxRegionContain}{Contains}{\param{const wxRect\& }{rect}}
70
71 Returns a value indicating whether the given rectangle is contained within the region.
72
73 \wxheading{Return value}
74
75 The return value is one of wxOutRegion, wxPartRegion and wxInRegion.
76
77 On Windows, only wxOutRegion and wxInRegion are returned; a value wxInRegion then indicates that
78 all or some part of the region is contained in this region.
79
80 \membersection{wxRegion::GetBox}\label{wxregiongetbox}
81
82 \constfunc{void}{GetBox}{\param{long\& }{x}, \param{long\& }{y}, \param{long\& }{width}, \param{long\& }{height}}
83
84 Returns the outer bounds of the region.
85
86 \constfunc{wxRect}{GetBox}{\void}
87
88 Returns the outer bounds of the region.
89
90 \membersection{wxRegion::Intersect}\label{wxregionintersect}
91
92 \func{bool}{Intersect}{\param{long}{ x}, \param{long}{ y}, \param{long}{ width}, \param{long}{ height}}
93
94 Finds the intersection of this region and another, rectangular region, specified using position and size.
95
96 \func{bool}{Intersect}{\param{const wxRect\&}{ rect}}
97
98 Finds the intersection of this region and another, rectangular region.
99
100 \func{bool}{Intersect}{\param{const wxRegion\&}{ region}}
101
102 Finds the intersection of this region and another region.
103
104 \wxheading{Return value}
105
106 TRUE if successful, FALSE otherwise.
107
108 \wxheading{Remarks}
109
110 Creates the intersection of the two regions, that is, the parts which are in both regions. The result
111 is stored in this region.
112
113 \membersection{wxRegion::IsEmpty}\label{wxregionisempty}
114
115 \constfunc{bool}{IsEmpty}{\void}
116
117 Returns TRUE if the region is empty, FALSE otherwise.
118
119 \membersection{wxRegion::Subtract}\label{wxregionsubstract}
120
121 \func{bool}{Subtract}{\param{const wxRect\&}{ rect}}
122
123 Subtracts a rectangular region from this region.
124
125 \func{bool}{Subtract}{\param{const wxRegion\&}{ region}}
126
127 Subtracts a region from this region.
128
129 \wxheading{Return value}
130
131 TRUE if successful, FALSE otherwise.
132
133 \wxheading{Remarks}
134
135 This operation combines the parts of 'this' region that are not part of the second region.
136 The result is stored in this region.
137
138 \membersection{wxRegion::Union}\label{wxregionunion}
139
140 \func{bool}{Union}{\param{long}{ x}, \param{long}{ y}, \param{long}{ width}, \param{long}{ height}}
141
142 Finds the union of this region and another, rectangular region, specified using position and size.
143
144 \func{bool}{Union}{\param{const wxRect\&}{ rect}}
145
146 Finds the union of this region and another, rectangular region.
147
148 \func{bool}{Union}{\param{const wxRegion\&}{ region}}
149
150 Finds the union of this region and another region.
151
152 \wxheading{Return value}
153
154 TRUE if successful, FALSE otherwise.
155
156 \wxheading{Remarks}
157
158 This operation creates a region that combines all of this region and the second region.
159 The result is stored in this region.
160
161 \membersection{wxRegion::Xor}\label{wxregionxor}
162
163 \func{bool}{Xor}{\param{long}{ x}, \param{long}{ y}, \param{long}{ width}, \param{long}{ height}}
164
165 Finds the Xor of this region and another, rectangular region, specified using position and size.
166
167 \func{bool}{Xor}{\param{const wxRect\&}{ rect}}
168
169 Finds the Xor of this region and another, rectangular region.
170
171 \func{bool}{Xor}{\param{const wxRegion\&}{ region}}
172
173 Finds the Xor of this region and another region.
174
175 \wxheading{Return value}
176
177 TRUE if successful, FALSE otherwise.
178
179 \wxheading{Remarks}
180
181 This operation creates a region that combines all of this region and the second region, except
182 for any overlapping areas. The result is stored in this region.
183
184 \membersection{wxRegion::operator $=$}\label{wxregionassign}
185
186 \func{void}{operator $=$}{\param{const wxRegion\&}{ region}}
187
188 Copies {\it region} by reference counting.
189
190 \section{\class{wxRegionIterator}}\label{wxregioniterator}
191
192 This class is used to iterate through the rectangles in a region,
193 typically when examining the damaged regions of a window within an OnPaint call.
194
195 To use it, construct an iterator object on the stack and loop through the
196 regions, testing the object and incrementing the iterator at the end of the loop.
197
198 See \helpref{wxWindow::OnPaint}{wxwindowonpaint} for an example of use.
199
200 \wxheading{Derived from}
201
202 \helpref{wxObject}{wxobject}
203
204 \wxheading{Include files}
205
206 <wx/region.h>
207
208 \wxheading{See also}
209
210 \helpref{wxWindow::OnPaint}{wxwindowonpaint}
211
212 \latexignore{\rtfignore{\wxheading{Members}}}
213
214 \membersection{wxRegionIterator::wxRegionIterator}
215
216 \func{}{wxRegionIterator}{\void}
217
218 Default constructor.
219
220 \func{}{wxRegionIterator}{\param{const wxRegion\&}{ region}}
221
222 Creates an iterator object given a region.
223
224 \membersection{wxRegionIterator::GetX}
225
226 \constfunc{long}{GetX}{\void}
227
228 Returns the x value for the current region.
229
230 \membersection{wxRegionIterator::GetY}
231
232 \constfunc{long}{GetY}{\void}
233
234 Returns the y value for the current region.
235
236 \membersection{wxRegionIterator::GetW}
237
238 \constfunc{long}{GetW}{\void}
239
240 An alias for GetWidth.
241
242 \membersection{wxRegionIterator::GetWidth}
243
244 \constfunc{long}{GetWidth}{\void}
245
246 Returns the width value for the current region.
247
248 \membersection{wxRegionIterator::GetH}
249
250 \constfunc{long}{GetH}{\void}
251
252 An alias for GetHeight.
253
254 \membersection{wxRegionIterator::GetHeight}
255
256 \constfunc{long}{GetWidth}{\void}
257
258 Returns the width value for the current region.
259
260 \membersection{wxRegionIterator::GetRect}
261
262 \constfunc{wxRect}{GetRect}{\void}
263
264 Returns the current rectangle.
265
266 \membersection{wxRegionIterator::HaveRects}
267
268 \constfunc{bool}{HaveRects}{\void}
269
270 Returns TRUE if there are still some rectangles; otherwise returns FALSE.
271
272 \membersection{wxRegionIterator::Reset}
273
274 \func{void}{Reset}{\void}
275
276 Resets the iterator to the beginning of the rectangles.
277
278 \func{void}{Reset}{\param{const wxRegion\&}{ region}}
279
280 Resets the iterator to the given region.
281
282 \membersection{wxRegionIterator::operator $++$}
283
284 \func{void}{operator $++$}{\void}
285
286 Increment operator. Increments the iterator to the next region.
287
288 \pythonnote{A wxPython alias for this operator is called {\tt Next}.}
289
290 \membersection{wxRegionIterator::operator bool}
291
292 \constfunc{}{operator bool}{\void}
293
294 Returns TRUE if there are still some rectangles; otherwise returns FALSE.
295
296 You can use this to test the iterator object as if it were of type bool.
297