X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/261357eb0ad855b642fe68a84c9ad2b727a926cb..bb650010c8200174ce824aaadac44e8e5ead194d:/samples/widgets/checkbox.cpp diff --git a/samples/widgets/checkbox.cpp b/samples/widgets/checkbox.cpp index 384d4156e8..6ecbfd872a 100644 --- a/samples/widgets/checkbox.cpp +++ b/samples/widgets/checkbox.cpp @@ -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()