+ void SetSize( const wxSize &s ) { width = s.GetWidth(); height = s.GetHeight(); }
+
+ bool IsEmpty() const { return (width <= 0) || (height <= 0); }
+
+ wxPoint GetTopLeft() const { return GetPosition(); }
+ wxPoint GetLeftTop() const { return GetTopLeft(); }
+ void SetTopLeft(const wxPoint &p) { SetPosition(p); }
+ void SetLeftTop(const wxPoint &p) { SetTopLeft(p); }
+
+ wxPoint GetBottomRight() const { return wxPoint(GetRight(), GetBottom()); }
+ wxPoint GetRightBottom() const { return GetBottomRight(); }
+ void SetBottomRight(const wxPoint &p) { SetRight(p.x); SetBottom(p.y); }
+ void SetRightBottom(const wxPoint &p) { SetBottomRight(p); }
+
+ int GetLeft() const { return x; }
+ int GetTop() const { return y; }
+ int GetBottom() const { return y + height - 1; }
+ int GetRight() const { return x + width - 1; }
+
+ void SetLeft(int left) { x = left; }
+ void SetRight(int right) { width = right - x + 1; }
+ void SetTop(int top) { y = top; }
+ void SetBottom(int bottom) { height = bottom - y + 1; }
+
+ // operations with rect
+ wxRect& Inflate(wxCoord dx, wxCoord dy);
+ wxRect& Inflate(wxCoord d) { return Inflate(d, d); }
+ wxRect Inflate(wxCoord dx, wxCoord dy) const
+ {
+ wxRect r = *this;
+ r.Inflate(dx, dy);
+ return r;
+ }
+
+ wxRect& Deflate(wxCoord dx, wxCoord dy) { return Inflate(-dx, -dy); }
+ wxRect& Deflate(wxCoord d) { return Inflate(-d); }
+ wxRect Deflate(wxCoord dx, wxCoord dy) const
+ {
+ wxRect r = *this;
+ r.Deflate(dx, dy);
+ return r;
+ }
+
+ void Offset(wxCoord dx, wxCoord dy) { x += dx; y += dy; }
+ void Offset(const wxPoint& pt) { Offset(pt.x, pt.y); }
+
+ wxRect& Intersect(const wxRect& rect);
+ wxRect Intersect(const wxRect& rect) const
+ {
+ wxRect r = *this;
+ r.Intersect(rect);
+ return r;
+ }
+
+ wxRect& Union(const wxRect& rect);
+ wxRect Union(const wxRect& rect) const
+ {
+ wxRect r = *this;
+ r.Union(rect);
+ return r;
+ }
+
+ // compare rectangles
+ bool operator==(const wxRect& rect) const;
+ bool operator!=(const wxRect& rect) const { return !(*this == rect); }