'From Squeak 2.4b of April 23, 1999 on 11 June 1999 at 3:00:06 am'! !SystemWindow methodsFor: 'initialization' stamp: 'TB 6/11/1999 02:55'! initialize | aFont fill | super initialize. isCollapsed _ false. activeOnlyOnTop _ true. paneMorphs _ Array new. paneRects _ Array new. borderColor _ Color black. borderWidth _ 1. color _ (Color r: 0.658 g: 0.658 b: 0.658). aFont _ Preferences fontForScriptorButtons. fill := GradientFillMorph newBounds: bounds. fill beHorizontal. stripes _ Array with: fill "see extent:". self addMorph: (stripes first). self addMorph: (label _ StringMorph new contents: labelString; color: (Color white); font: (TextStyle default fontAt: 1) emphasis: 1). self addMorph: (closeBox _ SimpleButtonMorph new borderWidth: 1; label: 'X' font: aFont; color: (Color r: 0.75 g: 0.75 b: 0.75); actionSelector: #delete; target: self; extent: 14@14). self addMorph: (collapseBox _ SimpleButtonMorph new borderWidth: 1; label: 'O' font: aFont; color: (Color r: 0.75 g: 0.75 b: 0.75) ; actionSelector: #collapseOrExpand; target: self; extent: 14@14). Preferences noviceMode ifTrue: [closeBox setBalloonText: 'close window'. collapseBox setBalloonText: 'collapse/expand window']. self on: #mouseEnter send: #spawnReframeHandle: to: self. self on: #mouseLeave send: #spawnReframeHandle: to: self. label on: #mouseDown send: #relabelEvent: to: self. self extent: 300@200! ! !SystemWindow methodsFor: 'geometry' stamp: 'TB 6/11/1999 02:56'! extent: newExtent | inner labelRect | isCollapsed ifTrue: [super extent: newExtent x @ (self labelHeight + 2)] ifFalse: [super extent: newExtent]. inner _ self innerBounds. labelRect _ self labelRect. stripes first bounds: (labelRect insetBy: 1). self setStripeColorsFrom: self paneColor. closeBox align: closeBox topLeft with: inner topLeft + (4@2). collapseBox align: collapseBox topRight with: inner topRight - (1@-2). label fitContents; setWidth: (label width min: bounds width - 50). label align: label bounds topCenter with: inner topCenter + 2. self setBoundsOfPaneMorphs. isCollapsed ifTrue: [collapsedFrame _ self bounds] ifFalse: [fullFrame _ self bounds]. ! ! !SystemWindow methodsFor: 'label' stamp: 'TB 6/11/1999 02:55'! labelHeight ^ label height + 1 max: closeBox height + 4! ! !SystemWindow methodsFor: 'label' stamp: 'TB 6/11/1999 02:05'! setStripeColorsFrom: paneColor self isActive ifTrue: [ stripes first color: (Color r: 0 g: 0 b: 255). stripes first gradientFillColor: (Color white) ] ifFalse: ["This could be much faster" stripes first color: Color gray. ]. ! !