X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/155ce4f18462c0a8e6348cc31e73bee490fcb12d..38e392a8d6bd7a13802276fce9fe723063e30556:/src/common/textentrycmn.cpp diff --git a/src/common/textentrycmn.cpp b/src/common/textentrycmn.cpp index 3e5c6117e0..b1480e322e 100644 --- a/src/common/textentrycmn.cpp +++ b/src/common/textentrycmn.cpp @@ -3,7 +3,6 @@ // Purpose: wxTextEntryBase implementation // Author: Vadim Zeitlin // Created: 2007-09-26 -// RCS-ID: $Id$ // Copyright: (c) 2007 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -50,7 +49,7 @@ public: wxTextEntryHintData::OnSetFocus, this); wxBIND_OR_CONNECT_HACK(win, wxEVT_KILL_FOCUS, wxFocusEventHandler, wxTextEntryHintData::OnKillFocus, this); - wxBIND_OR_CONNECT_HACK(win, wxEVT_COMMAND_TEXT_UPDATED, + wxBIND_OR_CONNECT_HACK(win, wxEVT_TEXT, wxCommandEventHandler, wxTextEntryHintData::OnTextChanged, this); } @@ -230,6 +229,8 @@ void wxTextEntryBase::DoSetValue(const wxString& value, int flags) SelectAll(); WriteText(value); + + SetInsertionPoint(0); } else // Same value, no need to do anything. { @@ -238,8 +239,6 @@ void wxTextEntryBase::DoSetValue(const wxString& value, int flags) if ( flags & SetValue_SendEvent ) SendTextUpdatedEvent(GetEditableWindow()); } - - SetInsertionPoint(0); } void wxTextEntryBase::Replace(long from, long to, const wxString& value) @@ -367,7 +366,7 @@ bool wxTextEntryBase::SendTextUpdatedEvent(wxWindow *win) { wxCHECK_MSG( win, false, "can't send an event without a window" ); - wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, win->GetId()); + wxCommandEvent event(wxEVT_TEXT, win->GetId()); // do not do this as it could be very inefficient if the text control // contains a lot of text and we're not using ref-counted wxString