'From Squeak3.1alpha of 28 February 2001 [latest update: #4106] on 1 June 2001 at 9:58:42 pm'! "Change Set: StackLooks-tk Date: 31 May 2001 Author: Ted Kaehler To change to color of a blank TextMorph, execute self setProperty: #nullTextColor toValue: Color transparent. in it. "! !CardPlayer methodsFor: 'as template' stamp: 'tk 5/31/2001 16:46'! matchNames | list str ll tms stk crds | "List of names of cards that matched the last template search." tms _ self class classPool at: #TemplateMatches ifAbsent: [^ #()]. list _ (tms at: self ifAbsent: [#(#() 0)]) first. stk _ costume valueOfProperty: #myStack ifAbsent: [nil]. crds _ stk ifNil: [#()] ifNotNil: [stk cards]. ^ list collect: [:cd | str _ ''. (ll _ cd allStringsAfter: nil) ifNotNil: [ str _ ll inject: '' into: [:strr :this | strr, this]]. (str copyFrom: 1 to: (30 min: str size)), '... (' , (crds indexOf: cd) printString, ')']. "Maybe include a card title?"! ! !StackMorph methodsFor: 'menu' stamp: 'tk 6/1/2001 10:54'! findViaTemplate | list pl cardInst | "Current card is the template. Only search cards in this background. Look at cards directly (not allText). Key must be found in the same field as in the template. HyperCard style (multiple starts of words). Put results in a list, outside the stack." list _ self templateMatches. list isEmpty ifTrue: [^ self inform: 'No matches were found. Be sure the current card is mostly blank and only has text you want to match.']. "put up a PluggableListMorph" cardInst _ self currentCard. cardInst matchIndex: 0. "establish entries" cardInst results at: 1 put: list. self currentPage setProperty: #myStack toValue: self. "way to get back" pl _ PluggableListMorph new on: cardInst list: #matchNames selected: #matchIndex changeSelected: #matchIndex: menu: nil "#matchMenu:shifted:" keystroke: nil. ActiveHand attachMorph: (self formatList: pl). ! ! !StackMorph methodsFor: 'menu' stamp: 'tk 6/1/2001 21:57'! formatList: pl | rr ff | "Turn this plugglable list into a good looking morph." pl color: Color transparent; borderWidth: 0. pl font: ((TextStyle named: #Palatino) fontOfSize: 14). pl toggleCornerRounding; width: 252; retractableOrNot; hResizing: #spaceFill. rr _ (RectangleMorph new) toggleCornerRounding; extent: pl extent + (30@30). rr color: self currentPage color; fillStyle: (ff _ self currentPage fillStyle copy). rr fillStyle direction: (ff direction * self currentPage extent / rr extent) rounded. rr fillStyle origin: rr bounds origin. rr addMorph: pl. rr layoutPolicy: TableLayout new. rr layoutInset: 10@15; cellInset: 10@15; wrapDirection: #leftToRight. rr listCentering: #center; borderWidth: 5; borderColor: #raised. "Up and down buttons on left with arrows in a holder." "lb _ (RectangleMorph new) color: transparent; borderWidth: 0." ^ rr! ! !TextMorph methodsFor: 'drawing' stamp: 'tk 6/1/2001 10:24'! drawNullTextOn: aCanvas "make null text frame visible" aCanvas fillRectangle: bounds color: ((Color black) alpha: 0.1). ! !