]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/checkbox.cpp
ensure all topic overviews have an horizontal rule with the list of the sections...
[wxWidgets.git] / samples / widgets / checkbox.cpp
index 375a7a370fb0ce37a5bf646c332f8c8c1bb12a55..6ecbfd872a1d36d3070bc8b6ebae4d5638444053 100644 (file)
@@ -79,6 +79,9 @@ public:
     virtual wxControl *GetWidget() const { return m_checkbox; }
     virtual void RecreateWidget() { CreateCheckbox(); }
 
+    // lazy creation of the content
+    virtual void CreateContent();
+
 protected:
     // event handlers
     void OnCheckBox(wxCommandEvent& event);
@@ -158,10 +161,12 @@ IMPLEMENT_WIDGETS_PAGE(CheckBoxWidgetsPage, wxT("CheckBox"), FAMILY_CTRLS );
 
 CheckBoxWidgetsPage::CheckBoxWidgetsPage(WidgetsBookCtrl *book,
                                          wxImageList *imaglist)
-                  : WidgetsPage(book)
+                  : WidgetsPage(book, imaglist, checkbox_xpm)
 {
-    imaglist->Add(wxBitmap(checkbox_xpm));
+}
 
+void CheckBoxWidgetsPage::CreateContent()
+{
     wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
 
     // left pane
@@ -228,8 +233,6 @@ CheckBoxWidgetsPage::CheckBoxWidgetsPage(WidgetsBookCtrl *book,
     Reset();
 
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 void CheckBoxWidgetsPage::Reset()