'From Squeak3.3alpha of 12 January 2002 [latest update: #4819] on 24 April 2002 at 6:02:44 pm'! "Change Set: iBeamInNullText-sw Date: 25 April 2002 Author: Scott Wallace Draws an I-beam when an empty Text object has keyboard focus. Try to get the Objects tool, when switched into Find mode, to show the i-beam immediately. Also, adds an optimization so that when there is an empty selecton in the search pane of the Objects tool, it doesn't take so long to conclude that there are no matches."! !ObjectsTool methodsFor: 'search' stamp: 'sw 4/25/2002 00:52'! showMorphsMatchingSearchString "Put items matching the search string into my lower pane" | quads | self setSearchStringFromSearchPane. submorphs last removeAllMorphs. searchString size = 0 ifTrue: [^ self]. quads _ OrderedCollection new. Morph withAllSubclasses do: [:aClass | aClass addPartsDescriptorQuadsTo: quads if: [:info | info formalName includesSubstring: searchString caseSensitive: false]]. self installQuads: quads fromButton: nil! ! !ObjectsTool methodsFor: 'search' stamp: 'sw 4/25/2002 00:52'! showSearchPane "Set the receiver up so that it shows the search pane" | aPane | modeSymbol == #search ifFalse: [self replaceSubmorph: submorphs second by: (aPane _ self newSearchPane). self modeSymbol: #search. self tweakAppearanceAfterModeShift. self showMorphsMatchingSearchString. ActiveHand newKeyboardFocus: aPane firstSubmorph]! ! !TextMorph methodsFor: 'drawing' stamp: 'sw 4/25/2002 00:52'! drawOn: aCanvas "Draw the receiver on a canvas" | fauxBounds | self setDefaultContentsIfNil. super drawOn: aCanvas. "Border and background if any" false ifTrue: [self debugDrawLineRectsOn: aCanvas]. "show line rects for debugging" (self startingIndex > text size) ifTrue: [self drawNullTextOn: aCanvas]. "Hack here: The canvas expects bounds to carry the location of the text, but we also need to communicate clipping." fauxBounds _ self bounds topLeft corner: self innerBounds bottomRight. aCanvas paragraph: self paragraph bounds: fauxBounds color: color! !