'From Cuis 1.0 of 6 April 2009 [latest update: #169] on 7 April 2009 at 8:42:10 am'!

!Browser methodsFor: 'initialize-release' stamp: 'jmv 4/7/2009 08:19'!
openAsMorphEditing: editString
	"Create a pluggable version of all the morphs for a Browser in Morphic"
	| window hSepFrac |

	hSepFrac _ 0.4.
	window _ (SystemWindow labelled: 'later') model: self.
	
"The method SystemWindow>>addMorph:fullFrame: checks scrollBarsOnRight, then adds the morph at the back if true, otherwise it is added in front. But flopout hScrollbars need the lowerpanes to be behind the upper ones in the draw order. Hence the value of scrollBarsOnRight affects the order in which the lowerpanes are added. "
	Preferences scrollBarsOnRight ifFalse: [
		self 
			addLowerPanesTo: window 
			at: (0@hSepFrac corner: 1@1) 
			with: editString].
		
	window 
		addMorph: self buildMorphicSystemCatList
		frame: (0@0 corner: 0.25@hSepFrac).
	self 
		addClassAndSwitchesTo: window 
		at: (0.25@0 corner: 0.5@hSepFrac)
		plus: 0.
	window 
		addMorph: self buildMorphicMessageCatList
		frame: (0.5@0 extent: 0.25@hSepFrac).
	window addMorph: self buildMorphicMessageList
		frame: (0.75@0 extent: 0.25@hSepFrac).
		
	Preferences scrollBarsOnRight ifTrue: [
		self 
			addLowerPanesTo: window 
			at: (0@hSepFrac corner: 1@1) 
			with: editString].
		
	window setUpdatablePanesFrom: #(systemCategoryList classList messageCategoryList messageList).
	^ window! !


!PackagePaneBrowser methodsFor: 'initialize-release' stamp: 'jmv 4/7/2009 08:21'!
openAsMorphEditing: editString 
	"Create a pluggable version of all the views for a Browser, including 
	views and controllers."
	"PackagePaneBrowser openBrowser"

	| listHeight window |
	listHeight _ 0.4.
	(window _ SystemWindow labelled: 'later') model: self.

"The method SystemWindow>>addMorph:fullFrame: checks scrollBarsOnRight, then adds the morph at the back if true, otherwise it is added in front. But flopout hScrollbars need the lowerpanes to be behind the upper ones in the draw order. Hence the value of scrollBarsOnRight affects the order in which the lowerpanes are added. "
	Preferences scrollBarsOnRight ifFalse: [
		self 
			addLowerPanesTo: window 
			at: (0@listHeight corner: 1@1) 
			with: editString].

	window
		addMorph: (PluggableListMorph
				on: self
				list: #packageList
				selected: #packageListIndex
				changeSelected: #packageListIndex:
				menu: #packageMenu:
				keystroke: #packageListKey:from:)
		frame: (0 @ 0 extent: 0.15 @ listHeight).
	window
		addMorph: self buildMorphicSystemCatList
		frame: (0.15 @ 0 extent: 0.2 @ listHeight).
	self
		addClassAndSwitchesTo: window
		at: (0.35 @ 0 extent: 0.25 @ listHeight)
		plus: 0.
	window
		addMorph: self buildMorphicMessageCatList
		frame: (0.6 @ 0 extent: 0.15 @ listHeight).
	window
		addMorph: self buildMorphicMessageList
		frame: (0.75 @ 0 extent: 0.25 @ listHeight).
		
	Preferences scrollBarsOnRight ifTrue: [
		self
			addLowerPanesTo: window
			at: (0 @ listHeight corner: 1 @ 1)
			with: editString ].
	window setUpdatablePanesFrom: #(#packageList #systemCategoryList #classList #messageCategoryList #messageList ).
	^ window! !


!ScrollPane methodsFor: 'geometry' stamp: 'jmv 4/7/2009 08:31'!
layoutChanged
	| t topLeft |
	super layoutChanged.
	
	hideScrollBars ifTrue: [^self].
	
	t _ Preferences scrollbarThickness.

	topLeft _ scrollBarOnLeft ifTrue: [
		"scrollbarOnLeft => retractableScrollBar"
		bounds topLeft + (0-t @ borderWidth)]
	ifFalse: [
		retractableScrollBar 
			ifTrue: [bounds topRight + (0-borderWidth @ borderWidth)]
			ifFalse: [bounds topRight + (0-t-borderWidth @ borderWidth)]].
	scrollBar 
		bounds: (topLeft extent: t @ self vScrollBarHeight).

	topLeft _ retractableScrollBar
				ifTrue: [bounds bottomLeft + (borderWidth @ borderWidth negated)]
				ifFalse: [bounds bottomLeft + (borderWidth @ (t + borderWidth) negated)].
	hScrollBar bounds: (topLeft extent: self hScrollBarWidth@ t)! !

!ScrollPane methodsFor: 'initialization' stamp: 'jmv 4/7/2009 08:35'!
initialize
	
	"initialize the state of the receiver"
	super initialize.
	hideScrollBars _ false.
	retractableScrollBar _ Preferences inboardScrollbars not.
	scrollBarOnLeft _ Preferences scrollBarsOnRight not.
	scrollBarOnLeft ifTrue: [
		retractableScrollBar _ true ].
	hasFocus _ false.
	self initializeScrollBars.
	self extent: 150 @ 120


! !


!SystemWindow methodsFor: 'panes' stamp: 'jmv 4/7/2009 08:11'!
addMorph: aMorph fullFrame: aLayoutFrame

	super addMorph: aMorph fullFrame: aLayoutFrame.

	paneMorphs _ paneMorphs copyReplaceFrom: 1 to: 0 with: (Array with: aMorph).
	Preferences alternativeWindowLook
		ifFalse:
			[aMorph borderWidth: 1.
			aMorph color: self paneColor]
		ifTrue:
			[aMorph adoptPaneColor: self paneColor.
			aMorph borderWidth: 2; borderColor: #inset; color: Color transparent].
	"reorder panes so flop-out right-side scrollbar is visible"
	Preferences scrollBarsOnRight
		ifTrue: [ self addMorphBack: aMorph ]! !

