'From etoys3.0 of 24 February 2008 [latest update: #1929] on 25 March 2008 at 5:46:17 pm'! "Change Set: viewerMenuHelp-sw Date: 26 March 2008 Author: Scott Wallace TRAC 5784: The help balloon for the white menu in the top of the Viewer says: 'click here to get a menu that will allow you to add a variable, tear off a tile, etc.' but . . . you can't add a variable in that menu. (Kathleen) Fixed by changing the wording of the help message."! !StandardViewer methodsFor: 'initialization' stamp: 'sw 3/20/2008 17:44'! addHeaderMorphWithBarHeight: anInteger includeDismissButton: aBoolean "Add the header morph to the receiver, using anInteger as a guide for its height, and if aBoolean is true, include a dismiss buton for it" | header aButton aTextMorph nail wrpr costs headWrapper | header _ AlignmentMorph newRow color: Color transparent; wrapCentering: #center; cellPositioning: #leftCenter. aBoolean ifTrue: [aButton _ self tanOButton. header addMorph: aButton. aButton actionSelector: #dismiss; setBalloonText: 'remove this entire Viewer from the screen don''t worry -- nothing will be lost!!.' translated. header addTransparentSpacerOfSize: 3]. costs _ scriptedPlayer costumes. costs ifNotNil: [(costs size > 1 or: [costs size = 1 and: [costs first ~~ scriptedPlayer costume]]) ifTrue: [header addUpDownArrowsFor: self. "addArrowsOn: adds the box with two arrow at the front." (wrpr _ header submorphs first) submorphs second setBalloonText: 'switch to previous costume' translated. wrpr submorphs first setBalloonText: 'switch to next costume' translated]. header addTransparentSpacerOfSize: 3]. self viewsMorph ifTrue: [scriptedPlayer costume assureExternalName]. aTextMorph _ UpdatingStringMorph new useStringFormat; target: scriptedPlayer; getSelector: #nameForViewer; setNameTo: 'name'; font: ScriptingSystem fontForNameEditingInScriptor. self viewsMorph ifTrue: [aTextMorph putSelector: #setName:. aTextMorph setProperty: #okToTextEdit toValue: true]. aTextMorph step. header addMorphBack: aTextMorph. aTextMorph setBalloonText: 'Click here to edit the player''s name.' translated. header addMorphBack: ((self transparentSpacerOfSize: 0) hResizing: #spaceFill; color: Color red). aButton := ThreePhaseButtonMorph labelSymbol: #AddInstanceVariable target: scriptedPlayer actionSelector: #addInstanceVariable arguments: #(). aButton setBalloonText: 'click here to add a variable to this object.' translated. header addMorphBack: aButton. header addTransparentSpacerOfSize: 3. nail _ (self hasProperty: #noInteriorThumbnail) ifFalse: [ThumbnailMorph new objectToView: scriptedPlayer viewSelector: #costume] ifTrue: [ImageMorph new image: (ScriptingSystem formAtKey: #MenuIcon)]. nail on: #mouseDown send: #offerViewerMenuForEvt:morph: to: scriptedPlayer. header addMorphBack: nail. nail setBalloonText: 'click here to get a menu that will allow you to locate this object, tear off a tile, etc..' translated. (self hasProperty: #noInteriorThumbnail) ifFalse: [nail borderWidth: 3; borderColor: #raised]. header addTransparentSpacerOfSize: 3. aButton _ ThreePhaseButtonMorph labelSymbol: #AddCategoryViewer. aButton actWhen: #buttonUp; target: self; actionSelector: #addCategoryViewer; setBalloonText: 'click here to add another category pane' translated. header addMorphBack: aButton. header beSticky. anInteger > 0 ifTrue: [headWrapper _ AlignmentMorph newColumn color: self color. headWrapper addTransparentSpacerOfSize: (0 @ anInteger). headWrapper addMorphBack: header. self addMorph: headWrapper] ifFalse: [self addMorph: header]! !