'From etoys4.0 of 5 November 2008 [latest update: #2237] on 6 August 2009 at 6:45:53 pm'! "Change Set: revealAndGrab-sw Date: 4 August 2009 Author: Scott Wallace 6 August 2009: make the wording of the hand-me-a-tile item in the halo-actions submenu consistent with the below, as recommended by Antonio. The two other balloon-help situations mentioned by Antonio remain somewhat inconsistent with other balloon-help wordings for hand-me-a-tile, but are retained in their current form to maintain consistency with balloon-help wordings for adjacent items in the same tool. Harmonizes menus that have 'reveal object', 'grab object', and 'tile for object' items, so that they all offer all three items, with the same wording and compatible balloon-help. This finally catches up with a very reasonable recommendation from Kathleen Harness long ago."! !Morph methodsFor: 'menus' stamp: 'sw 8/6/2009 18:35'! addHaloActionsTo: aMenu "Add items to aMenu representing actions requestable via halo" | subMenu | subMenu _ MenuMorph new defaultTarget: self. subMenu addTitle: self externalName. subMenu addStayUpItemSpecial. subMenu addLine. subMenu add: 'delete' translated action: #dismissViaHalo. subMenu balloonTextForLastItem: 'Delete this object -- warning -- can be destructive!!' translated. self maybeAddCollapseItemTo: subMenu. subMenu add: 'grab' translated action: #openInHand. subMenu balloonTextForLastItem: 'Pick this object up -- warning, since this removes it from its container, it can have adverse effects.' translated. subMenu addLine. subMenu add: 'resize' translated action: #resizeFromMenu. subMenu balloonTextForLastItem: 'Change the size of this object' translated. subMenu add: 'duplicate' translated action: #maybeDuplicateMorph. subMenu balloonTextForLastItem: 'Hand me a copy of this object' translated. "Note that this allows access to the non-instancing duplicate even when this is a uniclass instance" self couldMakeSibling ifTrue: [subMenu add: 'make a sibling' translated action: #handUserASibling. subMenu balloonTextForLastItem: 'Make a new sibling of this object and hand it to me' translated]. subMenu addLine. subMenu add: 'property sheet' translated target: self renderedMorph action: #openAPropertySheet. subMenu balloonTextForLastItem: 'Open a property sheet for me. Allows changing lots of stuff at once.' translated. subMenu add: 'set color' translated target: self renderedMorph action: #changeColor. subMenu balloonTextForLastItem: 'Change the color of this object' translated. subMenu add: 'viewer' translated target: self action: #beViewed. subMenu balloonTextForLastItem: 'Open a Viewer that will allow everything about this object to be seen and controlled.' translated. subMenu add: 'tile browser' translated target: self action: #openInstanceBrowserWithTiles. subMenu balloonTextForLastItem: 'Open a tool that will facilitate tile scripting of this object.' translated. subMenu add: 'tile representing this object' translated target: self action: #tearOffTile. subMenu balloonTextForLastItem: 'Hand me a tile represting this object' translated. subMenu addLine. subMenu add: 'inspect' translated target: self action: #inspect. subMenu balloonTextForLastItem: 'Open an Inspector on this object' translated. aMenu add: 'halo actions...' translated subMenu: subMenu ! ! !Player methodsFor: 'misc' stamp: 'sw 8/4/2009 17:44'! offerViewerMenuFor: aViewer event: evt "Put up the Viewer menu on behalf of the receiver. If the shift key is held down, put up the alternate menu. The menu omits the 'add a new variable' item when in eToyFriendly mode, as per request from teachers using Squeakland in 2003 once the button for adding a new variable was added to the viewer" | aMenu aWorld | (evt notNil and: [evt shiftPressed and: [Preferences eToyFriendly not]]) ifTrue: [^ self offerAlternateViewerMenuFor: aViewer event: evt]. aWorld _ aViewer world. aMenu _ MenuMorph new defaultTarget: self. aMenu title: self externalName. aMenu addStayUpItem. self costume renderedMorph offerCostumeViewerMenu: aMenu. Preferences eToyFriendly ifFalse: "exclude this from squeakland-like UI " [aMenu add: 'add a new variable' translated target: self action: #addInstanceVariable. aMenu balloonTextForLastItem: 'Add a new variable to this object and all of its siblings. You will be asked to supply a name for it.' translated]. aMenu add: 'add a new script' translated target: aViewer action: #newPermanentScript. aMenu balloonTextForLastItem: 'Add a new script that will work for this object and all of its siblings' translated. aMenu addLine. aMenu add: 'grab this object' translated target: self selector: #grabPlayerIn: argument: aWorld. aMenu balloonTextForLastItem: 'This will actually pick up the object this Viewer is looking at, and hand it to you. Click the (left) button to drop it' translated. aMenu add: 'reveal this object' translated target: self selector: #revealPlayerIn: argument: aWorld. aMenu balloonTextForLastItem: 'If you have misplaced the object that this Viewer is looking at, use this item to (try to) make it visible' translated. aMenu add: 'tile representing this object' translated action: #tearOffTileForSelf. aMenu balloonTextForLastItem: 'choose this to obtain a tile which represents the object associated with this script' translated. aMenu addLine. aMenu add: 'add search pane' translated target: aViewer action: #addSearchPane. Preferences eToyFriendly ifFalse: [ aMenu addLine. aMenu add: 'more...' translated target: self selector: #offerAlternateViewerMenuFor:event: argumentList: {aViewer. evt}]. aMenu popUpEvent: evt in: aWorld ! ! !ScriptEditorMorph methodsFor: 'other' stamp: 'sw 8/4/2009 17:45'! offerScriptorMenu "Put up a menu in response to the user's clicking in the menu-request area of the scriptor's heaer" | aMenu count | self modernize. ActiveHand showTemporaryCursor: nil. Preferences eToyFriendly ifTrue: [^ self offerSimplerScriptorMenu]. aMenu _ MenuMorph new defaultTarget: self. aMenu addTitle: scriptName asString. aMenu addStayUpItem. "NB: the kids version in #offerSimplerScriptorMenu does not deploy the stay-up item" aMenu addList: (self hasParameter ifTrue: [{ {'remove parameter' translated. #ceaseHavingAParameter}}] ifFalse: [{ {'add parameter' translated. #addParameter}}]). self hasParameter ifFalse: [aMenu addTranslatedList: { {'button to fire this script' translatedNoop. #tearOfButtonToFireScript}. {'fires per tick...' translatedNoop. #chooseFrequency}. #- }]. aMenu addUpdating: #showingCaretsString target: self action: #toggleShowingCarets. aMenu addLine. aMenu addList: { {'edit balloon help for this script' translated. #editMethodDescription}. {'explain status alternatives' translated. #explainStatusAlternatives}. #- }. Preferences universalTiles ifFalse: [count _ self savedTileVersionsCount. self showingMethodPane ifFalse: "currently showing tiles" [aMenu add: 'show code textually' translated action: #toggleWhetherShowingTiles. count > 0 ifTrue: [aMenu add: 'revert to tile version...' translated action: #revertScriptVersion]. aMenu add: 'save this version' translated action: #saveScriptVersion] ifTrue: "current showing textual source" [count >= 1 ifTrue: [aMenu add: 'revert to tile version' translated action: #toggleWhetherShowingTiles]]]. "aMenu addLine. self addGoldBoxItemsTo: aMenu." aMenu addLine. aMenu add: 'grab this object' translated target: playerScripted selector: #grabPlayerIn: argument: ActiveWorld. aMenu balloonTextForLastItem: 'This will actually pick up the object bearing this script and hand it to you. Click the (left) button to drop it' translated. aMenu add: 'reveal this object' translated target: playerScripted selector: #revealPlayerIn: argument: ActiveWorld. aMenu balloonTextForLastItem: 'If you have misplaced the object bearing this script, use this item to (try to) make it visible' translated. aMenu add: 'tile representing this object' translated target: playerScripted action: #tearOffTileForSelf. aMenu balloonTextForLastItem: 'choose this to obtain a tile which represents the object associated with this script' translated. aMenu addTranslatedList: { #-. {'open viewer' translatedNoop. #openObjectsViewer. 'open the viewer of the object to which this script belongs' translatedNoop}. {'detached method pane' translatedNoop. #makeIsolatedCodePane. 'open a little window that shows the Smalltalk code underlying this script.' translatedNoop}. #-. {'destroy this script' translatedNoop. #destroyScript} }. aMenu popUpInWorld: self currentWorld. ! ! !ScriptEditorMorph methodsFor: 'other' stamp: 'sw 8/4/2009 17:45'! offerSimplerScriptorMenu "Put up a menu in response to the user's clicking in the menu-request area of the scriptor's heaer. This variant is used when eToyFriendly preference is true." | aMenu count | ActiveHand showTemporaryCursor: nil. aMenu _ MenuMorph new defaultTarget: self. aMenu addTitle: scriptName asString. aMenu addList: (self hasParameter ifTrue: [{ {'remove parameter' translated. #ceaseHavingAParameter}}] ifFalse: [{ {'add parameter' translated. #addParameter}}]). self hasParameter ifFalse: [aMenu addTranslatedList: #( ('button to fire this script' tearOfButtonToFireScript) -) translatedNoop]. aMenu addUpdating: #showingCaretsString target: self action: #toggleShowingCarets. aMenu addLine. aMenu addList: { {'edit balloon help for this script' translated. #editMethodDescription}. {'explain status alternatives' translated. #explainStatusAlternatives}. #- }. Preferences universalTiles ifFalse: [count _ self savedTileVersionsCount. self showingMethodPane ifFalse: "currently showing tiles" [aMenu add: 'show code textually' translated action: #toggleWhetherShowingTiles. count > 0 ifTrue: [aMenu add: 'revert to tile version...' translated action: #revertScriptVersion]. aMenu add: 'save this version' translated action: #saveScriptVersion] ifTrue: "current showing textual source" [count >= 1 ifTrue: [aMenu add: 'revert to tile version' translated action: #toggleWhetherShowingTiles]]]. aMenu addLine. aMenu add: 'grab this object' translated target: playerScripted selector: #grabPlayerIn: argument: ActiveWorld. aMenu balloonTextForLastItem: 'This will actually pick up the object bearing this script and hand it to you. Click the (left) button to drop it' translated. aMenu add: 'reveal this object' translated target: playerScripted selector: #revealPlayerIn: argument: ActiveWorld. aMenu balloonTextForLastItem: 'If you have misplaced the object bearing this script, use this item to (try to) make it visible' translated. aMenu add: 'tile representing this object' translated target: playerScripted action: #tearOffTileForSelf. aMenu balloonTextForLastItem: 'choose this to obtain a tile which represents the object associated with this script' translated. aMenu addLine. aMenu addTranslatedList: #( - ('open viewer' openObjectsViewer 'open the viewer of the object to which this script belongs') - ('destroy this script' destroyScript)) translatedNoop. aMenu popUpInWorld: self currentWorld. ! ! !ScriptInstantiation methodsFor: 'misc' stamp: 'sw 8/4/2009 17:48'! offerMenuIn: aStatusViewer "Put up a menu." | aMenu | ActiveHand showTemporaryCursor: nil. aMenu _ MenuMorph new defaultTarget: self. aMenu title: player knownName, ' ', selector. aMenu addStayUpItem. (player class instanceCount > 1) ifTrue: [aMenu add: 'propagate status to siblings' translated selector: #assignStatusToAllSiblingsIn: argument: aStatusViewer. aMenu balloonTextForLastItem: 'Make the status of this script in all of my sibling instances be the same as the status you see here' translated]. aMenu addLine. aMenu add: 'grab this object' translated target: player selector: #grabPlayerIn: argument: ActiveWorld. aMenu balloonTextForLastItem: 'This will actually pick up the object bearing this script and hand it to you. Click the (left) button to drop it' translated. aMenu add: 'reveal this object' translated target: player selector: #revealPlayerIn: argument: ActiveWorld. aMenu balloonTextForLastItem: 'If you have misplaced the object bearing this script, use this item to (try to) make it visible' translated. aMenu add: 'tile representing this object' translated target: player selector: #tearOffTileForSelf. aMenu balloonTextForLastItem: 'choose this to obtain a tile which represents the object associated with this script' translated. aMenu addLine. aMenu add: 'open this script''s Scriptor' translated target: player selector: #grabScriptorForSelector:in: argumentList: {selector. aStatusViewer world}. aMenu balloonTextForLastItem: 'Open up the Scriptor for this script' translated. aMenu add: 'open this object''s Viewer' translated target: player selector: #beViewed. aMenu balloonTextForLastItem: 'Open up a Viewer for this object' translated. aMenu addLine. aMenu add: 'more...' translated target: self selector: #offerShiftedMenuIn: argument: aStatusViewer. aMenu balloonTextForLastItem: 'The "more..." branch offers you menu items that are less frequently used.' translated. aMenu popUpInWorld: ActiveWorld! !