'From Cuis 1.0 of 2 October 2009 [latest update: #316] on 7 October 2009 at 11:22:53 am'!

!CodeHolder methodsFor: 'annotation' stamp: 'jmv 10/7/2009 11:11'!
addOptionalAnnotationsTo: window at: fractions plus: verticalOffset
	"Add an annotation pane to the window if preferences indicate a desire for it, and return the incoming verticalOffset plus the height of the added pane, if any"

	| aTextMorph divider delta |
	self wantsAnnotationPane ifFalse: [^ verticalOffset].
	aTextMorph _ PluggableTextMorph 
		model: self
		editorClass: self editorClass
		textGetter: #annotation 
		textSetter: nil.
	aTextMorph
		askBeforeDiscardingEdits: false;
		borderWidth: 0;
		hideScrollBarsIndefinitely.
	divider _ BorderedSubpaneDividerMorph forBottomEdge.
	divider extent: 4@4; color: Color transparent; borderColor: #raised; borderWidth: 2.
	delta _ self defaultAnnotationPaneHeight.
	window 
		addMorph: aTextMorph 
		fullFrame: (LayoutFrame 
				fractions: fractions 
				offsets: (0@verticalOffset corner: 0@(verticalOffset + delta - 1))).
	window 
		addMorph: divider
		fullFrame: (LayoutFrame 
				fractions: fractions 
				offsets: (0@(verticalOffset + delta - 1) corner: 0@(verticalOffset + delta))).
	^ verticalOffset + delta! !

!CodeHolder methodsFor: 'controls' stamp: 'jmv 10/7/2009 11:11'!
addOptionalButtonsTo: window at: fractions plus: verticalOffset
	"If the receiver wishes it, add a button pane to the window, and answer the verticalOffset plus the height added"

	| delta buttons divider |
	self wantsOptionalButtons ifFalse: [^verticalOffset].
	delta _ self defaultButtonPaneHeight.
	buttons _ self optionalButtonRow 
		color: (Display depth <= 8 ifTrue: [Color transparent] ifFalse: [self class windowColor duller paler]).
	divider _ BorderedSubpaneDividerMorph forBottomEdge.
	divider extent: 4@4; color: Color transparent; borderColor: #raised; borderWidth: 2.
	window 
		addMorph: buttons
		fullFrame: (LayoutFrame 
				fractions: fractions 
				offsets: (0@verticalOffset corner: 0@(verticalOffset + delta - 1))).
	window 
		addMorph: divider
		fullFrame: (LayoutFrame 
				fractions: fractions 
				offsets: (0@(verticalOffset + delta - 1) corner: 0@(verticalOffset + delta))).
	^ verticalOffset + delta! !

