[Pkg] The Trunk: EToys-pre.277.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Dec 21 12:31:02 UTC 2016


Patrick Rein uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-pre.277.mcz

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

Name: EToys-pre.277
Author: pre
Time: 21 December 2016, 1:30:50.200014 pm
UUID: 110a16f2-0f1b-b04c-97d9-41aa27926c8c
Ancestors: EToys-cmm.276

- Fixes a test for the TileMorph
- Reformats some TileMorph methods

=============== Diff against EToys-cmm.276 ===============

Item was changed:
  SystemOrganization addCategory: #'Etoys-Buttons'!
  SystemOrganization addCategory: #'Etoys-CustomEvents'!
  SystemOrganization addCategory: #'Etoys-Experimental'!
  SystemOrganization addCategory: #'Etoys-Outliner'!
  SystemOrganization addCategory: #'Etoys-Protocols'!
  SystemOrganization addCategory: #'Etoys-Protocols-Type Vocabularies'!
  SystemOrganization addCategory: #'Etoys-Scripting'!
  SystemOrganization addCategory: #'Etoys-Scripting Support'!
  SystemOrganization addCategory: #'Etoys-Scripting Tiles'!
  SystemOrganization addCategory: #'Etoys-Squeakland-BroomMorphs-Base'!
  SystemOrganization addCategory: #'Etoys-Squeakland-BroomMorphs-Connectors'!
  SystemOrganization addCategory: #'Etoys-Squeakland-EToys-Kedama'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-Buttons'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-Calendar'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-Debugger'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-Help'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-Input'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-Scripting'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-Scripting Support'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-Scripting Tiles'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-SpeechBubbles'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-Tile Scriptors'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Graphics-External'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Graphics-Text'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Graphics-Tools-Intersection'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Graphics-Tools-Simplification'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Graphics-Tools-Triangulation'!
  SystemOrganization addCategory: #'Etoys-Squeakland-MorphicExtras-AdditionalMorphs'!
  SystemOrganization addCategory: #'Etoys-Squeakland-MorphicExtras-Charts'!
  SystemOrganization addCategory: #'Etoys-Squeakland-MorphicExtras-Postscript Filters'!
  SystemOrganization addCategory: #'Etoys-Squeakland-MorphicExtras-WebCam'!
  SystemOrganization addCategory: #'Etoys-Squeakland-MorphicExtras-Widgets'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Basic'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Books'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Components'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Demo'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Experimental'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Games'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Games-Chess'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-GeeMail'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Kernel'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Mentoring'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Navigators'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-PartsBin'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-PDA'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Support'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Widgets'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Windows'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Worlds'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Multilingual-Languages'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Multilingual-Scanning'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Multilingual-TextConversion'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Network-HTML-Formatter'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Network-HTML-Forms'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Network-HTML-Parser'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Network-HTML-Parser Entities'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Network-HTML-Tokenizer'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Network-MIME'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Network-TelNet WordNet'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Network-UI'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Network-Url'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Protocols-Type Vocabularies'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Sound-Interface'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Sound-Ogg'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Sound-Scores'!
  SystemOrganization addCategory: #'Etoys-Squeakland-ST80-Morphic'!
  SystemOrganization addCategory: #'Etoys-Squeakland-SUnit'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Sugar'!
