]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/textentrycmn.cpp
Add wxInputStream::ReadAll() and wxOutputStream::WriteAll().
[wxWidgets.git] / src / common / textentrycmn.cpp
index 971f5626688ed50faab56148b1f5a62469327d04..0db04b25f8a07ce22cd6e95566b9b338c59c2a98 100644 (file)
@@ -50,7 +50,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);
     }
@@ -224,12 +224,14 @@ void wxTextEntryBase::AppendText(const wxString& text)
 
 void wxTextEntryBase::DoSetValue(const wxString& value, int flags)
 {
-    if ( value != GetValue() )
+    if ( value != DoGetValue() )
     {
         EventsSuppressor noeventsIf(this, !(flags & SetValue_SendEvent));
 
         SelectAll();
         WriteText(value);
+
+        SetInsertionPoint(0);
     }
     else // Same value, no need to do anything.
     {
@@ -238,8 +240,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 +367,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