[squeak-dev] The Trunk: Morphic-ml.194.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Sep 27 02:47:48 UTC 2009


Andreas Raab uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ml.194.mcz

==================== Summary ====================

Name: Morphic-ml.194
Author: ml
Time: 26 September 2009, 4:04:53 am
UUID: d462d0e2-95f2-498d-83bb-5cb571578d52
Ancestors: Morphic-ml.193

Enhancements to ProportionalSplitterMorph behaviour.

The splitters in tool builder windows now determine the range of movement by looking at the minimum extent of adjecent  morphs. For deterministic results the ScrollPane minExtent assumes that eventually both scrollbars will be displayed.

Fixed LayoutFrame>>minExtentFrom: to calculate min extent based on the fraction occupied by the frame.

=============== Diff against Morphic-nice.191 ===============

Item was changed:
  ----- Method: LayoutFrame>>minExtentFrom: (in category 'layout') -----
  minExtentFrom: minExtent
  	"Return the minimal extent the given bounds can be represented in"
+ 	| widthFraction heightFraction width height left right top bottom |
+ 	left := leftFraction ifNil: [0.0].
+ 	right := rightFraction ifNil: [1.0].
+ 	widthFraction := 1.0 / (right - left).
+ 	top := topFraction ifNil: [0.0].
+ 	bottom := bottomFraction ifNil: [1.0].
+ 	heightFraction := 1.0 / (bottom - top).
- 	| widthFraction heightFraction width height |
- 	widthFraction := 1.0.
- 	leftFraction ifNotNil:[widthFraction := widthFraction + leftFraction].
- 	rightFraction ifNotNil:[widthFraction := widthFraction + rightFraction].
- 	heightFraction := 1.0.
- 	topFraction ifNotNil:[heightFraction := heightFraction + topFraction].
- 	bottomFraction ifNotNil:[heightFraction := heightFraction + bottomFraction].
  	width := minExtent x * widthFraction.
  	height := minExtent y * heightFraction.
  	leftOffset ifNotNil:[width := width + leftOffset].
  	rightOffset ifNotNil:[width := width + rightOffset].
  	topOffset ifNotNil:[height := height + topOffset].
  	bottomOffset ifNotNil:[height := height + bottomOffset].
  	^width truncated @ height truncated!

Item was added:
+ ----- Method: ScrollPane>>minExtent (in category 'geometry') -----
+ minExtent
+ 	"Answer the calculated minimum size of the receiver."
+ 
+ 	^ super minExtent max: self minScrollbarExtent!

Item was changed:
  ----- Method: ProportionalSplitterMorph>>bottomBoundary (in category 'as yet unclassified') -----
  bottomBoundary
+ 	"Answert the bottommost x position the receiver could be moved."
  
+ 	| splitter morphs |
+ 	splitter := self splitterBelow.
+ 	morphs := self commonNeighbours: rightOrBottom with: splitter.
+ 	^ (splitter
+ 		ifNil: [self containingWindow panelRect bottom]
+ 		ifNotNil: [splitter top])
+ 		- (self minimumHeightOf: morphs)!
- 	^ (self splitterBelow ifNil: [self containingWindow panelRect bottom] ifNotNil: [self splitterBelow top]) - 75!

Item was added:
+ ----- Method: ProportionalSplitterMorph>>commonNeighbours:with: (in category 'as yet unclassified') -----
+ commonNeighbours: morphs with: aProportionalSplitterMorphOrNil
+ 	"Answer the subset of morphs which is also confined by aProportionalSplitterMorphOrNil."
+ 
+ 	^ aProportionalSplitterMorphOrNil isNil
+ 		ifTrue: [morphs]
+ 		ifFalse: [morphs select: [ :which |
+ 				aProportionalSplitterMorphOrNil bordersOn: which]]!

Item was added:
+ ----- Method: ProportionalSplitterMorph>>minimumWidthOf: (in category 'as yet unclassified') -----
+ minimumWidthOf: aCollection
+ 	"Answer the minimum width needed to display any of the morphs in aCollection."
+ 
+ 	^ aCollection inject: 0 into: [ :width :morph |
+ 		morph minExtent x max: width]!

Item was changed:
  ----- Method: ProportionalSplitterMorph>>leftBoundary (in category 'as yet unclassified') -----
  leftBoundary
+ 	"Answer the leftmost y position the receiver could be moved."
  
+ 	| splitter morphs |
+ 	splitter := self splitterLeft.
+ 	morphs := self commonNeighbours: leftOrTop with: splitter.
+ 	^ (splitter
+ 		ifNil: [self containingWindow panelRect left]
+ 		ifNotNil: [splitter right])
+ 		 + (self minimumWidthOf: morphs)!
- 	^ (self splitterLeft ifNil: [self containingWindow panelRect left] ifNotNil: [self splitterLeft right]) + 50!

