X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6d5653493414c8203639682536d005f6d9a13c43..77c5e9230e558873be25c8a5472b9b9038b03466:/src/mac/app.cpp diff --git a/src/mac/app.cpp b/src/mac/app.cpp index 5671d05795..baa2127bbf 100644 --- a/src/mac/app.cpp +++ b/src/mac/app.cpp @@ -104,7 +104,6 @@ long wxApp::sm_lastMessageTime = 0; long wxApp::s_lastModifiers = 0 ; -bool wxApp::s_macDefaultEncodingIsPC = true ; bool wxApp::s_macSupportPCMenuShortcuts = true ; long wxApp::s_macAboutMenuItemId = wxID_ABOUT ; long wxApp::s_macPreferencesMenuItemId = wxID_PREFERENCES ; @@ -220,13 +219,12 @@ short wxApp::MacHandleAEOApp(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNU short wxApp::MacHandleAEQuit(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNUSED(reply)) { - /* wxWindow* win = GetTopWindow() ; + wxWindow* win = GetTopWindow() ; if ( win ) { win->Close(TRUE ) ; } - else - */ + else { ExitMainLoop() ; } @@ -601,7 +599,6 @@ bool wxApp::Initialize(int& argc, wxChar **argv) #endif #endif - wxMacSetupConverters() ; s_macCursorRgn = ::NewRgn() ; @@ -612,10 +609,11 @@ bool wxApp::Initialize(int& argc, wxChar **argv) if ( argc > 1 ) { static const wxChar *ARG_PSN = _T("-psn_"); - if ( wxStrncmp(argv[1], ARG_PSN, sizeof(ARG_PSN) - 1) == 0 ) + if ( wxStrncmp(argv[1], ARG_PSN, wxStrlen(ARG_PSN)) == 0 ) { // remove this argument - memmove(argv, argv + 1, argc--); + --argc; + memmove(argv + 1, argv + 2, argc * sizeof(char *)); } } @@ -703,7 +701,6 @@ void wxApp::CleanUp() // __wxterminate in Mach-O shared libraries wxStAppResource::CloseSharedLibraryResource(); #endif - wxMacCleanupConverters() ; UMACleanupToolbox() ; if (s_macCursorRgn) { @@ -1009,15 +1006,9 @@ wxApp::wxApp() m_auto3D = TRUE; m_macCurrentEvent = NULL ; +#if TARGET_CARBON m_macCurrentEventHandlerCallRef = NULL ; -} - -bool wxApp::Initialized() -{ - if (GetTopWindow()) - return TRUE; - else - return FALSE; +#endif } int wxApp::MainLoop() @@ -1050,9 +1041,11 @@ bool wxApp::Pending() } // Dispatch a message. -void wxApp::Dispatch() +bool wxApp::Dispatch() { MacDoOneEvent() ; + + return true; } void wxApp::OnIdle(wxIdleEvent& event) @@ -1396,7 +1389,7 @@ void wxApp::MacHandleModifierEvents( WXEVENTREF evr ) event.SetEventType( ( ev->modifiers & optionKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; focus->GetEventHandler()->ProcessEvent( event ) ; } - if ( ev->modifiers ^ s_lastModifiers ) & cmdKey ) + if ( ( ev->modifiers ^ s_lastModifiers ) & cmdKey ) { event.m_keyCode = WXK_COMMAND ; event.SetEventType( ( ev->modifiers & cmdKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; @@ -1561,7 +1554,7 @@ void wxApp::MacHandleMouseDownEvent( WXEVENTREF evr ) { // Activate window first ::SelectWindow( window ) ; - + // Send event later if ( win ) win->MacMouseDown( ev , windowPart ) ; @@ -2177,7 +2170,7 @@ void wxApp::MacHandleMouseMovedEvent(wxInt32 x , wxInt32 y ,wxUint32 modifiers , event.m_controlDown = modifiers & controlKey; event.m_altDown = modifiers & optionKey; event.m_metaDown = modifiers & cmdKey; - + event.m_x = x; event.m_y = y; event.m_timeStamp = timestamp;