- SystemOrganization addCategory: #'Etoys-Squeakland-System-Applications'!
  SystemOrganization addCategory: #'Etoys-Squeakland-System-Clipboard-Extended'!
  SystemOrganization addCategory: #'Etoys-Squeakland-System-Compiler'!
  SystemOrganization addCategory: #'Etoys-Squeakland-System-Exceptions Kernel'!
  SystemOrganization addCategory: #'Etoys-Squeakland-System-Support'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Tools-Changes'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Tools-Explorer'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Tools-File Contents Browser'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Tools-Process Browser'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Tweak-Kedama-ObjectVectors'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Tweak-Kedama-ParseTreeTransformer'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Tweak-Kedama-ParseTree-AttributeDefinition'!
  SystemOrganization addCategory: #'Etoys-Stacks'!
  SystemOrganization addCategory: #'Etoys-StarSqueak'!
  SystemOrganization addCategory: #'Etoys-Support'!
  SystemOrganization addCategory: #'Etoys-Tests'!
  SystemOrganization addCategory: #'Etoys-Tile Scriptors'!
  SystemOrganization addCategory: #'Etoys-Widgets'!
  SystemOrganization addCategory: #'Etoys-Squeakland-Support'!
  SystemOrganization addCategory: #'Etoys-Squeakland-SISS-Serialization'!
  SystemOrganization addCategory: #'Etoys-OLPC-Display'!
  SystemOrganization addCategory: #'Etoys-ReleaseBuilder'!
  SystemOrganization addCategory: #'Etoys-UserInterfaceTheme'!

Item was changed:
  ----- Method: TileMorph>>arrowAction: (in category 'arrows') -----
  arrowAction: delta 
  	"Do what is appropriate when an arrow on the tile is pressed; delta will  
  	be +1 or -1"
  	| index options |
