]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/colourcmn.cpp
implement button support for pre-XP systems (or with themes disabled); using only...
[wxWidgets.git] / src / common / colourcmn.cpp
index 4868f808f2d5ad27cb0b0a18451207da50065559..a03efa79426b683672767b3b882c14d009c49498 100644 (file)
@@ -110,7 +110,7 @@ wxString wxColourBase::GetAsString(long flags) const
     if ( (flags & wxC2S_NAME) && isOpaque )
     {
         colName = wxTheColourDatabase->FindName(
-                    wx_static_cast(const wxColour &, *this)).MakeLower();
+                    static_cast<const wxColour &>(*this)).MakeLower();
     }
 
     if ( colName.empty() )
@@ -163,3 +163,25 @@ void wxColourBase::InitFromName(const wxString& col)
 }
 
 #endif // WXWIN_COMPATIBILITY_2_6
+
+// wxColour <-> wxString utilities, used by wxConfig
+wxString wxToString(const wxColourBase& col)
+{
+    return col.IsOk() ? col.GetAsString(wxC2S_CSS_SYNTAX)
+                      : wxString();
+}
+
+bool wxFromString(const wxString& str, wxColourBase *col)
+{
+    wxCHECK_MSG( col, false, _T("NULL output parameter") );
+
+    if ( str.empty() )
+    {
+        *col = wxNullColour;
+        return true;
+    }
+
+    return col->Set(str);
+}
+
+