wxRectA class for manipulating rectangles. Derived from None Include files <wx/gdicmn.h> See also Members
wxRect::wxRect
wxRect::wxRectwxRect() Default constructor. wxRect(int x, int y, int width, int height) Creates a wxRect object from x, y, width and height values. wxRect(const wxPoint& topLeft, const wxPoint& bottomRight) Creates a wxRect object from top-left and bottom-right points. wxRect(const wxPoint& pos, const wxSize& size) Creates a wxRect object from position and size values. wxRect(const wxSize& size) Creates a wxRect object from size values at the origin.
wxRect::xint x x coordinate of the top-level corner of the rectangle.
wxRect::yint y y coordinate of the top-level corner of the rectangle.
wxRect::widthint width Width member.
wxRect::heightint height Height member.
wxRect::CentreInwxRect CentreIn(const wxRect& r, int dir = wxBOTH) const wxRect CenterIn(const wxRect& r, int dir = wxBOTH) const Returns the rectangle having the same size as this one but centered relatively to the given rectangle r. By default, rectangle is centred in both directions but if dir includes only wxVERTICAL or only wxHORIZONTAL flag, then it is only centered in this direction while the other component of its position remains unchanged.
wxRect::Containsbool Contains(int x, int y) const bool Contains(const wxPoint& pt) const Returns true if the given point is inside the rectangle (or on its boundary) and false otherwise. bool Contains(const wxRect& rect) const Returns true if the given rectangle is completely inside this rectangle (or touches its boundary) and false otherwise.
wxRect::Deflatevoid Deflate(wxCoord dx, wxCoord dy) void Deflate(const wxSize& diff) void Deflate(wxCoord diff) wxRect Deflate(wxCoord dx, wxCoord dy) const 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. See also
wxRect::GetBottomint GetBottom() const Gets the bottom point of the rectangle.
wxRect::GetHeightint GetHeight() const Gets the height member.
wxRect::GetLeftint GetLeft() const Gets the left point of the rectangle (the same as wxRect::GetX).
wxRect::GetPositionwxPoint GetPosition() const Gets the position.
wxRect::GetTopLeftwxPoint GetTopLeft() const Gets the position of the top left corner of the rectangle, same as GetPosition.
wxRect::GetTopRightwxPoint GetTopRight() const Gets the position of the top right corner.
wxRect::GetBottomLeftwxPoint GetBottomLeft() const Gets the position of the bottom left corner.
wxRect::GetBottomRightwxPoint GetBottomRight() const Gets the position of the bottom right corner.
wxRect::GetRightint GetRight() const Gets the right point of the rectangle.
wxRect::GetSizewxSize GetSize() const Gets the size. See also
wxRect::GetTopint GetTop() const Gets the top point of the rectangle (the same as wxRect::GetY).
wxRect::GetWidthint GetWidth() const Gets the width member.
wxRect::GetXint GetX() const Gets the x member.
wxRect::GetYint GetY() const Gets the y member.
wxRect::Inflatevoid Inflate(wxCoord dx, wxCoord dy) void Inflate(const wxSize& diff) void Inflate(wxCoord diff) wxRect Inflate(wxCoord dx, wxCoord dy) const 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:
See also
wxRect::IntersectwxRect Intersect(const wxRect& rect) const wxRect& Intersect(const wxRect& rect) Modifies the rectangle to contain the overlapping 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.
wxRect::Intersectsbool Intersects(const wxRect& rect) const Returns true if this rectangle has a non-empty intersection with the rectangle rect and false otherwise.
wxRect::IsEmptybool IsEmpty() const Returns true if this rectangle has a width or height less than or equal to 0 and false otherwise.
wxRect::Offsetvoid Offset(wxCoord dx, wxCoord dy) 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.
wxRect::SetHeightvoid SetHeight(int height) Sets the height.
wxRect::SetSizevoid SetSize(const wxSize& s) Sets the size. See also
wxRect::SetWidthvoid SetWidth(int width) Sets the width.
wxRect::SetXvoid SetX(int x) Sets the x position.
wxRect::SetYvoid SetY(int y) Sets the y position.
wxRect::UnionwxRect Union(const wxRect& rect) const 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.
wxRect::operator =void operator =(const wxRect& rect) Assignment operator.
wxRect::operator ==bool operator ==(const wxRect& rect) Equality operator.
wxRect::operator !=bool operator !=(const wxRect& rect) Inequality operator.
|