X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/492e2a5b07efb80cc645c5bab7d93adbccb8a503..3ef37e7f4ec5f0688a4fb47e530ca2d30a6bb3ed:/include/wx/gdicmn.h?ds=inline diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index a03e1d77fe..7be6d7bcb4 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -273,6 +273,12 @@ public: wxPoint& operator+=(const wxPoint& p) { x += p.x; y += p.y; return *this; } wxPoint& operator-=(const wxPoint& p) { x -= p.x; y -= p.y; return *this; } + + wxPoint& operator+=(const wxSize& s) { x += s.GetWidth(); y += s.GetHeight(); return *this; } + wxPoint& operator-=(const wxSize& s) { x -= s.GetWidth(); y -= s.GetHeight(); return *this; } + + wxPoint operator+(const wxSize& s) const { return wxPoint(x + s.GetWidth(), y + s.GetHeight()); } + wxPoint operator-(const wxSize& s) const { return wxPoint(x - s.GetWidth(), y - s.GetHeight()); } }; // --------------------------------------------------------------------------- @@ -311,6 +317,16 @@ public: wxSize GetSize() const { return wxSize(width, height); } void SetSize( const wxSize &s ) { width = s.GetWidth(); height = s.GetHeight(); } + 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; }