!CodeHolder methodsFor: 'controls' stamp: 'jmv 9/10/2009 18:54'!
optionalButtonTuples
	"Answer a tuple buttons, in the format:
			button label
			selector to send
			help message"

	| aList |

	aList _ #(
	(10	'browse'			browseMethodFull				'view this method in a browser')
	(11	'senders' 			browseSendersOfMessages	'browse senders of...')
	(16	'implementors'		browseMessages				'browse implementors of...')
	(11	'versions'			browseVersions					'browse versions')), 

	(Preferences decorateBrowserButtons
		ifTrue:
			[{#(13	'inheritance'		methodHierarchy 	'browse method inheritance
green: sends to super
tan: has override(s)
mauve: both of the above
pink: is an override but doesn''t call super
pinkish tan: has override(s), also is an override but doesn''t call super' )}]
		ifFalse:
			[{#(13	'inheritance'		methodHierarchy	'browse method inheritance')}]),

	#(
	(12	'hierarchy'			classHierarchy					'browse class hierarchy')
	(11	'inst vars'			browseInstVarRefs				'inst var refs...')
	(13	'class vars'			browseClassVarRefs			'class var refs...')
	(9	'show...'				offerWhatToShowMenu		'menu of what to show in lower pane')).

	^ aList! !


!Browser methodsFor: 'initialize-release' stamp: 'jmv 10/7/2009 11:10'!
buildMorphicSwitches
	| instanceSwitch commentSwitch classSwitch row aColor |
	instanceSwitch := PluggableButtonMorph 
				model: self
				stateGetter: #instanceMessagesIndicated
				action: #indicateInstanceMessages.
	instanceSwitch
		label: 'instance';
		askBeforeChanging: true;
		borderWidth: 0.
	commentSwitch := PluggableButtonMorph 
				model: self
				stateGetter: #classCommentIndicated
				action: #plusButtonHit.
	commentSwitch
		label: '?' asText allBold;
		askBeforeChanging: true;
		setBalloonText: 'class comment';
		borderWidth: 0.
	classSwitch := PluggableButtonMorph 
				model: self
				stateGetter: #classMessagesIndicated
				action: #indicateClassMessages.
	classSwitch
		label: 'class';
		askBeforeChanging: true;
		borderWidth: 0.
	row _ AlignmentMorph proportional.
	row
		addInRow: {instanceSwitch. commentSwitch. classSwitch}
		atFractions: #(0.0 0.5 0.65 1.0).
	aColor := Color colorFrom: self class windowColor.
	row color: aColor duller.	"ensure matching button divider color. (see #paneColor)"
	aColor := aColor muchLighter.
	{ 
		instanceSwitch.
		commentSwitch.
		classSwitch} do: 
				[:m | 
				m
					color: aColor;
					onColor: aColor twiceDarker offColor: aColor].
	^row! !

!Browser methodsFor: 'initialize-release' stamp: 'jmv 10/7/2009 11:11'!
morphicClassColumn
	| column switchHeight divider |
	column _ AlignmentMorph proportional.
	switchHeight _ StrikeFont default height + 4.
	column 
		addMorph: self buildMorphicSwitches
		fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1)
				offsets: (0 @ (1 - switchHeight) corner: 0 @ 0)).
	divider _ BorderedSubpaneDividerMorph forTopEdge.
	divider
		extent: 4 @ 4;
		color: Color transparent;
		borderColor: #raised;
		borderWidth: 2.
	column addMorph: divider
		fullFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1)
				offsets: (0 @ switchHeight negated corner: 0 @ (1 - switchHeight))).
	column addMorph: self buildMorphicClassList 
		fullFrame: (LayoutFrame fractions: (0 @ 0 corner: 1 @ 1)
				offsets: (0 @ 0 corner: 0 @ switchHeight negated)).
	^column! !


!Color methodsFor: 'transformations' stamp: 'jmv 9/10/2009 18:41'!
quiteBlacker

	^ self alphaMixed: 0.8 with: Color black
! !

!Color methodsFor: 'transformations' stamp: 'jmv 9/10/2009 18:44'!
quiteWhiter

	^ self alphaMixed: 0.6 with: Color white! !


!Debugger methodsFor: 'controls' stamp: 'jmv 10/7/2009 11:11'!
addOptionalButtonsTo: window at: fractions plus: verticalOffset
	"Add button panes to the window.  A row of custom debugger-specific buttons (Proceed, Restart, etc.) is always added, and if optionalButtons is in force, then the standard code-tool buttons are also added.  Answer the verticalOffset plus the height added."

	| delta buttons divider anOffset |
	anOffset _ (Preferences optionalButtons and: [Preferences extraDebuggerButtons | true])
		ifTrue:
			[super addOptionalButtonsTo: window at: fractions plus: verticalOffset]
		ifFalse:
			[verticalOffset].

	delta _ self defaultButtonPaneHeight.
	buttons _ self customButtonRow.
	buttons color: (Display depth <= 8 ifTrue: [Color transparent] ifFalse: [self class windowColor duller paler]).
	divider _ BorderedSubpaneDividerMorph forBottomEdge.
	divider extent: 4@4; color: Color transparent; borderColor: #raised; borderWidth: 2.
	window 
		addMorph: buttons
		fullFrame: (LayoutFrame 
				fractions: fractions 
				offsets: (0@anOffset corner: 0@(anOffset + delta - 1))).
	window 
		addMorph: divider
		fullFrame: (LayoutFrame 
				fractions: fractions 
				offsets: (0@(anOffset + delta - 1) corner: 0@(anOffset + delta))).
	^ anOffset + delta! !


!FileContentsBrowser methodsFor: 'creation' stamp: 'jmv 10/7/2009 11:11'!
addLowerPanesTo: window at: nominalFractions with: editString

	| verticalOffset column codePane infoPane infoHeight divider |


	column _ AlignmentMorph proportional.

	codePane _ PluggableTextMorph 
		model: self 
		editorClass: self editorClass
		textGetter: #contents 
		textSetter: #contents:notifying:
		selectionGetter: #contentsSelection 
		menuGetter: #paneMenu:shifted:editorClass:.
	infoPane _ PluggableTextMorph 
		model: self 
		editorClass: self editorClass
		textGetter: #infoViewContents 
		textSetter: nil
		selectionGetter: nil 
		menuGetter: nil.
	infoPane askBeforeDiscardingEdits: false.
	verticalOffset _ 0.

