[squeak-dev] The Trunk: MorphicExtras-nice.66.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Jan 3 14:48:18 UTC 2010


Nicolas Cellier uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-nice.66.mcz

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

Name: MorphicExtras-nice.66
Author: nice
Time: 3 January 2010, 3:47:59 am
UUID: d15c89aa-952f-47df-a9bb-b4b22d339d9d
Ancestors: MorphicExtras-nice.64

move #basicType to EToys
remove some #or:or: #and:and: sends

=============== Diff against MorphicExtras-nice.64 ===============

Item was changed:
  ----- Method: CanvasCharacterScanner>>displayLine:offset:leftInRun: (in category 'scanning') -----
  displayLine: textLine offset: offset leftInRun: leftInRun 
  	"largely copied from DisplayScanner's routine"
  
+ 	| nowLeftInRun startLoc startIndex stopCondition |
- 	| nowLeftInRun done startLoc startIndex stopCondition |
  	line := textLine.
  	foregroundColor ifNil: [foregroundColor := Color black].
  	leftMargin := (line leftMarginForAlignment: alignment) + offset x.
  	rightMargin := line rightMargin + offset x.
  	lineY := line top + offset y.
  	lastIndex := textLine first.
  	nowLeftInRun := leftInRun <= 0 
  				ifTrue: 
  					[self setStopConditions.	"also sets the font"
  					text runLengthFor: lastIndex]
  				ifFalse: [leftInRun]. 
  	runX := destX := leftMargin.
  	runStopIndex := lastIndex + (nowLeftInRun - 1) min: line last.
  	spaceCount := 0.
+ 	[
+ 			"remember where this portion of the line starts"
- 	done := false.
- 	[done] whileFalse: 
- 			["remember where this portion of the line starts"
- 
  			startLoc := destX @ destY.
  			startIndex := lastIndex.
  
  			"find the end of this portion of the line"
  			stopCondition := self 
  						scanCharactersFrom: lastIndex
  						to: runStopIndex
  						in: text string
  						rightX: rightMargin
  						stopConditions: stopConditions
  						kern: kern.	"displaying: false"
  
  			"display that portion of the line"
  			canvas 
  				drawString: text string
  				from: startIndex
  				to: lastIndex
  				at: startLoc
  				font: font
  				color: foregroundColor.
  
  			"handle the stop condition"
+ 			self perform: stopCondition
+ 	] whileFalse.
- 			done := self perform: stopCondition].
  	^runStopIndex - lastIndex!

