X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/50f403a568d0ca48a20d780c4a2ebd5b53139aa2..da6f998486f1070e205f2e0a54f22a1b67cb32a4:/src/osx/carbon/app.cpp diff --git a/src/osx/carbon/app.cpp b/src/osx/carbon/app.cpp index 4f7c331b8c..30e3ba48be 100644 --- a/src/osx/carbon/app.cpp +++ b/src/osx/carbon/app.cpp @@ -4,7 +4,6 @@ // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 -// RCS-ID: $Id$ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -401,6 +400,31 @@ void wxApp::MacReopenApp() } } +#if wxOSX_USE_COCOA_OR_IPHONE +void wxApp::OSXOnWillFinishLaunching() +{ + m_onInitResult = OnInit(); +} + +void wxApp::OSXOnDidFinishLaunching() +{ +} + +void wxApp::OSXOnWillTerminate() +{ + wxCloseEvent event; + event.SetCanVeto(false); + wxTheApp->OnEndSession(event); +} + +bool wxApp::OSXOnShouldTerminate() +{ + wxCloseEvent event; + wxTheApp->OnQueryEndSession(event); + return !event.GetVeto(); +} +#endif + //---------------------------------------------------------------------- // Macintosh CommandID support - converting between native and wx IDs //---------------------------------------------------------------------- @@ -795,21 +819,6 @@ bool wxApp::Initialize(int& argc, wxChar **argv) InstallDebugAssertOutputHandler( NewDebugAssertOutputHandlerUPP( wxMacAssertOutputHandler ) ); #endif - // Mac OS X passes a process serial number command line argument when - // the application is launched from the Finder. This argument must be - // removed from the command line arguments before being handled by the - // application (otherwise applications would need to handle it) - if ( argc > 1 ) - { - static const wxChar *ARG_PSN = wxT("-psn_"); - if ( wxStrncmp(argv[1], ARG_PSN, wxStrlen(ARG_PSN)) == 0 ) - { - // remove this argument - --argc; - memmove(argv + 1, argv + 2, argc * sizeof(wxChar*)); - } - } - /* Cocoa supports -Key value options which set the user defaults key "Key" to the value "value" Some of them are very handy for debugging like @@ -863,7 +872,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv) return true; } -#if wxOSX_USE_COCOA_OR_CARBON +#if wxOSX_USE_CARBON bool wxApp::CallOnInit() { wxMacAutoreleasePool autoreleasepool; @@ -1138,7 +1147,7 @@ CGKeyCode wxCharCodeWXToOSX(wxKeyCode code) case WXK_RETURN: keycode = kVK_Return; break; case WXK_ESCAPE: keycode = kVK_Escape; break; case WXK_SPACE: keycode = kVK_Space; break; - case WXK_DELETE: keycode = kVK_Delete; break; + case WXK_DELETE: keycode = kVK_ForwardDelete; break; case WXK_SHIFT: keycode = kVK_Shift; break; case WXK_ALT: keycode = kVK_Option; break;