X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c50f92d08cc3633f8127931e7cf5d362ab8ac392..c077ee943391930e0a7550f7ce810cb72a6d5820:/include/wx/gdicmn.h diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index 9002d14e11..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; } @@ -426,9 +442,8 @@ public: // add a new colour to the database void AddColour(const wxString& name, const wxColour& colour); - // deprecated, use Find()/Add() instead - wxColour *FindColour(const wxString& name); - void AddColour(const wxString& name, wxColour *colour); + // deprecated, use Find() instead + wxDEPRECATED( wxColour *FindColour(const wxString& name) ); #ifdef __WXPM__