1 \section{\class{wxRect
}}\label{wxrect
}
3 A class for manipulating rectangles.
5 \wxheading{Derived from
}
9 \wxheading{Include files
}
15 \helpref{wxPoint
}{wxpoint
},
\helpref{wxSize
}{wxsize
}
17 \latexignore{\rtfignore{\wxheading{Members
}}}
20 \membersection{wxRect::wxRect
}\label{wxrectctor
}
22 \func{}{wxRect
}{\void}
26 \func{}{wxRect
}{\param{int
}{ x
},
\param{int
}{ y
},
\param{int
}{ width
},
\param{int
}{ height
}}
28 Creates a wxRect object from x, y, width and height values.
30 \func{}{wxRect
}{\param{const wxPoint\&
}{ topLeft
},
\param{const wxPoint\&
}{ bottomRight
}}
32 Creates a wxRect object from top-left and bottom-right points.
34 \func{}{wxRect
}{\param{const wxPoint\&
}{ pos
},
\param{const wxSize\&
}{ size
}}
36 Creates a wxRect object from position and size values.
38 \func{}{wxRect
}{\param{const wxSize\&
}{ size
}}
40 Creates a wxRect object from size values at the origin.
43 \membersection{wxRect::x
}\label{wxrectx
}
47 x coordinate of the top-level corner of the rectangle.
50 \membersection{wxRect::y
}\label{wxrecty
}
54 y coordinate of the top-level corner of the rectangle.
57 \membersection{wxRect::width
}\label{wxrectwidth
}
64 \membersection{wxRect::height
}\label{wxrectheight
}
71 \membersection{wxRect::Deflate
}\label{wxrectdeflate
}
73 \func{void
}{Deflate
}{\param{wxCoord
}{dx
},
\param{wxCoord
}{dy
}}
75 \func{void
}{Deflate
}{\param{wxCoord
}{diff
}}
77 \constfunc{wxRect
}{Deflate
}{\param{wxCoord
}{dx
},
\param{wxCoord
}{dy
}}
79 Decrease the rectangle size by
{\it dx
} in x direction and
{\it dy
} in y
80 direction. Both (or one of) parameters may be negative to increase the
81 rectngle size. This method is the opposite of
\helpref{Inflate
}{wxrectinflate
}.
83 The second form uses the same
{\it diff
} for both
{\it dx
} and
{\it dy
}.
85 The first two versions modify the rectangle in place, the last one returns a
86 new rectangle leaving this one unchanged.
90 \helpref{Inflate
}{wxrectinflate
}
93 \membersection{wxRect::GetBottom
}\label{wxrectgetbottom
}
95 \constfunc{int
}{GetBottom
}{\void}
97 Gets the bottom point of the rectangle.
100 \membersection{wxRect::GetHeight
}\label{wxrectgetheight
}
102 \constfunc{int
}{GetHeight
}{\void}
104 Gets the height member.
107 \membersection{wxRect::GetLeft
}\label{wxrectgetleft
}
109 \constfunc{int
}{GetLeft
}{\void}
111 Gets the left point of the rectangle (the same as
\helpref{wxRect::GetX
}{wxrectgetx
}).
114 \membersection{wxRect::GetPosition
}\label{wxrectgetposition
}
116 \constfunc{wxPoint
}{GetPosition
}{\void}
121 \membersection{wxRect::GetTopLeft
}\label{wxrectgettopleft
}
123 \constfunc{wxPoint
}{GetTopLeft
}{\void}
125 Gets the topleft position of the rectangle. (Same as GetPosition).
128 \membersection{wxRect::GetBottomRight
}\label{wxrectgetbottomright
}
130 \constfunc{wxPoint
}{GetBottomRight
}{\void}
132 Gets the the bottom right position. Returns the bottom right point inside the rectangle.
135 \membersection{wxRect::GetRight
}\label{wxrectgetright
}
137 \constfunc{int
}{GetRight
}{\void}
139 Gets the right point of the rectangle.
142 \membersection{wxRect::GetSize
}\label{wxrectgetsize
}
144 \constfunc{wxSize
}{GetSize
}{\void}
149 \membersection{wxRect::GetTop
}\label{wxrectgettop
}
151 \constfunc{int
}{GetTop
}{\void}
153 Gets the top point of the rectangle (the same as
\helpref{wxRect::GetY
}{wxrectgety
}).
156 \membersection{wxRect::GetWidth
}\label{wxrectgetwidth
}
158 \constfunc{int
}{GetWidth
}{\void}
160 Gets the width member.
163 \membersection{wxRect::GetX
}\label{wxrectgetx
}
165 \constfunc{int
}{GetX
}{\void}
170 \membersection{wxRect::GetY
}\label{wxrectgety
}
172 \constfunc{int
}{GetY
}{\void}
177 \membersection{wxRect::Inflate
}\label{wxrectinflate
}
179 \func{void
}{Inflate
}{\param{wxCoord
}{dx
},
\param{wxCoord
}{dy
}}
181 \func{void
}{Inflate
}{\param{wxCoord
}{diff
}}
183 \constfunc{wxRect
}{Inflate
}{\param{wxCoord
}{dx
},
\param{wxCoord
}{dy
}}
185 Increase the rectangle size by
{\it dx
} in x direction and
{\it dy
} in y
186 direction. Both (or one of) parameters may be negative to decrease the
189 The second form uses the same
{\it diff
} for both
{\it dx
} and
{\it dy
}.
191 The first two versions modify the rectangle in place, the last one returns a
192 new rectangle leaving this one unchanged.
196 \helpref{Deflate
}{wxrectdeflate
}
199 \membersection{wxRect::Inside
}\label{wxrectinside
}
201 \constfunc{bool
}{Inside
}{\param{int
}{x
},
\param{int
}{y
}}
203 \constfunc{bool
}{Inside
}{\param{const wxPoint\&
}{pt
}}
205 Returns
{\tt true
} if the given point is inside the rectangle (or on its
206 boundary) and
{\tt false
} otherwise.
209 \membersection{wxRect::Intersects
}\label{wxrectintersects
}
211 \constfunc{bool
}{Intersects
}{\param{const wxRect\&
}{rect
}}
213 Returns
{\tt true
} if this rectangle has a non empty intersection with the
214 rectangle
{\it rect
} and
{\tt false
} otherwise.
217 \membersection{wxRect::Offset
}\label{wxrectoffset
}
219 \func{void
}{Offset
}{\param{wxCoord
}{dx
},
\param{wxCoord
}{dy
}}
221 \func{void
}{Offset
}{\param{const wxPoint\&
}{pt
}}
223 Moves the rectangle by the specified offset. If
{\it dx
} is positive, the
224 rectangle is moved to the right, if
{\it dy
} is positive, it is moved to the
225 bottom, otherwise it is moved to the left or top respectively.
228 \membersection{wxRect::SetHeight
}\label{wxrectsetheight
}
230 \func{void
}{SetHeight
}{\param{int
}{ height
}}
235 \membersection{wxRect::SetWidth
}\label{wxrectsetwidth
}
237 \func{void
}{SetWidth
}{\param{int
}{ width
}}
242 \membersection{wxRect::SetX
}\label{wxrectsetx
}
244 \func{void
}{SetX
}{\param{int
}{ x
}}
249 \membersection{wxRect::SetY
}\label{wxrectsety
}
251 \func{void
}{SetY
}{\param{int
}{ y
}}
256 \membersection{wxRect::Union
}\label{wxrectunion
}
258 \constfunc{wxRect
}{Union
}{\param{const wxRect\&
}{ rect
}}
260 \func{wxRect\&
}{Union
}{\param{const wxRect\&
}{ rect
}}
262 Modifies the rectangle to contain the bounding box of this rectangle and the
263 one passed in as parameter. The const version returns the new rectangle, the
264 other one modifies this rectangle in place.
267 \membersection{wxRect::operator $=$
}\label{wxrectassign
}
269 \func{void
}{operator $=$
}{\param{const wxRect\&
}{rect
}}
274 \membersection{wxRect::operator $==$
}\label{wxrectequal
}
276 \func{bool
}{operator $==$
}{\param{const wxRect\&
}{rect
}}
281 \membersection{wxRect::operator $!=$
}\label{wxrectnotequal
}
283 \func{bool
}{operator $!=$
}{\param{const wxRect\&
}{rect
}}