]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/colourcmn.cpp
Added wxDataViewTreeCtrl
[wxWidgets.git] / src / common / colourcmn.cpp
index 4868f808f2d5ad27cb0b0a18451207da50065559..99243dd383ee5a444f8fcb103dc1750b62ccf4ad 100644 (file)
@@ -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);
+}
+
+