]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix wxSearchCtrl recreation in the widgets sample.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 28 Sep 2012 23:50:05 +0000 (23:50 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 28 Sep 2012 23:50:05 +0000 (23:50 +0000)
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

samples/widgets/searchctrl.cpp

index 97a95881031398e95c902f63f067d0031e6bf414..7ba5df5a9337108b9c3c5c7019ea99cb9f6ad443 100644 (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()
 {