]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/cocoa/colour.h
corrected the direction of comparisons between wxString and char/wxChar strings
[wxWidgets.git] / include / wx / cocoa / colour.h
index f0088f694c6128760d37547ce3897249c3852cd5..c1bbc340ed4e56d5b71ac746414576d93017e369 100644 (file)
@@ -27,7 +27,16 @@ 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 wxChar *colourName) { Init(); Set(colourName); }
 
     // initialization using existing NSColor
     wxColour( WX_NSColor aColor );
@@ -40,7 +49,8 @@ public:
     virtual ~wxColour();
 
     // accessors
-    bool Ok() const { return m_cocoaNSColor; }
+    bool Ok() const { return IsOk(); }
+    bool IsOk() const { return m_cocoaNSColor; }
     WX_NSColor GetNSColor() { return m_cocoaNSColor; }
 
     unsigned char Red() const { return m_red; }
@@ -83,10 +93,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;