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