]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/app.cpp
Remove persistence related files ag
[wxWidgets.git] / src / osx / carbon / app.cpp
index be9227b5fb8cac6b8bd8674dcf81a84426d76a2a..41469e71ab9598a1d8d12fec1d642f510f70de47 100644 (file)
@@ -79,7 +79,7 @@ wxString  wxApp::s_macHelpMenuTitleName = wxT("&Help") ;
 
 bool      wxApp::sm_isEmbedded = false; // Normally we're not a plugin
 
-#if wxOSX_USE_COCOA_OR_CARBON
+#if wxOSX_USE_CARBON
 
 //----------------------------------------------------------------------
 // Core Apple Event Support
@@ -1377,47 +1377,10 @@ bool wxApp::MacSendKeyDownEvent( wxWindow* focus , long keymessage , long modifi
     if ( !focus )
         return false ;
 
-    bool handled;
     wxKeyEvent event(wxEVT_KEY_DOWN) ;
     MacCreateKeyEvent( event, focus , keymessage , modifiers , when , wherex , wherey , uniChar ) ;
 
-    handled = focus->HandleWindowEvent( event ) ;
-    if ( handled && event.GetSkipped() )
-        handled = false ;
-
-#if wxUSE_ACCEL
-    if ( !handled )
-    {
-        wxWindow *ancestor = focus;
-        while (ancestor)
-        {
-            int command = ancestor->GetAcceleratorTable()->GetCommand( event );
-            if (command != -1)
-            {
-                wxEvtHandler * const handler = ancestor->GetEventHandler();
-
-                wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command );
-                handled = handler->ProcessEvent( command_event );
-
-                if ( !handled )
-                {
-                    // accelerators can also be used with buttons, try them too
-                    command_event.SetEventType(wxEVT_COMMAND_BUTTON_CLICKED);
-                    handled = handler->ProcessEvent( command_event );
-                }
-
-                break;
-            }
-
-            if (ancestor->IsTopLevel())
-                break;
-
-            ancestor = ancestor->GetParent();
-        }
-    }
-#endif // wxUSE_ACCEL
-
-    return handled ;
+    return focus->HandleKeyEvent(event);
 }
 
 bool wxApp::MacSendKeyUpEvent( wxWindow* focus , long keymessage , long modifiers , long when , short wherex , short wherey , wxChar uniChar )
@@ -1428,9 +1391,8 @@ bool wxApp::MacSendKeyUpEvent( wxWindow* focus , long keymessage , long modifier
     bool handled;
     wxKeyEvent event( wxEVT_KEY_UP ) ;
     MacCreateKeyEvent( event, focus , keymessage , modifiers , when , wherex , wherey , uniChar ) ;
-    handled = focus->HandleWindowEvent( event ) ;
 
-    return handled ;
+    return focus->HandleKeyEvent(event) ;
 }
 
 bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers , long when , short wherex , short wherey , wxChar uniChar )
@@ -1439,11 +1401,11 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers
         return false ;
     wxKeyEvent event(wxEVT_CHAR) ;
     MacCreateKeyEvent( event, focus , keymessage , modifiers , when , wherex , wherey , uniChar ) ;
-    long keyval = event.m_keyCode ;
 
     bool handled = false ;
 
 #if wxOSX_USE_CARBON
+    long keyval = event.m_keyCode ;
     wxNonOwnedWindow *tlw = focus->MacGetTopLevelWindow() ;
 
     if (tlw)