]> git.saurik.com Git - wxWidgets.git/commitdiff
added wxTo/FromString() overloads for wxFont (1st part of patch 1760073)
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 27 Jul 2007 23:49:08 +0000 (23:49 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 27 Jul 2007 23:49:08 +0000 (23:49 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47763 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/function.tex
include/wx/font.h
src/common/fontcmn.cpp

index e145da28863227e84e970bc25a83729004a74912..5d8a4e82b6338c8c3d979dde673abc9be776d51f 100644 (file)
@@ -3264,7 +3264,10 @@ and current pointer position in screen coordinates.
 \membersection{wxFromString}\label{wxfromstring}
 
 \func{bool}{wxFromString}{\param{const wxString\& }{str},
 \membersection{wxFromString}\label{wxfromstring}
 
 \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.
 See also: \helpref{wxToString}{wxtostring}.
 
 Converts string to the type of the second argument. Returns \true on success.
 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.
 See also: \helpref{wxFromString}{wxfromstring}.
 
 Converts its argument to string.
 See also: \helpref{wxFromString}{wxfromstring}.
index c20d2125a95bde97b97b91119c829b5fc9b833fb..9b87cafd11ec76dfc830a52c283ae3f8a5f824bf 100644 (file)
@@ -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
 #if defined(__WXPALMOS__)
     #include "wx/palmos/font.h"
 // include the real class declaration
 #if defined(__WXPALMOS__)
     #include "wx/palmos/font.h"
index 20b8c303d021882cfdb6a38c175ca258c527b3c3..8a9063f5b344ea3714fd4a1441adfb2d9a8609ba 100644 (file)
@@ -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);
+}
+
+