[squeak-dev] The Trunk: Morphic-mt.838.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Apr 7 11:55:50 UTC 2015


Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.838.mcz

==================== Summary ====================

Name: Morphic-mt.838
Author: mt
Time: 7 April 2015, 1:55:40.414 pm
UUID: a40ffb0d-4521-5748-a42a-777eb94323c7
Ancestors: Morphic-mt.837

Search bar now spawns a new (transient) text box (like a balloon morph) to show print-it results, which can be selected and copied and ...

=============== Diff against Morphic-mt.837 ===============

Item was changed:
  Model subclass: #SearchBar
+ 	instanceVariableNames: 'searchTerm selection resultsWidget'
- 	instanceVariableNames: 'searchTerm selection'
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'Morphic-Menus-DockingBar'!

Item was added:
+ ----- Method: SearchBar>>printIt:result: (in category 'do-its') -----
+ printIt: code result: object
+ 
+ 	| focusedWidget |
+ 	focusedWidget := self currentHand keyboardFocus.
+ 
+ 	self removeResultsWidget.
+ 	
+ 	ToolBuilder default in: [:builder |
+ 		resultsWidget := (builder build: (StringHolder new
+ 			contents: object asString;
+ 			buildCodePaneWith: builder)).
+ 		resultsWidget textMorph
+ 			on: #mouseLeave send: #delete to: resultsWidget.
+ 		resultsWidget
+ 			extent: 250 at 150;
+ 			fullBounds;
+ 			height: (resultsWidget textMorph height min: 300);
+ 			position: (focusedWidget
+ 				ifNotNil: [:w | w owner boundsInWorld bottomLeft]
+ 				ifNil: [self currentHand position]);
+ 			color: (BalloonMorph balloonColor alpha: 1.0).
+ 			
+ 		Preferences menuAppearance3d
+ 			ifTrue: [resultsWidget addDropShadow].
+ 			
+ 		resultsWidget openInWorld].!

Item was added:
+ ----- Method: SearchBar>>removeResultsWidget (in category 'accessing') -----
+ removeResultsWidget
+ 
+ 	resultsWidget ifNotNil: [:w | w delete].
+ 	resultsWidget := nil.!

Item was changed:
  ----- Method: SearchBar>>searchTerm: (in category 'accessing') -----
  searchTerm: aString
  
  	searchTerm := aString.
  	self changed: #searchTerm.!

Item was changed:
  ----- Method: SearchBar>>smartSearch:in: (in category 'searching') -----
  smartSearch: text in: morph
  	"Take the user input and perform an appropriate search"
  	| input newContents |
+ 	self removeResultsWidget.
  	input := text asString ifEmpty:[^self].
  	(Smalltalk bindingOf: input) ifNotNil:[:assoc| | global |
  		"It's a global or a class"
  		global := assoc value.
  		^ToolSet browse: (global isBehavior ifTrue:[global] ifFalse:[global class]) selector: nil.
  	].
  	(SystemNavigation new allImplementorsOf: input asSymbol) ifNotEmpty:[:list|
  		^SystemNavigation new
  			browseMessageList: list
  			name: 'Implementors of ' , input
  	].
  	input first isUppercase ifTrue:[
  		(UIManager default classFromPattern: input withCaption: '') ifNotNil:[:aClass|
  			^ToolSet browse: aClass selector: nil.
  		].
  	] ifFalse:[
  		^ToolSet default browseMessageNames: input
  	].
  	newContents := input, ' -- not found.'.
  	
  	self searchTerm: newContents.
  	self selection: (input size+1 to: newContents size).
  	self currentHand newKeyboardFocus: morph textMorph.!



More information about the Squeak-dev mailing list