Tim Felgentreff uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-tfel.248.mcz ==================== Summary ==================== Name: EToys-tfel.248 Author: tfel Time: 23 September 2016, 3:08:59.783418 pm UUID: 4e5fd879-c6b4-624b-9380-e84b180eaeb2 Ancestors: EToys-tfel.247 - also don't allow grabbing a tile morph out of the viewer line - add a convenient way to add a name watcher to a player's morph through the viewer menu =============== Diff against EToys-tfel.247 =============== Item was changed: ----- Method: Player>>offerViewerMenuFor:event: (in category 'misc') ----- 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 a search pane' translated target: aViewer action: #addSearchPane. + aMenu add: 'Toggle showing name' translated target: self action: #toggleShowName. Preferences eToyFriendly ifFalse: [ aMenu addLine. aMenu add: 'more...' translated target: self selector: #offerAlternateViewerMenuFor:event: argumentList: {aViewer. evt}]. aMenu popUpEvent: evt in: aWorld ! Item was added: + ----- Method: Player>>toggleShowName (in category 'as yet unclassified') ----- + toggleShowName + | watcher | + self costume ifNil: [^ self]. + watcher := self costume valueOfProperty: #nameWatcher ifAbsent: [nil]. + watcher + ifNil: [ + watcher := FollowingWatcher new unlabeledForPlayer: self getter: #externalName. + watcher openInWorld.] + ifNotNil: [ + watcher delete. + watcher := nil]. + self costume setProperty: #nameWatcher toValue: watcher.! Item was changed: ----- Method: TileMorph>>aboutToBeGrabbedBy: (in category 'dropping/grabbing') ----- aboutToBeGrabbedBy: aHand "do not allow grabbing me out of a tile or out of a tile pad morph (which itself is in a tile)" + ^ (self owner isTileLike or: + [self owner owner notNil and: [self owner owner isTileLike]] or: + [self owner isAlignmentMorph]) - ^ (self owner isTileLike or: [self owner owner notNil and: [self owner owner isTileLike]]) ifTrue: [nil] ifFalse: [self] ! |
Free forum by Nabble | Edit this page |