setting up current event also when mouse is captured ...

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70694 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2012-02-26 10:21:03 +00:00
parent e59e670c9b
commit 2712275c88

View File

@@ -120,9 +120,14 @@ bool shouldHandleSelector(SEL selector)
bool handled = false; bool handled = false;
if ( ([event type] >= NSLeftMouseDown) && ([event type] <= NSMouseExited) ) if ( ([event type] >= NSLeftMouseDown) && ([event type] <= NSMouseExited) )
{ {
WXEVENTREF formerEvent = wxTheApp == NULL ? NULL : wxTheApp->MacGetCurrentEvent();
WXEVENTHANDLERCALLREF formerHandler = wxTheApp == NULL ? NULL : wxTheApp->MacGetCurrentEventHandlerCallRef();
wxWindow* cw = wxWindow::GetCapture(); wxWindow* cw = wxWindow::GetCapture();
if ( cw != NULL ) if ( cw != NULL )
{ {
if (wxTheApp)
wxTheApp->MacSetCurrentEvent(event, NULL);
((wxWidgetCocoaImpl*)cw->GetPeer())->DoHandleMouseEvent( event); ((wxWidgetCocoaImpl*)cw->GetPeer())->DoHandleMouseEvent( event);
handled = true; handled = true;
} }
@@ -136,10 +141,17 @@ bool shouldHandleSelector(SEL selector)
wxWindow* mw = ::wxFindWindowAtPoint(pt); wxWindow* mw = ::wxFindWindowAtPoint(pt);
if ( mw ) if ( mw )
{ {
if (wxTheApp)
wxTheApp->MacSetCurrentEvent(event, NULL);
((wxWidgetCocoaImpl*)mw->GetPeer())->DoHandleMouseEvent( event); ((wxWidgetCocoaImpl*)mw->GetPeer())->DoHandleMouseEvent( event);
handled = true; handled = true;
} }
} }
if ( handled )
{
if (wxTheApp)
wxTheApp->MacSetCurrentEvent(formerEvent , formerHandler);
}
} }
return handled; return handled;
} }
@@ -469,8 +481,8 @@ extern int wxOSXGetIdFromSelector(SEL action );
[editor release]; [editor release];
} }
return editor; return editor;
} }
return nil; return nil;
} }