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
This commit is contained in:
@@ -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<wxTextCtrl*>(wxpeer)->GetValue() );
|
||||
wxpeer->HandleWindowEvent( event );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)controlTextDidEndEditing:(NSNotification *)aNotification
|
||||
{
|
||||
wxUnusedVar(aNotification);
|
||||
|
Reference in New Issue
Block a user