X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6519b40fe9f5e4706e02497fe01ff71c65079d6..e3e8e3c0aa864da4c7e5bfbee200d9f0732cf4c5:/include/wx/textctrl.h diff --git a/include/wx/textctrl.h b/include/wx/textctrl.h index 172301b6ad..1314ef112f 100644 --- a/include/wx/textctrl.h +++ b/include/wx/textctrl.h @@ -39,11 +39,6 @@ #define wxHAS_TEXT_WINDOW_STREAM 0 #endif -#if WXWIN_COMPATIBILITY_2_4 && !wxHAS_TEXT_WINDOW_STREAM - // define old flag if one could use it somewhere - #define NO_TEXT_WINDOW_STREAM -#endif - class WXDLLEXPORT wxTextCtrl; class WXDLLEXPORT wxTextCtrlBase; @@ -298,9 +293,12 @@ public: // --------- virtual wxString GetValue() const = 0; - virtual void SetValue(const wxString& value) = 0; + virtual bool IsEmpty() const { return GetValue().empty(); } - virtual void ChangeValue(const wxString &value) = 0; + virtual void SetValue(const wxString& value) + { DoSetValue(value, SetValue_SendEvent); } + virtual void ChangeValue(const wxString& value) + { DoSetValue(value); } virtual wxString GetRange(long from, long to) const; @@ -420,6 +418,9 @@ public: wxTextCtrl& operator<<(double d); wxTextCtrl& operator<<(const wxChar c); + // generate the wxEVT_COMMAND_TEXT_UPDATED event, like SetValue() does + void SendTextUpdatedEvent(); + // do the window-specific processing after processing the update event virtual void DoUpdateWindowUI(wxUpdateUIEvent& event); @@ -431,17 +432,16 @@ protected: int overflow(int i); #endif // wxHAS_TEXT_WINDOW_STREAM - // typically, wxTextCtrl classes will use a DoSetValue() function to - // implement both SetValue() and ChangeValue() functions and these - // flags are meant to be passed to such DoSetValue() + // flags for DoSetValue(): common part of SetValue() and ChangeValue() and + // also used to implement WriteText() in wxMSW enum { SetValue_SendEvent = 1, SetValue_SelectionOnly = 2 }; - // generate the wxEVT_COMMAND_TEXT_UPDATED event - void SendTextUpdatedEvent(); + virtual void DoSetValue(const wxString& value, int flags = 0) = 0; + // the name of the last file loaded with LoadFile() which will be used by // SaveFile() by default