Fix wxSearchCtrl recreation in the widgets sample.

The control wasn't readded to the sizer correctly after being recreated.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72576 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2012-09-28 23:50:05 +00:00
parent ceddf94945
commit 07d304d2aa

View File

@ -73,7 +73,7 @@ public:
virtual wxControl *GetWidget() const { return m_srchCtrl; }
virtual wxTextEntryBase *GetTextEntry() const { return m_srchCtrl; }
virtual void RecreateWidget() { CreateControl(); }
virtual void RecreateWidget();
// lazy creation of the content
virtual void CreateContent();
@ -172,6 +172,14 @@ void SearchCtrlWidgetsPage::CreateControl()
wxSize(150, -1), style);
}
void SearchCtrlWidgetsPage::RecreateWidget()
{
CreateControl();
GetSizer()->Add(m_srchCtrl, wxSizerFlags().Centre().TripleBorder());
Layout();
}
wxMenu* SearchCtrlWidgetsPage::CreateTestMenu()
{