virtual wxControl *GetWidget() const { return m_button; }
virtual void RecreateWidget() { CreateButton(); }
+ // lazy creation of the content
+ virtual void CreateContent();
+
protected:
// event handlers
void OnCheckOrRadioBox(wxCommandEvent& event);
ButtonWidgetsPage::ButtonWidgetsPage(WidgetsBookCtrl *book,
wxImageList *imaglist)
- : WidgetsPage(book)
+ : WidgetsPage(book, imaglist, button_xpm)
{
- imaglist->Add(wxBitmap(button_xpm));
-
// init everything
m_chkBitmap =
m_chkImage =
m_button = (wxButton *)NULL;
m_sizerButton = (wxSizer *)NULL;
+}
+void ButtonWidgetsPage::CreateContent()
+{
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
CreateButton();
SetSizer(sizerTop);
-
- sizerTop->Fit(this);
}
// ----------------------------------------------------------------------------