Increase interoperability between wxPoint and wxRealPoint introducing constructors which convert between the two classes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64539 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2010-06-09 18:03:27 +00:00
parent 6f32f3cea2
commit a5664fd6ef
3 changed files with 64 additions and 0 deletions

View File

@@ -395,6 +395,16 @@ public:
wxRealPoint() : x(0.0), y(0.0) { }
wxRealPoint(double xx, double yy) : x(xx), y(yy) { }
wxRealPoint(const wxPoint& pt);
// no copy ctor or assignment operator - the defaults are ok
//assignment operators
wxRealPoint& operator+=(const wxRealPoint& p) { x += p.x; y += p.y; return *this; }
wxRealPoint& operator-=(const wxRealPoint& p) { x -= p.x; y -= p.y; return *this; }
wxRealPoint& operator+=(const wxSize& s) { x += s.GetWidth(); y += s.GetHeight(); return *this; }
wxRealPoint& operator-=(const wxSize& s) { x -= s.GetWidth(); y -= s.GetHeight(); return *this; }
};
@@ -502,6 +512,7 @@ public:
wxPoint() : x(0), y(0) { }
wxPoint(int xx, int yy) : x(xx), y(yy) { }
wxPoint(const wxRealPoint& pt) : x(pt.x), y(pt.y) { }
// no copy ctor or assignment operator - the defaults are ok