">>not with this browser--- at least not yet ---
	innerFractions _ 0@0 corner: 1@0.
	verticalOffset _ self addOptionalAnnotationsTo: row at: innerFractions plus: verticalOffset.
	verticalOffset _ self addOptionalButtonsTo: row  at: innerFractions plus: verticalOffset.
<<<<"

	infoHeight _ 20.
	column 
		addMorph: (codePane borderWidth: 0)
		fullFrame: (
			LayoutFrame 
				fractions: (0@0 corner: 1@1) 
				offsets: (0@verticalOffset corner: 0@infoHeight negated)
		).
	divider _ BorderedSubpaneDividerMorph forTopEdge.
	divider extent: 4@4; color: Color transparent; borderColor: #raised; borderWidth: 2.
	column 
		addMorph: divider
		fullFrame: (
			LayoutFrame 
				fractions: (0@1 corner: 1@1) 
				offsets: (0@infoHeight negated corner: 0@(1-infoHeight))
		).
	column 
		addMorph: (infoPane borderWidth: 0; hideScrollBarsIndefinitely)
		fullFrame: (
			LayoutFrame 
				fractions: (0@1 corner: 1@1) 
				offsets: (0@(1-infoHeight) corner: 0@0)
		).
	window 
		addMorph: column
		frame: nominalFractions.

	column on: #mouseEnter send: #paneTransition: to: window.
	column on: #mouseLeave send: #paneTransition: to: window! !


!FileList class methodsFor: 'instance creation' stamp: 'jmv 10/7/2009 11:12'!
addButtonsAndFileListPanesTo: window at: upperFraction plus: offset forFileList: aFileList 
	| fileListMorph column buttonHeight fileListTop divider dividerDelta buttons |
	fileListMorph _ PluggableListMorph
				model: aFileList
				listGetter: #fileList
				indexGetter: #fileListIndex
				indexSetter: #fileListIndex:
				menuGetter: #fileListMenu:.
	fileListMorph enableDrag: true; enableDrop: false.
	aFileList wantsOptionalButtons
		ifTrue: [
			buttons _ aFileList optionalButtonRow.
			divider _ BorderedSubpaneDividerMorph forBottomEdge.
			dividerDelta _ 0.
			buttons color: Color transparent.
			divider extent: 4 @ 4;
				 color: Color transparent;
				 borderColor: #raised;
				 borderWidth: 2.
			fileListMorph borderColor: Color transparent.
			dividerDelta _ 3.
			column _ AlignmentMorph proportional.
			buttonHeight _ self defaultButtonPaneHeight.
			column
				addMorph: buttons
				fullFrame: (LayoutFrame
						fractions: (0 @ 0 corner: 1 @ 0)
						offsets: (0 @ 0 corner: 0 @ buttonHeight)).
			column
				addMorph: divider
				fullFrame: (LayoutFrame
						fractions: (0 @ 0 corner: 1 @ 0)
						offsets: (0 @ buttonHeight corner: 0 @ buttonHeight + dividerDelta)).
			column
				addMorph: fileListMorph
				fullFrame: (LayoutFrame
						fractions: (0 @ 0 corner: 1 @ 1)
						offsets: (0 @ buttonHeight + dividerDelta corner: 0 @ 0)).
			window
				addMorph: column
				fullFrame: (LayoutFrame
						fractions: upperFraction
						offsets: (0 @ offset corner: 0 @ 0)).
			column borderWidth: 2]
		ifFalse: [
			fileListTop _ 0.
			window
				addMorph: fileListMorph
				frame: (0.3 @ fileListTop corner: 1 @ 0.3)].! !

