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

!Browser methodsFor: 'initialize-release' stamp: 'jmv 9/22/2009 14:28'!
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
		addMorph: instanceSwitch fullFrame: (LayoutFrame fractions: (0@0 corner: 0.5@1));
		addMorph: commentSwitch fullFrame: (LayoutFrame fractions: (0.51@0 corner: 0.65@1));
		addMorph: classSwitch fullFrame: (LayoutFrame fractions: (0.66@0 corner: 1@1)).
	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:32'!
openAsMorphMessageEditing: editString
	"Create a pluggable version a Browser that shows just one message"

	| window mySingletonMessageList verticalOffset nominalFractions |
	window := SystemWindow new model: self.
	mySingletonMessageList := PluggableListMorph 
				model: self
				listGetter: #messageListSingleton
				indexGetter: #indexIsOne
				indexSetter: #indexIsOne:
				menuGetter: #messageListMenu:shifted:
				keystrokeAction: #messageListKey:from:.
	mySingletonMessageList enableDragNDrop: false.
	verticalOffset := 25.
	nominalFractions := 0 @ 0 corner: 1 @ 0.
	window addMorph: mySingletonMessageList
		fullFrame: (LayoutFrame fractions: nominalFractions
				offsets: (0 @ 0 corner: 0 @ verticalOffset)).
	verticalOffset := self 
				addOptionalAnnotationsTo: window
				at: nominalFractions
				plus: verticalOffset.
	verticalOffset := self 
				addOptionalButtonsTo: window
				at: nominalFractions
				plus: verticalOffset.
	window addMorph: (self buildMorphicCodePaneWith: editString)
		fullFrame: (LayoutFrame fractions: (0 @ 0 corner: 1 @ 1)
				offsets: (0 @ verticalOffset corner: 0 @ 0)).
	^window! !


!FileContentsBrowser methodsFor: 'creation' stamp: 'jmv 10/7/2009 11:31'!
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.

	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! !

