X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/261357eb0ad855b642fe68a84c9ad2b727a926cb..f4f5d5697dc5e34a5582061dbd857d1cd4326f91:/samples/widgets/toggle.cpp diff --git a/samples/widgets/toggle.cpp b/samples/widgets/toggle.cpp index 214474f7ad..a44b1ff900 100644 --- a/samples/widgets/toggle.cpp +++ b/samples/widgets/toggle.cpp @@ -64,6 +64,9 @@ public: virtual wxControl *GetWidget() const { return m_toggle; } virtual void RecreateWidget() { CreateToggle(); } + // lazy creation of the content + virtual void CreateContent(); + protected: // event handlers void OnButtonReset(wxCommandEvent& event); @@ -116,6 +119,10 @@ IMPLEMENT_WIDGETS_PAGE(ToggleWidgetsPage, wxT("ToggleButton"), ToggleWidgetsPage::ToggleWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) :WidgetsPage(book, imaglist, toggle_xpm) +{ +} + +void ToggleWidgetsPage::CreateContent() { wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); @@ -156,8 +163,6 @@ ToggleWidgetsPage::ToggleWidgetsPage(WidgetsBookCtrl *book, Reset(); SetSizer(sizerTop); - - sizerTop->Fit(this); } void ToggleWidgetsPage::Reset()