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::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.
|