!FileList class methodsFor: 'instance creation' stamp: 'jmv 10/7/2009 11:12'!
addVolumesAndPatternPanesTo: window at: upperFraction plus: offset forFileList: aFileList 
	| column patternHeight volumeListMorph patternMorph divider dividerDelta |
	column _ AlignmentMorph proportional.
	patternHeight _ 25.
	volumeListMorph _ (PluggableListMorph
				model: aFileList
				listGetter: #volumeList
				indexGetter: #volumeListIndex
				indexSetter: #volumeListIndex:
				menuGetter: #volumeMenu:)
				autoDeselect: false.
	volumeListMorph enableDrag: false; enableDrop: true.
	patternMorph _ PluggableTextMorph
				model: aFileList
				editorClass: aFileList editorClass
				textGetter: #pattern
				textSetter: #pattern:.
	patternMorph acceptOnCR: true.
	patternMorph hideScrollBarsIndefinitely.
	divider _ BorderedSubpaneDividerMorph new.
	dividerDelta _ 0.
	divider
		extent: 4 @ 4;
		color: Color transparent;
		borderColor: #raised;
		borderWidth: 2.
	volumeListMorph borderColor: Color transparent.
	patternMorph borderColor: Color transparent.
	dividerDelta _ 3.
	column
		addMorph: (volumeListMorph autoDeselect: false)
		fullFrame: (LayoutFrame
				fractions: (0 @ 0 corner: 1 @ 1)
				offsets: (0 @ 0 corner: 0 @ patternHeight negated - dividerDelta)).
	column
		addMorph: divider
		fullFrame: (LayoutFrame
				fractions: (0 @ 1 corner: 1 @ 1)
				offsets: (0 @ patternHeight negated - dividerDelta corner: 0 @ patternHeight negated)).
	column
		addMorph: patternMorph
		fullFrame: (LayoutFrame
				fractions: (0 @ 1 corner: 1 @ 1)
				offsets: (0 @ patternHeight negated corner: 0 @ 0)).
	window
		addMorph: column
		fullFrame: (LayoutFrame
				fractions: upperFraction
				offsets: (0 @ offset corner: 0 @ 0)).
	column borderWidth: 2! !


!InsetBorder methodsFor: 'accessing' stamp: 'jmv 9/10/2009 18:47'!
bottomRightColor
	^color quiteWhiter! !

!InsetBorder methodsFor: 'accessing' stamp: 'jmv 9/10/2009 18:46'!
topLeftColor
	^color quiteBlacker! !


!Preferences class methodsFor: 'misc' stamp: 'jmv 10/7/2009 11:16'!
defaultValueTableForCurrentRelease
	"Answer a table defining default values for all the preferences in the release.  Returns a list of (pref-symbol, boolean-symbol) pairs"

	^  #(
		(abbreviatedBrowserButtons false)
		(alternativeBrowseIt false)
		(annotationPanes false)
		(automaticFlapLayout true)
		(automaticPlatformSettings true)
		(balloonHelpEnabled true)
		(browseWithPrettyPrint false)
		(browserShowsPackagePane false)
		(canRecordWhilePlaying false)
		(caseSensitiveFinds false)
		(changeSetVersionNumbers true)
		(checkForSlips true)
		(classicNewMorphMenu false)
		(cmdDotEnabled true)
		(collapseWindowsInPlace false)
		(conversionMethodsAtFileOut false)
		(cpuWatcherEnabled false)
		(debugHaloHandle true)
		(debugPrintSpaceLog false)
		(debugShowDamage false)
		(decorateBrowserButtons true)
		(diffsInChangeList true)
		(diffsWithPrettyPrint false)
		(dismissAllOnOptionClose false)
		(fastDragWindowForMorphic true)
		(fullScreenLeavesDeskMargins true)
		(hiddenScrollBars false)
		(higherPerformance false)
		(honorDesktopCmdKeys true)
		(inboardScrollbars true)
		(logDebuggerStackToFile true)
		(menuButtonInToolPane false)
		(menuColorFromWorld false)
		(menuKeyboardControl false)  
		(modalColorPickers true)
		(optionalButtons true)
		(personalizedWorldMenu true)
		(projectsSentToDisk false)
		(restartAlsoProceeds false)
		(reverseWindowStagger true)
		(scrollBarsWithoutMenuButton false)
		(selectiveHalos false)
		(showBoundsInHalo false)
		(simpleMenus false)
		(smartUpdating true)
		(soundQuickStart false)
		(soundStopWhenDone false)
		(soundsEnabled true)
		(systemWindowEmbedOK false)
		(thoroughSenders true)
		(twentyFourHourFileStamps true)
		(warnIfNoChangesFile true)
		(warnIfNoSourcesFile true))


