]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/rect.tex
First step in background erase optimization
[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
19\membersection{wxRect::wxRect}
20
21\func{}{wxRect}{\void}
22
23Default constructor.
24
eaaa6a06 25\func{}{wxRect}{\param{int}{ x}, \param{int}{ y}, \param{int}{ width}, \param{int}{ height}}
a660d684
KB
26
27Creates a wxRect object from x, y, width and height values.
28
29\func{}{wxRect}{\param{const wxPoint\&}{ topLeft}, \param{const wxPoint\&}{ bottomRight}}
30
31Creates a wxRect object from top-left and bottom-right points.
32
33\func{}{wxRect}{\param{const wxPoint\&}{ pos}, \param{const wxSize\&}{ size}}
34
35Creates a wxRect object from position and size values.
36
37\membersection{wxRect::x}
38
39\member{int}{x}
40
f6bcfd97 41x coordinate of the top-level corner of the rectangle.
a660d684
KB
42
43\membersection{wxRect::y}
44
45\member{int}{y}
46
f6bcfd97 47y coordinate of the top-level corner of the rectangle.
a660d684
KB
48
49\membersection{wxRect::width}
50
51\member{int}{width}
52
53Width member.
54
55\membersection{wxRect::height}
56
57\member{int}{height}
58
59Height member.
60
f4c43a17
VZ
61\membersection{wxRect::Deflate}\label{wxrectdeflate}
62
63\func{void}{Deflate}{\param{wxCoord }{dx}, \param{wxCoord }{dy}}
64
65\func{void}{Deflate}{\param{wxCoord }{diff}}
66
67\constfunc{wxRect}{Deflate}{\param{wxCoord }{dx}, \param{wxCoord }{dy}}
68
69Decrease the rectangle size by {\it dx} in x direction and {\it dy} in y
70direction. Both (or one of) parameters may be negative to increase the
71rectngle size. This method is the opposite of \helpref{Inflate}{wxrectinflate}.
72
73The second form uses the same {\it diff} for both {\it dx} and {\it dy}.
74
75The first two versions modify the rectangle in place, the last one returns a
76new rectangle leaving this one unchanged.
77
78\wxheading{See also}
79
80\helpref{Inflate}{wxrectinflate}
81
a660d684
KB
82\membersection{wxRect::GetBottom}\label{wxrectgetbottom}
83
84\constfunc{int}{GetBottom}{\void}
85
86Gets the bottom point of the rectangle.
87
88\membersection{wxRect::GetHeight}\label{wxrectgetheight}
89
90\constfunc{int}{GetHeight}{\void}
91
92Gets the height member.
93
94\membersection{wxRect::GetLeft}\label{wxrectgetleft}
95
96\constfunc{int}{GetLeft}{\void}
97
98Gets the left point of the rectangle (the same as \helpref{wxRect::GetX}{wxrectgetx}).
99
100\membersection{wxRect::GetPosition}\label{wxrectgetposition}
101
102\constfunc{wxPoint}{GetPosition}{\void}
103
104Gets the position.
105
355a5e2b
JS
106\membersection{wxRect::GetTopLeft}\label{wxrectgettopleft}
107
108\constfunc{wxPoint}{GetTopLeft}{\void}
109
110Gets the topleft position of the rectangle. (Same as GetPosition).
111
112\membersection{wxRect::GetBottomRight}\label{wxrectgetbottomright}
113
114\constfunc{wxPoint}{GetBottomRight}{\void}
115
116Gets the the bottom right position. Returns the bottom right point inside the rectangle.
117
a660d684
KB
118\membersection{wxRect::GetRight}\label{wxrectgetright}
119
120\constfunc{int}{GetRight}{\void}
121
122Gets the right point of the rectangle.
123
124\membersection{wxRect::GetSize}\label{wxrectgetsize}
125
126\constfunc{wxSize}{GetSize}{\void}
127
128Gets the size.
129
130\membersection{wxRect::GetTop}\label{wxrectgettop}
131
132\constfunc{int}{GetTop}{\void}
133
134Gets the top point of the rectangle (the same as \helpref{wxRect::GetY}{wxrectgety}).
135
136\membersection{wxRect::GetWidth}\label{wxrectgetwidth}
137
138\constfunc{int}{GetWidth}{\void}
139
140Gets the width member.
141
142\membersection{wxRect::GetX}\label{wxrectgetx}
143
144\constfunc{int}{GetX}{\void}
145
146Gets the x member.
147
148\membersection{wxRect::GetY}\label{wxrectgety}
149
150\constfunc{int}{GetY}{\void}
151
152Gets the y member.
153
45816ddd
VZ
154\membersection{wxRect::Inflate}\label{wxrectinflate}
155
156\func{void}{Inflate}{\param{wxCoord }{dx}, \param{wxCoord }{dy}}
157
158\func{void}{Inflate}{\param{wxCoord }{diff}}
159
f4c43a17
VZ
160\constfunc{wxRect}{Inflate}{\param{wxCoord }{dx}, \param{wxCoord }{dy}}
161
45816ddd
VZ
162Increase the rectangle size by {\it dx} in x direction and {\it dy} in y
163direction. Both (or one of) parameters may be negative to decrease the
2edb0bde 164rectangle size.
45816ddd
VZ
165
166The second form uses the same {\it diff} for both {\it dx} and {\it dy}.
167
f4c43a17
VZ
168The first two versions modify the rectangle in place, the last one returns a
169new rectangle leaving this one unchanged.
170
171\wxheading{See also}
172
173\helpref{Deflate}{wxrectdeflate}
174
175\membersection{wxRect:Inside}\label{wxrectinside}
176
177\constfunc{bool}{Inside}{\param{int }{x}, \param{int }{y}}
178
179\constfunc{bool}{Inside}{\param{const wxPoint\& }{pt}}
180
cc81d32f
VS
181Returns {\tt true} if the given point is inside the rectangle (or on its
182boundary) and {\tt false} otherwise.
f4c43a17
VZ
183
184\membersection{wxRect:Intersects}\label{wxrectintersects}
185
186\constfunc{bool}{Intersects}{\param{const wxRect\& }{rect}}
187
cc81d32f
VS
188Returns {\tt true} if this rectangle has a non empty intersection with the
189rectangle {\it rect} and {\tt false} otherwise.
f4c43a17
VZ
190
191\membersection{wxRect::Offset}\label{wxrectoffset}
192
193\func{void}{Offset}{\param{wxCoord }{dx}, \param{wxCoord }{dy}}
194
195\func{void}{Offset}{\param{const wxPoint\& }{pt}}
196
197Moves the rectangle by the specified offset. If {\it dx} is positive, the
198rectangle is moved to the right, if {\it dy} is positive, it is moved to the
199bottom, otherwise it is moved to the left or top respectively.
200
a660d684
KB
201\membersection{wxRect::SetHeight}\label{wxrectsetheight}
202
eaaa6a06 203\func{void}{SetHeight}{\param{int}{ height}}
a660d684
KB
204
205Sets the height.
206
207\membersection{wxRect::SetWidth}\label{wxrectsetwidth}
208
eaaa6a06 209\func{void}{SetWidth}{\param{int}{ width}}
a660d684
KB
210
211Sets the width.
212
213\membersection{wxRect::SetX}\label{wxrectsetx}
214
eaaa6a06 215\func{void}{SetX}{\param{int}{ x}}
a660d684
KB
216
217Sets the x position.
218
219\membersection{wxRect::SetY}\label{wxrectsety}
220
eaaa6a06 221\func{void}{SetY}{\param{int}{ y}}
a660d684
KB
222
223Sets the y position.
224
225\membersection{wxRect::operator $=$}
226
227\func{void}{operator $=$}{\param{const wxRect\& }{rect}}
228
229Assignment operator.
230
231\membersection{wxRect::operator $==$}
232
233\func{bool}{operator $==$}{\param{const wxRect\& }{rect}}
234
235Equality operator.
236
237\membersection{wxRect::operator $!=$}
238
239\func{bool}{operator $!=$}{\param{const wxRect\& }{rect}}
240
241Inequality operator.
242