X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f0fa4312b1a537189ada21bec53cff5618e6660b..17b1d76b4add82305463d10b9f65668d06169363:/samples/widgets/checkbox.cpp diff --git a/samples/widgets/checkbox.cpp b/samples/widgets/checkbox.cpp index 375a7a370f..65a5c1ea4e 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