X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1bd568fa44a864a4110b13e8e0d08f923e5fb4ff..10ff9c616e00e4074dfdc2ac9e354605cc129c22:/src/mac/carbon/app.cpp diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index f17bc48c4a..566f3a34a7 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -39,6 +39,7 @@ #include "wx/docview.h" #include "wx/filename.h" #include "wx/link.h" +#include "wx/thread.h" #include @@ -586,7 +587,7 @@ wxMacAppMenuEventHandler( EventHandlerCallRef WXUNUSED(handler), { wxWindow *win = menu->GetInvokingWindow(); if (win) - win->GetEventHandler()->ProcessEvent(wxevent); + win->HandleWindowEvent(wxevent); } } } @@ -779,8 +780,6 @@ extern "C" void macPostedEventCallback(void *WXUNUSED(unused)) wxTheApp->ProcessPendingEvents(); } -ProcessSerialNumber gAppProcess ; - bool wxApp::Initialize(int& argc, wxChar **argv) { // Mac-specific @@ -791,7 +790,6 @@ bool wxApp::Initialize(int& argc, wxChar **argv) UMAInitToolbox( 4, sm_isEmbedded ) ; // TODO CHECK Can Be Removed SetEventMask( everyEvent ) ; - UMAShowWatchCursor() ; // Mac OS X passes a process serial number command line argument when // the application is launched from the Finder. This argument must be @@ -811,8 +809,6 @@ bool wxApp::Initialize(int& argc, wxChar **argv) if ( !wxAppBase::Initialize(argc, argv) ) return false; - GetCurrentProcess(&gAppProcess); - #if wxUSE_INTL wxFont::SetDefaultEncoding(wxLocale::GetSystemEncoding()); #endif @@ -839,8 +835,6 @@ bool wxApp::Initialize(int& argc, wxChar **argv) // run loop takes ownership CFRelease(m_macEventPosted); - UMAShowArrowCursor() ; - return true; } @@ -909,8 +903,6 @@ void wxApp::CleanUp() // One last chance for pending objects to be cleaned up wxTheApp->DeletePendingObjects(); - UMACleanupToolbox() ; - if (!sm_isEmbedded) RemoveEventHandler( (EventHandlerRef)(wxTheApp->m_macEventHandler) ); @@ -1417,7 +1409,7 @@ bool wxApp::MacSendKeyDownEvent( wxWindow* focus , long keymessage , long modifi wxKeyEvent event(wxEVT_KEY_DOWN) ; MacCreateKeyEvent( event, focus , keymessage , modifiers , when , wherex , wherey , uniChar ) ; - handled = focus->GetEventHandler()->ProcessEvent( event ) ; + handled = focus->HandleWindowEvent( event ) ; if ( handled && event.GetSkipped() ) handled = false ; @@ -1464,7 +1456,7 @@ 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->GetEventHandler()->ProcessEvent( event ) ; + handled = focus->HandleWindowEvent( event ) ; return handled ; } @@ -1485,7 +1477,7 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers if (tlw) { event.SetEventType( wxEVT_CHAR_HOOK ); - handled = tlw->GetEventHandler()->ProcessEvent( event ); + handled = tlw->HandleWindowEvent( event ); if ( handled && event.GetSkipped() ) handled = false ; } @@ -1494,7 +1486,7 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers { event.SetEventType( wxEVT_CHAR ); event.Skip( false ) ; - handled = focus->GetEventHandler()->ProcessEvent( event ) ; + handled = focus->HandleWindowEvent( event ) ; } if ( !handled && (keyval == WXK_TAB) ) @@ -1510,7 +1502,7 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers /* 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 ); + handled = focus->GetParent()->HandleWindowEvent( new_event ); if ( handled && new_event.GetSkipped() ) handled = false ; } @@ -1549,7 +1541,7 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers // generate wxID_CANCEL if command-. or has been pressed (typically in dialogs) wxCommandEvent new_event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_CANCEL); new_event.SetEventObject( focus ); - handled = focus->GetEventHandler()->ProcessEvent( new_event ); + handled = focus->HandleWindowEvent( new_event ); } } #endif