]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/region.tex
InsertItems() documented
[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
43\membersection{wxRegion::\destruct{wxRegion}}
44
45\func{}{\destruct{wxRegion}}{\void}
46
47Destructor.
48
49\membersection{wxRegion::Clear}\label{wxregionclear}
50
51\func{void}{Clear}{\void}
52
53Clears the current region.
54
55\membersection{wxRegion::Contains}\label{wxregioncontains}
56
57\constfunc{wxRegionContain}{Contains}{\param{long\& }{x}, \param{long\& }{y}}
58
59Returns a value indicating whether the given point is contained within the region.
60
61\constfunc{wxRegionContain}{Contains}{\param{const wxPoint\&}{ pt}}
62
63Returns 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
67Returns a value indicating whether the given rectangle is contained within the region.
68
69\constfunc{wxRegionContain}{Contains}{\param{const wxRect\& }{rect}}
70
71Returns a value indicating whether the given rectangle is contained within the region.
72
73\wxheading{Return value}
74
75The return value is one of wxOutRegion, wxPartRegion and wxInRegion.
76
77On Windows, only wxOutRegion and wxInRegion are returned; a value wxInRegion then indicates that
78all 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
84Returns the outer bounds of the region.
85
86\constfunc{wxRect}{GetBox}{\void}
87
88Returns 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
94Finds the intersection of this region and another, rectangular region, specified using position and size.
95
96\func{bool}{Intersect}{\param{const wxRect\&}{ rect}}
97
98Finds the intersection of this region and another, rectangular region.
99
100\func{bool}{Intersect}{\param{const wxRegion\&}{ region}}
101
102Finds the intersection of this region and another region.
103
104\wxheading{Return value}
105
106TRUE if successful, FALSE otherwise.
107
108\wxheading{Remarks}
109
110Creates the intersection of the two regions, that is, the parts which are in both regions. The result
111is stored in this region.
112
113\membersection{wxRegion::IsEmpty}\label{wxregionisempty}
114
115\constfunc{bool}{IsEmpty}{\void}
116
117\func{bool}{IsEmpty}{\void}
118
119Returns TRUE if the region is empty, FALSE otherwise.
120
121\func{bool}{Subtract}{\param{const wxRect\&}{ rect}}
122
123Subtracts a rectangular region from this region.
124
125\func{bool}{Subtract}{\param{const wxRegion\&}{ region}}
126
127Subtracts a region from this region.
128
129\wxheading{Return value}
130
131TRUE if successful, FALSE otherwise.
132
133\wxheading{Remarks}
134
135This operation combines the parts of 'this' region that are not part of the second region.
136The 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
142Finds the union of this region and another, rectangular region, specified using position and size.
143
144\func{bool}{Union}{\param{const wxRect\&}{ rect}}
145
146Finds the union of this region and another, rectangular region.
147
148\func{bool}{Union}{\param{const wxRegion\&}{ region}}
149
150Finds the union of this region and another region.
151
152\wxheading{Return value}
153
154TRUE if successful, FALSE otherwise.
155
156\wxheading{Remarks}
157
158This operation creates a region that combines all of this region and the second region.
159The 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
165Finds the Xor of this region and another, rectangular region, specified using position and size.
166
167\func{bool}{Xor}{\param{const wxRect\&}{ rect}}
168
169Finds the Xor of this region and another, rectangular region.
170
171\func{bool}{Xor}{\param{const wxRegion\&}{ region}}
172
173Finds the Xor of this region and another region.
174
175\wxheading{Return value}
176
177TRUE if successful, FALSE otherwise.
178
179\wxheading{Remarks}
180
181This operation creates a region that combines all of this region and the second region, except
182for 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
188Copies {\it region} by reference counting.
189
76c5df24
JS
190\section{\class{wxRegionIterator}}\label{wxregioniterator}
191
192This class is used to iterate through the rectangles in a region,
193typically when examining the damaged regions of a window within an OnPaint call.
194
195To use it, construct an iterator object on the stack and loop through the
196regions, testing the object and incrementing the iterator at the end of the loop.
197
198See \helpref{wxWindow::OnPaint}{wxwindowonpaint} for an example of use.
199
200\wxheading{Derived from}
201
202\helpref{wxObject}{wxobject}
203
954b8ae6
JS
204\wxheading{Include files}
205
206<wx/region.h>
207
76c5df24
JS
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
218Default constructor.
219
220\func{}{wxRegionIterator}{\param{const wxRegion\&}{ region}}
221
222Creates an iterator object given a region.
223
224\membersection{wxRegionIterator::GetX}
225
226\constfunc{long}{GetX}{\void}
227
228Returns the x value for the current region.
229
230\membersection{wxRegionIterator::GetY}
231
232\constfunc{long}{GetY}{\void}
233
234Returns the y value for the current region.
235
236\membersection{wxRegionIterator::GetW}
237
238\constfunc{long}{GetW}{\void}
239
240An alias for GetWidth.
241
242\membersection{wxRegionIterator::GetWidth}
243
244\constfunc{long}{GetWidth}{\void}
245
246Returns the width value for the current region.
247
248\membersection{wxRegionIterator::GetH}
249
250\constfunc{long}{GetH}{\void}
251
252An alias for GetHeight.
253
254\membersection{wxRegionIterator::GetHeight}
255
256\constfunc{long}{GetWidth}{\void}
257
258Returns the width value for the current region.
259
260\membersection{wxRegionIterator::GetRect}
261
262\constfunc{wxRect}{GetRect}{\void}
263
264Returns the current rectangle.
265
266\membersection{wxRegionIterator::HaveRects}
267
268\constfunc{bool}{HaveRects}{\void}
269
270Returns TRUE if there are still some rectangles; otherwise returns FALSE.
271
272\membersection{wxRegionIterator::Reset}
273
274\func{void}{Reset}{\void}
275
276Resets the iterator to the beginning of the rectangles.
277
278\func{void}{Reset}{\param{const wxRegion\&}{ region}}
279
280Resets the iterator to the given region.
281
282\membersection{wxRegionIterator::operator $++$}
283
284\func{void}{operator $++$}{\void}
285
286Increment operator. Increments the iterator to the next region.
287
06d20283
RD
288\pythonnote{A wxPython alias for this operator is called \tt{Next}.}
289
76c5df24
JS
290\membersection{wxRegionIterator::operator bool}
291
292\constfunc{}{operator bool}{\void}
293
294Returns TRUE if there are still some rectangles; otherwise returns FALSE.
295
296You can use this to test the iterator object as if it were of type bool.
a660d684 297