]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/rect.tex
wxMediaCtrl API changes for 2.5.x/2.6
[wxWidgets.git] / docs / latex / wx / rect.tex
CommitLineData
a660d684
KB
1\section{\class{wxRect}}\label{wxrect}
2
3A class for manipulating rectangles.
4
5\wxheading{Derived from}
6
9838df2c 7None
a660d684 8
954b8ae6
JS
9\wxheading{Include files}
10
11<wx/gdicmn.h>
12
a660d684
KB
13\wxheading{See also}
14
15\helpref{wxPoint}{wxpoint}, \helpref{wxSize}{wxsize}
16
17\latexignore{\rtfignore{\wxheading{Members}}}
18
df83b840 19
39275175 20\membersection{wxRect::wxRect}\label{wxrectctor}
a660d684
KB
21
22\func{}{wxRect}{\void}
23
24Default constructor.
25
eaaa6a06 26\func{}{wxRect}{\param{int}{ x}, \param{int}{ y}, \param{int}{ width}, \param{int}{ height}}
a660d684
KB
27
28Creates a wxRect object from x, y, width and height values.
29
30\func{}{wxRect}{\param{const wxPoint\&}{ topLeft}, \param{const wxPoint\&}{ bottomRight}}
31
32Creates a wxRect object from top-left and bottom-right points.
33
34\func{}{wxRect}{\param{const wxPoint\&}{ pos}, \param{const wxSize\&}{ size}}
35
36Creates a wxRect object from position and size values.
37
8d8fbb9d
WS
38\func{}{wxRect}{\param{const wxSize\&}{ size}}
39
40Creates a wxRect object from size values at the origin.
41
df83b840 42
39275175 43\membersection{wxRect::x}\label{wxrectx}
a660d684
KB
44
45\member{int}{x}
46
f6bcfd97 47x coordinate of the top-level corner of the rectangle.
a660d684 48
df83b840 49
39275175 50\membersection{wxRect::y}\label{wxrecty}
a660d684
KB
51
52\member{int}{y}
53
f6bcfd97 54y coordinate of the top-level corner of the rectangle.
a660d684 55
df83b840 56
39275175 57\membersection{wxRect::width}\label{wxrectwidth}
a660d684
KB
58
59\member{int}{width}
60
61Width member.
62
df83b840 63
39275175 64\membersection{wxRect::height}\label{wxrectheight}
a660d684
KB
65
66\member{int}{height}
67
68Height member.
69
df83b840 70
f4c43a17
VZ
71\membersection{wxRect::Deflate}\label{wxrectdeflate}
72
73\func{void}{Deflate}{\param{wxCoord }{dx}, \param{wxCoord }{dy}}
74
75\func{void}{Deflate}{\param{wxCoord }{diff}}
76
77\constfunc{wxRect}{Deflate}{\param{wxCoord }{dx}, \param{wxCoord }{dy}}
78
79Decrease the rectangle size by {\it dx} in x direction and {\it dy} in y
80direction. Both (or one of) parameters may be negative to increase the
81rectngle size. This method is the opposite of \helpref{Inflate}{wxrectinflate}.
82
83The second form uses the same {\it diff} for both {\it dx} and {\it dy}.
84
85The first two versions modify the rectangle in place, the last one returns a
86new rectangle leaving this one unchanged.
87
88\wxheading{See also}
89
90\helpref{Inflate}{wxrectinflate}
91
df83b840 92
a660d684
KB
93\membersection{wxRect::GetBottom}\label{wxrectgetbottom}
94
95\constfunc{int}{GetBottom}{\void}
96
97Gets the bottom point of the rectangle.
98
df83b840 99
a660d684
KB
100\membersection{wxRect::GetHeight}\label{wxrectgetheight}
101
102\constfunc{int}{GetHeight}{\void}
103
104Gets the height member.
105
df83b840 106
a660d684
KB
107\membersection{wxRect::GetLeft}\label{wxrectgetleft}
108
109\constfunc{int}{GetLeft}{\void}
110
111Gets the left point of the rectangle (the same as \helpref{wxRect::GetX}{wxrectgetx}).
112
df83b840 113
a660d684
KB
114\membersection{wxRect::GetPosition}\label{wxrectgetposition}
115
116\constfunc{wxPoint}{GetPosition}{\void}
117
118Gets the position.
119
df83b840 120
355a5e2b
JS
121\membersection{wxRect::GetTopLeft}\label{wxrectgettopleft}
122
123\constfunc{wxPoint}{GetTopLeft}{\void}
124
125Gets the topleft position of the rectangle. (Same as GetPosition).
126
df83b840 127
355a5e2b
JS
128\membersection{wxRect::GetBottomRight}\label{wxrectgetbottomright}
129
130\constfunc{wxPoint}{GetBottomRight}{\void}
131
132Gets the the bottom right position. Returns the bottom right point inside the rectangle.
133
df83b840 134
a660d684
KB
135\membersection{wxRect::GetRight}\label{wxrectgetright}
136
137\constfunc{int}{GetRight}{\void}
138
139Gets the right point of the rectangle.
140
df83b840 141
a660d684
KB
142\membersection{wxRect::GetSize}\label{wxrectgetsize}
143
144\constfunc{wxSize}{GetSize}{\void}
145
146Gets the size.
147
df83b840 148
a660d684
KB
149\membersection{wxRect::GetTop}\label{wxrectgettop}
150
151\constfunc{int}{GetTop}{\void}
152
153Gets the top point of the rectangle (the same as \helpref{wxRect::GetY}{wxrectgety}).
154
df83b840 155
a660d684
KB
156\membersection{wxRect::GetWidth}\label{wxrectgetwidth}
157
158\constfunc{int}{GetWidth}{\void}
159
160Gets the width member.
161
df83b840 162
a660d684
KB
163\membersection{wxRect::GetX}\label{wxrectgetx}
164
165\constfunc{int}{GetX}{\void}
166
167Gets the x member.
168
df83b840 169
a660d684
KB
170\membersection{wxRect::GetY}\label{wxrectgety}
171
172\constfunc{int}{GetY}{\void}
173
174Gets the y member.
175
df83b840 176
45816ddd
VZ
177\membersection{wxRect::Inflate}\label{wxrectinflate}
178
179\func{void}{Inflate}{\param{wxCoord }{dx}, \param{wxCoord }{dy}}
180
181\func{void}{Inflate}{\param{wxCoord }{diff}}
182
f4c43a17
VZ
183\constfunc{wxRect}{Inflate}{\param{wxCoord }{dx}, \param{wxCoord }{dy}}
184
45816ddd
VZ
185Increase the rectangle size by {\it dx} in x direction and {\it dy} in y
186direction. Both (or one of) parameters may be negative to decrease the
2edb0bde 187rectangle size.
45816ddd
VZ
188
189The second form uses the same {\it diff} for both {\it dx} and {\it dy}.
190
f4c43a17
VZ
191The first two versions modify the rectangle in place, the last one returns a
192new rectangle leaving this one unchanged.
193
194\wxheading{See also}
195
196\helpref{Deflate}{wxrectdeflate}
197
df83b840 198
c0f62256 199\membersection{wxRect::Inside}\label{wxrectinside}
f4c43a17
VZ
200
201\constfunc{bool}{Inside}{\param{int }{x}, \param{int }{y}}
202
203\constfunc{bool}{Inside}{\param{const wxPoint\& }{pt}}
204
cc81d32f
VS
205Returns {\tt true} if the given point is inside the rectangle (or on its
206boundary) and {\tt false} otherwise.
f4c43a17 207
df83b840 208
c0f62256 209\membersection{wxRect::Intersects}\label{wxrectintersects}
f4c43a17
VZ
210
211\constfunc{bool}{Intersects}{\param{const wxRect\& }{rect}}
212
cc81d32f
VS
213Returns {\tt true} if this rectangle has a non empty intersection with the
214rectangle {\it rect} and {\tt false} otherwise.
f4c43a17 215
df83b840 216
f4c43a17
VZ
217\membersection{wxRect::Offset}\label{wxrectoffset}
218
219\func{void}{Offset}{\param{wxCoord }{dx}, \param{wxCoord }{dy}}
220
221\func{void}{Offset}{\param{const wxPoint\& }{pt}}
222
223Moves the rectangle by the specified offset. If {\it dx} is positive, the
224rectangle is moved to the right, if {\it dy} is positive, it is moved to the
225bottom, otherwise it is moved to the left or top respectively.
226
df83b840 227
a660d684
KB
228\membersection{wxRect::SetHeight}\label{wxrectsetheight}
229
eaaa6a06 230\func{void}{SetHeight}{\param{int}{ height}}
a660d684
KB
231
232Sets the height.
233
df83b840 234
a660d684
KB
235\membersection{wxRect::SetWidth}\label{wxrectsetwidth}
236
eaaa6a06 237\func{void}{SetWidth}{\param{int}{ width}}
a660d684
KB
238
239Sets the width.
240
df83b840 241
a660d684
KB
242\membersection{wxRect::SetX}\label{wxrectsetx}
243
eaaa6a06 244\func{void}{SetX}{\param{int}{ x}}
a660d684
KB
245
246Sets the x position.
247
df83b840 248
a660d684
KB
249\membersection{wxRect::SetY}\label{wxrectsety}
250
eaaa6a06 251\func{void}{SetY}{\param{int}{ y}}
a660d684
KB
252
253Sets the y position.
254
df83b840
VZ
255
256\membersection{wxRect::Union}\label{wxrectunion}
257
258\constfunc{wxRect}{Union}{\param{const wxRect\&}{ rect}}
259
260\func{wxRect\&}{Union}{\param{const wxRect\&}{ rect}}
261
262Modifies the rectangle to contain the bounding box of this rectangle and the
263one passed in as parameter. The const version returns the new rectangle, the
264other one modifies this rectangle in place.
265
266
39275175 267\membersection{wxRect::operator $=$}\label{wxrectassign}
a660d684
KB
268
269\func{void}{operator $=$}{\param{const wxRect\& }{rect}}
270
271Assignment operator.
272
df83b840 273
39275175 274\membersection{wxRect::operator $==$}\label{wxrectequal}
a660d684
KB
275
276\func{bool}{operator $==$}{\param{const wxRect\& }{rect}}
277
278Equality operator.
279
df83b840 280
39275175 281\membersection{wxRect::operator $!=$}\label{wxrectnotequal}
a660d684
KB
282
283\func{bool}{operator $!=$}{\param{const wxRect\& }{rect}}
284
285Inequality operator.
286