From 27740109cad72ef6aca05ffbed7c0f5c2a0b8cd8 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Fri, 6 Aug 2004 15:50:40 +0000 Subject: [PATCH] moving stacking event handlers and event ref to central location git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28659 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/app.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index 9e29f7961c..f610756a2a 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -366,11 +366,7 @@ static const EventTypeSpec eventList[] = static pascal OSStatus wxMacAppMenuEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - EventRef formerEvent = (EventRef) wxTheApp->MacGetCurrentEvent() ; - EventHandlerCallRef formerEventHandlerCallRef = (EventHandlerCallRef) wxTheApp->MacGetCurrentEventHandlerCallRef() ; - wxTheApp->MacSetCurrentEvent( event , handler ) ; - +{ wxMacCarbonEvent cEvent( event ) ; MenuRef menuRef = cEvent.GetParameter(kEventParamDirectObject) ; wxMenu* menu = wxFindMenuFromMacMenu( menuRef ) ; @@ -416,8 +412,6 @@ wxMacAppMenuEventHandler( EventHandlerCallRef handler , EventRef event , void *d } } - wxTheApp->MacSetCurrentEvent( formerEvent, formerEventHandlerCallRef ) ; - return eventNotHandledErr; } @@ -502,6 +496,10 @@ static pascal OSStatus wxMacAppApplicationEventHandler( EventHandlerCallRef hand pascal OSStatus wxMacAppEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) { + EventRef formerEvent = (EventRef) wxTheApp->MacGetCurrentEvent() ; + EventHandlerCallRef formerEventHandlerCallRef = (EventHandlerCallRef) wxTheApp->MacGetCurrentEventHandlerCallRef() ; + wxTheApp->MacSetCurrentEvent( event , handler ) ; + OSStatus result = eventNotHandledErr ; switch( GetEventClass( event ) ) { @@ -528,6 +526,8 @@ pascal OSStatus wxMacAppEventHandler( EventHandlerCallRef handler , EventRef eve break ; } + wxTheApp->MacSetCurrentEvent( formerEvent, formerEventHandlerCallRef ) ; + return result ; }