.\" This is a wxWidgets manpage page generated from the XML docs .TH wxRect 3wx 2005-02-15 "wxWidgets" "wxWidgets class documentation" .SH NAME wxRect \- A class representing a rectangle .SH DESCRIPTION A class for manipulating rectangles. .SH "PARENTS" .SH "INCLUDE FILES" wx/gdicmn.h .SH MEMBERS .SS wxRect () Default constructor. .SS wxRect (int xint yint widthint height) Creates a wxRect object from x, y, width and height values. .SS wxRect (const wxPoint& topLeftconst wxPoint& bottomRight) Creates a wxRect object from top-left and bottom-right points. .SS wxRect (const wxPoint& posconst wxSize& size) Creates a wxRect object from position and size values. .SS wxRect (const wxSize& size) Creates a wxRect object from size values at the origin. .SS void Deflate (wxCoord dxwxCoord dy) .SS void Deflate (wxCoord diff) .SS wxRect Deflate (wxCoord dxwxCoord dy) Decrease the rectangle size. This method is the opposite from Inflate : Deflate(a, b) is equivalent to Inflate(-a, -b). Please refer to Inflate for full description. .SS int GetBottom () Gets the bottom point of the rectangle. .SS int GetHeight () Gets the height member. .SS int GetLeft () Gets the left point of the rectangle (the same as wxRect::GetX ). .SS wxPoint GetPosition () Gets the position. .SS wxPoint GetTopLeft () Gets the topleft position of the rectangle. (Same as GetPosition). .SS wxPoint GetBottomRight () Gets the bottom right position. Returns the bottom right point inside the rectangle. .SS int GetRight () Gets the right point of the rectangle. .SS wxSize GetSize () Gets the size. .SS int GetTop () Gets the top point of the rectangle (the same as wxRect::GetY ). .SS int GetWidth () Gets the width member. .SS int GetX () Gets the x member. .SS int GetY () Gets the y member. .SS void Inflate (wxCoord dxwxCoord dy) .SS void Inflate (wxCoord diff) .SS wxRect Inflate (wxCoord dxwxCoord dy) Increases the size of the rectangle. The second form uses the same diff for both dx and dy . The first two versions modify the rectangle in place, the last one returns a new rectangle leaving this one unchanged. The left border is moved farther left and the right border is moved farther right by dx . The upper border is moved farther up and the bottom border is moved farther down by dy . (Note the the width and height of the rectangle thus change by 2* dx and 2* dy , respectively.) If one or both of dx and dy are negative, the opposite happens: the rectangle size decreases in the respective direction. Inflating and deflating behaves ``naturally''. Defined more precisely, that means: ``Real'' inflates (that is, dx and/or dy >= 0) are not constrained. Thus inflating a rectangle can cause its upper left corner to move into the negative numbers. (the versions prior to 2.5.4 forced the top left coordinate to not fall below (0, 0), which implied a forced move of the rectangle.) Deflates are clamped to not reduce the width or height of the rectangle below zero. In such cases, the top-left corner is nonetheless handled properly. For example, a rectangle at (10, 10) with size (20, 40) that is inflated by (-15, -15) will become located at (20, 25) at size (0, 10). Finally, observe that the width and height are treated independently. In the above example, the width is reduced by 20, whereas the height is reduced by the full 30 (rather than also stopping at 20, when the width reached zero). .SS bool Inside (int xint y) .SS bool Inside (const wxPoint& pt) Returns true if the given point is inside the rectangle (or on its boundary) and false otherwise. .SS bool Intersects (const wxRect& rect) Returns true if this rectangle has a non empty intersection with the rectangle rect and false otherwise. .SS bool IsEmpty () Returns true if this rectangle has a width or height less than or equal to 0 and false otherwise. .SS void Offset (wxCoord dxwxCoord dy) .SS void Offset (const wxPoint& pt) Moves the rectangle by the specified offset. If dx is positive, the rectangle is moved to the right, if dy is positive, it is moved to the bottom, otherwise it is moved to the left or top respectively. .SS void SetHeight (int height) Sets the height. .SS void SetSize (const wxSize& s) Sets the size. .SS void SetWidth (int width) Sets the width. .SS void SetX (int x) Sets the x position. .SS void SetY (int y) Sets the y position. .SS wxRect Union (const wxRect& rect) .SS wxRect& Union (const wxRect& rect) Modifies the rectangle to contain the bounding box of this rectangle and the one passed in as parameter. The const version returns the new rectangle, the other one modifies this rectangle in place. .SS void operator = (const wxRect& rect) Assignment operator. .SS bool operator == (const wxRect& rect) Equality operator. .SS bool operator != (const wxRect& rect) Inequality operator. .SH "SEE ALSO" wxPoint wxSize .SH "AUTHORS" Documentation content by Julian Smart, Robert Roebling, Vadim Zeitlin, Robin Dunn, et al Conversion to manpage format by Arnout Engelen (http://bzzt.net), bugreports welcome.