X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4ce7b1e43fdf835a77a78765fe73de707b89e85f..89579a60d7ba7da32777647ad7647af69ec4e687:/src/common/fontpickercmn.cpp?ds=sidebyside diff --git a/src/common/fontpickercmn.cpp b/src/common/fontpickercmn.cpp index a3b766e571..92cf9898b6 100644 --- a/src/common/fontpickercmn.cpp +++ b/src/common/fontpickercmn.cpp @@ -27,6 +27,11 @@ #if wxUSE_FONTPICKERCTRL #include "wx/fontpicker.h" + +#ifndef WX_PRECOMP + #include "wx/textctrl.h" +#endif + #include "wx/fontenum.h" #include "wx/tokenzr.h" @@ -50,9 +55,6 @@ bool wxFontPickerCtrl::Create( wxWindow *parent, wxWindowID id, long style, const wxValidator& validator, const wxString &name ) { - // by default, the textctrl is, if present, as big as the picker, for wxFontPickerCtrl - SetTextCtrlProportion(1); - if (!wxPickerBase::CreateBase(parent, id, Font2String(initial), pos, size, style, validator, name)) return false; @@ -61,6 +63,9 @@ bool wxFontPickerCtrl::Create( wxWindow *parent, wxWindowID id, m_picker = new wxFontPickerWidget(this, wxID_ANY, initial, wxDefaultPosition, wxDefaultSize, GetPickerStyle(style)); + // complete sizer creation + wxPickerBase::PostCreation(); + m_picker->Connect(wxEVT_COMMAND_FONTPICKER_CHANGED, wxFontPickerEventHandler(wxFontPickerCtrl::OnFontChange), NULL, this);