X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d02bc4c8d40b855c05a4c2103a584b2ecdc7788c..5c9f6bf455c4a27161fce95688eeffe4e958e696:/include/wx/gdicmn.h?ds=inline diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index 7be6d7bcb4..85d5ad6150 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -116,7 +116,7 @@ enum wxStockCursor 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 @@ -214,7 +214,7 @@ public: // 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) @@ -228,6 +228,18 @@ public: 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; }