'From Squeak3.2alpha of 17 December 2001 [latest update: #4634] on 28 December 2001 at 1:26:11 am'! "Change Set: MenuKbdPref-ar Date: 27 December 2001 Author: Andreas Raab Adds a preference for controling keyboard control in menus." Preferences addPreference: #menuKeyboardControl categories: #(morphic) default: true balloonHelp:'When true, allow keyboard control and searching in menus'.! !MenuMorph methodsFor: 'control' stamp: 'ar 12/27/2001 22:46'! popUpAt: aPoint forHand: hand in: aWorld "Present this menu at the given point under control of the given hand. Allow keyboard input into the menu." ^ self popUpAt: aPoint forHand: hand in: aWorld allowKeyboard: Preferences menuKeyboardControl! ! !MVCMenuMorph methodsFor: 'invoking' stamp: 'ar 12/27/2001 22:46'! invokeAt: aPoint in: aWorld "Add this menu to the given world centered at the given point. Wait for the user to make a selection and answer it. The selection value returned is an integer in keeping with PopUpMenu, if the menu is converted from an MVC-style menu." "Details: This is invoked synchronously from the caller. In order to keep processing inputs and updating the screen while waiting for the user to respond, this method has its own version of the World's event loop." ^ self invokeAt: aPoint in: aWorld allowKeyboard: Preferences menuKeyboardControl! ! !PopUpMenu methodsFor: 'basic control sequence' stamp: 'ar 12/27/2001 22:47'! startUpWithCaption: captionOrNil at: location "Display the menu, with caption if supplied. Wait for the mouse button to go down, then track the selection as long as the button is pressed. When the button is released, answer the index of the current selection, or zero if the mouse is not released over any menu item. Location specifies the desired topLeft of the menu body rectangle." ^ self startUpWithCaption: captionOrNil at: location allowKeyboard: Preferences menuKeyboardControl! !