'From Moshi of 3 March 2007 [latest update: #247] on 20 July 2007 at 11:53:03 am'! "Change Set: ScrollingField-width-tk Date: 20 July 2007 Author: Ted Kaehler Fixes for ScrollableField 1. Make TextMorph inside a ScrollableField always track the width of the field. 2. Add the three font halo handles to ScrollableField's halo so you don't have to drill down to get them. 3. A new SF has no horizontal scroll bar, but it thinks that it does have one. Fix this in initialize. 4. Bordered Text in the Objects Catalog: It had a transparent background. Changed this to a white background. Makes more sense. If we want to add text with transparency in the catalog, we can, but don't confound it with bordered text with fixed sized bounds Cross-published from Moshi update 0259ScrollingField-width-tk ."! !Morph methodsFor: 'classification' stamp: 'tk 7/17/2007 18:17'! fontsForText "I encapsulate a TextMorph, and need to show halo handles for text font commands." ^ false! ! !HaloMorph methodsFor: 'handles' stamp: 'tk 7/17/2007 18:18'! addFontEmphHandle: haloSpec (innerTarget isTextMorph) ifTrue: [self addHandle: haloSpec on: #mouseDown send: #chooseEmphasisOrAlignment to: innerTarget]. (innerTarget fontsForText) ifTrue: [self addHandle: haloSpec on: #mouseDown send: #chooseEmphasisOrAlignment to: innerTarget textMorph]! ! !HaloMorph methodsFor: 'handles' stamp: 'tk 7/17/2007 18:18'! addFontSizeHandle: haloSpec (innerTarget isTextMorph) ifTrue: [self addHandle: haloSpec on: #mouseDown send: #chooseFont to: innerTarget]. (innerTarget fontsForText) ifTrue: [self addHandle: haloSpec on: #mouseDown send: #chooseFont to: innerTarget textMorph]! ! !HaloMorph methodsFor: 'handles' stamp: 'tk 7/17/2007 18:18'! addFontStyleHandle: haloSpec (innerTarget isTextMorph) ifTrue: [self addHandle: haloSpec on: #mouseDown send: #chooseStyle to: innerTarget]. (innerTarget fontsForText) ifTrue: [self addHandle: haloSpec on: #mouseDown send: #chooseStyle to: innerTarget textMorph]! ! !PluggableTextMorph methodsFor: 'classification' stamp: 'tk 7/17/2007 18:18'! fontsForText "I encapsulate a TextMorph, and need to show halo handles for text font commands." ^ true! ! !ScrollableField methodsFor: 'parts bin' stamp: 'tk 7/17/2007 18:16'! initializeToStandAlone super initializeToStandAlone. self color: (Color r: 0.972 g: 0.972 b: 0.662). self retractable: false; scrollBarOnLeft: false. self resetExtent.! ! !ScrollableField methodsFor: 'scrolling' stamp: 'tk 7/17/2007 13:54'! initializeScrollBars "initialize the receiver's scrollBar. Force no horizontal scroll bar." super initializeScrollBars. Preferences alwaysHideHScrollbar ifFalse: [ Preferences alwaysShowHScrollbar ifFalse: [ "no prefs, so hide it" self hideHScrollBarIndefinitely: true]]. ! ! !ScrollableField methodsFor: 'scrolling' stamp: 'tk 7/17/2007 17:31'! resetExtent super resetExtent. textMorph ifNotNil: [textMorph extent: (self innerBounds width-6)@self height. textMorph fit]. "force text to be full width (Later, extent: should never exit early?)" ! ! !TextMorph class methodsFor: 'parts bin' stamp: 'tk 7/2/2007 15:01'! borderedPrototype | t | t _ self authoringPrototype. t fontName: 'BitstreamVeraSans' pointSize: 24. t autoFit: false; extent: 250@100. t borderWidth: 1; margins: 4@0; backgroundColor: Color white. "Strangeness here in order to avoid two offset copies of the default contents when operating in an mvc project before cursor enters the morphic window" t paragraph. ^ t! !