[etoys-dev] Etoys: Etoys-kfr.118.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Mar 8 06:38:37 EST 2012
Karl Ramberg uploaded a new version of Etoys to project Etoys:
http://source.squeak.org/etoys/Etoys-kfr.118.mcz
==================== Summary ====================
Name: Etoys-kfr.118
Author: kfr
Time: 8 March 2012, 12:37:35 pm
UUID: ee4f63db-b49b-d54b-887e-fdd96867d9b2
Ancestors: Etoys-bf.117
Just 'grey out' decimal places in the variable panel, don't remove it. Swap places of remove variable and modify variable in menu
=============== Diff against Etoys-bf.117 ===============
Item was changed:
----- Method: NewVariableDialogMorph>>addDecimalPlaces (in category 'build') -----
addDecimalPlaces
self addARow: {
self inAColumn: {
(self addARow: {
self lockedString: 'Decimal places:' translated.
self spacer.
decimalPlacesButton := self buildDecimalPlacesButton
+ } ) cellPositioning: #center.
+ } named: #decimalPlaces.
- }) cellPositioning: #center.
- }
}.
self addSeparator!
Item was changed:
----- Method: NewVariableDialogMorph>>rebuild (in category 'build') -----
rebuild
+ | buttonColor itsName aBoolean |
- | buttonColor |
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 addARow: {
self lockedString: 'Type:' translated.
self spacer.
varTypeButton := self buildVarTypeButton
}) cellPositioning: #center.
}
}.
ActiveWorld activeHand newKeyboardFocus: varNameText.
self addSeparator.
+ self addDecimalPlaces.
+ aBoolean := false.
-
(#(#Number #Point) includes: self varType)
+ ifTrue: [ aBoolean := true].
+ self allMorphsDo: [ :each |
+ itsName := each knownName.
+ (#(decimalPlaces) includes: itsName) ifTrue:
+ [self enable: each when: aBoolean]].
+
+
- ifTrue: [self addDecimalPlaces].
-
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
}
}
!
Item was changed:
----- Method: Player>>slotInfoButtonHitFor:inViewer: (in category 'scripts-kernel') -----
slotInfoButtonHitFor: aGetterSymbol inViewer: aViewer
"The user made a gesture asking for slot menu for the given getter symbol in a viewer; put up the menu."
+ | aMenu slotSym aType typeVocab |
- | aMenu slotSym aType typeVocab interface selector |
(#(+ - * /) includes: aGetterSymbol)
ifTrue:
[^ self inform: ('{1} is used for vector operations' translated format: {aGetterSymbol})].
slotSym _ Utilities inherentSelectorForGetter: aGetterSymbol.
aType _ self typeForSlotWithGetter: aGetterSymbol asSymbol.
aMenu _ MenuMorph new defaultTarget: self.
+ "interface := aViewer currentVocabulary methodInterfaceAt: aGetterSymbol ifAbsent: [nil].
- interface := aViewer currentVocabulary methodInterfaceAt: aGetterSymbol ifAbsent: [nil].
selector := interface isNil
ifTrue: [slotSym asString]
+ ifFalse: [interface selector]."
- ifFalse: [interface selector].
aType = #Patch ifTrue: [
aMenu add: 'grab morph' translated
target: (self perform: aGetterSymbol)
selector: #grabPatchMorph
argument: #().
aMenu addLine.
].
(typeVocab _ Vocabulary vocabularyForType: aType) addWatcherItemsToMenu: aMenu forGetter: aGetterSymbol.
(self slotInfo includesKey: slotSym)
ifTrue:
[typeVocab addUserSlotItemsTo: aMenu slotSymbol: slotSym.
+ aMenu add: ('modify "{1}"' translated format: {slotSym}) selector: #changeSlotInfo: argument: slotSym.
aMenu add: ('remove "{1}"' translated format: {slotSym}) selector: #removeSlotNamed: argument: slotSym.
+
- aMenu add: ('modify "{1}"' translated format: {slotSym}) selector: #changeSlotInfo: argument: slotSym
]
ifFalse: [
aMenu addLine.
typeVocab addExtraItemsToMenu: aMenu forSlotSymbol: slotSym. "e.g. Player type adds hand-me-tiles"].
self addIdiosyncraticMenuItemsTo: aMenu forSlotSymol: slotSym.
aMenu items isEmpty ifTrue:
[aMenu add: 'ok' translated action: #yourself].
aMenu popUpForHand: aViewer primaryHand in: aViewer world!
More information about the etoys-dev
mailing list