'From etoys2.1 of 26 July 2007 [latest update: #1606] on 9 September 2007 at 4:36:42 am'! "Change Set: constantTileVis-sw Date: 9 September 2007 Author: Scott Wallace Make the numeric-constant tile in the gold box visible again."! !GoldBoxMenu methodsFor: 'initialization' stamp: 'sw 9/9/2007 04:29'! initializeFor: aScriptor "Answer a graphical menu to be put up in conjunction with the Gold Box" | aButton goldBox aReceiver boxBounds | scriptor _ aScriptor. lastItemMousedOver _ nil. self removeAllMorphs. self setProperty: #goldBox toValue: true. self listDirection: #topToBottom; hResizing: #spaceFill; extent: 1@1; vResizing: #spaceFill. "standard #newColumn stuff" self setNameTo: 'Gold Box'. self useRoundedCorners. self color: Color white. self borderColor: (Color r: 1.0 g: 0.839 b: 0.065). self hResizing: #shrinkWrap; vResizing: #shrinkWrap; borderWidth: 4. { {ScriptingSystem. #yesNoComplexOfTiles. 'test' translated. 'Test/Yes/No panes for testing a condition.' translated}. {ScriptingSystem. #timesRepeatComplexOfTiles. 'repeat' translated. 'TimesRepeat panes for running a section of code repeatedly.' translated}. { ScriptingSystem. #randomNumberTile. 'random' translated. 'A tile that will produce a random number in a given range.' translated}. { ScriptingSystem. #seminalFunctionTile. 'function' translated. 'A tile representing a function call. Click on the function name or the arrows to change functions..' translated}. {ScriptingSystem. #buttonUpTile. 'button up?' translated. 'Reports whether the mouse button is up' translated}. {ScriptingSystem. #buttonDownTile. 'button down?' translated. 'Reports whether the mouse button is down' translated}. {scriptor playerScripted. #tileToRefer. 'tile for me' translated. 'A tile representing the object being scripted' translated}. {self. #numericConstantTile. 'number' translated. 'A tile holding a plain number' translated}. } do: [:tuple | aReceiver _ tuple first. aButton _ IconicButton new initializeWithThumbnail: (PartsBin thumbnailForQuad: tuple color: self color) withLabel: '' andColor: self color andSend: tuple second to: aReceiver. aButton actionSelector: #launchPartOffsetVia:label:. aButton arguments: {tuple second. tuple third}. (tuple size > 3 and: [tuple fourth isEmptyOrNil not]) ifTrue: [aButton setBalloonText: tuple fourth]. aButton on: #mouseEnter send: #mousedOverEvent:button: to: self. aButton on: #click send: #clickEvent:button: to: self. self addMorphBack: aButton]. goldBox _ aScriptor submorphs first submorphThat: [:m | (m isKindOf: SimpleButtonMorph) and: [m actionSelector == #offerGoldBoxMenu]] ifNone: [nil]. goldBox ifNil: [self position: ActiveHand position] ifNotNil: [boxBounds _ goldBox boundsInWorld. self center: boxBounds center. self left: (boxBounds center x - (self width // 2)). self top: boxBounds bottom]. lastItemMousedOver _ nil. self on: #mouseLeave send: #mouseLeftMenuWithEvent: to: self. self on: #mouseLeaveDragging send: #delete to: self.! ! !GoldBoxMenu methodsFor: 'initialization' stamp: 'sw 9/9/2007 04:28'! numericConstantTile "Answer a bare numeric-constant tile." | aTile | aTile := (Vocabulary vocabularyNamed: 'Number') defaultArgumentTile. aTile vResizing: #shrinkWrap. ^ aTile! ! !TileMorph methodsFor: '*connectors-dropping/grabbing' stamp: 'sw 9/9/2007 04:35'! justDroppedInto: aMorph event: anEvent "This message is sent to a dropped morph after it has been dropped on -- and been accepted by -- a drop-sensitive morph" super justDroppedInto: aMorph event: anEvent. aMorph isPlayfieldLike ifTrue: [self vResizing: #shrinkWrap] ifFalse: [(aMorph isTileScriptingElement or: [aMorph isKindOf: TilePadMorph]) ifTrue: [self vResizing: #spaceFill]] ! ! "Postscript:" PartsBin uncacheThumbnailFor: 'number'. !