]> git.saurik.com Git - wxWidgets.git/commitdiff
use wxNullFont instead of *wxNORMAL_FONT as default parameter for wxFontPickerCtrl...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 3 Nov 2006 21:54:13 +0000 (21:54 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 3 Nov 2006 21:54:13 +0000 (21:54 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42999 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/fontpicker.tex
include/wx/fontpicker.h
include/wx/generic/fontpickerg.h
include/wx/gtk/fontpicker.h
src/common/fontpickercmn.cpp
src/generic/fontpickerg.cpp
src/gtk/fontpicker.cpp

index 099f0287211bdf0570b9c67f2906e4ba674ac736..4f06ac899af67e306ff197706cf91ae0b131575d 100644 (file)
@@ -64,7 +64,7 @@ user's input is valid, i.e. recognizable). }
 
 \func{}{wxFontPickerCtrl}{\param{wxWindow *}{parent},\rtfsp
 \param{wxWindowID}{ id},\rtfsp
-\param{const wxFont\& }{font = *wxNORMAL\_FONT},\rtfsp
+\param{const wxFont\& }{font = wxNullFont},\rtfsp
 \param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
 \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
 \param{long}{ style = wxFNTP\_DEFAULT\_STYLE},\rtfsp
@@ -79,7 +79,7 @@ all the parameters.
 
 \func{bool}{Create}{\param{wxWindow *}{parent},\rtfsp
 \param{wxWindowID}{ id},\rtfsp
-\param{const wxFont\& }{font = *wxNORMAL\_FONT},\rtfsp
+\param{const wxFont\& }{font = wxNullFont},\rtfsp
 \param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
 \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
 \param{long}{ style = wxFNTP\_DEFAULT\_STYLE},\rtfsp
@@ -92,7 +92,8 @@ all the parameters.
 
 \docparam{id}{The identifier for the control.}
 
-\docparam{font}{The initial font shown in the control.}
+\docparam{font}{The initial font shown in the control. The default 
+\texttt{wxNORMAL\_FONT} value means to use the default font.}
 
 \docparam{pos}{Initial position.}
 
index 3a296ad89bb8179631a3b7916d34a942556a7b1c..308b20f964e9c352a1453e621d62acc2bd8eab73 100644 (file)
@@ -107,7 +107,7 @@ public:
 
     wxFontPickerCtrl(wxWindow *parent,
                      wxWindowID id,
-                     const wxFont& initial = *wxNORMAL_FONT,
+                     const wxFont& initial = wxNullFont,
                      const wxPoint& pos = wxDefaultPosition,
                      const wxSize& size = wxDefaultSize,
                      long style = wxFNTP_DEFAULT_STYLE,
@@ -121,7 +121,7 @@ public:
 
     bool Create(wxWindow *parent,
                 wxWindowID id,
-                const wxFont& initial = *wxNORMAL_FONT,
+                const wxFont& initial = wxNullFont,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
                 long style = wxFNTP_DEFAULT_STYLE,
index ece82ba8bd8c2d67c64e0f64b01baa17fb33eadc..a3c27f432183d7ff2f8d843303fc62b4e9189cb7 100644 (file)
@@ -29,7 +29,7 @@ public:
     wxGenericFontButton() {}
     wxGenericFontButton(wxWindow *parent,
                         wxWindowID id,
-                        const wxFont &initial = *wxNORMAL_FONT,
+                        const wxFont &initial = wxNullFont,
                         const wxPoint& pos = wxDefaultPosition,
                         const wxSize& size = wxDefaultSize,
                         long style = wxFONTBTN_DEFAULT_STYLE,
index 200615fcff12eec0d7be91ca39aecb9aaeb95304..cef2cd16652abf903ff5ef65870fea8800c712d8 100644 (file)
@@ -27,7 +27,7 @@ public:
     wxFontButton() {}
     wxFontButton(wxWindow *parent,
                  wxWindowID id,
-                 const wxFont& initial = *wxNORMAL_FONT,
+                 const wxFont& initial = wxNullFont,
                  const wxPoint& pos = wxDefaultPosition,
                  const wxSize& size = wxDefaultSize,
                  long style = wxFONTBTN_DEFAULT_STYLE,
@@ -44,7 +44,7 @@ public:     // overrides
 
     bool Create(wxWindow *parent,
                 wxWindowID id,
-                const wxFont& initial = *wxNORMAL_FONT,
+                const wxFont& initial = wxNullFont,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
                 long style = wxFONTBTN_DEFAULT_STYLE,
index 00c68a699dfbf82ab2c7591070a3c222bfcaa12c..3ca7872f1d1c12e7af39e98f183264b9cde8d024 100644 (file)
@@ -58,7 +58,9 @@ bool wxFontPickerCtrl::Create( wxWindow *parent, wxWindowID id,
                         long style, const wxValidator& validator,
                         const wxString &name )
 {
-    if (!wxPickerBase::CreateBase(parent, id, Font2String(initial),
+    if (!wxPickerBase::CreateBase(parent, id,
+                                  Font2String(initial.IsOk() ? initial
+                                                             : *wxNORMAL_FONT),
                                   pos, size, style, validator, name))
         return false;
 
index 06a5c5c539fd8a0a3d9c290edd63756ffe770924..26f9908d7df1dd05c4ea60136f016cbebe1f0403 100644 (file)
@@ -64,7 +64,7 @@ bool wxGenericFontButton::Create( wxWindow *parent, wxWindowID id,
             wxCommandEventHandler(wxGenericFontButton::OnButtonClick),
             NULL, this);
 
-    m_selectedFont = initial;
+    m_selectedFont = initial.IsOk() ? initial : *wxNORMAL_FONT;
     UpdateFont();
     InitFontData();
 
index eda8022cc19a7c96f09b5f4854e5812a95a0c7af..bc24c2e8d8f337098d48dff73b683aa4e408009e 100644 (file)
@@ -73,7 +73,7 @@ bool wxFontButton::Create( wxWindow *parent, wxWindowID id,
         m_widget = gtk_font_button_new();
 
         // set initial font
-        m_selectedFont = initial;
+        m_selectedFont = initial.IsOk() ? initial : *wxNORMAL_FONT;
         UpdateFont();
 
         // honour the fontbutton styles