Karl Ramberg uploaded a new version of Etoys to project Etoys:
http://source.squeak.org/etoys/Etoys-kfr.148.mcz ==================== Summary ==================== Name: Etoys-kfr.148 Author: kfr Time: 5 December 2012, 11:46:20 pm UUID: fd79bb30-d4b2-7f44-a296-b13f11ce7f5f Ancestors: Etoys-kfr.147 Unable change of variable type of variables in use in scripts =============== Diff against Etoys-kfr.147 =============== Item was added: + ----- Method: ModifyVariableDialogMorph>>rebuild (in category 'accessing') ----- + rebuild + | enableVarType itsName | + super rebuild. + enableVarType :=(self targetPlayer okayToRemoveSlotNamed: slot). + + self allMorphsDo: [ :each | + itsName := each knownName. + (#(varType) includes: itsName) ifTrue: + [self enable: each when: enableVarType]]. + ! Item was changed: ----- Method: NewVariableDialogMorph>>rebuild (in category 'build') ----- rebuild + | buttonColor itsName enableDecimalPlaces | - | buttonColor itsName aBoolean | self removeAllMorphs. self addAColumn: { self lockedString: self title. }. self addSeparator. self addARow: { self inAColumn: { (self addARow: { self lockedString: 'Name:' translated. self spacer. varNameText := self newTextMorph contentsWrapped: self varName; selectAll; crAction: (MessageSend receiver: self selector: #doAccept); yourself }) cellPositioning: #center. + self inAColumn: { + (self addARow: { + self lockedString: 'Type:' translated. + self spacer. + varTypeButton := self buildVarTypeButton + }) cellPositioning: #center. + } named: #varType. - (self addARow: { - self lockedString: 'Type:' translated. - self spacer. - varTypeButton := self buildVarTypeButton - }) cellPositioning: #center. } }. ActiveWorld activeHand newKeyboardFocus: varNameText. self addSeparator. self addDecimalPlaces. + enableDecimalPlaces := false. - aBoolean := false. (#(#Number #Point) includes: self varType) + ifTrue: [ enableDecimalPlaces := true]. - ifTrue: [ aBoolean := true]. self allMorphsDo: [ :each | itsName := each knownName. (#(decimalPlaces) includes: itsName) ifTrue: + [self enable: each when: enableDecimalPlaces]]. - [self enable: each when: aBoolean]]. + + buttonColor := self color lighter. self addARow: { self inAColumn: { (self addARow: { self buttonNamed: 'Accept' translated action: #doAccept color: buttonColor help: 'keep changes made and close panel' translated. self buttonNamed: 'Cancel' translated action: #doCancel color: buttonColor help: 'cancel changes made and close panel' translated. }) listCentering: #center } } ! _______________________________________________ etoys-dev mailing list [hidden email] http://lists.squeakland.org/mailman/listinfo/etoys-dev |
Free forum by Nabble | Edit this page |