X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7106497983220393044f3e74d6eccd9e8ee7b576..736fe67c66e0f5a552f3b45e13d288f5c650c46e:/include/wx/cocoa/colour.h diff --git a/include/wx/cocoa/colour.h b/include/wx/cocoa/colour.h index f0088f694c..dbdc52ae62 100644 --- a/include/wx/cocoa/colour.h +++ b/include/wx/cocoa/colour.h @@ -27,7 +27,17 @@ public: // default wxColour() { Init(); } - DEFINE_STD_WXCOLOUR_CONSTRUCTORS + + // the other standard ones: notice that we can't use + // DEFINE_STD_WXCOLOUR_CONSTRUCTORS here because we need to call Init() to + // initialize m_cocoaNSColor and the macro doesn't do it + wxColour( ChannelType red, ChannelType green, ChannelType blue, + ChannelType alpha = wxALPHA_OPAQUE ) + { Init(); Set(red, green, blue, alpha); } + wxColour(unsigned long colRGB) { Init(); Set(colRGB); } + wxColour(const wxString& colourName) { Init(); Set(colourName); } + wxColour(const char *colourName) { Init(); Set(colourName); } + wxColour(const wchar_t *colourName) { Init(); Set(colourName); } // initialization using existing NSColor wxColour( WX_NSColor aColor ); @@ -40,7 +50,7 @@ public: virtual ~wxColour(); // accessors - bool Ok() const { return m_cocoaNSColor; } + bool IsOk() const { return m_cocoaNSColor; } WX_NSColor GetNSColor() { return m_cocoaNSColor; } unsigned char Red() const { return m_red; } @@ -70,9 +80,6 @@ public: unsigned char alpha = wxALPHA_OPAQUE) { wxColourBase::Set(red, green, blue, alpha); } - bool Set(const wxChar *str) - { return wxColourBase::Set(str); } - bool Set(const wxString &str) { return wxColourBase::Set(str); } @@ -83,10 +90,8 @@ protected: // puts the object in an invalid, uninitialized state void Init(); - virtual void InitWith(unsigned char red, - unsigned char green, - unsigned char blue, - unsigned char alpha); + virtual void + InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a); private: WX_NSColor m_cocoaNSColor;