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:
parent
ef37a43194
commit
fc9361e3ec
@ -3264,7 +3264,10 @@ and current pointer position in screen coordinates.
|
|||||||
\membersection{wxFromString}\label{wxfromstring}
|
\membersection{wxFromString}\label{wxfromstring}
|
||||||
|
|
||||||
\func{bool}{wxFromString}{\param{const wxString\& }{str},
|
\func{bool}{wxFromString}{\param{const wxString\& }{str},
|
||||||
\param{wxColourBase* }{col}}
|
\param{wxColour* }{col}}
|
||||||
|
|
||||||
|
\func{bool}{wxFromString}{\param{const wxString\& }{str},
|
||||||
|
\param{wxFont* }{col}}
|
||||||
|
|
||||||
Converts string to the type of the second argument. Returns \true on success.
|
Converts string to the type of the second argument. Returns \true on success.
|
||||||
See also: \helpref{wxToString}{wxtostring}.
|
See also: \helpref{wxToString}{wxtostring}.
|
||||||
@ -3587,7 +3590,9 @@ Notice that there should be no semicolon after this macro.
|
|||||||
|
|
||||||
\membersection{wxToString}\label{wxtostring}
|
\membersection{wxToString}\label{wxtostring}
|
||||||
|
|
||||||
\func{wxString}{wxToString}{\param{const wxColourBase\& }{col}}
|
\func{wxString}{wxToString}{\param{const wxColour\& }{col}}
|
||||||
|
|
||||||
|
\func{wxString}{wxToString}{\param{const wxFont\& }{col}}
|
||||||
|
|
||||||
Converts its argument to string.
|
Converts its argument to string.
|
||||||
See also: \helpref{wxFromString}{wxfromstring}.
|
See also: \helpref{wxFromString}{wxfromstring}.
|
||||||
|
@ -222,6 +222,12 @@ private:
|
|||||||
static wxFontEncoding ms_encodingDefault;
|
static wxFontEncoding ms_encodingDefault;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// wxFontBase <-> wxString utilities, used by wxConfig
|
||||||
|
WXDLLIMPEXP_CORE wxString wxToString(const wxFontBase& font);
|
||||||
|
WXDLLIMPEXP_CORE bool wxFromString(const wxString& str, wxFontBase* font);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// include the real class declaration
|
// include the real class declaration
|
||||||
#if defined(__WXPALMOS__)
|
#if defined(__WXPALMOS__)
|
||||||
#include "wx/palmos/font.h"
|
#include "wx/palmos/font.h"
|
||||||
|
@ -799,3 +799,26 @@ bool wxNativeFontInfo::FromUserString(const wxString& s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif // generic or wxMSW or wxOS2
|
#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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user