X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f0fa4312b1a537189ada21bec53cff5618e6660b..02fd8b9b6186623ed61019ac7e69ed9a4ef16773:/samples/widgets/checkbox.cpp diff --git a/samples/widgets/checkbox.cpp b/samples/widgets/checkbox.cpp index 375a7a370f..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); @@ -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()