X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c0b301f4e599f2d89820e87d057ae5aa2233ab43..039d4cfb78de4d8a8b97e542e9abd574a5db02eb:/src/osx/carbon/app.cpp?ds=sidebyside diff --git a/src/osx/carbon/app.cpp b/src/osx/carbon/app.cpp index 72602a844e..be1de28f32 100644 --- a/src/osx/carbon/app.cpp +++ b/src/osx/carbon/app.cpp @@ -161,9 +161,13 @@ short wxApp::MacHandleAEODoc(const WXEVENTREF event, WXEVENTREF WXUNUSED(reply)) wxArrayString fileNames; for (i = 1; i <= itemsInList; i++) { - AEGetNthPtr( + err = AEGetNthPtr( &docList, i, typeFSRef, &keywd, &returnedType, (Ptr)&theRef, sizeof(theRef), &actualSize); + + if ( err != noErr) + return err; + fName = wxMacFSRefToPath( &theRef ) ; fileNames.Add(fName); @@ -229,9 +233,13 @@ short wxApp::MacHandleAEPDoc(const WXEVENTREF event , WXEVENTREF WXUNUSED(reply) for (i = 1; i <= itemsInList; i++) { - AEGetNthPtr( + err = AEGetNthPtr( &docList, i, typeFSRef, &keywd, &returnedType, (Ptr)&theRef, sizeof(theRef), &actualSize); + + if ( err != noErr) + return err; + fName = wxMacFSRefToPath( &theRef ) ; MacPrintFile(fName); @@ -1392,34 +1400,34 @@ wxMouseState wxGetMouseState() // TODO : once the new key/char handling is tested, move all the code to wxWindow -bool wxApp::MacSendKeyDownEvent( wxWindow* focus , long keymessage , long modifiers , long when , short wherex , short wherey , wxChar uniChar ) +bool wxApp::MacSendKeyDownEvent( wxWindow* focus , long keymessage , long modifiers , long when , wxChar uniChar ) { if ( !focus ) return false ; wxKeyEvent event(wxEVT_KEY_DOWN) ; - MacCreateKeyEvent( event, focus , keymessage , modifiers , when , wherex , wherey , uniChar ) ; + MacCreateKeyEvent( event, focus , keymessage , modifiers , when , uniChar ) ; return focus->OSXHandleKeyEvent(event); } -bool wxApp::MacSendKeyUpEvent( wxWindow* focus , long keymessage , long modifiers , long when , short wherex , short wherey , wxChar uniChar ) +bool wxApp::MacSendKeyUpEvent( wxWindow* focus , long keymessage , long modifiers , long when , wxChar uniChar ) { if ( !focus ) return false ; wxKeyEvent event( wxEVT_KEY_UP ) ; - MacCreateKeyEvent( event, focus , keymessage , modifiers , when , wherex , wherey , uniChar ) ; + MacCreateKeyEvent( event, focus , keymessage , modifiers , when , uniChar ) ; return focus->OSXHandleKeyEvent(event) ; } -bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers , long when , short wherex , short wherey , wxChar uniChar ) +bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers , long when , wxChar uniChar ) { if ( !focus ) return false ; wxKeyEvent event(wxEVT_CHAR) ; - MacCreateKeyEvent( event, focus , keymessage , modifiers , when , wherex , wherey , uniChar ) ; + MacCreateKeyEvent( event, focus , keymessage , modifiers , when , uniChar ) ; bool handled = false ; @@ -1477,7 +1485,7 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers wxButton *def = wxDynamicCast(tlw->GetDefaultItem(), wxButton); if ( def && def->IsEnabled() ) { - wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() ); + wxCommandEvent event(wxEVT_BUTTON, def->GetId() ); event.SetEventObject(def); def->Command(event); @@ -1488,7 +1496,7 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers else if (keyval == WXK_ESCAPE || (keyval == '.' && modifiers & cmdKey ) ) { // generate wxID_CANCEL if command-. or has been pressed (typically in dialogs) - wxCommandEvent new_event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_CANCEL); + wxCommandEvent new_event(wxEVT_BUTTON,wxID_CANCEL); new_event.SetEventObject( focus ); handled = focus->HandleWindowEvent( new_event ); } @@ -1500,7 +1508,7 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers } // This method handles common code for SendKeyDown, SendKeyUp, and SendChar events. -void wxApp::MacCreateKeyEvent( wxKeyEvent& event, wxWindow* focus , long keymessage , long modifiers , long when , short wherex , short wherey , wxChar uniChar ) +void wxApp::MacCreateKeyEvent( wxKeyEvent& event, wxWindow* focus , long keymessage , long modifiers , long when , wxChar uniChar ) { #if wxOSX_USE_COCOA_OR_CARBON @@ -1582,8 +1590,6 @@ void wxApp::MacCreateKeyEvent( wxKeyEvent& event, wxWindow* focus , long keymess event.m_rawCode = keymessage; event.m_rawFlags = modifiers; - event.m_x = wherex; - event.m_y = wherey; event.SetTimestamp(when); event.SetEventObject(focus); #else @@ -1592,8 +1598,6 @@ void wxApp::MacCreateKeyEvent( wxKeyEvent& event, wxWindow* focus , long keymess wxUnusedVar(keymessage); wxUnusedVar(modifiers); wxUnusedVar(when); - wxUnusedVar(wherex); - wxUnusedVar(wherey); wxUnusedVar(uniChar); #endif }