added wxTo/FromString(wxColour) (part of patch 1753875)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47632 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user