X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3306aec1240b38347abda1ad776df32b6687ad01..61f84e2493a78236d8491ad53ea62ff401da53a0:/include/wx/textctrl.h?ds=sidebyside diff --git a/include/wx/textctrl.h b/include/wx/textctrl.h index 204c28b7df..fd6ad89317 100644 --- a/include/wx/textctrl.h +++ b/include/wx/textctrl.h @@ -298,7 +298,12 @@ public: // --------- virtual wxString GetValue() const = 0; - virtual void SetValue(const wxString& value) = 0; + virtual bool IsEmpty() const { return GetValue().empty(); } + + 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; @@ -418,6 +423,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); @@ -429,6 +437,17 @@ protected: int overflow(int i); #endif // wxHAS_TEXT_WINDOW_STREAM + // flags for DoSetValue(): common part of SetValue() and ChangeValue() and + // also used to implement WriteText() in wxMSW + enum + { + SetValue_SendEvent = 1, + SetValue_SelectionOnly = 2 + }; + + 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 wxString m_filename;