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