X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d02bc4c8d40b855c05a4c2103a584b2ecdc7788c..eedc82f4e96c7f8f0b24addbfd6b4429c9587631:/include/wx/gdicmn.h diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index 7be6d7bcb4..c3fe25e346 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -24,6 +24,7 @@ #include "wx/list.h" #include "wx/string.h" #include "wx/fontenc.h" +#include "wx/hashmap.h" // --------------------------------------------------------------------------- // forward declarations @@ -116,7 +117,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 +215,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 +229,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; } @@ -427,7 +440,7 @@ public: wxFontEncoding encoding = wxFONTENCODING_DEFAULT); }; -class WXDLLEXPORT wxStringToColourHashMap; +WX_DECLARE_STRING_HASH_MAP( wxColour *, wxStringToColourHashMap ); class WXDLLEXPORT wxColourDatabase {