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@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.! |
Best, Marcel |
Really great! It's clear we have a Morphic wizard in our midst. Now
we can not only search but do Straight-Airs and Inverted-Hand-Plants off the "Search" bar again.. :) Well done, thank you. On Tue, Apr 7, 2015 at 6:47 AM, Marcel Taeumel <[hidden email]> wrote: > <http://forum.world.st/file/n4818009/search-results.png> > > Best, > Marcel > > > > -- > View this message in context: http://forum.world.st/The-Trunk-Morphic-mt-838-mcz-tp4818005p4818009.html > Sent from the Squeak - Dev mailing list archive at Nabble.com. > |
Free forum by Nabble | Edit this page |