X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f0fa4312b1a537189ada21bec53cff5618e6660b..17b1d76b4add82305463d10b9f65668d06169363:/samples/widgets/static.cpp diff --git a/samples/widgets/static.cpp b/samples/widgets/static.cpp index 0082fde6fd..fe33e6667c 100644 --- a/samples/widgets/static.cpp +++ b/samples/widgets/static.cpp @@ -145,6 +145,9 @@ public: virtual wxControl *GetWidget() const { return m_statText; } virtual void RecreateWidget() { CreateStatic(); } + // lazy creation of the content + virtual void CreateContent(); + protected: // event handlers void OnCheckOrRadioBox(wxCommandEvent& event); @@ -205,15 +208,13 @@ END_EVENT_TABLE() // ============================================================================ IMPLEMENT_WIDGETS_PAGE(StaticWidgetsPage, _T("Static"), - (int)wxPlatform(GENERIC_CTRLS).If(wxMSW,NATIVE_CTRLS) + (int)wxPlatform(GENERIC_CTRLS).If(wxOS_WINDOWS,NATIVE_CTRLS) ); StaticWidgetsPage::StaticWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) - : WidgetsPage(book) + : WidgetsPage(book, imaglist, statbox_xpm) { - imaglist->Add(wxBitmap(statbox_xpm)); - // init everything m_chkVert = m_chkAutoResize = (wxCheckBox *)NULL; @@ -229,7 +230,10 @@ StaticWidgetsPage::StaticWidgetsPage(WidgetsBookCtrl *book, m_staticBox = (wxStaticBox *)NULL; m_sizerStatBox = (wxStaticBoxSizer *)NULL; m_sizerStatic = (wxSizer *)NULL; +} +void StaticWidgetsPage::CreateContent() +{ wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane