diff -r 453ac2ba069d -r 65841fbd0933 MenuPanel.st --- a/MenuPanel.st Tue Aug 08 12:08:40 2006 +0200 +++ b/MenuPanel.st Tue Aug 08 16:00:10 2006 +0200 @@ -7378,57 +7378,19 @@ shortcutKeyAsString "converts shortcutKey to a text object" - |nm prefix shortcutKey| + |shortcutKey| shortcutKey := menuItem shortcutKey. shortcutKey isNil ifTrue:[ ^ nil ]. - shortcutKey isCharacter ifTrue:[ - nm := shortcutKey asString - ] ifFalse:[ - "/ this is somewhat complicated: we have the symbolic key at hand, - "/ but want to show the untranslated (inverse keyBoardMapped) key & modifier - "/ Ask the devices keyboardMap for the backtranslation. - - nm := menuPanel device keyboardMap keyAtValue:shortcutKey ifAbsent:shortcutKey. - "/ - "/ some modifier-key combination ? - "/ - (nm startsWith:#Cmd) ifTrue:[ - prefix := #Cmd. - ] ifFalse:[(nm startsWith:#Alt) ifTrue:[ - prefix := #Alt. - ] ifFalse:[(nm startsWith:#Meta) ifTrue:[ - prefix := #Meta. - ] ifFalse:[(nm startsWith:#Ctrl) ifTrue:[ - prefix := #Ctrl. - ]]]]. - prefix notNil ifTrue:[ - nm := (self shortcutKeyPrefixFor:prefix), (nm copyFrom:(prefix size + 1)) - ] ifFalse:[ - nm := nm asString - ] - ]. - ^ nm - - "Modified: / 17.7.1998 / 11:56:40 / cg" -! - -shortcutKeyPrefixFor:aModifier - "returns the prefix assigned to a modifier" - - |m| - - m := menuPanel device modifierKeyTopFor:aModifier. - m notNil ifTrue:[ - ^ m , '-' - ]. - ^ aModifier , '-'. - - "Modified: / 17.7.1998 / 11:56:46 / cg" + ^ shortcutKey asString + ]. + ^ menuPanel device shortKeyStringFor:shortcutKey. + + "Modified: / 08-08-2006 / 15:46:24 / cg" ! ! !MenuPanel::Item methodsFor:'selection'! @@ -7646,7 +7608,7 @@ !MenuPanel class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libwidg2/MenuPanel.st,v 1.426 2006-03-06 13:45:28 cg Exp $' + ^ '$Header: /cvs/stx/stx/libwidg2/MenuPanel.st,v 1.427 2006-08-08 14:00:10 cg Exp $' ! ! MenuPanel initialize!