[etoys-dev] Etoys: Etoys-kfr.18.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Jun 6 12:49:20 EDT 2010


Karl Ramberg uploaded a new version of Etoys to project Etoys:
http://source.squeak.org/etoys/Etoys-kfr.18.mcz

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

Name: Etoys-kfr.18
Author: kfr
Time: 6 June 2010, 6:48:55 pm
UUID: d472d925-5bd5-2c46-b222-f2b574a19750
Ancestors: Etoys-kfr.17

Try once again to get to changes right. Do not add info to slotInfo, just change it if it's  there....

=============== Diff against Etoys-kfr.17 ===============

Item was changed:
  ----- Method: Player>>noteDecimalPlaces:forGetter: (in category 'misc') -----
  noteDecimalPlaces: aNumber forGetter: aGetter
  	"Note the given preference of decimal places for the given getter"
+ 	| slotInfo |
+ 	slotInfo := self slotInfoForGetter: aGetter.
+ 	slotInfo ifNotNil:[ slotInfo floatPrecision: (Utilities floatPrecisionForDecimalPlaces: aNumber)].
- 	| |
- 	"slotInfo _ self slotInfoAt: (Utilities inherentSelectorForGetter: aGetter).
- 	slotInfo floatPrecision: (Utilities floatPrecisionForDecimalPlaces: aNumber)."
  	costume noteDecimalPlaces: aNumber forGetter: aGetter!

Item was changed:
  ----- Method: Player>>setPrecisionFor: (in category 'slots-user') -----
  setPrecisionFor: slotName 
  	"Set the precision for the given slot name"
  
  	| aList aMenu reply val aGetter places |
  	aGetter := Utilities getterSelectorFor: slotName.
+ 	places := Utilities 
+ 				decimalPlacesForFloatPrecision: (self defaultFloatPrecisionFor: aGetter).
- 	places := Utilities decimalPlacesForFloatPrecision: (self getPrecisionFor: slotName).
  	aList := #('0' '1' '2' '3' '4' '5' '6' '7' '8' '9' '10').
  	aMenu := SelectionMenu labels: aList
  				selections: (aList collect: [:m | m asNumber]).
  	reply := aMenu 
  				startUpWithCaption: ('How many decimal places? (currently {1})' translated
  						format: {places}).
  	reply ifNotNil: 
  			[(self slotInfo includesKey: slotName) 
  				ifTrue: 
  					["it's a user slot"
  
  					(self slotInfoAt: slotName) 
  						floatPrecision: (Utilities floatPrecisionForDecimalPlaces: reply).
  					self class allInstancesDo: 
  							[:anInst | 
  							reply == 0 
  								ifFalse: 
  									[((val := anInst instVarNamed: slotName asString) isInteger) 
  										ifTrue: [anInst instVarNamed: slotName asString put: val asFloat]].
  							anInst updateAllViewers]]
  				ifFalse: 
  					["it's specifying a preference for precision on a system-defined numeric slot"
  
  					self noteDecimalPlaces: reply forGetter: aGetter.
  					self updateAllViewers]]!



More information about the etoys-dev mailing list