// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
-#include "wx/gtk/private.h"
+#if wxUSE_FONTPICKERCTRL && defined(__WXGTK24__)
+
#include "wx/fontpicker.h"
#include "wx/fontutil.h" // for wxNativeFontInfo
#include "wx/gtk/private.h"
-#include <gdk/gdk.h>
-#include <gtk/gtk.h>
-
-
-
// ============================================================================
// implementation
// ============================================================================
-#if wxUSE_FONTPICKERCTRL && defined(__WXGTK24__)
-
//-----------------------------------------------------------------------------
// "font-set"
//-----------------------------------------------------------------------------
if (!gtk_check_version(2,4,0))
{
m_needParent = true;
+ m_acceptsFocus = true;
if (!PreCreation( parent, pos, size ) ||
!wxControl::CreateBase(parent, id, pos, size, style, validator, name))
m_widget = gtk_font_button_new();
// set initial font
- m_selectedFont = initial;
+ m_selectedFont = initial.IsOk() ? initial : *wxNORMAL_FONT;
UpdateFont();
// honour the fontbutton styles
m_parent->DoAddChild( this );
PostCreation(size);
- SetBestSize(size);
+ SetInitialSize(size);
}
else
return wxGenericFontButton::Create(parent, id, initial, pos, size,
wxGenericFontButton::UpdateFont();
}
-#endif // wxUSE_FONTPICKERCTRL
+#endif // wxUSE_FONTPICKERCTRL && defined(__WXGTK24__)