+ 	(type == #literal and: [literal isNumber])
+ 		ifTrue: [self value:
+ 			       (((literal + delta) printShowingDecimalPlaces: self decimalPlaces) asNumber)]
+ 		ifFalse: [options := self options ifNil: [^ self].
+ 			      index := (options first indexOf: self value) + delta.
+ 				self value: (options first atWrap: index).
+ 				(options second atWrap: index) ifNotNilDo:
+ 					[:bt | submorphs last setBalloonText: bt translated]]!
- 	(type == #literal
- 			and: [literal isNumber])
- 		ifTrue: [self value:(((literal + delta) printShowingDecimalPlaces: self decimalPlaces) asNumber)]
- 		ifFalse: [options := self options
- 						ifNil: [^ self].
- 			index := (options first indexOf: self value)
- 						+ delta.
- 			self
- 				value: (options first atWrap: index).
- 			(options second atWrap: index) ifNotNilDo:
- 				[:bt |
- 					submorphs last
- 						setBalloonText: bt translated]]!

Item was changed:
  ----- Method: TileMorph>>arrowDelta (in category 'mouse handling') -----
  arrowDelta
  	"Answer the amount by which a number I display should increase at a time"
  
  	| readout |
  	(readout := self findA: UpdatingStringMorph) ifNotNil: [^readout floatPrecision ].
+ 	^ 1!
- 	^1!

Item was changed:
  ----- Method: TileMorph>>basicWidth (in category 'misc') -----
  basicWidth
  	"Provide a nominal minimum, exclusive of arrows and independent of label width"
  
  	^ operatorOrExpression
+ 		ifNotNil: [3]
+ 		ifNil: [18]!
- 		ifNotNil:
- 			[3]
- 		ifNil:
- 			[18]!

Item was changed:
  ----- Method: TileMorph>>couldAddSuffixArrow (in category '*Etoys-Squeakland-arrows') -----
  couldAddSuffixArrow
  	"Answer whether it is appropriate for the receiver to bear a suffix arrow."
  
  	| phrase pad |
  	type = #operator ifTrue:
  		[((owner isKindOf: PhraseTileMorph) and: [owner submorphs last == self] and: [#("Point" Number) includes: owner resultType])
  			ifTrue: [^ true]].
  	(#(literal function parameter) includes: type) ifFalse: [^ false].
  	(pad := self ownerThatIsA: TilePadMorph) ifNil: [^ false].
  
  	(#("Point" Number) includes: pad type) ifFalse: [^ false].
  
  	phrase := pad owner.
  	(phrase isKindOf: TimesRow) ifTrue: [^ true].  "times-repeat situation"
  	(phrase isKindOf: PhraseTileMorph)
+ 		 ifTrue: [^ phrase submorphs last allMorphs includes: self]
+ 		ifFalse: [^ phrase isKindOf: FunctionTile]!
- 		 ifTrue:
- 			[ ^ phrase submorphs last allMorphs includes: self]
- 		ifFalse:
- 			[^ phrase isKindOf: FunctionTile]!

Item was changed:
  ----- Method: TileMorph>>isPopArrowNeeded (in category '*Etoys-Squeakland-arrows popup') -----
  isPopArrowNeeded
+ 	^ upArrow notNil or: [suffixArrow notNil]!
- 	^ upArrow notNil
- 		or: [suffixArrow notNil]!

Item was changed:
  ----- Method: TileMorph>>isTileMorph (in category 'e-toy support') -----
  isTileMorph
+ 	^ true!
- 	^true!

Item was changed:
  ----- Method: TileMorph>>options (in category 'accessing') -----
  options
  	"Answer the options of the tile for an arrow"
+ 	(type == #literal and: [literal isKindOf: Boolean])
- 	(type == #literal
- 			and: [literal isKindOf: Boolean])
  		ifTrue: [^ {{true. false}. #('true' 'false' ) translatedNoop}].
  	operatorOrExpression
  		ifNil: [^ nil].
  	(ScriptingSystem arithmeticalOperatorsAndHelpStrings first includes: operatorOrExpression)
  		ifTrue: [^ ScriptingSystem arithmeticalOperatorsAndHelpStrings].
  	(ScriptingSystem numericComparitorsAndHelpStrings first includes: operatorOrExpression)
  		ifTrue: [self receiverType = #Number
  				ifTrue: [^ ScriptingSystem numericComparitorsAndHelpStrings]
  				ifFalse: [^ #(#(#= #~=) #('equal' 'not equal')) translatedNoop ]].
  	^ nil!

Item was changed:
  ----- Method: TileMorph>>ownerChanged (in category 'change reporting') -----
  ownerChanged
  	super ownerChanged.
  	(owner class == TilePadMorph and:[owner layoutPolicy isNil]) ifTrue:[
  		owner layoutPolicy: TableLayout new.
  		owner hResizing: #shrinkWrap.
+ 		owner vResizing: #spaceFill	].!
- 		owner vResizing: #spaceFill.
- 	].!

Item was changed:
  ----- Method: TileMorph>>playerBearingCode (in category 'accessing') -----
  playerBearingCode
  	"Answer the actual Player object who will be the 'self' when the receiver is being asked to generate code"
  
  	self topEditor ifNotNil:
  		[:anEditor | ^ anEditor playerScripted].
+ 	(self nearestOwnerThat: [:m | m isAViewer]) ifNotNil:
+ 		[:aViewer | ^ aViewer scriptedPlayer].
- 	(self nearestOwnerThat: [:m | m isAViewer]) 
- 		ifNotNil:
- 			[:aViewer | ^ aViewer scriptedPlayer].
  	^ actualObject!

Item was changed:
  ----- Method: TileMorph>>setVisibilityOfUpDownCarets: (in category '*Etoys-Squeakland-arrows') -----
  setVisibilityOfUpDownCarets: showCarets
  	"If the argument is true, make all the 'up and down' carets, such as those that let you change the value of a number or of a boolean constant, visible; if false, remove them from sight. "
  
  	(submorphs detect: [:m | m hasProperty: #arrows] ifNone: [nil]) ifNotNilDo:
  		[:wrapper |
  			showCarets
+ 				ifTrue:  [wrapper width: 9]
+ 				ifFalse: [wrapper width: 0]]!
- 				ifTrue:
- 					[wrapper width: 9]
- 				ifFalse:
- 					[wrapper width: 0]]!

Item was changed:
  ----- Method: TileMorph>>veryDeepFixupWith: (in category 'copying') -----
  veryDeepFixupWith: deepCopier
  	"If target and arguments fields were weakly copied, fix them here.  If they were in the tree being copied, fix them up, otherwise point to the originals!!!!"
  
+ 	super veryDeepFixupWith: deepCopier.
+ 	actualObject := deepCopier references at: actualObject ifAbsent: [actualObject].!
- super veryDeepFixupWith: deepCopier.
- actualObject := deepCopier references at: actualObject ifAbsent: [actualObject].!

Item was changed:
  ----- Method: TileMorph>>veryDeepInner: (in category 'copying') -----
  veryDeepInner: deepCopier
  	"Copy all of my instance variables.  Some need to be not copied at all, but shared.  	Warning!!!!  Every instance variable defined in this class must be handled.  We must also implement veryDeepFixupWith:.  See DeepCopier class comment."
  
+ 	super veryDeepInner: deepCopier.
+ 	type := type veryDeepCopyWith: deepCopier.
+ 	slotName := slotName veryDeepCopyWith: deepCopier.
+ 	literal := literal veryDeepCopyWith: deepCopier.
+ 	operatorOrExpression := operatorOrExpression veryDeepCopyWith: deepCopier.
+ 	"actualObject := actualObject.		Weakly copied"
+ 	downArrow := downArrow veryDeepCopyWith: deepCopier.
+ 	upArrow := upArrow veryDeepCopyWith: deepCopier.
+ 	suffixArrow := suffixArrow veryDeepCopyWith: deepCopier.
+ 	typeColor := typeColor veryDeepCopyWith: deepCopier.
+ 	lastArrowTick := lastArrowTick veryDeepCopyWith: deepCopier.
+ 	nArrowTicks := nArrowTicks veryDeepCopyWith: deepCopier.
+ 	operatorReadoutString := operatorReadoutString veryDeepCopyWith: deepCopier.
+ 	possessive := possessive veryDeepCopyWith: deepCopier.
+ 	retractArrow := retractArrow veryDeepCopyWith: deepCopier.
+ 	vocabularySymbol := vocabularySymbol.  "Weakly copied"
+ 	vocabulary := nil.   "obsolete - clobbered"!
- super veryDeepInner: deepCopier.
- type := type veryDeepCopyWith: deepCopier.
- slotName := slotName veryDeepCopyWith: deepCopier.
- literal := literal veryDeepCopyWith: deepCopier.
- operatorOrExpression := operatorOrExpression veryDeepCopyWith: deepCopier.
- "actualObject := actualObject.		Weakly copied"
- downArrow := downArrow veryDeepCopyWith: deepCopier.
- upArrow := upArrow veryDeepCopyWith: deepCopier.
- suffixArrow := suffixArrow veryDeepCopyWith: deepCopier.
- typeColor := typeColor veryDeepCopyWith: deepCopier.
- lastArrowTick := lastArrowTick veryDeepCopyWith: deepCopier.
- nArrowTicks := nArrowTicks veryDeepCopyWith: deepCopier.
- operatorReadoutString := operatorReadoutString veryDeepCopyWith: deepCopier.
- possessive := possessive veryDeepCopyWith: deepCopier.
- retractArrow := retractArrow veryDeepCopyWith: deepCopier.
- vocabularySymbol := vocabularySymbol.  "Weakly copied"
- vocabulary := nil.   "obsolete - clobbered"!

Item was changed:
  ----- Method: TileMorphTest>>testArrowAction (in category 'testing') -----
  testArrowAction
  	"self debug: #testArrowAction"
  	| dummy tile |
  	dummy := Morph new.
  	tile := TileMorph new setOperator: '+'.
  	dummy addMorph: tile.
  	tile arrowAction: 1.
  	self assert: tile codeString = '-'.
  
  	tile := TileMorph new setOperator: '<'.
  	dummy addMorph: tile.
  	tile arrowAction: 1.
  	"Because receiver is not tile"
+ 	self assert: tile codeString = 'eToysEQ:'.
- 	self assert: tile codeString = '='.
  
  	tile := true newTileMorphRepresentative.
  	dummy addMorph: tile.
  	tile arrowAction: 1.
  	self assert: tile codeString = '(false)'.
  !



More information about the Packages mailing list