X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f2fdc4d56e41711ce7c547484bf97aa0c2bd997a..df1496e3eb11e87e15a29fd04c068cd6cd3b607e:/samples/widgets/textctrl.cpp diff --git a/samples/widgets/textctrl.cpp b/samples/widgets/textctrl.cpp index c01eb60d76..0d2e8e293c 100644 --- a/samples/widgets/textctrl.cpp +++ b/samples/widgets/textctrl.cpp @@ -53,7 +53,7 @@ // control ids enum { - TextPage_Reset = 100, + TextPage_Reset = wxID_HIGHEST, TextPage_Set, TextPage_Add, @@ -138,6 +138,9 @@ public: virtual wxControl *GetWidget() const { return m_text; } virtual void RecreateWidget() { CreateText(); } + // lazy creation of the content + virtual void CreateContent(); + protected: // create an info text contorl wxTextCtrl *CreateInfoText(); @@ -329,9 +332,16 @@ END_EVENT_TABLE() // implementation // ============================================================================ +#if defined(__WXX11__) + #define FAMILY_CTRLS NATIVE_CTRLS +#elif defined(__WXUNIVERSAL__) + #define FAMILY_CTRLS UNIVERSAL_CTRLS +#else + #define FAMILY_CTRLS NATIVE_CTRLS +#endif + IMPLEMENT_WIDGETS_PAGE(TextWidgetsPage, _T("Text"), - (int)wxPlatform(GENERIC_CTRLS).If(wxMSW,NATIVE_CTRLS) - | EDITABLE_CTRLS + FAMILY_CTRLS | EDITABLE_CTRLS ); // ---------------------------------------------------------------------------- @@ -339,10 +349,8 @@ IMPLEMENT_WIDGETS_PAGE(TextWidgetsPage, _T("Text"), // ---------------------------------------------------------------------------- TextWidgetsPage::TextWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) - : WidgetsPage(book) + : WidgetsPage(book, imaglist, text_xpm) { - imaglist->Add(wxBitmap(text_xpm)); - // init everything #ifdef __WXMSW__ m_radioKind = @@ -369,7 +377,10 @@ TextWidgetsPage::TextWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) m_posLast = m_selFrom = m_selTo = -2; // not -1 which means "no selection" +} +void TextWidgetsPage::CreateContent() +{ // left pane static const wxString modes[] = {