wxCURSOR_DEFAULT, // standard X11 cursor
#endif
#ifdef __WXMAC__
- wxCURSOR_COPY_ARROW , // MacOS Theme Plus arrow
+ wxCURSOR_COPY_ARROW , // MacOS Theme Plus arrow
#endif
#ifdef __X__
// Not yet implemented for Windows
// FIXME are these really useful? If they're, we should have += &c as well
wxSize operator+(const wxSize& sz) { return wxSize(x + sz.x, y + sz.y); }
wxSize operator-(const wxSize& sz) { return wxSize(x - sz.x, y - sz.y); }
-
+
void IncTo(const wxSize& sz)
{ if ( sz.x > x ) x = sz.x; if ( sz.y > y ) y = sz.y; }
void DecTo(const wxSize& sz)
int GetWidth() const { return x; }
int GetHeight() const { return y; }
+ bool IsFullySpecified() const { return x != -1 && y != -1; }
+
+ // combine this size with the other one replacing the default (i.e. equal
+ // to -1) components of this object with those of the other
+ void SetDefaults(const wxSize& size)
+ {
+ if ( x == -1 )
+ x = size.x;
+ if ( y == -1 )
+ y = size.y;
+ }
+
// compatibility
int GetX() const { return x; }
int GetY() const { return y; }
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()); }
};
// ---------------------------------------------------------------------------
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; }