X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/98af9c738332c9a24475ad19efbfabe2b152c429..f028b0d919d618a95254452282b8e8467da51921:/src/mac/carbon/uma.cpp diff --git a/src/mac/carbon/uma.cpp b/src/mac/carbon/uma.cpp index e5fc628fea..d5f59cef31 100644 --- a/src/mac/carbon/uma.cpp +++ b/src/mac/carbon/uma.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: uma.cpp +// Name: src/mac/carbon/uma.cpp // Purpose: UMA support // Author: Stefan Csomor // Modified by: @@ -242,7 +242,8 @@ void UMASetMenuTitle( MenuRef menu , const wxString& title , wxFontEncoding enco void UMASetMenuItemText( MenuRef menu, MenuItemIndex item, const wxString& title, wxFontEncoding encoding ) { - wxString str = wxStripMenuCodes( title ) ; + // we don't strip the accels here anymore, must be done before + wxString str = title ; #if TARGET_CARBON SetMenuItemTextWithCFString( menu , item , wxMacCFStringHolder(str , encoding) ) ; @@ -357,12 +358,12 @@ void UMASetMenuItemShortcut( MenuRef menu , MenuItemIndex item , wxAcceleratorEn glyph = kMenuClearGlyph ; break ; - case WXK_PRIOR : // PAGE UP + case WXK_PAGEUP : macKey = kPageUpCharCode ; glyph = kMenuPageUpGlyph ; break ; - case WXK_NEXT : + case WXK_PAGEDOWN : macKey = kPageDownCharCode ; glyph = kMenuPageDownGlyph ; break ; @@ -387,6 +388,15 @@ void UMASetMenuItemShortcut( MenuRef menu , MenuItemIndex item , wxAcceleratorEn glyph = kMenuDownArrowGlyph ; break ; + case WXK_HOME : + macKey = kHomeCharCode ; + glyph = kMenuNorthwestArrowGlyph ; + break ; + + case WXK_END : + macKey = kEndCharCode ; + glyph = kMenuSoutheastArrowGlyph ; + break ; default : macKey = toupper( key ) ; break ; @@ -400,7 +410,7 @@ void UMASetMenuItemShortcut( MenuRef menu , MenuItemIndex item , wxAcceleratorEn // 1d and 1e have special meaning to SetItemCmd, so // do not use for these character codes. - if (key != WXK_UP && key != WXK_RIGHT) + if (key != WXK_UP && key != WXK_RIGHT && key != WXK_DOWN && key != WXK_LEFT) SetItemCmd( menu, item , macKey ); SetMenuItemModifiers( menu, item , modifiers ) ; @@ -414,7 +424,7 @@ void UMAAppendMenuItem( MenuRef menu , const wxString& title, wxFontEncoding enc { MacAppendMenu(menu, "\pA"); - // don't attempt to interpret metacharacters like a '-' at the beginning (would become a separator otherwise) + // don't attempt to interpret metacharacters like a '-' at the beginning (would become a separator otherwise) ChangeMenuItemAttributes( menu , ::CountMenuItems(menu), kMenuItemAttrIgnoreMeta , 0 ) ; UMASetMenuItemText(menu, (SInt16) ::CountMenuItems(menu), title , encoding ); UMASetMenuItemShortcut( menu , (SInt16) ::CountMenuItems(menu), entry ) ; @@ -424,7 +434,7 @@ void UMAInsertMenuItem( MenuRef menu , const wxString& title, wxFontEncoding enc { MacInsertMenuItem( menu , "\pA" , item) ; - // don't attempt to interpret metacharacters like a '-' at the beginning (would become a separator otherwise) + // don't attempt to interpret metacharacters like a '-' at the beginning (would become a separator otherwise) ChangeMenuItemAttributes( menu , item+1, kMenuItemAttrIgnoreMeta , 0 ) ; UMASetMenuItemText(menu, item+1 , title , encoding ); UMASetMenuItemShortcut( menu , item+1 , entry ) ; @@ -583,7 +593,7 @@ void UMAActivateControl( ControlRef inControl ) InvalWindowRect( GetControlOwner(inControl), UMAGetControlBoundsInWindowCoords(inControl, &ctrlBounds) ) ; } } -#endif +#endif } void UMAMoveControl( ControlRef inControl , short x , short y ) @@ -875,4 +885,3 @@ void UMASetSystemIsInitialized(bool val) } #endif // wxUSE_BASE -