]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/colourcmn.cpp
Applied #15375 to stop event-sending in generic wxSpinCtrl ctor (eco)
[wxWidgets.git] / src / common / colourcmn.cpp
index 7bbb17260f065920d929cc56318dc9769106b15e..12b5f2007cf2e72e604cd1946d4a43c89c81bf18 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Francesco Montorsi
 // Modified by:
 // Created:     20/4/2006
-// RCS-ID:      $Id$
 // Copyright:   (c) Francesco Montorsi
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -177,13 +176,13 @@ bool wxColourBase::FromString(const wxString& str)
         // because this place can be called from constructor
         // and 'this' could not be available yet
         wxColour clr = wxTheColourDatabase->Find(str);
-        if (clr.Ok())
+        if (clr.IsOk())
             Set((unsigned char)clr.Red(),
                 (unsigned char)clr.Green(),
                 (unsigned char)clr.Blue());
     }
 
-    if (Ok())
+    if (IsOk())
         return true;
 
     wxLogDebug(wxT("wxColour::Set - couldn't set to colour string '%s'"), str);
@@ -273,6 +272,16 @@ void wxColourBase::MakeDisabled(unsigned char* r, unsigned char* g, unsigned cha
     *b = AlphaBlend(*b, brightness, 0.4);
 }
 
+wxColour& wxColourBase::MakeDisabled(unsigned char brightness)
+{
+    unsigned char r = Red(),
+                  g = Green(),
+                  b = Blue();
+    MakeDisabled(&r, &g, &b, brightness);
+    Set(r, g, b, Alpha());
+    return static_cast<wxColour&>(*this);
+}
+
 // AlphaBlend is used by ChangeLightness and MakeDisabled
 
 // static