X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/261357eb0ad855b642fe68a84c9ad2b727a926cb..67bb3c8818ad57893d62e3ee3511afadbc5a54ac:/samples/widgets/static.cpp diff --git a/samples/widgets/static.cpp b/samples/widgets/static.cpp index 05c1366909..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,7 +208,7 @@ 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, @@ -227,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