]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/textctrl.cpp
redirect to the page only the help events coming from this control itself to avoid...
[wxWidgets.git] / samples / widgets / textctrl.cpp
index 7728ba3cc94a09a48c3b85d89eb3c804ec6c37cc..0d2e8e293c966b098b2a8e8e08193f0d74d9e64d 100644 (file)
@@ -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();
@@ -346,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 =
@@ -376,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[] =
     {