'From etoys2.2 of 24 September 2007 [latest update: #1790] on 21 November 2007 at 9:39:35 am'! "Change Set: noNarrowScrollbar-sw Date: 21 November 2007 Author: Scott Wallace TRAC 3545: Eliminate narrow scrollbars from various tools and help-flaps."! !AllPlayersTool methodsFor: 'reinvigoration' stamp: 'sw 11/21/2007 09:27'! reinvigorate "Rebuild the contents of the Players tool" | firstTwo oldList newList rowsForPlayers rowsWrapper outer existingThird oldExtent | firstTwo _ {self submorphs first. self submorphs second}. existingThird := (self submorphs size > 2) ifTrue: [self submorphs third] ifFalse: [nil]. oldExtent := existingThird ifNotNil: [existingThird extent] ifNil: [300 @ 460]. oldList := self playersOnDisplay asOrderedCollection. self presenter flushPlayerListCache. newList _ self presenter reallyAllExtantPlayers. oldList asSet = newList asSet ifFalse: [self removeAllMorphs; addAllMorphs: firstTwo. rowsForPlayers _ newList collect: [:aPlayer | aPlayer costume assureExternalName. aPlayer entryForPlayersTool: self]. rowsWrapper := AlignmentMorph newColumn. rowsWrapper hResizing: #shrinkWrap; beTransparent. rowsWrapper addAllMorphs: rowsForPlayers. outer := ScrollPane new extent: oldExtent. outer minWidth: firstTwo first width. outer model: self presenter. outer useRoundedCorners. outer scrollBarOnLeft: false. outer scroller addMorph: rowsWrapper. outer retractable: false. outer hideHScrollBarIndefinitely: true. outer alwaysShowHScrollBar: true. outer borderWidth: 1; borderColor: Color gray. self addMorphBack: outer. self updateScrollbar]! ! !EventRollMorph methodsFor: 'processing' stamp: 'sw 11/21/2007 09:27'! formulate "Given that all my relevant inst vars are now filled,build the structures that constitute the tool." "Replace the parts of the tool that change" | outer scrollAreaWidth | submorphs size > 1 ifFalse: [scrollAreaWidth := 600] ifTrue: [scrollAreaWidth := submorphs second width]. [submorphs size > 1] whileTrue: [submorphs last delete]. actualRoll := EventTimeline new extent: ( (self totalDuration / millisecondsPerPixel) @ 160). actualRoll color: Color yellow muchLighter. actualRoll beSticky. outer := ScrollPane new extent: scrollAreaWidth @ 160. outer model: self. outer useRoundedCorners. outer scrollBarOnLeft: false. outer scroller addMorph: actualRoll. outer retractable: false. outer hideVScrollBarIndefinitely: true. outer alwaysShowHScrollBar: true. self addMorphBack: outer. self setMouseEventMorphs. self setKeyboardEventMorphs. self setMediaEventMorphs. self setTimeIndicators. actualRoll addMorphFront: eventPlaybackCursor. eventPlaybackCursor bounds: (actualRoll topLeft extent: (2 @ actualRoll height)). self setVerticalGrid: (1000/millisecondsPerPixel) rounded backgroundColor: Color blue veryMuchLighter lineColor: Color gray darker. self updateScrollbar! ! !StandardScriptingSystem methodsFor: 'help in a flap' stamp: 'sw 11/21/2007 09:24'! openInfoFlapWithLabel: aTitle helpContents: aString edge: anEdge "Open an info flap with the given label, contents, and edge" | aPlug outer leftStrip rightStrip titleRow aDismissButton aFlapTab | Preferences enable: #scrollBarsOnRight. Preferences enable: #inboardScrollbars. aFlapTab := FlapTab new. aFlapTab assureExtension visible: false. aFlapTab referentMargin: (0 @ ActiveWorld sugarAllowance). outer := AlignmentMorph newRow. outer assureExtension visible: false. outer clipSubmorphs: true. outer beTransparent. outer vResizing: #spaceFill; hResizing: #spaceFill. outer layoutInset: 0; cellInset: 0; borderWidth: 0. outer setProperty: #morphicLayerNumber toValue: 26. leftStrip := Morph new beTransparent. leftStrip layoutInset: 0; cellInset: 0; borderWidth: 0. leftStrip width: 20. leftStrip hResizing: #rigid; vResizing: #spaceFill. outer addMorphBack: leftStrip. rightStrip := AlignmentMorph newColumn. rightStrip beTransparent. rightStrip layoutInset: 0; cellInset: 0; borderWidth: 0. outer addMorphBack: rightStrip. outer clipSubmorphs: true. titleRow := AlignmentMorph newRow. titleRow borderColor: Color veryVeryLightGray; borderWidth: 1. titleRow hResizing: #spaceFill; vResizing: #shrinkWrap. titleRow beTransparent. aDismissButton := aFlapTab tanOButton. aDismissButton actionSelector: #dismissViaHalo. titleRow addMorphFront: aDismissButton. titleRow addTransparentSpacerOfSize: 8 @ 0. titleRow addMorphBack: (StringMorph contents: aTitle font: Preferences standardEToysTitleFont). rightStrip addMorph: titleRow. aPlug := PluggableTextMorph new. aPlug width: 540. aPlug setText: aString. aPlug textMorph beAllFont: Preferences standardEToysFont. aPlug retractable: false; scrollBarOnLeft: false. aPlug hideHScrollBarIndefinitely: true. aPlug borderColor: ScriptingSystem borderColor. aPlug setNameTo: aTitle. aPlug hResizing: #spaceFill. aPlug vResizing: #spaceFill. rightStrip addMorphBack: aPlug. aFlapTab referent ifNotNil: [aFlapTab referent delete]. aFlapTab referent: outer. aFlapTab setName: aTitle edge: anEdge color: (Color r: 0.677 g: 0.935 b: 0.484). aFlapTab submorphs first beAllFont: Preferences standardEToysFont. ActiveWorld addMorphFront: aFlapTab. aFlapTab adaptToWorld: ActiveWorld. aFlapTab computeEdgeFraction. anEdge == #left ifTrue: [aFlapTab position: (outer left @ outer top). outer extent: (540 @ ActiveWorld height)]. anEdge == #right ifTrue: [aFlapTab position: ((ActiveWorld right - aFlapTab width) @ ActiveWorld top). outer extent: (540 @ ActiveWorld height)]. outer beFlap: true. outer color: Color green veryMuchLighter. aPlug textMorph lock. aFlapTab referent hide. aFlapTab openFully. outer beSticky. leftStrip beSticky. rightStrip beSticky. ActiveWorld doOneCycle. aPlug width: 540. aPlug setText: aString. "hmm, again" aPlug color: outer color. aPlug borderWidth: 0. aPlug textMorph contents: aString wrappedTo: 520. aFlapTab applyThickness: 560. aFlapTab fitOnScreen. aFlapTab referent show. ^ aFlapTab! ! "Postscript:" Preferences disable: #scrollBarsNarrow. !