"
Preferences defaultValueTableForCurrentRelease do:
	[:pair | (Preferences preferenceAt: pair first ifAbsent: [nil]) ifNotNilDo:
			[:pref | pref defaultValue: (pair last == #true)]].
Preferences chooseInitialSettings.
"! !

!Preferences class methodsFor: 'themes' stamp: 'jmv 10/7/2009 11:16'!
brightSqueak
	"The classic bright Squeak look.  Windows have saturated colors and relatively low contrast; scroll-bars are of the flop-out variety and are on the left.  Many power-user features are enabled."

	self setPreferencesFrom:
	#(
		(annotationPanes true)
		(automaticFlapLayout true)
		(balloonHelpEnabled true)
		(browseWithPrettyPrint false)
		(browserShowsPackagePane false)
		(classicNewMorphMenu false)
		(cmdDotEnabled true)
		(collapseWindowsInPlace false)
		(debugHaloHandle true)
		(debugPrintSpaceLog false)
		(debugShowDamage false)
		(decorateBrowserButtons true)
		(diffsInChangeList true)
		(diffsWithPrettyPrint false)
		(fastDragWindowForMorphic true)
		(fullScreenLeavesDeskMargins true)
		(hiddenScrollBars false)
		(inboardScrollbars false)
		(logDebuggerStackToFile true)
		(menuButtonInToolPane false)
		(menuColorFromWorld false)
		(menuKeyboardControl true)
		(optionalButtons true)
		(personalizedWorldMenu true)
		(restartAlsoProceeds false)
		(reverseWindowStagger true)
		(scrollBarsWithoutMenuButton false)
		(selectiveHalos false)
		(simpleMenus false)
		(smartUpdating true)
		(systemWindowEmbedOK false)
		(thoroughSenders true)
		(warnIfNoChangesFile true)
		(warnIfNoSourcesFile true))! !

!Preferences class methodsFor: 'themes' stamp: 'jmv 10/7/2009 11:16'!
magdeburg
	"Alternative window & scroll-bar looks, no desktop command keys, no keyboard menu control, no annotation panes..."

	self setPreferencesFrom: #(
		(annotationPanes false)
		(canRecordWhilePlaying false)
		(conversionMethodsAtFileOut true)
		(honorDesktopCmdKeys false)
		(menuKeyboardControl false)  
		(scrollBarsWithoutMenuButton true))! !

!Preferences class methodsFor: 'themes' stamp: 'jmv 10/7/2009 11:16'!
paloAlto
	"Similar to the brightSqueak theme, but with a number of idiosyncratic personal settings.   Note that caseSensitiveFinds is true"


	self setPreferencesFrom:
	#(
		(abbreviatedBrowserButtons false)
		(accessOnlineModuleRepositories noOpinion)
		(alternativeBrowseIt noOpinion)
		(annotationPanes true)
		(automaticFlapLayout true)
		(automaticPlatformSettings noOpinion)
		(balloonHelpEnabled true)
		(browseWithPrettyPrint false)
		(browserShowsPackagePane false)
		(canRecordWhilePlaying noOpinion)
		(caseSensitiveFinds true)
		(changeSetVersionNumbers true)
		(checkForSlips true)
		(classicNewMorphMenu false)
		(cmdDotEnabled true)
		(collapseWindowsInPlace false)
		(conservativeModuleDeActivation noOpinion)
		(conversionMethodsAtFileOut true)
		(cpuWatcherEnabled noOpinion)
		(debugHaloHandle true)
		(debugPrintSpaceLog true)
		(debugShowDamage false)
		(decorateBrowserButtons true)
		(diffsInChangeList true)
		(diffsWithPrettyPrint false)
		(dismissAllOnOptionClose true)
		(duplicateControlAndAltKeys false)
		(extraDebuggerButtons true)
		(fastDragWindowForMorphic true)
		(fullScreenLeavesDeskMargins true)
		(hiddenScrollBars false)
		(higherPerformance noOpinion)
		(honorDesktopCmdKeys true)
		(inboardScrollbars false)
		(logDebuggerStackToFile true)
		(menuButtonInToolPane false)
		(menuColorFromWorld false)
		(menuKeyboardControl true)  
		(modalColorPickers true)
		(modularClassDefinitions noOpinion)
		(optionalButtons true)
		(personalizedWorldMenu true)
		(projectsSentToDisk noOpinion)
		(restartAlsoProceeds false)
		(reverseWindowStagger true)
		(scrollBarsWithoutMenuButton false)
		(selectiveHalos false)
		(showBoundsInHalo false)
		(simpleMenus false)
		(smartUpdating true)
		(soundQuickStart noOpinion)
		(soundsEnabled true)
		(soundStopWhenDone noOpinion)
		(strongModules noOpinion)
		(swapControlAndAltKeys noOpinion)
		(swapMouseButtons  noOpinion)
		(systemWindowEmbedOK false)
		(thoroughSenders true)
		(twentyFourHourFileStamps false)
		(warnIfNoChangesFile true)
		(warnIfNoSourcesFile true))! !

