'From etoys4.0 of 9 October 2008 [latest update: #2247] on 18 August 2009 at 7:05:15 pm'! "Change Set: collapseTweak-sw Date: 18 August 2009 Author: Scott Wallace Use a more felicitous translation idiom in a recently-modified method."! !SketchMorph methodsFor: 'menus' stamp: 'sw 8/18/2009 18:52'! collapse "Replace the receiver with a collapsed rendition of itself." | w collapsedVersion a ht tab | (w _ self world) ifNil: [^self]. collapsedVersion _ (self imageForm scaledToSize: 50@50) asMorph. collapsedVersion setProperty: #uncollapsedMorph toValue: self. collapsedVersion on: #mouseUp send: #uncollapseSketch to: collapsedVersion. collapsedVersion setBalloonText: ('A collapsed version of {1}. Click to open it back up.' translated format: {self externalName}). self delete. w addMorphFront: ( a _ AlignmentMorph newRow hResizing: #shrinkWrap; vResizing: #shrinkWrap; borderWidth: 4; borderColor: Color white; addMorph: collapsedVersion; yourself). a setNameTo: self externalName. ht := (tab := ActiveWorld findA: SugarNavTab) ifNotNil: [tab height] ifNil: [80]. a position: 0@ht. collapsedVersion setProperty: #collapsedMorphCarrier toValue: a. (self valueOfProperty: #collapsedPosition) ifNotNilDo: [:priorPosition | a position: priorPosition]! !