[FIX?!] User Menu

Bert Freudenberg bert at isgnw.CS.Uni-Magdeburg.De
Mon Sep 27 08:12:08 UTC 1999


Renames methods related to the personalizable desktop menu from option
menu to user menu (since that name is meaningless to non-Mac users).

  /bert

Content-Type: TEXT/PLAIN; charset=US-ASCII; name="UserMenu-bf.22Sep321pm.cs"
Content-ID: <Pine.LNX.3.96.990927101208.31728I at balloon.cs.uni-magdeburg.de>
Content-Description: 

'From Squeak 2.5 of August 6, 1999 on 22 September 1999 at 3:21:51 pm'!
"Change Set:		UserMenu-bf
Date:			22 September 1999
Author:			Bert Freudenberg

Renames methods related to the personalizable desktop menu from option menu to user menu"!


!HandMorph methodsFor: 'world menu commands' stamp: 'bf 9/22/1999 13:20'!
invokeMetaMenu: evt
	"Invoke the meta menu. If the hand is over the background, the world menu is presented. If it is over a morph, a menu of operations for that morph is presented. Each menu entry contains a string to be presented in the menu and a selector. If the selector takes an argument, the mouse-down event that invoked the menu is passed as an argument. This lets the command know which hand invoked it in order to do things like attaching the result of the command to that hand.

If the hand is over the background and the shift key is pressed, the find-window menu is immediately put up.

If the hand is over the background but the yellow button was pressed, an alternate menu, which individual users are encouraged to personalize, is put up -- see HandMorph.yellowButtonClickOnDesktopWithEvent:"

	| menu |
	Preferences noviceMode ifTrue: [^ self].

	"if carrying morphs, just drop them"
	self hasSubmorphs ifTrue: [^ self dropMorphsEvent: evt].

	targetOffset _ menuTargetOffset _ self position.
	argument _ self argumentOrNil.
	argument == nil
		ifTrue:
			[Utilities bringFlapsToFront.
			evt yellowButtonPressed
				ifTrue: [^ self yellowButtonClickOnDesktopWithEvent: evt].

			evt shiftPressed
				ifFalse:
					["put put screen menu"
					menu _ self buildWorldMenu.
					menu addTitle: 'World']
				ifTrue:
					[^ self findWindow]]
		ifFalse:
			[menu _ self buildMorphMenuFor: argument.
			menu addTitle: argument class name].
	self invokeMenu: menu event: evt.
! !

!HandMorph methodsFor: 'world menu commands' stamp: 'bf 9/22/1999 13:21'!
yellowButtonClickOnDesktopWithEvent: evt
	
	| aMenu |
	aMenu _ MenuMorph new defaultTarget: self world.
	Preferences personalizeUserMenu: aMenu.
	aMenu addLine.
	aMenu add: 'personalize...' target: Preferences action: #letUserPersonalizeMenu.
	self invokeMenu: aMenu event: evt

! !


!Preferences class methodsFor: 'personalization' stamp: 'bf 9/22/1999 13:22'!
letUserPersonalizeMenu
	"Invoked from menu, opens up a single-msg browser on the message that user is invited to customize for rapid morphic access via option-click on morphic desktop"

	Browser openMessageBrowserForClass: Preferences class 
		selector: #personalizeUserMenu: editString: nil! !

!Preferences class methodsFor: 'personalization' stamp: 'bf 9/22/1999 14:05'!
personalizeUserMenu: aMenu
	"The user has clicked on the morphic desktop with the yellow mouse button (option+click on the Mac); a menu is being constructed to present to the user in response; its default target is the current world.  In this method, you are invited to add items to the menu as per personal preferences.
	The default implementation, for illustrative purposes, sets the menu title to 'personal', and adds items for go-to-previous-project, show/hide flaps, and load code updates"
	
	aMenu addTitle: 'personal'.  "Remove or modify this as per personal choice"

	aMenu add: 'previous project' action: #goBack.
	aMenu addUpdating: #suppressFlapsString target: Utilities action: #toggleFlapSuppressionInProject.
	aMenu add: 'load latest code updates' target: Utilities action: #updateFromServer! !


HandMorph removeSelector: #optionClickOnDesktopWithEvent:!
Preferences class removeSelector: #letUserPersonalizeOptionMenu!
Preferences class removeSelector: #personalizeOptionMenu:!





More information about the Squeak-dev mailing list