WriteText() must replace the selection, not just insert the new text,
otherwise SetValue() implementation inherited from the base class doesn't work
as it doesn't clear the old contents of the control before adding new text to
it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72594
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// implement wxTextEntryBase pure virtual methods
// ----------------------------------------------
// 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, "");
virtual void Remove(long from, long to)
{
Replace(from, to, "");
// implement wxTextEntryBase pure virtual methods
// ----------------------------------------------
// 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, "");
virtual void Remove(long from, long to)
{
Replace(from, to, "");