X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/61c083e7818114734695cb26aa006098a86e62c3..17b1d76b4add82305463d10b9f65668d06169363:/samples/widgets/static.cpp?ds=sidebyside diff --git a/samples/widgets/static.cpp b/samples/widgets/static.cpp index 63cfb0d583..fe33e6667c 100644 --- a/samples/widgets/static.cpp +++ b/samples/widgets/static.cpp @@ -51,7 +51,7 @@ // control ids enum { - StaticPage_Reset = 100, + StaticPage_Reset = wxID_HIGHEST, StaticPage_BoxText, StaticPage_LabelText }; @@ -139,10 +139,14 @@ END_EVENT_TABLE() class StaticWidgetsPage : public WidgetsPage { public: - StaticWidgetsPage(wxBookCtrl *book, wxImageList *imaglist); + StaticWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist); virtual ~StaticWidgetsPage(){}; virtual wxControl *GetWidget() const { return m_statText; } + virtual void RecreateWidget() { CreateStatic(); } + + // lazy creation of the content + virtual void CreateContent(); protected: // event handlers @@ -203,14 +207,14 @@ END_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(StaticWidgetsPage, _T("Static")); +IMPLEMENT_WIDGETS_PAGE(StaticWidgetsPage, _T("Static"), + (int)wxPlatform(GENERIC_CTRLS).If(wxOS_WINDOWS,NATIVE_CTRLS) + ); -StaticWidgetsPage::StaticWidgetsPage(wxBookCtrl *book, +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; @@ -226,7 +230,10 @@ StaticWidgetsPage::StaticWidgetsPage(wxBookCtrl *book, m_staticBox = (wxStaticBox *)NULL; m_sizerStatBox = (wxStaticBoxSizer *)NULL; m_sizerStatic = (wxSizer *)NULL; +} +void StaticWidgetsPage::CreateContent() +{ wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane @@ -333,7 +340,7 @@ void StaticWidgetsPage::CreateStatic() } int flagsBox = 0, - flagsText = 0; + flagsText = ms_defaultFlags; if ( !m_chkAutoResize->GetValue() ) {