X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/58ddb76c39b7c204181f28d9ef14e71466968b1f..7d9bf1f11cc6c2067af6285682f096d98e523540:/src/mac/carbon/app.cpp diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index bee3132deb..082a1c35ed 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -49,7 +49,7 @@ #endif #endif -#include "apprsrc.h" +// #include "apprsrc.h" #include "wx/mac/uma.h" #include "wx/mac/macnotfy.h" @@ -59,6 +59,8 @@ # if defined(WXMAKINGDLL_CORE) # include # endif +// include hid keyboard +# include "wx/mac/carbon/private/hid.h" #else # include # include @@ -69,6 +71,16 @@ extern wxList wxPendingDelete; +// set wxMAC_USE_RAEL to 1 if RunApplicationEventLoop should be used +// if 0 the lower level CarbonEventLoop will be used +// on the long run RAEL should replace the low level event loop +// we will have to clean up event handling to make sure we don't +// miss handling of things like pending events etc +// perhaps we will also have to pipe events through an ueber-event-handler +// to make sure we have one place to do all these house-keeping functions + +#define wxMAC_USE_RAEL 0 + #if wxUSE_THREADS extern size_t g_numberOfThreads; #endif // wxUSE_THREADS @@ -109,6 +121,10 @@ long wxApp::s_macPreferencesMenuItemId = wxID_PREFERENCES ; long wxApp::s_macExitMenuItemId = wxID_EXIT ; wxString wxApp::s_macHelpMenuTitleName = wxT("&Help") ; +#ifdef __DARWIN__ + wxHIDKeyboard* wxApp::s_macHIDKeyboard = NULL; +#endif + // Normally we're not a plugin bool wxApp::sm_isEmbedded = false; //---------------------------------------------------------------------- @@ -155,7 +171,6 @@ short wxApp::MacHandleAEODoc(const WXEVENTREF event, WXEVENTREF WXUNUSED(reply)) DescType returnedType; Size actualSize; long itemsInList; - FSSpec theSpec; OSErr err; short i; err = AEGetParamDesc((AppleEvent *)event, keyDirectObject, typeAEList,&docList); @@ -171,10 +186,15 @@ short wxApp::MacHandleAEODoc(const WXEVENTREF event, WXEVENTREF WXUNUSED(reply)) PSN.lowLongOfPSN = kCurrentProcess ; SetFrontProcess( &PSN ) ; - for (i = 1; i <= itemsInList; i++) { - AEGetNthPtr(&docList, i, typeFSS, &keywd, &returnedType, - (Ptr) & theSpec, sizeof(theSpec), &actualSize); - wxString fName = wxMacFSSpec2MacFilename(&theSpec); + for (i = 1; i <= itemsInList; i++) + { + wxString fName ; + + FSRef theRef ; + AEGetNthPtr(&docList, i, typeFSRef, &keywd, &returnedType, + (Ptr) & theRef, sizeof(theRef), &actualSize); + fName = wxMacFSRefToPath( &theRef ) ; + MacOpenFile(fName); } return noErr; @@ -189,7 +209,6 @@ short wxApp::MacHandleAEPDoc(const WXEVENTREF event , WXEVENTREF WXUNUSED(reply) DescType returnedType; Size actualSize; long itemsInList; - FSSpec theSpec; OSErr err; short i; err = AEGetParamDesc((AppleEvent *)event, keyDirectObject, typeAEList,&docList); @@ -206,9 +225,13 @@ short wxApp::MacHandleAEPDoc(const WXEVENTREF event , WXEVENTREF WXUNUSED(reply) SetFrontProcess( &PSN ) ; for (i = 1; i <= itemsInList; i++) { - AEGetNthPtr(&docList, i, typeFSS, &keywd, &returnedType, - (Ptr) & theSpec, sizeof(theSpec), &actualSize); - wxString fName = wxMacFSSpec2MacFilename(&theSpec); + wxString fName ; + + FSRef theRef ; + AEGetNthPtr(&docList, i, typeFSRef, &keywd, &returnedType, + (Ptr) & theRef, sizeof(theRef), &actualSize); + fName = wxMacFSRefToPath( &theRef ) ; + MacPrintFile(fName); } return noErr; @@ -294,7 +317,37 @@ void wxApp::MacNewFile() void wxApp::MacReopenApp() { - // eventually check for open docs, if none, call MacNewFile + // HIG says : + // if there is no open window -> create a new one + // if all windows are hidden -> show the first + // if some windows are not hidden -> do nothing + + wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst(); + if ( node == NULL ) + { + MacNewFile() ; + } + else + { + wxTopLevelWindow* firstIconized = NULL ; + while (node) + { + wxTopLevelWindow* win = (wxTopLevelWindow*) node->GetData(); + if ( win->IsIconized() == false ) + { + firstIconized = NULL ; + break ; + } + else + { + if ( firstIconized == NULL ) + firstIconized = win ; + } + node = node->GetNext(); + } + if ( firstIconized ) + firstIconized->Iconize( false ) ; + } } //---------------------------------------------------------------------- @@ -326,57 +379,52 @@ static const EventTypeSpec eventList[] = static pascal OSStatus wxMacAppMenuEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - wxMenuBar* mbar = wxMenuBar::MacGetInstalledMenuBar(); +{ + wxMacCarbonEvent cEvent( event ) ; + MenuRef menuRef = cEvent.GetParameter(kEventParamDirectObject) ; + wxMenu* menu = wxFindMenuFromMacMenu( menuRef ) ; - if ( mbar ) + if ( menu ) { - wxFrame* win = mbar->GetFrame(); - if ( win ) + wxEventType type=0; + MenuCommand cmd=0; + switch (GetEventKind(event)) { - - // VZ: we could find the menu from its handle here by examining all - // the menus in the menu bar recursively but knowing that neither - // wxMSW nor wxGTK do it why bother... - #if 0 - MenuRef menuRef; - - GetEventParameter(event, - kEventParamDirectObject, - typeMenuRef, NULL, - sizeof(menuRef), NULL, - &menuRef); - #endif // 0 - - wxEventType type=0; - MenuCommand cmd=0; - switch (GetEventKind(event)) - { - case kEventMenuOpening: - type = wxEVT_MENU_OPEN; - break; - case kEventMenuClosed: - type = wxEVT_MENU_CLOSE; - break; - case kEventMenuTargetItem: + case kEventMenuOpening: + type = wxEVT_MENU_OPEN; + break; + case kEventMenuClosed: + type = wxEVT_MENU_CLOSE; + break; + case kEventMenuTargetItem: + cmd = cEvent.GetParameter(kEventParamMenuCommand,typeMenuCommand) ; + if (cmd != 0) type = wxEVT_MENU_HIGHLIGHT; - GetEventParameter(event, kEventParamMenuCommand, - typeMenuCommand, NULL, - sizeof(cmd), NULL, &cmd); - if (cmd == 0) return eventNotHandledErr; - break; - default: - wxFAIL_MSG(wxT("Unexpected menu event kind")); - break; - } + break; + default: + wxFAIL_MSG(wxT("Unexpected menu event kind")); + break; + } - wxMenuEvent wxevent(type, cmd); - wxevent.SetEventObject(win); + if ( type ) + { + wxMenuEvent wxevent(type, cmd, menu); + wxevent.SetEventObject(menu); - (void)win->GetEventHandler()->ProcessEvent(wxevent); - } + wxEvtHandler* handler = menu->GetEventHandler(); + if (handler && handler->ProcessEvent(wxevent)) + { + // handled + } + else + { + wxWindow *win = menu->GetInvokingWindow(); + if (win) + win->GetEventHandler()->ProcessEvent(wxevent); + } + } } - + return eventNotHandledErr; } @@ -386,32 +434,31 @@ static pascal OSStatus wxMacAppCommandEventHandler( EventHandlerCallRef handler HICommand command ; - GetEventParameter( event, kEventParamDirectObject, typeHICommand, NULL, - sizeof( HICommand ), NULL, &command ); - + wxMacCarbonEvent cEvent( event ) ; + cEvent.GetParameter(kEventParamDirectObject,typeHICommand,&command) ; + + wxMenuItem* item = NULL ; MenuCommand id = command.commandID ; + // for items we don't really control if ( id == kHICommandPreferences ) - id = wxApp::s_macPreferencesMenuItemId ; - - wxMenuBar* mbar = wxMenuBar::MacGetInstalledMenuBar() ; - wxMenu* menu = NULL ; - wxMenuItem* item = NULL ; - - if ( mbar ) { - item = mbar->FindItem( id , &menu ) ; - // it is not 100 % sure that an menu of id 0 is really ours, safety check - if ( id == 0 && menu != NULL && menu->GetHMenu() != command.menu.menuRef ) + id = wxApp::s_macPreferencesMenuItemId ; + + wxMenuBar* mbar = wxMenuBar::MacGetInstalledMenuBar() ; + if ( mbar ) { - item = NULL ; - menu = NULL ; + wxMenu* menu = NULL ; + item = mbar->FindItem( id , &menu ) ; } } - - if ( item == NULL || menu == NULL || mbar == NULL ) - return result ; - - switch( GetEventKind( event ) ) + else if ( id != 0 && command.menu.menuRef != 0 && command.menu.menuItemIndex != 0 ) + { + GetMenuItemRefCon( command.menu.menuRef , command.menu.menuItemIndex , (UInt32*) &item ) ; + } + + if ( item ) + { + switch( cEvent.GetKind() ) { case kEventProcessCommand : { @@ -420,18 +467,18 @@ static pascal OSStatus wxMacAppCommandEventHandler( EventHandlerCallRef handler item->Check( !item->IsChecked() ) ; } - menu->SendEvent( id , item->IsCheckable() ? item->IsChecked() : -1 ) ; + item->GetMenu()->SendEvent( id , item->IsCheckable() ? item->IsChecked() : -1 ) ; result = noErr ; } - break ; + break ; case kEventCommandUpdateStatus: // eventually trigger an updateui round result = noErr ; break ; - default : - break ; - } - + default : + break ; + } + } return result ; } @@ -462,6 +509,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 ) ) { @@ -475,7 +526,17 @@ pascal OSStatus wxMacAppEventHandler( EventHandlerCallRef handler , EventRef eve result = wxMacAppMenuEventHandler( handler , event , data ) ; break ; case kEventClassMouse : - result = wxMacTopLevelMouseEventHandler( handler , event , NULL ) ; + { + wxMacCarbonEvent cEvent( event ) ; + + WindowRef window ; + Point screenMouseLocation = cEvent.GetParameter(kEventParamMouseLocation) ; + ::FindWindow(screenMouseLocation, &window); + // only send this event in case it had not already been sent to a tlw, as we get + // double events otherwise (in case event.skip) was called + if ( window == NULL ) + result = wxMacTopLevelMouseEventHandler( handler , event , NULL ) ; + } break ; case kEventClassAppleEvent : { @@ -488,6 +549,8 @@ pascal OSStatus wxMacAppEventHandler( EventHandlerCallRef handler , EventRef eve break ; } + wxTheApp->MacSetCurrentEvent( formerEvent, formerEventHandlerCallRef ) ; + return result ; } @@ -498,6 +561,8 @@ DEFINE_ONE_SHOT_HANDLER_GETTER( wxMacAppEventHandler ) WXIMPORT char std::__throws_bad_alloc ; #endif +#if __WXDEBUG__ + pascal static void wxMacAssertOutputHandler(OSType componentSignature, UInt32 options, const char *assertionString, const char *exceptionLabelString, const char *errorString, const char *fileName, long lineNumber, void *value, ConstStr255Param outputMsg) @@ -534,6 +599,8 @@ pascal static void wxMacAssertOutputHandler(OSType componentSignature, UInt32 op #endif } +#endif //__WXDEBUG__ + bool wxApp::Initialize(int& argc, wxChar **argv) { // Mac-specific @@ -545,12 +612,6 @@ bool wxApp::Initialize(int& argc, wxChar **argv) SetEventMask( everyEvent ) ; UMAShowWatchCursor() ; -#if defined(WXMAKINGDLL_CORE) && defined(__DARWIN__) - // open shared library resources from here since we don't have - // __wxinitialize in Mach-O shared libraries - wxStAppResource::OpenSharedLibraryResource(NULL); -#endif - #ifndef __DARWIN__ # if __option(profile) ProfilerInit( collectDetailed, bestTimeBase , 40000 , 50 ) ; @@ -590,6 +651,20 @@ bool wxApp::Initialize(int& argc, wxChar **argv) wxFont::SetDefaultEncoding(wxLocale::GetSystemEncoding()); #endif +#if TARGET_API_MAC_OSX + // these might be the startup dirs, set them to the 'usual' dir containing the app bundle + wxString startupCwd = wxGetCwd() ; + if ( startupCwd == wxT("/") || startupCwd.Right(15) == wxT("/Contents/MacOS") ) + { + CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle() ) ; + CFURLRef urlParent = CFURLCreateCopyDeletingLastPathComponent( kCFAllocatorDefault , url ) ; + CFRelease( url ) ; + CFStringRef path = CFURLCopyFileSystemPath ( urlParent , kCFURLPOSIXPathStyle ) ; + CFRelease( urlParent ) ; + wxString cwd = wxMacCFStringHolder(path).AsString(wxLocale::GetSystemEncoding()); + wxSetWorkingDirectory( cwd ) ; + } +#endif wxMacCreateNotifierTable() ; @@ -648,12 +723,10 @@ void wxApp::CleanUp() ProfilerDump( (StringPtr)"\papp.prof" ) ; ProfilerTerm() ; # endif -#endif -#if defined(WXMAKINGDLL_CORE) && defined(__DARWIN__) - // close shared library resources from here since we don't have - // __wxterminate in Mach-O shared libraries - wxStAppResource::CloseSharedLibraryResource(); + // clean up HID Keyboard + if (s_macHIDKeyboard) + delete s_macHIDKeyboard; #endif UMACleanupToolbox() ; @@ -672,153 +745,6 @@ void wxApp::CleanUp() // misc initialization stuff //---------------------------------------------------------------------- -// extern variable for shared library resource id -// need to be able to find it with NSLookupAndBindSymbol -short gSharedLibraryResource = kResFileNotOpened ; - -#if defined(WXMAKINGDLL_CORE) && defined(__DARWIN__) -CFBundleRef gSharedLibraryBundle = NULL; -#endif /* WXMAKINGDLL_CORE && __DARWIN__ */ - -wxStAppResource::wxStAppResource() -{ - m_currentRefNum = CurResFile() ; - if ( gSharedLibraryResource != kResFileNotOpened ) - { - UseResFile( gSharedLibraryResource ) ; - } -} - -wxStAppResource::~wxStAppResource() -{ - if ( m_currentRefNum != kResFileNotOpened ) - { - UseResFile( m_currentRefNum ) ; - } -} - -void wxStAppResource::OpenSharedLibraryResource(const void *initBlock) -{ - gSharedLibraryResource = kResFileNotOpened; - -#ifdef WXMAKINGDLL_CORE - if ( initBlock != NULL ) { - const CFragInitBlock *theInitBlock = (const CFragInitBlock *)initBlock; - FSSpec *fileSpec = NULL; - - if (theInitBlock->fragLocator.where == kDataForkCFragLocator) { - fileSpec = theInitBlock->fragLocator.u.onDisk.fileSpec; - } - else if (theInitBlock->fragLocator.where == kResourceCFragLocator) { - fileSpec = theInitBlock->fragLocator.u.inSegs.fileSpec; - } - - if (fileSpec != NULL) { - gSharedLibraryResource = FSpOpenResFile(fileSpec, fsRdPerm); - } - } - else { -#ifdef __DARWIN__ - // Open the shared library resource file if it is not yet open - NSSymbol theSymbol; - NSModule theModule; - const char *theLibPath; - - gSharedLibraryBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.wxwindows.wxWindows")); - if (gSharedLibraryBundle != NULL) { - // wxWindows has been bundled into a framework - // load the framework resources - - gSharedLibraryResource = CFBundleOpenBundleResourceMap(gSharedLibraryBundle); - } - else { - // wxWindows is a simple dynamic shared library - // load the resources from the data fork of a separate resource file - wxString theResPath; - wxString theName; - FSRef theResRef; - OSErr theErr = noErr; - - // get the library path - theSymbol = NSLookupAndBindSymbol("_gSharedLibraryResource"); - theModule = NSModuleForSymbol(theSymbol); - theLibPath = NSLibraryNameForModule(theModule); - - // if we call wxLogDebug from here then, as wxTheApp hasn't been - // created yet when we're called from wxApp::Initialize(), wxLog - // is going to create a default stderr-based log target instead of - // the expected normal GUI one -- don't do it, if we really want - // to see this message just use fprintf() here -#if 0 - wxLogDebug( wxT("wxMac library installation name is '%s'"), - theLibPath ); -#endif - - // allocate copy to replace .dylib.* extension with .rsrc - if (theLibPath != NULL) { -#if wxUSE_UNICODE - theResPath = wxString(theLibPath, wxConvLocal); -#else - theResPath = wxString(theLibPath); -#endif - // replace '_core' with '' in case of multi-lib build - theResPath.Replace(wxT("_core"), wxEmptyString); - // replace ".dylib" shared library extension with ".rsrc" - theResPath.Replace(wxT(".dylib"), wxT(".rsrc")); - // Find the begining of the filename - theName = theResPath.AfterLast('/'); - -#if 0 - wxLogDebug( wxT("wxMac resources file name is '%s'"), - theResPath.mb_str() ); -#endif - - theErr = FSPathMakeRef((UInt8 *) theResPath.mb_str(), &theResRef, false); - if (theErr != noErr) { - // try in current directory (using name only) - theErr = FSPathMakeRef((UInt8 *) theName.mb_str(), &theResRef, false); - } - - // open the resource file - if (theErr == noErr) { - theErr = FSOpenResourceFile( &theResRef, 0, NULL, fsRdPerm, - &gSharedLibraryResource); - } - if (theErr != noErr) { -#ifdef __WXDEBUG__ - wxLogDebug( wxT("unable to open wxMac resource file '%s'\n"), - theResPath.mb_str() ); -#endif // __WXDEBUG__ - } - - } - } -#endif /* __DARWIN__ */ - } -#endif /* WXMAKINGDLL_CORE */ -} - -void wxStAppResource::CloseSharedLibraryResource() -{ -#ifdef WXMAKINGDLL_CORE - // Close the shared library resource file - if (gSharedLibraryResource != kResFileNotOpened) { -#ifdef __DARWIN__ - if (gSharedLibraryBundle != NULL) { - CFBundleCloseBundleResourceMap(gSharedLibraryBundle, - gSharedLibraryResource); - gSharedLibraryBundle = NULL; - } - else -#endif /* __DARWIN__ */ - { - CloseResFile(gSharedLibraryResource); - } - gSharedLibraryResource = kResFileNotOpened; - } -#endif /* WXMAKINGDLL_CORE */ -} - #if defined(WXMAKINGDLL_CORE) && !defined(__DARWIN__) // for shared libraries we have to manually get the correct resource @@ -833,13 +759,11 @@ extern "C" { pascal OSErr __wxinitialize(const CFragInitBlock *theInitBlock) { - wxStAppResource::OpenSharedLibraryResource( theInitBlock ) ; return __initialize( theInitBlock ) ; } pascal void __wxterminate(void) { - wxStAppResource::CloseSharedLibraryResource() ; __terminate() ; } @@ -934,18 +858,23 @@ wxApp::wxApp() int wxApp::MainLoop() { m_keepGoing = TRUE; - +#if wxMAC_USE_RAEL + RunApplicationEventLoop() ; +#else while (m_keepGoing) { MacDoOneEvent() ; } - +#endif return 0; } void wxApp::ExitMainLoop() { - m_keepGoing = FALSE; + m_keepGoing = FALSE; +#if wxMAC_USE_RAEL + QuitApplicationEventLoop() ; +#endif } // Is a message/event pending? @@ -1028,9 +957,6 @@ bool wxApp::Yield(bool onlyIfNeeded) s_inYield = TRUE; -#if wxUSE_THREADS - YieldToAnyThread() ; -#endif // by definition yield should handle all non-processed events EventRef theEvent; @@ -1077,18 +1003,7 @@ void wxApp::MacDoOneEvent() if ( wxTheApp->ProcessIdle() ) sleepTime = kEventDurationNoWait ; else - { -#if wxUSE_THREADS - if (g_numberOfThreads) - { - sleepTime = kEventDurationNoWait; - } - else -#endif // wxUSE_THREADS - { - sleepTime = kEventDurationSecond; - } - } + sleepTime = kEventDurationSecond; } else if ( status == eventLoopQuitErr ) { @@ -1123,6 +1038,9 @@ void wxApp::MacHandleOneEvent( WXEVENTREF evr ) MacHandleUnhandledEvent(evr); } wxMacProcessNotifierAndPendingEvents() ; +#if wxUSE_THREADS + wxMutexGuiLeaveOrEnter(); +#endif // wxUSE_THREADS } long wxMacTranslateKey(unsigned char key, unsigned char code) ; @@ -1261,11 +1179,16 @@ int wxMacKeyCodeToModifier(wxKeyCode key) bool wxGetKeyState(wxKeyCode key) //virtual key code if < 10.2.x, else see below { -//#ifdef __DARWIN__ -// wxHIDKeyboard keyboard; -// return keyboard.IsActive(key); -//#else -// TODO: Have it use HID Manager on OSX... +#ifdef __DARWIN__ + // Startup HID keyboard for getting key codes on DARWIN + if (!wxApp::s_macHIDKeyboard) + { + wxApp::s_macHIDKeyboard = new wxHIDKeyboard(); + wxApp::s_macHIDKeyboard->Create(); + } + + return wxApp::s_macHIDKeyboard->IsActive(key); +#else //if OS X > 10.2 (i.e. 10.2.x) //a known apple bug prevents the system from determining led //states with GetKeys... can only determine caps lock led @@ -1274,7 +1197,7 @@ bool wxGetKeyState(wxKeyCode key) //virtual key code if < 10.2.x, else see below // KeyMapByteArray keymap; // GetKeys((BigEndianLong*)keymap); // return !!(BitTst(keymap, (sizeof(KeyMapByteArray)*8) - iKey)); -//#endif +#endif } @@ -1354,27 +1277,25 @@ bool wxApp::MacSendKeyDownEvent( wxWindow* focus , long keymessage , long modifi if ( handled && event.GetSkipped() ) handled = false ; } - if ( !handled && - (keyval == WXK_TAB) && -// CS: copied the change below from wxGTK -// VZ: testing for wxTE_PROCESS_TAB shouldn't be done here the control may -// have this style, yet choose not to process this particular TAB in which -// case TAB must still work as a navigational character -#if 0 - (!focus->HasFlag(wxTE_PROCESS_TAB)) && -#endif - (focus->GetParent()) && - (focus->GetParent()->HasFlag( wxTAB_TRAVERSAL)) ) + if ( !handled && (keyval == WXK_TAB) ) { - wxNavigationKeyEvent new_event; - new_event.SetEventObject( focus ); - new_event.SetDirection( !event.ShiftDown() ); - /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */ - new_event.SetWindowChange( event.ControlDown() ); - new_event.SetCurrentFocus( focus ); - handled = focus->GetEventHandler()->ProcessEvent( new_event ); - if ( handled && new_event.GetSkipped() ) - handled = false ; + wxWindow* iter = focus->GetParent() ; + while( iter && !handled ) + { + if ( iter->HasFlag( wxTAB_TRAVERSAL ) ) + { + wxNavigationKeyEvent new_event; + new_event.SetEventObject( focus ); + new_event.SetDirection( !event.ShiftDown() ); + /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */ + new_event.SetWindowChange( event.ControlDown() ); + new_event.SetCurrentFocus( focus ); + handled = focus->GetParent()->GetEventHandler()->ProcessEvent( new_event ); + if ( handled && new_event.GetSkipped() ) + handled = false ; + } + iter = iter->GetParent() ; + } } // backdoor handler for default return and command escape if ( !handled && (!focus->IsKindOf(CLASSINFO(wxControl) ) || !focus->MacCanFocus() ) )