!Preferences class methodsFor: 'themes' stamp: 'jmv 10/7/2009 11:16'!
slowMachine

	self setPreferencesFrom:

	#(
		(annotationPanes false)
		(balloonHelpEnabled false)
		(browseWithPrettyPrint false)
		(browserShowsPackagePane false)
		(caseSensitiveFinds true)
		(checkForSlips false)
		(cmdDotEnabled true)
		(collapseWindowsInPlace false)
		(diffsInChangeList false)
		(diffsWithPrettyPrint false)
		(fastDragWindowForMorphic true)
		(honorDesktopCmdKeys false)
		(inboardScrollbars true)
		(menuColorFromWorld false)
		(menuKeyboardControl false)
		(optionalButtons false)
		(personalizedWorldMenu false)
		(restartAlsoProceeds false)
		(scrollBarsWithoutMenuButton false)
		(simpleMenus false)
		(smartUpdating false)
		(subPixelRenderFonts false)
		(thoroughSenders false)
	)! !

!Preferences class methodsFor: 'themes' stamp: 'jmv 10/7/2009 11:15'!
smalltalk80
	"A traditional monochrome Smalltalk-80 look and feel, clean and austere, and lacking many features added to Squeak in recent years. Caution: this theme removes the standard Squeak flaps, turns off the 'smartUpdating' feature that keeps multiple browsers in synch, and much more."

	self setPreferencesFrom:

	#(
		(annotationPanes false)
		(balloonHelpEnabled false)
		(browseWithPrettyPrint false)
		(browserShowsPackagePane false)
		(caseSensitiveFinds true)
		(checkForSlips false)
		(cmdDotEnabled true)
		(collapseWindowsInPlace false)
		(diffsInChangeList false)
		(diffsWithPrettyPrint false)
		(fastDragWindowForMorphic true)
		(honorDesktopCmdKeys false)
		(inboardScrollbars false)
		(menuColorFromWorld false)
		(menuKeyboardControl false)
		(optionalButtons false)
		(personalizedWorldMenu false)
		(restartAlsoProceeds false)
		(scrollBarsWithoutMenuButton false)
		(simpleMenus false)
		(smartUpdating false)
		(thoroughSenders false)
	)! !


!RaisedBorder methodsFor: 'accessing' stamp: 'jmv 9/10/2009 18:47'!
bottomRightColor
	^color quiteBlacker! !

!RaisedBorder methodsFor: 'accessing' stamp: 'jmv 9/10/2009 18:47'!
topLeftColor
	^color quiteWhiter! !


!SystemWindow methodsFor: 'initialization' stamp: 'jmv 10/7/2009 11:15'!
defaultBorderColor
	"answer the default border color/fill style for the receiver"
	^ #raised! !

!SystemWindow methodsFor: 'initialization' stamp: 'jmv 10/7/2009 11:12'!
defaultBorderWidth
	"answer the default border width for the receiver"
	^ 2! !

!SystemWindow methodsFor: 'initialization' stamp: 'jmv 10/7/2009 11:12'!
defaultColor
	"answer the default color/fill style for the receiver"
	^ Color white! !

!SystemWindow methodsFor: 'initialization' stamp: 'jmv 10/7/2009 11:13'!
initialize
	"Initialize a system window. Add label, stripes, etc., if desired"
	super initialize.
	labelString ifNil: [labelString := 'Untitled Window' translated].
	isCollapsed := false.
	paneMorphs := Array new.
	borderColor := #raised.
	borderWidth := 2.
	color := Color white.
	
	self wantsLabel ifTrue: [self initializeLabelArea].
	self 
		on: #mouseEnter
		send: #spawnReframeHandle:
		to: self.
	self 
		on: #mouseLeave
		send: #spawnReframeHandle:
		to: self.
	self extent: 300 @ 200.
	updatablePanes := Array new! !

