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