X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c84030e020e56735cb4b7c1534e99d21a8bb48c0..ea412ac4eb9f19e3c28dfa32aa9099a81ac7c74c:/src/osx/textentry_osx.cpp diff --git a/src/osx/textentry_osx.cpp b/src/osx/textentry_osx.cpp index 680a4fdcfb..2d9d79a0e2 100644 --- a/src/osx/textentry_osx.cpp +++ b/src/osx/textentry_osx.cpp @@ -148,6 +148,8 @@ wxTextPos wxTextEntry::GetLastPosition() const void wxTextEntry::Remove(long from, long to) { GetTextPeer()->Remove( from , to ) ; + + SendTextUpdatedEventIfAllowed(); } void wxTextEntry::SetSelection(long from, long to) @@ -158,11 +160,15 @@ void wxTextEntry::SetSelection(long from, long to) void wxTextEntry::WriteText(const wxString& str) { GetTextPeer()->WriteText( str ) ; + + SendTextUpdatedEventIfAllowed(); } void wxTextEntry::Clear() { GetTextPeer()->Clear() ; + + SendTextUpdatedEventIfAllowed(); } bool wxTextEntry::IsEditable() const @@ -204,7 +210,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