]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/textctrl.cpp
reset the dirty flag before generating the event from SetValue() in case the text...
[wxWidgets.git] / samples / widgets / textctrl.cpp
index e9282d977f659283a8b977a5e21c1ba92b9536eb..6fd19a54978ad12bb95734197e38c28b69e15c33 100644 (file)
@@ -132,10 +132,11 @@ class TextWidgetsPage : public WidgetsPage
 {
 public:
     // ctor(s) and dtor
-    TextWidgetsPage(wxBookCtrl *book, wxImageList *imaglist);
+    TextWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist);
     virtual ~TextWidgetsPage(){};
 
     virtual wxControl *GetWidget() const { return m_text; }
+    virtual void RecreateWidget() { CreateText(); }
 
 protected:
     // create an info text contorl
@@ -334,7 +335,7 @@ IMPLEMENT_WIDGETS_PAGE(TextWidgetsPage, _T("Text"));
 // TextWidgetsPage creation
 // ----------------------------------------------------------------------------
 
-TextWidgetsPage::TextWidgetsPage(wxBookCtrl *book, wxImageList *imaglist)
+TextWidgetsPage::TextWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist)
                : WidgetsPage(book)
 {
     imaglist->Add(wxBitmap(text_xpm));
@@ -599,7 +600,7 @@ void TextWidgetsPage::Reset()
 
 void TextWidgetsPage::CreateText()
 {
-    int flags = 0;
+    int flags = ms_defaultFlags;
     switch ( m_radioTextLines->GetSelection() )
     {
         default:
@@ -633,7 +634,7 @@ void TextWidgetsPage::CreateText()
             break;
 
         case WrapStyle_Char:
-            flags |= wxTE_LINEWRAP;
+            flags |= wxTE_CHARWRAP;
             break;
 
         case WrapStyle_Best:
@@ -891,7 +892,7 @@ void TextWidgetsPage::OnStreamRedirector(wxCommandEvent& WXUNUSED(event))
 #if wxHAS_TEXT_WINDOW_STREAM
     wxStreamToTextRedirector redirect(m_text);
     wxString str( _T("Outputed to cout, appears in wxTextCtrl!") );
-    cout << str << endl;
+    wxSTD cout << str << wxSTD endl;
 #else
     wxMessageBox(_T("This wxWidgets build does not support wxStreamToTextRedirector"));
 #endif