]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/checkbox.cpp
fixing infinite recursion for rotated text, introduced in cleanup r57915
[wxWidgets.git] / samples / widgets / checkbox.cpp
index 384d4156e810c25dc5e8078a4c4f253ca66d97a4..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);
@@ -159,6 +162,10 @@ IMPLEMENT_WIDGETS_PAGE(CheckBoxWidgetsPage, wxT("CheckBox"), FAMILY_CTRLS );
 CheckBoxWidgetsPage::CheckBoxWidgetsPage(WidgetsBookCtrl *book,
                                          wxImageList *imaglist)
                   : WidgetsPage(book, imaglist, checkbox_xpm)
+{
+}
+
+void CheckBoxWidgetsPage::CreateContent()
 {
     wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
 
@@ -226,8 +233,6 @@ CheckBoxWidgetsPage::CheckBoxWidgetsPage(WidgetsBookCtrl *book,
     Reset();
 
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 void CheckBoxWidgetsPage::Reset()