!SystemWindow methodsFor: 'menu' stamp: 'jmv 10/7/2009 11:14'!
setWindowColor: incomingColor
	| existingColor aColor |
	incomingColor ifNil: [^ self].  "it happens"
	aColor _ incomingColor asNontranslucentColor.
	(aColor = ColorPickerMorph perniciousBorderColor 
		or: [aColor = Color black]) ifTrue: [^ self].
	existingColor _ self paneColorToUse.
	existingColor ifNil: [^ Beeper beep].
	self paneColor: aColor.
	self changed! !

!SystemWindow methodsFor: 'panes' stamp: 'jmv 10/7/2009 11:13'!
paneColor
	| cc |
	(cc := paneColor) ifNotNil: [^cc].
	Display depth > 2 
		ifTrue: [
			model ifNotNil: [
					model isInMemory 
						ifTrue: [
							cc := Color colorFrom: model class windowColor.
							cc := (cc = Color lightYellow or: [cc = Color white]) 
								ifTrue: [Color gray: 0.67]
								ifFalse: [cc duller]]].
			cc ifNil: [cc := paneMorphs isEmptyOrNil ifFalse: [paneMorphs first color]]].
	cc ifNil: [cc := Color white].
	self paneColor: cc.
	^cc! !

!SystemWindow methodsFor: 'panes' stamp: 'jmv 10/7/2009 11:13'!
paneColor: aColor
	paneColor _ aColor.
	aColor notNil
		ifTrue: [ self color: aColor veryMuchLighter ].
	self adoptPaneColor: aColor.! !


!TestRunner methodsFor: 'interface opening' stamp: 'jmv 10/7/2009 11:15'!
buildLowerPanes
	| failuresList errorsList column tHeight divider |
	column _ AlignmentMorph proportional.
	self buildPassFailText.
	self buildDetailsText.
	self buildTestsList.
	failuresList _ self buildFailuresList.
	errorsList _ self buildErrorsList.
	tHeight _ 26.
	divider _ Array new: 3.
	1
		to: divider size
		do: [:index | 
			divider at: index put: BorderedSubpaneDividerMorph forBottomEdge.
			(divider at: index)
				extent: 4 @ 4;
				color: Color transparent;
				borderColor: #raised;
				borderWidth: 2].
	column
		addMorph: (passFailText borderWidth: 0)
		fullFrame: (LayoutFrame
				fractions: (0 @ 0 corner: 1 @ 0)
				offsets: (0 @ 0 corner: 0 @ tHeight - 1)).
	column
		addMorph: (divider at: 1)
		fullFrame: (LayoutFrame
				fractions: (0 @ 0 corner: 1 @ 0)
				offsets: (0 @ (tHeight - 1) corner: 0 @ tHeight)).
	column
		addMorph: (detailsText borderWidth: 0)
		fullFrame: (LayoutFrame
				fractions: (0 @ 0 corner: 1 @ 0)
				offsets: (0 @ tHeight corner: 0 @ (2 * tHeight - 1))).
	column
		addMorph: (divider at: 2)
		fullFrame: (LayoutFrame
				fractions: (0 @ 0 corner: 1 @ 0)
				offsets: (0 @ (2 * tHeight - 1) corner: 0 @ (2 * tHeight))).
	column
		addMorph: (failuresList borderWidth: 0)
		fullFrame: (LayoutFrame
				fractions: (0 @ 0 corner: 1 @ 0.6)
				offsets: (0 @ (2 * tHeight) corner: 0 @ -1)).
	column
		addMorph: (divider at: 3)
		fullFrame: (LayoutFrame
				fractions: (0 @ 0.6 corner: 1 @ 0.6)
				offsets: (0 @ - 1 corner: 0 @ 0)).
	column
		addMorph: (errorsList borderWidth: 0)
		fullFrame: (LayoutFrame
				fractions: (0 @ 0.6 corner: 1 @ 1)
				offsets: (0 @ 0 corner: 0 @ 0)).
	^ column! !

