X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f0fa4312b1a537189ada21bec53cff5618e6660b..084ad0c2424aa998a640c151f8fa762435364449:/samples/widgets/datepick.cpp diff --git a/samples/widgets/datepick.cpp b/samples/widgets/datepick.cpp index 9babbf8c02..f72112cf8b 100644 --- a/samples/widgets/datepick.cpp +++ b/samples/widgets/datepick.cpp @@ -75,6 +75,9 @@ public: virtual wxControl *GetWidget() const { return m_datePicker; } virtual void RecreateWidget() { CreateDatePicker(); } + // lazy creation of the content + virtual void CreateContent(); + protected: // event handlers void OnButtonSet(wxCommandEvent& event); @@ -131,10 +134,12 @@ IMPLEMENT_WIDGETS_PAGE(DatePickerWidgetsPage, wxT("DatePicker"), DatePickerWidgetsPage::DatePickerWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) - :WidgetsPage(book) + :WidgetsPage(book, imaglist, datepick_xpm) { - imaglist->Add(wxBitmap(datepick_xpm)); +} +void DatePickerWidgetsPage::CreateContent() +{ wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane