]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/fontpickercmn.cpp
remove wxTextAttr::CreateFont(); return wxNullFont from GetFont() if we have no font...
[wxWidgets.git] / src / common / fontpickercmn.cpp
index 92cf9898b69dbeeda5d1d0a16be99932afd88596..cc1dd50bbe9e4d276ec1712cb4f141c3f5f25432 100644 (file)
@@ -39,6 +39,9 @@
 // implementation
 // ============================================================================
 
+const char wxFontPickerCtrlNameStr[] = "fontpicker";
+const char wxFontPickerWidgetNameStr[] = "fontpickerwidget";
+
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_FONTPICKER_CHANGED)
 IMPLEMENT_DYNAMIC_CLASS(wxFontPickerCtrl, wxPickerBase)
 IMPLEMENT_DYNAMIC_CLASS(wxFontPickerEvent, wxCommandEvent)
@@ -55,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;