'From Squeak3.1alpha of 5 February 2001 [latest update: #3747] on 27 February 2001 at 4:03:10 pm'! "Change Set: syntax8 Date: 27 February 2001 Author: Bob Arning fix a few problems unhibernating universal scriptors: - ensure that the bounds for the scrollers are set right - ensure that the top row of buttons is vResizing = #shrinkWrap (one wasn't) - ensure that the toggle for showing text is off"! !ScriptEditorMorph methodsFor: 'other' stamp: 'RAA 2/27/2001 15:55'! insertUniversalTiles "Insert universal tiles for the method at hand" self removeAllButFirstSubmorph. "fix a broken header in weasel" submorphs isEmpty ifFalse: [ self firstSubmorph vResizing: #shrinkWrap. ]. self insertUniversalTilesForClass: playerScripted class selector: scriptName! ! !ScriptEditorMorph methodsFor: 'other' stamp: 'RAA 2/27/2001 15:51'! insertUniversalTilesForClass: aClass selector: aSelector "Add a submorph which holds the universal-tiles script for the given class and selector" | source tree syn widget header | source _ aClass sourceCodeAt: aSelector. tree _ Compiler new parse: source in: aClass notifying: nil. (syn _ tree asMorphicSyntaxUsing: SyntaxMorph) parsedInClass: aClass. aSelector numArgs = 0 ifTrue: [ "remove method header line" (header _ syn findA: SelectorNode) ifNotNil: [header delete]]. widget _ syn inAScrollPane. widget color: Color transparent; setProperty: #hideUnneededScrollbars toValue: true; setProperty: #maxAutoFitSize toValue: 300@200. self addMorphBack: widget. widget extent: (self width - 10 @ 150). SyntaxMorph setSizeAndMakeResizable: self. syn finalAppearanceTweaks.! ! !ScriptEditorMorph methodsFor: 'other' stamp: 'RAA 2/27/2001 16:01'! unhibernate "Recreate my tiles from my method if I have new universal tiles." self world ifNil: [(playerScripted == nil or: [playerScripted isUniversalTiles not]) ifTrue: [^ self]] ifNotNil: [Preferences universalTiles ifFalse: [^ self]]. self insertUniversalTiles. self showingMethodPane: false. "no longer needed as it will already be set up" "self hResizing: #shrinkWrap; vResizing: #shrinkWrap; cellPositioning: #topLeft."! ! !SyntaxMorph class methodsFor: 'as yet unclassified' stamp: 'RAA 2/27/2001 15:34'! setSizeAndMakeResizable: outerMorph | tw | (tw _ outerMorph findA: TwoWayScrollPane) ifNil: [^self]. tw hResizing: #spaceFill; vResizing: #spaceFill; color: Color transparent; setProperty: #hideUnneededScrollbars toValue: true; setProperty: #maxAutoFitSize toValue: 300@200. outerMorph hResizing: #shrinkWrap; vResizing: #shrinkWrap; cellPositioning: #topLeft. outerMorph fullBounds. tw hResizing: #spaceFill; vResizing: #spaceFill; removeProperty: #maxAutoFitSize; resizeScrollBar. outerMorph minWidth: outerMorph width; minHeight: 100; hResizing: #rigid; vResizing: #rigid. ! !