X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fc7a2a602b4bd9308be21bc07e40a680f483438e..fcb35beb942ced9d2552b5ab5b4fe0df8e6df93a:/include/wx/textctrl.h diff --git a/include/wx/textctrl.h b/include/wx/textctrl.h index 06c1ee23d6..df004c9479 100644 --- a/include/wx/textctrl.h +++ b/include/wx/textctrl.h @@ -16,7 +16,7 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(__APPLE__) +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "textctrlbase.h" #endif @@ -262,7 +262,8 @@ public: virtual bool LoadFile(const wxString& file); virtual bool SaveFile(const wxString& file = wxEmptyString); - // clears the dirty flag + // sets/clears the dirty flag + virtual void MarkDirty() = 0; virtual void DiscardEdits() = 0; // set the max number of characters which may be entered in a single line @@ -337,11 +338,6 @@ public: // do the window-specific processing after processing the update event virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) ; - // obsolete functions -#if WXWIN_COMPATIBILITY - bool Modified() const { return IsModified(); } -#endif - protected: // the name of the last file loaded with LoadFile() which will be used by // SaveFile() by default @@ -440,14 +436,26 @@ typedef void (wxEvtHandler::*wxTextUrlEventFunction)(wxTextUrlEvent&); class WXDLLEXPORT wxStreamToTextRedirector { -public: - wxStreamToTextRedirector(wxTextCtrl *text, wxSTD ostream *ostr = NULL) - : m_ostr(ostr ? *ostr : wxSTD cout) +private: + void Init() { m_sbufOld = m_ostr.rdbuf(); m_ostr.rdbuf(text); } +public: + wxStreamToTextRedirector(wxTextCtrl *text) + : m_ostr(wxSTD cout) + { + Init(); + } + + wxStreamToTextRedirector(wxTextCtrl *text, wxSTD ostream *ostr) + : m_ostr(*ostr) + { + Init(); + } + ~wxStreamToTextRedirector() { m_ostr.rdbuf(m_sbufOld);