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

commits at source.squeak.org commits at source.squeak.org
Sat Feb 11 05:02:49 EST 2012


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

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

Name: Etoys-kfr.105
Author: kfr
Time: 11 February 2012, 11:03:11 am
UUID: 0ffabf1d-eb56-1742-8dc6-1b823237267f
Ancestors: Etoys-Richo.104

Deficient support for Point-valued variables
http://tracker.squeakland.org/browse/SQ-1012

=============== Diff against Etoys-Richo.104 ===============

Item was changed:
  ----- Method: CategoryViewer>>readoutFor:type:readOnly:getSelector:putSelector: (in category 'entries') -----
  readoutFor: partName type: partType readOnly: readOnly getSelector: getSelector putSelector: putSelector
  	"Answer a readout morph for the given part"
  
  	| readout delta |
  	readout _ (Vocabulary vocabularyForType: partType) updatingTileForTarget: scriptedPlayer partName: partName getter: getSelector setter: putSelector.
  
  	(partType == #Number) ifTrue:
  		[(delta _ scriptedPlayer arrowDeltaFor: getSelector) = 1
  			ifFalse:
  				[readout setProperty: #arrowDelta toValue: delta].
  		scriptedPlayer setFloatPrecisionFor: readout updatingStringMorph].
  
+ 	partType == #Point ifTrue:
+ 		[scriptedPlayer setFloatPrecisionFor: readout updatingStringMorph].
+ 
  	readout step.
  	^ readout!

Item was changed:
  ----- Method: DataType>>updatingTileForTarget:partName:getter:setter: (in category '*Etoys-tiles') -----
  updatingTileForTarget: aTarget partName: partName getter: getter setter: setter
  	"Answer, for classic tiles, an updating readout tile for a part with the receiver's type, with the given getter and setter"
  
  	| aTile displayer actualSetter |
  	actualSetter _ setter ifNotNil:
  		[(#(none #nil unused) includes: setter) ifTrue: [nil] ifFalse: [setter]].
  
  	aTile _ self newReadoutTile.
  
  	displayer _ UpdatingStringMorph new
  		getSelector: getter;
  		target: aTarget;
  		growable: true;
  		minimumWidth: 48;
  		putSelector: actualSetter.
+ 	"Note that where relevant (Number and Point types), the #target: call above will have dealt with floatPrecision details"
- 	"Note that when typeSymbol = #number, the #target: call above will have dealt with floatPrecision details"
  
  	displayer font: Preferences standardEToysFont.
  	self setFormatForDisplayer: displayer.
  	aTile addMorphBack: displayer.
  	displayer setNameTo: 'readout string' translated.
  	(actualSetter notNil and: [self wantsArrowsOnTiles]) ifTrue: [aTile addArrows].	
  	getter numArgs == 0 ifTrue:
  		[aTile setLiteralInitially: (aTarget perform: getter)].
  	^ aTile
  !

Item was changed:
  ----- Method: Morph>>defaultFloatPrecisionFor: (in category '*Etoys-scripting') -----
  defaultFloatPrecisionFor: aGetSelector
  	"Answer a number indicating the default float precision to be used in a numeric readout for which the receiver provides the data.   Individual morphs can override this.  Showing fractional values for readouts of getCursor was in response to an explicit request from ack"
  
  	(self renderedMorph decimalPlacesForGetter: aGetSelector) ifNotNilDo: [:places | ^ (Utilities floatPrecisionForDecimalPlaces: places)].
  
  	(#(getCursor getNumericValue getNumberAtCursor getCursorWrapped getScaleFactor) includes: aGetSelector)
  		ifTrue:
  			[^ 0.01].
+ 
+ 	(#(getXOnGraph getYOnGraph getLocationOnGraph) includes: aGetSelector)
+ 		ifTrue:
+ 			[^ 0.1].
  	^ 1!

Item was changed:
  TileMorph subclass: #NumericReadoutTile
  	instanceVariableNames: ''
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'Etoys-Scripting Tiles'!
+ 
+ !NumericReadoutTile commentStamp: 'sw 2/8/2012 18:22' prior: 0!
+ A readout tile for Number-valued variables.
+ If it bears property #PointValued, it will actually represent a Point-valued variable.!



More information about the etoys-dev mailing list