X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/98c9096992dfc5e8149d0bf1b7d0de51a7979075..0afeb753e0a6a3fdba290bf3612bb2f012d44d95:/src/osx/cocoa/textctrl.mm diff --git a/src/osx/cocoa/textctrl.mm b/src/osx/cocoa/textctrl.mm index 3099d4a408..760257f4f4 100644 --- a/src/osx/cocoa/textctrl.mm +++ b/src/osx/cocoa/textctrl.mm @@ -148,7 +148,7 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil; int len = [*partialStringPtr length]; if ( maxLength > 0 && len > maxLength ) { - // TODO wxEVT_COMMAND_TEXT_MAXLEN + // TODO wxEVT_TEXT_MAXLEN return NO; } return YES; @@ -182,7 +182,11 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil; wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self ); if ( impl ) { - impl->DoNotifyFocusEvent( false, NULL ); + NSResponder * responder = wxNonOwnedWindowCocoaImpl::GetNextFirstResponder(); + NSView* otherView = wxOSXGetViewFromResponder(responder); + + wxWidgetImpl* otherWindow = impl->FindBestFromWXWidget(otherView); + impl->DoNotifyFocusEvent( false, otherWindow ); } } @@ -206,7 +210,7 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil; wxButton *def = wxDynamicCast(tlw->GetDefaultItem(), wxButton); if ( def && def->IsEnabled() ) { - wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() ); + wxCommandEvent event(wxEVT_BUTTON, def->GetId() ); event.SetEventObject(def); def->Command(event); handled = YES; @@ -336,7 +340,11 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil; wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self ); if ( impl ) { - impl->DoNotifyFocusEvent( false, NULL ); + NSResponder * responder = wxNonOwnedWindowCocoaImpl::GetNextFirstResponder(); + NSView* otherView = wxOSXGetViewFromResponder(responder); + + wxWidgetImpl* otherWindow = impl->FindBestFromWXWidget(otherView); + impl->DoNotifyFocusEvent( false, otherWindow ); } } @@ -506,7 +514,11 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil; timpl->SetInternalSelection(range.location, range.location + range.length); } - impl->DoNotifyFocusEvent( false, NULL ); + NSResponder * responder = wxNonOwnedWindowCocoaImpl::GetNextFirstResponder(); + NSView* otherView = wxOSXGetViewFromResponder(responder); + + wxWidgetImpl* otherWindow = impl->FindBestFromWXWidget(otherView); + impl->DoNotifyFocusEvent( false, otherWindow ); } } @end @@ -912,7 +924,7 @@ void wxNSTextFieldControl::controlAction(WXWidget WXUNUSED(slf), wxWindow* wxpeer = (wxWindow*) GetWXPeer(); if ( wxpeer && (wxpeer->GetWindowStyle() & wxTE_PROCESS_ENTER) ) { - wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, wxpeer->GetId()); + wxCommandEvent event(wxEVT_TEXT_ENTER, wxpeer->GetId()); event.SetEventObject( wxpeer ); event.SetString( GetTextEntry()->GetValue() ); wxpeer->HandleWindowEvent( event );