X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/286ff306d8ba79b72ebc34d9f1c6ae18ad8d45ea..faca2e452feedcab0daddd333f8e5473fa96949a:/samples/widgets/textctrl.cpp diff --git a/samples/widgets/textctrl.cpp b/samples/widgets/textctrl.cpp index 8377e4c079..c3b4392181 100644 --- a/samples/widgets/textctrl.cpp +++ b/samples/widgets/textctrl.cpp @@ -40,6 +40,7 @@ #endif #include "wx/sizer.h" +#include "wx/ioswrap.h" #include "widgets.h" @@ -131,7 +132,7 @@ 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; } @@ -333,7 +334,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)); @@ -554,7 +555,7 @@ wxTextCtrl *TextWidgetsPage::CreateInfoText() wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, - wxSize(s_maxWidth, -1), + wxSize(s_maxWidth, wxDefaultCoord), wxTE_READONLY); return text; } @@ -887,13 +888,11 @@ void TextWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) void TextWidgetsPage::OnStreamRedirector(wxCommandEvent& WXUNUSED(event)) { -// Note, NO_TEXT_WINDOW_STREAM is private flag of wxWidgets header -// it's simpler to check it rather than duplicate whole -#ifdef NO_TEXT_WINDOW_STREAM - wxMessageBox(_T("This wxWidgets build does not support wxStreamToTextRedirector")); -#else +#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 }