added wxTo/FromString() overloads for wxFont (1st part of patch 1760073)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47763 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -799,3 +799,26 @@ bool wxNativeFontInfo::FromUserString(const wxString& s)
|
||||
}
|
||||
|
||||
#endif // generic or wxMSW or wxOS2
|
||||
|
||||
|
||||
// wxFont <-> wxString utilities, used by wxConfig
|
||||
wxString wxToString(const wxFontBase& font)
|
||||
{
|
||||
return font.IsOk() ? font.GetNativeFontInfoDesc()
|
||||
: wxString();
|
||||
}
|
||||
|
||||
bool wxFromString(const wxString& str, wxFontBase *font)
|
||||
{
|
||||
wxCHECK_MSG( font, false, _T("NULL output parameter") );
|
||||
|
||||
if ( str.empty() )
|
||||
{
|
||||
*font = wxNullFont;
|
||||
return true;
|
||||
}
|
||||
|
||||
return font->SetNativeFontInfo(str);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user