Item was changed:
  ----- Method: CommandHistory>>undoMenuWording (in category 'menu') -----
  undoMenuWording
  	"Answer the wording to be used in an 'undo' menu item"
  
  	(lastCommand isNil
+ 			or: [Preferences useUndo not
+ 			or: [(Preferences infiniteUndo not and: [lastCommand phase == #undone])
+ 			or: [self nextCommandToUndo isNil]]])
- 			or: [Preferences useUndo not]
- 			or: [Preferences infiniteUndo not and: [lastCommand phase == #undone]]
- 			or: [self nextCommandToUndo isNil])
  		ifTrue: [^ 'can''t undo' translated].
  
  	^ String
  		streamContents: [:aStream | 
  			aStream nextPutAll: 'undo' translated.
  			aStream nextPutAll: ' "'.
  			aStream nextPutAll: (self nextCommandToUndo cmdWording truncateWithElipsisTo: 20).
  			aStream nextPut: $".
  			lastCommand phase == #done
  				ifTrue: [aStream nextPutAll: ' (z)']].!

Item was changed:
  ----- Method: PostscriptCharacterScanner>>displayLine:offset:leftInRun: (in category 'displaying') -----
  displayLine: line offset: baseOffset leftInRun: leftInRun
+ 	| offset aText string doJustified |
- 	| offset aText string doJustified drawFont |
  
  	self setTextStylesForOffset: ((line first) + 1).	" sets up various instance vars from text styles "
- 	drawFont := self font.
  	offset := baseOffset.
+ 	offset := offset + (line left @ (line top + line baseline - self font ascent )). 
- 	offset := offset + (line left @ (line top + line baseline - drawFont ascent )). 
  	offset := offset + ((self textStyle alignment caseOf:{
  		[Centered] -> [ line paddingWidth /2 ].
  		[RightFlush] -> [ line paddingWidth ] } otherwise:[0]) @ 0).
  
  	canvas moveto: offset.
  
  	aText := paragraph text copyFrom: line first to: line last.
  	doJustified := (paragraph textStyle alignment = Justified)
  						and: [ (paragraph text at:line last) ~= Character cr
  						and: [aText runs runs size = 1]].
  	string := aText string.
+ 	aText runs withStartStopAndValueDo: [:start :stop :attributes | | s drawFont |
- 	aText runs withStartStopAndValueDo: [:start :stop :attributes | | s |
  		self setTextStylesForOffset: (start + line first - 1).	" sets up inst vars from text styles "
  		s := string copyFrom: start to: stop.
  		drawFont := self font.
  		canvas setFont: drawFont.
  		canvas 
  			textStyled: s
  			at: offset 		"<--now ignored"
  			font: drawFont 		"<--now ignored"
  			color: foregroundColor
  			justified: doJustified		"<-can't do this now for multi-styles" 
  			parwidth: line right - line left.
  	].
  !

Item was changed:
  ----- Method: Flaps class>>positionVisibleFlapsRightToLeftOnEdge:butPlaceAtLeftFlapsWithIDs: (in category 'shared flaps') -----
  positionVisibleFlapsRightToLeftOnEdge: edgeSymbol butPlaceAtLeftFlapsWithIDs: idList
  	"Lay out flaps along the designated edge right-to-left, while laying left-to-right any flaps found in the exception list
  
  	Flaps positionVisibleFlapsRightToLeftOnEdge: #bottom butPlaceAtLeftFlapWithIDs: {'Navigator' translated. 'Supplies' translated}
  	Flaps sharedFlapsAlongBottom"
  
  	| leftX flapList flapsOnRight flapsOnLeft |
+ 	flapList := self globalFlapTabsIfAny select:
- 	flapList _ self globalFlapTabsIfAny select:
  		[:aFlapTab | aFlapTab isInWorld and: [aFlapTab edgeToAdhereTo == edgeSymbol]].
+ 	flapsOnLeft := flapList select: [:fl | idList includes: fl flapID].
- 	flapsOnLeft _ flapList select: [:fl | idList includes: fl flapID].
  	flapList removeAll: flapsOnLeft.
  
+ 	flapsOnRight := flapList asSortedCollection:
- 	flapsOnRight _ flapList asSortedCollection:
  		[:f1 :f2 | f1 left > f2 left].
+ 	leftX := ActiveWorld width - 15.
- 	leftX _ ActiveWorld width - 15.
  
  	flapsOnRight do:
  		[:aFlapTab |
  			aFlapTab right: leftX - 3.
+ 			leftX := aFlapTab left].
- 			leftX _ aFlapTab left].
  
+ 	leftX := ActiveWorld left.
+ 	flapsOnLeft := flapsOnLeft asSortedCollection:
- 	leftX _ ActiveWorld left.
- 	flapsOnLeft _ flapsOnLeft asSortedCollection:
  		[:f1 :f2 | f1 left > f2 left].
  	flapsOnLeft do:
  		[:aFlapTab |
  			aFlapTab left: leftX + 3.
+ 			leftX := aFlapTab right].
- 			leftX _ aFlapTab right].
  
  	(flapsOnLeft asOrderedCollection, flapsOnRight asOrderedCollection) do:
  		[:ft | ft computeEdgeFraction.
  		ft flapID = 'Navigator' translated ifTrue:
  			[ft referent left: (ft center x - (ft referent width//2) max: 0)]]
  !




More information about the Squeak-dev mailing list