]>
Commit | Line | Data |
---|---|---|
a660d684 KB |
1 | \section{\class{wxRect}}\label{wxrect} |
2 | ||
3 | A class for manipulating rectangles. | |
4 | ||
5 | \wxheading{Derived from} | |
6 | ||
9838df2c | 7 | None |
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 | ||
39275175 | 19 | \membersection{wxRect::wxRect}\label{wxrectctor} |
a660d684 KB |
20 | |
21 | \func{}{wxRect}{\void} | |
22 | ||
23 | Default constructor. | |
24 | ||
eaaa6a06 | 25 | \func{}{wxRect}{\param{int}{ x}, \param{int}{ y}, \param{int}{ width}, \param{int}{ height}} |
a660d684 KB |
26 | |
27 | Creates a wxRect object from x, y, width and height values. | |
28 | ||
29 | \func{}{wxRect}{\param{const wxPoint\&}{ topLeft}, \param{const wxPoint\&}{ bottomRight}} | |
30 | ||
31 | Creates a wxRect object from top-left and bottom-right points. | |
32 | ||
33 | \func{}{wxRect}{\param{const wxPoint\&}{ pos}, \param{const wxSize\&}{ size}} | |
34 | ||
35 | Creates a wxRect object from position and size values. | |
36 | ||
39275175 | 37 | \membersection{wxRect::x}\label{wxrectx} |
a660d684 KB |
38 | |
39 | \member{int}{x} | |
40 | ||
f6bcfd97 | 41 | x coordinate of the top-level corner of the rectangle. |
a660d684 | 42 | |
39275175 | 43 | \membersection{wxRect::y}\label{wxrecty} |
a660d684 KB |
44 | |
45 | \member{int}{y} | |
46 | ||
f6bcfd97 | 47 | y coordinate of the top-level corner of the rectangle. |
a660d684 | 48 | |
39275175 | 49 | \membersection{wxRect::width}\label{wxrectwidth} |
a660d684 KB |
50 | |
51 | \member{int}{width} | |
52 | ||
53 | Width member. | |
54 | ||
39275175 | 55 | \membersection{wxRect::height}\label{wxrectheight} |
a660d684 KB |
56 | |
57 | \member{int}{height} | |
58 | ||
59 | Height 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 | ||
69 | Decrease the rectangle size by {\it dx} in x direction and {\it dy} in y | |
70 | direction. Both (or one of) parameters may be negative to increase the | |
71 | rectngle size. This method is the opposite of \helpref{Inflate}{wxrectinflate}. | |
72 | ||
73 | The second form uses the same {\it diff} for both {\it dx} and {\it dy}. | |
74 | ||
75 | The first two versions modify the rectangle in place, the last one returns a | |
76 | new 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 | ||
86 | Gets the bottom point of the rectangle. | |
87 | ||
88 | \membersection{wxRect::GetHeight}\label{wxrectgetheight} | |
89 | ||
90 | \constfunc{int}{GetHeight}{\void} | |
91 | ||
92 | Gets the height member. | |
93 | ||
94 | \membersection{wxRect::GetLeft}\label{wxrectgetleft} | |
95 | ||
96 | \constfunc{int}{GetLeft}{\void} | |
97 | ||
98 | Gets 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 | ||
104 | Gets the position. | |
105 | ||
355a5e2b JS |
106 | \membersection{wxRect::GetTopLeft}\label{wxrectgettopleft} |
107 | ||
108 | \constfunc{wxPoint}{GetTopLeft}{\void} | |
109 | ||
110 | Gets the topleft position of the rectangle. (Same as GetPosition). | |
111 | ||
112 | \membersection{wxRect::GetBottomRight}\label{wxrectgetbottomright} | |
113 | ||
114 | \constfunc{wxPoint}{GetBottomRight}{\void} | |
115 | ||
116 | Gets 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 | ||
122 | Gets the right point of the rectangle. | |
123 | ||
124 | \membersection{wxRect::GetSize}\label{wxrectgetsize} | |
125 | ||
126 | \constfunc{wxSize}{GetSize}{\void} | |
127 | ||
128 | Gets the size. | |
129 | ||
130 | \membersection{wxRect::GetTop}\label{wxrectgettop} | |
131 | ||
132 | \constfunc{int}{GetTop}{\void} | |
133 | ||
134 | Gets 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 | ||
140 | Gets the width member. | |
141 | ||
142 | \membersection{wxRect::GetX}\label{wxrectgetx} | |
143 | ||
144 | \constfunc{int}{GetX}{\void} | |
145 | ||
146 | Gets the x member. | |
147 | ||
148 | \membersection{wxRect::GetY}\label{wxrectgety} | |
149 | ||
150 | \constfunc{int}{GetY}{\void} | |
151 | ||
152 | Gets 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 |
162 | Increase the rectangle size by {\it dx} in x direction and {\it dy} in y |
163 | direction. Both (or one of) parameters may be negative to decrease the | |
2edb0bde | 164 | rectangle size. |
45816ddd VZ |
165 | |
166 | The second form uses the same {\it diff} for both {\it dx} and {\it dy}. | |
167 | ||
f4c43a17 VZ |
168 | The first two versions modify the rectangle in place, the last one returns a |
169 | new 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 |
181 | Returns {\tt true} if the given point is inside the rectangle (or on its |
182 | boundary) 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 |
188 | Returns {\tt true} if this rectangle has a non empty intersection with the |
189 | rectangle {\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 | ||
197 | Moves the rectangle by the specified offset. If {\it dx} is positive, the | |
198 | rectangle is moved to the right, if {\it dy} is positive, it is moved to the | |
199 | bottom, 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 | |
205 | Sets the height. | |
206 | ||
207 | \membersection{wxRect::SetWidth}\label{wxrectsetwidth} | |
208 | ||
eaaa6a06 | 209 | \func{void}{SetWidth}{\param{int}{ width}} |
a660d684 KB |
210 | |
211 | Sets the width. | |
212 | ||
213 | \membersection{wxRect::SetX}\label{wxrectsetx} | |
214 | ||
eaaa6a06 | 215 | \func{void}{SetX}{\param{int}{ x}} |
a660d684 KB |
216 | |
217 | Sets the x position. | |
218 | ||
219 | \membersection{wxRect::SetY}\label{wxrectsety} | |
220 | ||
eaaa6a06 | 221 | \func{void}{SetY}{\param{int}{ y}} |
a660d684 KB |
222 | |
223 | Sets the y position. | |
224 | ||
39275175 | 225 | \membersection{wxRect::operator $=$}\label{wxrectassign} |
a660d684 KB |
226 | |
227 | \func{void}{operator $=$}{\param{const wxRect\& }{rect}} | |
228 | ||
229 | Assignment operator. | |
230 | ||
39275175 | 231 | \membersection{wxRect::operator $==$}\label{wxrectequal} |
a660d684 KB |
232 | |
233 | \func{bool}{operator $==$}{\param{const wxRect\& }{rect}} | |
234 | ||
235 | Equality operator. | |
236 | ||
39275175 | 237 | \membersection{wxRect::operator $!=$}\label{wxrectnotequal} |
a660d684 KB |
238 | |
239 | \func{bool}{operator $!=$}{\param{const wxRect\& }{rect}} | |
240 | ||
241 | Inequality operator. | |
242 |