Item was added:
+ ----- Method: ScrollBar>>minExtent (in category 'geometry') -----
+ minExtent
+ 	"The minimum extent is that of 2 or 3 buttons in a row or column,
+ 	the 'up' and 'down' button and optionally the 'menu' button."
+ 
+ 	| btns cnt |
+ 	btns := 2.
+ 	menuButton ifNotNil: [
+ 		btns := btns + 1].
+ 	cnt := 1 at btns. "assume vertical layout"
+ 	self bounds isWide
+ 		ifTrue: [cnt := cnt transposed].
+ 	^ upButton minExtent * cnt!

Item was changed:
  SystemOrganization addCategory: #'Morphic-Balloon'!
  SystemOrganization addCategory: #'Morphic-Basic'!
  SystemOrganization addCategory: #'Morphic-Basic-NewCurve'!
  SystemOrganization addCategory: #'Morphic-Borders'!
  SystemOrganization addCategory: #'Morphic-Collections-Arrayed'!
  SystemOrganization addCategory: #'Morphic-Components'!
  SystemOrganization addCategory: #'Morphic-Demo'!
  SystemOrganization addCategory: #'Morphic-Events'!
  SystemOrganization addCategory: #'Morphic-Explorer'!
  SystemOrganization addCategory: #'Morphic-FileList'!
  SystemOrganization addCategory: #'Morphic-Kernel'!
  SystemOrganization addCategory: #'Morphic-Layouts'!
  SystemOrganization addCategory: #'Morphic-Menus'!
+ SystemOrganization addCategory: #'Morphic-Models'!
  SystemOrganization addCategory: #'Morphic-Pluggable Widgets'!
  SystemOrganization addCategory: #'Morphic-Refactoring Candidates'!
  SystemOrganization addCategory: #'Morphic-Scripting'!
  SystemOrganization addCategory: #'Morphic-Support'!
  SystemOrganization addCategory: #'Morphic-Text Support'!
  SystemOrganization addCategory: #'Morphic-TrueType'!
  SystemOrganization addCategory: #'Morphic-Widgets'!
  SystemOrganization addCategory: #'Morphic-Windows'!
  SystemOrganization addCategory: #'Morphic-Worlds'!

Item was changed:
  ----- Method: ProportionalSplitterMorph>>rightBoundary (in category 'as yet unclassified') -----
  rightBoundary
+ 	"Answer the rightmost x position the receiver could be moved to."
  
+ 	| splitter morphs |
+ 	splitter := self splitterRight.
+ 	morphs := self commonNeighbours: rightOrBottom with: splitter.
+ 	^ (splitter
+ 		ifNil: [self containingWindow panelRect right]
+ 		ifNotNil: [splitter left])
+ 		- (self minimumWidthOf: morphs)!
- 	^ (self splitterRight ifNil: [self containingWindow panelRect right] ifNotNil: [self splitterRight left]) - 50!

Item was added:
+ MorphicModel subclass: #MorphicModel2
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'Morphic-Models'!

Item was added:
+ MorphicModel subclass: #MorphicModel1
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'Morphic-Models'!

Item was added:
+ ----- Method: ProportionalSplitterMorph>>bordersOn: (in category 'as yet unclassified') -----
+ bordersOn: aMorph
+ 	"Answer true if the aMorph is one of my neighbours."
+ 
+ 	^ (leftOrTop includes: aMorph) or: [rightOrBottom includes: aMorph]!

Item was added:
+ ----- Method: ProportionalSplitterMorph>>minimumHeightOf: (in category 'as yet unclassified') -----
+ minimumHeightOf: aCollection
+ 	"Answer the minimum height needed to display any of the morphs in aCollection."
+ 
+ 	^ aCollection inject: 0 into: [ :height :morph |
+ 		morph minExtent y max: height]!

Item was changed:
  ----- Method: ProportionalSplitterMorph>>topBoundary (in category 'as yet unclassified') -----
  topBoundary
+ 	"Answer the topmost x position the receiver could be moved to."
  
+ 	| splitter morphs |
+ 	splitter := self splitterAbove.
+ 	morphs := self commonNeighbours: leftOrTop with: splitter.
+ 	^ (splitter
+ 		ifNil: [self containingWindow panelRect top]
+ 		ifNotNil: [splitter bottom])
+ 		+ (self minimumHeightOf: morphs)!
- 	^ (self splitterAbove ifNil: [self containingWindow panelRect top] ifNotNil: [self splitterAbove bottom]) + 75!

Item was added:
+ ----- Method: ScrollPane>>minScrollbarExtent (in category 'geometry') -----
+ minScrollbarExtent
+ 	"Answer the minimum extent occupied by the receiver..
+ 	It is assumed the if the receiver is sized to its minimum both scrollbars will be used (and visible).
+ 	This makes the behaviour also more predictable."
+ 
+ 	^ scrollBar minExtent + hScrollBar minExtent!




More information about the Squeak-dev mailing list