From: Vadim Zeitlin Date: Fri, 5 Nov 2010 21:39:49 +0000 (+0000) Subject: Remove duplicate wxEVT_COMMAND_TEXT_ENTER generation from wxOSX/Cocoa. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/dc36b43adf22c24d5f30ad7b7021bf9da4ce0d81 Remove duplicate wxEVT_COMMAND_TEXT_ENTER generation from wxOSX/Cocoa. The code in -[wxNSTextField control:textView:doCommandBySelector:] generated a second copy of this event as it was also generated from wxNSTextFieldControl::controlAction() for single line text controls. Closes #11691. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66032 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/cocoa/textctrl.mm b/src/osx/cocoa/textctrl.mm index 32464f3636..ad726edddf 100644 --- a/src/osx/cocoa/textctrl.mm +++ b/src/osx/cocoa/textctrl.mm @@ -253,31 +253,6 @@ protected : impl->controlTextDidChange(); } -typedef BOOL (*wxOSX_insertNewlineHandlerPtr)(NSView* self, SEL _cmd, NSControl *control, NSTextView* textView, SEL commandSelector); - -- (BOOL)control:(NSControl*)control textView:(NSTextView*)textView doCommandBySelector:(SEL)commandSelector -{ - wxUnusedVar(textView); - wxUnusedVar(control); - if (commandSelector == @selector(insertNewline:)) - { - wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self ); - if ( impl ) - { - wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer(); - if ( wxpeer && wxpeer->GetWindowStyle() & wxTE_PROCESS_ENTER ) - { - wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, wxpeer->GetId()); - event.SetEventObject( wxpeer ); - event.SetString( static_cast(wxpeer)->GetValue() ); - wxpeer->HandleWindowEvent( event ); - } - } - } - - return NO; -} - - (void)controlTextDidEndEditing:(NSNotification *)aNotification { wxUnusedVar(aNotification);