X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c1313b54c69ae2ca1b7987450a6bbac567b7e400..b39badac119fe944152cd1408a90b82e710ea598:/src/osx/carbon/app.cpp diff --git a/src/osx/carbon/app.cpp b/src/osx/carbon/app.cpp index cf1e53b104..171eb0825b 100644 --- a/src/osx/carbon/app.cpp +++ b/src/osx/carbon/app.cpp @@ -130,7 +130,7 @@ pascal OSErr AEHandleGURL( const AppleEvent *event , AppleEvent *reply , SRefCon } -// AEODoc Calls MacOpenFile on each of the files passed +// AEODoc Calls MacOpenFiles with all of the files passed short wxApp::MacHandleAEODoc(const WXEVENTREF event, WXEVENTREF WXUNUSED(reply)) { @@ -158,6 +158,7 @@ short wxApp::MacHandleAEODoc(const WXEVENTREF event, WXEVENTREF WXUNUSED(reply)) wxString fName ; FSRef theRef ; + wxArrayString fileNames; for (i = 1; i <= itemsInList; i++) { AEGetNthPtr( @@ -165,9 +166,11 @@ short wxApp::MacHandleAEODoc(const WXEVENTREF event, WXEVENTREF WXUNUSED(reply)) (Ptr)&theRef, sizeof(theRef), &actualSize); fName = wxMacFSRefToPath( &theRef ) ; - MacOpenFile(fName); + fileNames.Add(fName); } + MacOpenFiles(fileNames); + return noErr; } @@ -274,6 +277,16 @@ short wxApp::MacHandleAERApp(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNU // Support Routines linking the Mac...File Calls to the Document Manager //---------------------------------------------------------------------- +void wxApp::MacOpenFiles(const wxArrayString & fileNames ) +{ + size_t i; + const size_t fileCount = fileNames.GetCount(); + for (i = 0; i < fileCount; i++) + { + MacOpenFile(fileNames[i]); + } +} + void wxApp::MacOpenFile(const wxString & fileName ) { #if wxUSE_DOC_VIEW_ARCHITECTURE @@ -1306,8 +1319,8 @@ CGKeyCode wxCharCodeWXToOSX(wxKeyCode code) case WXK_SHIFT: keycode = kVK_Shift; break; case WXK_ALT: keycode = kVK_Option; break; - case WXK_CONTROL: keycode = kVK_Control; break; - case WXK_COMMAND: keycode = kVK_Command; break; + case WXK_RAW_CONTROL: keycode = kVK_Control; break; + case WXK_CONTROL: keycode = kVK_Command; break; case WXK_CAPITAL: keycode = kVK_CapsLock; break; case WXK_END: keycode = kVK_End; break; @@ -1517,6 +1530,7 @@ int wxMacKeyCodeToModifier(wxKeyCode key) { case WXK_START: case WXK_MENU: + case WXK_COMMAND: return cmdKey; case WXK_SHIFT: @@ -1528,7 +1542,7 @@ int wxMacKeyCodeToModifier(wxKeyCode key) case WXK_ALT: return optionKey; - case WXK_CONTROL: + case WXK_RAW_CONTROL: return controlKey; default: @@ -1557,10 +1571,10 @@ wxMouseState wxGetMouseState() ms.SetRightDown( (buttons & 0x02) != 0 ); UInt32 modifiers = GetCurrentKeyModifiers(); - ms.SetControlDown(modifiers & controlKey); + ms.SetRawControlDown(modifiers & controlKey); ms.SetShiftDown(modifiers & shiftKey); ms.SetAltDown(modifiers & optionKey); - ms.SetMetaDown(modifiers & cmdKey); + ms.SetControlDown(modifiers & cmdKey); return ms; } @@ -1753,9 +1767,9 @@ void wxApp::MacCreateKeyEvent( wxKeyEvent& event, wxWindow* focus , long keymess } event.m_shiftDown = modifiers & shiftKey; - event.m_controlDown = modifiers & controlKey; + event.m_rawControlDown = modifiers & controlKey; event.m_altDown = modifiers & optionKey; - event.m_metaDown = modifiers & cmdKey; + event.m_controlDown = modifiers & cmdKey; event.m_keyCode = keyval ; #if wxUSE_UNICODE event.m_uniChar = uniChar ;