diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h index 89c44a4cec..d53593a846 100644 --- a/include/wx/stc/stc.h +++ b/include/wx/stc/stc.h @@ -4546,7 +4546,11 @@ public: // implement wxTextEntryBase pure virtual methods // ---------------------------------------------- - virtual void WriteText(const wxString& text) { AddText(text); } + virtual void WriteText(const wxString& text) + { + ReplaceSelection(text); + } + virtual void Remove(long from, long to) { Replace(from, to, ""); diff --git a/src/stc/stc.h.in b/src/stc/stc.h.in index a10155c38b..d18af6b451 100644 --- a/src/stc/stc.h.in +++ b/src/stc/stc.h.in @@ -288,7 +288,11 @@ public: // implement wxTextEntryBase pure virtual methods // ---------------------------------------------- - virtual void WriteText(const wxString& text) { AddText(text); } + virtual void WriteText(const wxString& text) + { + ReplaceSelection(text); + } + virtual void Remove(long from, long to) { Replace(from, to, "");