]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/toggle.cpp
allow passing -1 range to SetScrollbar() to indicate the the scrollbar should be...
[wxWidgets.git] / samples / widgets / toggle.cpp
index 214474f7ade23e565e24397ee4e3b6764f905119..a44b1ff900c2a032d40880d0cf9bce6aa0d29388 100644 (file)
@@ -64,6 +64,9 @@ public:
     virtual wxControl *GetWidget() const { return m_toggle; }
     virtual void RecreateWidget() { CreateToggle(); }
 
+    // lazy creation of the content
+    virtual void CreateContent();
+
 protected:
     // event handlers
     void OnButtonReset(wxCommandEvent& event);
@@ -116,6 +119,10 @@ IMPLEMENT_WIDGETS_PAGE(ToggleWidgetsPage, wxT("ToggleButton"),
 ToggleWidgetsPage::ToggleWidgetsPage(WidgetsBookCtrl *book,
                                      wxImageList *imaglist)
                       :WidgetsPage(book, imaglist, toggle_xpm)
+{
+}
+
+void ToggleWidgetsPage::CreateContent()
 {
     wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
 
@@ -156,8 +163,6 @@ ToggleWidgetsPage::ToggleWidgetsPage(WidgetsBookCtrl *book,
     Reset();
 
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 void ToggleWidgetsPage::Reset()