X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c84030e020e56735cb4b7c1534e99d21a8bb48c0..38c69d200d4ae691a04f1b7d7a107d4c306b3ae0:/src/osx/textentry_osx.cpp diff --git a/src/osx/textentry_osx.cpp b/src/osx/textentry_osx.cpp index 680a4fdcfb..5f51fca1b7 100644 --- a/src/osx/textentry_osx.cpp +++ b/src/osx/textentry_osx.cpp @@ -4,7 +4,7 @@ // Author: Stefan Csomor // Modified by: Kevin Ollivier // Created: 1998-01-01 -// RCS-ID: $Id: textctrl.cpp 54820 2008-07-29 20:04:11Z SC $ +// RCS-ID: $Id$ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -147,7 +147,12 @@ wxTextPos wxTextEntry::GetLastPosition() const void wxTextEntry::Remove(long from, long to) { - GetTextPeer()->Remove( from , to ) ; + { + EventsSuppressor noevents(this); + GetTextPeer()->Remove( from , to ); + } + + SendTextUpdatedEventIfAllowed(); } void wxTextEntry::SetSelection(long from, long to) @@ -157,12 +162,22 @@ void wxTextEntry::SetSelection(long from, long to) void wxTextEntry::WriteText(const wxString& str) { - GetTextPeer()->WriteText( str ) ; + { + EventsSuppressor noevents(this); + GetTextPeer()->WriteText( str ); + } + + SendTextUpdatedEventIfAllowed(); } void wxTextEntry::Clear() { - GetTextPeer()->Clear() ; + { + EventsSuppressor noevents(this); + GetTextPeer()->Clear(); + } + + SendTextUpdatedEventIfAllowed(); } bool wxTextEntry::IsEditable() const @@ -204,7 +219,9 @@ bool wxTextEntry::CanRedo() const wxTextWidgetImpl * wxTextEntry::GetTextPeer() const { - wxFAIL_MSG("You need to implement wxTextWidgetImpl* GetTextPeer() in your wxTextEntry subclass if you want to use the native impls of its methods."); - return NULL; + wxWindow * const win = const_cast(this)->GetEditableWindow(); + + return win ? dynamic_cast(win->GetPeer()) : NULL; } + #endif // wxUSE_TEXTCTRL