]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/rect.tex
added operator==() and !=() for wxDateSpan
[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
106\membersection{wxRect::GetRight}\label{wxrectgetright}
107
108\constfunc{int}{GetRight}{\void}
109
110Gets the right point of the rectangle.
111
112\membersection{wxRect::GetSize}\label{wxrectgetsize}
113
114\constfunc{wxSize}{GetSize}{\void}
115
116Gets the size.
117
118\membersection{wxRect::GetTop}\label{wxrectgettop}
119
120\constfunc{int}{GetTop}{\void}
121
122Gets the top point of the rectangle (the same as \helpref{wxRect::GetY}{wxrectgety}).
123
124\membersection{wxRect::GetWidth}\label{wxrectgetwidth}
125
126\constfunc{int}{GetWidth}{\void}
127
128Gets the width member.
129
130\membersection{wxRect::GetX}\label{wxrectgetx}
131
132\constfunc{int}{GetX}{\void}
133
134Gets the x member.
135
136\membersection{wxRect::GetY}\label{wxrectgety}
137
138\constfunc{int}{GetY}{\void}
139
140Gets the y member.
141
45816ddd
VZ
142\membersection{wxRect::Inflate}\label{wxrectinflate}
143
144\func{void}{Inflate}{\param{wxCoord }{dx}, \param{wxCoord }{dy}}
145
146\func{void}{Inflate}{\param{wxCoord }{diff}}
147
f4c43a17
VZ
148\constfunc{wxRect}{Inflate}{\param{wxCoord }{dx}, \param{wxCoord }{dy}}
149
45816ddd
VZ
150Increase the rectangle size by {\it dx} in x direction and {\it dy} in y
151direction. Both (or one of) parameters may be negative to decrease the
2edb0bde 152rectangle size.
45816ddd
VZ
153
154The second form uses the same {\it diff} for both {\it dx} and {\it dy}.
155
f4c43a17
VZ
156The first two versions modify the rectangle in place, the last one returns a
157new rectangle leaving this one unchanged.
158
159\wxheading{See also}
160
161\helpref{Deflate}{wxrectdeflate}
162
163\membersection{wxRect:Inside}\label{wxrectinside}
164
165\constfunc{bool}{Inside}{\param{int }{x}, \param{int }{y}}
166
167\constfunc{bool}{Inside}{\param{const wxPoint\& }{pt}}
168
169Returns {\tt TRUE} if the given point is inside the rectangle (or on its
170boundary) and {\tt FALSE} otherwise.
171
172\membersection{wxRect:Intersects}\label{wxrectintersects}
173
174\constfunc{bool}{Intersects}{\param{const wxRect\& }{rect}}
175
176Returns {\tt TRUE} if this rectangle has a non empty intersection with the
177rectangle {\it rect} and {\tt FALSE} otherwise.
178
179\membersection{wxRect::Offset}\label{wxrectoffset}
180
181\func{void}{Offset}{\param{wxCoord }{dx}, \param{wxCoord }{dy}}
182
183\func{void}{Offset}{\param{const wxPoint\& }{pt}}
184
185Moves the rectangle by the specified offset. If {\it dx} is positive, the
186rectangle is moved to the right, if {\it dy} is positive, it is moved to the
187bottom, otherwise it is moved to the left or top respectively.
188
a660d684
KB
189\membersection{wxRect::SetHeight}\label{wxrectsetheight}
190
eaaa6a06 191\func{void}{SetHeight}{\param{int}{ height}}
a660d684
KB
192
193Sets the height.
194
195\membersection{wxRect::SetWidth}\label{wxrectsetwidth}
196
eaaa6a06 197\func{void}{SetWidth}{\param{int}{ width}}
a660d684
KB
198
199Sets the width.
200
201\membersection{wxRect::SetX}\label{wxrectsetx}
202
eaaa6a06 203\func{void}{SetX}{\param{int}{ x}}
a660d684
KB
204
205Sets the x position.
206
207\membersection{wxRect::SetY}\label{wxrectsety}
208
eaaa6a06 209\func{void}{SetY}{\param{int}{ y}}
a660d684
KB
210
211Sets the y position.
212
213\membersection{wxRect::operator $=$}
214
215\func{void}{operator $=$}{\param{const wxRect\& }{rect}}
216
217Assignment operator.
218
219\membersection{wxRect::operator $==$}
220
221\func{bool}{operator $==$}{\param{const wxRect\& }{rect}}
222
223Equality operator.
224
225\membersection{wxRect::operator $!=$}
226
227\func{bool}{operator $!=$}{\param{const wxRect\& }{rect}}
228
229Inequality operator.
230