[squeak-dev] A point about menu complistification (was Re: Browser menu interface to refactorings)

Bob Arning arning315 at comcast.net
Fri Nov 3 09:50:03 UTC 2017


well, that's not too hard, either ;-)


On 11/3/17 4:41 AM, Marcel Taeumel wrote:
> I suppose it would be more user-friendly to think about convenient 
> means of menu configuration instead of just straying from one set of 
> hard-coded values to another. :-/
>
> Best,
> Marcel
>
>
>> Am 02.11.2017 23:00:03 schrieb Bob Arning <arning315 at comcast.net>:
>>
>> that's not too hard
>>
>>
>>
>> On 11/2/17 3:48 PM, Chris Muller wrote:
>>> It'd be neat if the IDE could somehow keep a collection of items to 
>>> omit from the menu; with option to "restore all".
>>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20171103/ccfef594/attachment.html>
-------------- next part --------------
'From Squeak5.1 of 23 August 2016 [latest update: #16548] on 3 November 2017 at 5:48:24 am'!

!MenuMorph methodsFor: 'control' stamp: 'raa 11/3/2017 05:46'!
popUpAt: aPoint forHand: hand in: aWorld allowKeyboard: aBoolean 
	"Present this menu at the given point under control of the given 
	hand."
	| evt deletions |
	aWorld submorphs
		select: [:each | (each isKindOf: MenuMorph)
				and: [each stayUp not]]
		thenCollect: [:menu | menu delete].
	self items isEmpty
		ifTrue: [^ self].
	MenuIcons decorateMenu: self.
	(self submorphs
		select: [:m | m isKindOf: UpdatingMenuItemMorph])
		do: [:m | m updateContents].
	Preferences menuItemsMayBeOmitted ifTrue: [
		Preferences menuItemStringsToBeOmitted do:  [: e |
			deletions _ submorphs select: [ :sm | (sm asString findString: e) > 0].
			self removeAllMorphsIn: deletions
		].
	].
	"precompute width"
	self
		positionAt: aPoint
		relativeTo: (selectedItem
				ifNil: [self items first])
		inWorld: aWorld.
	aWorld addMorphFront: self.
	"Acquire focus for valid pop up behavior"
	hand newMouseFocus: self.
	aBoolean
		ifTrue: [
			originalFocusHolder := hand keyboardFocus.
			hand newKeyboardFocus: self.
			self showKeyboardHelp].
	evt := hand lastEvent.
	(evt isKeyboard
			or: [evt isMouse
					and: [evt anyButtonPressed not]])
		ifTrue: ["Select first item if button not down"
			self moveSelectionDown: 1 event: evt
			"Select first item if button not down"].
	self updateColor.
	self changed! !


!Preferences class methodsFor: 'standard queries'!
menuItemStringsToBeOmitted
	^ self
		valueOfFlag: #menuItemStringsToBeOmitted
		ifAbsent: [#('Create new service' 'browse mc history' 'toggle break on entry' 'browse protocol (p)' 'find test case' 'copy reference (C)' 'copy selector (c)' )]! !

!Preferences class methodsFor: 'standard queries' stamp: 'raa 11/3/2017 05:48'!
menuItemsMayBeOmitted
"
Preferences setPreference: #menuItemsMayBeOmitted toValue: true.
Preferences setPreference: #menuItemStringsToBeOmitted toValue: #('Create new service' 'browse mc history' 'toggle break on entry' 'browse protocol (p)' 'find test case' 'copy reference (C)' 'copy selector (c)')
Preferences setPreference: #menuItemStringsToBeOmitted toValue: #()
"
	^ self
		valueOfFlag: #menuItemsMayBeOmitted
		ifAbsent: [ true ]! !



More information about the Squeak-dev mailing list