X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f0fa4312b1a537189ada21bec53cff5618e6660b..0edfdd963bdc9cfeb54d403ed77b5f36e4de8c84:/samples/widgets/radiobox.cpp diff --git a/samples/widgets/radiobox.cpp b/samples/widgets/radiobox.cpp index 088da04a98..a4e73f24cc 100644 --- a/samples/widgets/radiobox.cpp +++ b/samples/widgets/radiobox.cpp @@ -89,6 +89,9 @@ public: virtual wxControl *GetWidget() const { return m_radio; } virtual void RecreateWidget() { CreateRadio(); } + // lazy creation of the content + virtual void CreateContent(); + protected: // event handlers void OnCheckOrRadioBox(wxCommandEvent& event); @@ -185,10 +188,8 @@ IMPLEMENT_WIDGETS_PAGE(RadioWidgetsPage, _T("Radio"), RadioWidgetsPage::RadioWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) - : WidgetsPage(book) + : WidgetsPage(book, imaglist, radio_xpm) { - imaglist->Add(wxBitmap(radio_xpm)); - // init everything m_chkVert = (wxCheckBox *)NULL; m_chkEnableItem = (wxCheckBox *)NULL; @@ -201,7 +202,10 @@ RadioWidgetsPage::RadioWidgetsPage(WidgetsBookCtrl *book, m_radio = m_radioDir = (wxRadioBox *)NULL; m_sizerRadio = (wxSizer *)NULL; +} +void RadioWidgetsPage::CreateContent() +{ wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane