X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ec376c8fd9ff813392030426acd2317c6fa6527e..8ca1a013e4e699724040ff1f514dab3b4a11d3c9:/src/gtk/fontpicker.cpp diff --git a/src/gtk/fontpicker.cpp b/src/gtk/fontpicker.cpp index 8934897134..6719a53aa9 100644 --- a/src/gtk/fontpicker.cpp +++ b/src/gtk/fontpicker.cpp @@ -17,23 +17,17 @@ // 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 -#include - - - // ============================================================================ // implementation // ============================================================================ -#if wxUSE_FONTPICKERCTRL && defined(__WXGTK24__) - //----------------------------------------------------------------------------- // "font-set" //----------------------------------------------------------------------------- @@ -66,8 +60,6 @@ bool wxFontButton::Create( wxWindow *parent, wxWindowID id, { if (!gtk_check_version(2,4,0)) { - m_needParent = true; - if (!PreCreation( parent, pos, size ) || !wxControl::CreateBase(parent, id, pos, size, style, validator, name)) { @@ -78,7 +70,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 @@ -90,7 +82,7 @@ bool wxFontButton::Create( wxWindow *parent, wxWindowID id, gtk_font_button_set_use_size(GTK_FONT_BUTTON(m_widget), usefont); gtk_font_button_set_use_font(GTK_FONT_BUTTON(m_widget), usefont); - gtk_widget_show( GTK_WIDGET(m_widget) ); + gtk_widget_show(m_widget); // GtkFontButton signals g_signal_connect(m_widget, "font-set", @@ -100,7 +92,7 @@ bool wxFontButton::Create( wxWindow *parent, wxWindowID id, m_parent->DoAddChild( this ); PostCreation(size); - SetBestSize(size); + SetInitialSize(size); } else return wxGenericFontButton::Create(parent, id, initial, pos, size, @@ -126,4 +118,4 @@ void wxFontButton::UpdateFont() wxGenericFontButton::UpdateFont(); } -#endif // wxUSE_FONTPICKERCTRL +#endif // wxUSE_FONTPICKERCTRL && defined(__WXGTK24__)