!TestRunner methodsFor: 'interface opening' stamp: 'jmv 10/7/2009 11:15'!
buildUpperControls
	| refreshButton filterButton stopButton runOneButton runButton row bWidth listsMorph |
	row _ AlignmentMorph proportional.
	row
		color: (Display depth <= 8
				ifTrue: [Color transparent]
				ifFalse: [Color gray alpha: 0.2]).
	refreshButton _ self buildRefreshButton.
	filterButton _ self buildFilterButton.
	stopButton _ self buildStopButton.
	runOneButton _ self buildRunOneButton.
	runButton _ self buildRunButton.
	listsMorph _ self buildTestsList.
	bWidth _ 90.
	row
		addMorph: refreshButton
		fullFrame: (LayoutFrame
				fractions: (0 @ 0 corner: 0 @ 0.33)
				offsets: (4 @ 2 corner: bWidth - 4 @ -2)).
	row
		addMorph: filterButton
		fullFrame: (LayoutFrame
				fractions: (0 @ 0.33 corner: 0 @ 0.66)
				offsets: (4 @ 2 corner: bWidth - 4 @ -2)).
	row
		addMorph: stopButton
		fullFrame: (LayoutFrame
				fractions: (0 @ 0.66 corner: 0 @ 1)
				offsets: (4 @ 2 corner: bWidth - 4 @ -2)).
	row
		addMorph: listsMorph
		fullFrame: (LayoutFrame
				fractions: (0 @ 0 corner: 1 @ 1)
				offsets: (bWidth  @ 0 corner: bWidth negated @ 0)).
	row
		addMorph: runOneButton
		fullFrame: (LayoutFrame
				fractions: (1 @ 0 corner: 1 @ 0.5)
				offsets: (bWidth negated + 4 @ 2 corner: -4 @ -2)).
	row
		addMorph: runButton
		fullFrame: (LayoutFrame
				fractions: (1 @ 0.5 corner: 1 @ 1)
				offsets: (bWidth negated + 4 @ 2 corner: -4 @ -2)).
	row color: Color transparent.
	^ row! !

!TestRunner methodsFor: 'interface opening' stamp: 'jmv 10/7/2009 11:15'!
morphicWindow
	"TestRunner new openAsMorph"
	| upperRow lowerPanes fracYRatio divider window |
	window _ SystemWindow labelled: self windowLabel.
	window model: self.
	upperRow _ self buildUpperControls.
	lowerPanes _ self buildLowerPanes.
	fracYRatio _ 0.25.
	window
		addMorph: upperRow
		fullFrame: (LayoutFrame fractions: (0 @ 0 extent: 1 @ fracYRatio)).
	divider _ BorderedSubpaneDividerMorph forBottomEdge.
	divider
		 color: Color transparent;
		 borderColor: #raised;
		 borderWidth: 1.
	window
		addMorph: divider
		fullFrame: (LayoutFrame
				fractions: (0 @ fracYRatio corner: 1 @ fracYRatio)
				offsets: (0 @ 0 corner: 0 @ 2)).

	window
		addMorph: lowerPanes
		fullFrame: (LayoutFrame fractions: (0 @ fracYRatio extent: 1 @ (1 - fracYRatio))).
	self refreshWindow.
	window extent: 460 @ 400.
	^window! !


!TheWorldMenu methodsFor: 'commands' stamp: 'jmv 10/7/2009 11:14'!
setDisplayDepth
	"Let the user choose a new depth for the display. "

	| result oldDepth allDepths allLabels menu hasBoth |
	oldDepth := Display nativeDepth.
	allDepths := #(1 -1 2 -2 4 -4 8 -8 16 -16 32 -32) 
				select: [:d | Display supportsDisplayDepth: d].
	hasBoth := (allDepths anySatisfy: [:d | d > 0]) 
				and: [allDepths anySatisfy: [:d | d < 0]].
	allLabels := allDepths collect: 
					[:d | 
					String streamContents: 
							[:s | 
							s nextPutAll: (d = oldDepth ifTrue: ['<on>'] ifFalse: ['<off>']).
							s print: d abs.
							hasBoth 
								ifTrue: 
									[s 
										nextPutAll: (d > 0 ifTrue: ['  (big endian)'] ifFalse: ['  (little endian)'])]]].
	menu := SelectionMenu labels: allLabels selections: allDepths.
	result := menu startUpWithCaption: 'Choose a display depth' translated.
	result ifNotNil: [Display newDepth: result].
	oldDepth := oldDepth abs! !

SystemWindow removeSelector: #restoreDefaultPaneColor!
SystemWindow removeSelector: #updatePaneColors!
Preferences class removeSelector: #alternativeWindowLook!
Preferences class removeSelector: #slowMachine1!
Preferences class removeSelector: #westwood!
