'From etoys2.1 of 26 July 2007 [latest update: #1607] on 10 September 2007 at 1:15:31 am'! "Change Set: penTrailGraphic-sw Date: 10 September 2007 Author: Scott Wallace Makes the graphic of a playfield's pen trails accessible for scripting through the viewer, as a slot of PasteUpMorph. From the penTrailGraphic entry in the viewer, one can also directly obtain a new SketchMorph whose picture is the playfield's current pen trails."! !PasteUpMorph methodsFor: 'pen' stamp: 'sw 9/9/2007 02:58'! hasPenTrails "Answer whether the receiver has any pen trails." ^ turtleTrailsForm notNil! ! !PasteUpMorph methodsFor: 'pen' stamp: 'sw 9/9/2007 03:02'! turtleTrailsForm "Answer the receiver's turtleTrailsForm; often nil." ^ turtleTrailsForm! ! !PasteUpMorph class methodsFor: '*green' stamp: 'sw 9/9/2007 03:06'! additionsToViewerCategoryPenTrails "Answer viewer additions for pen trails category" ^ #(#'pen trails' ( (command liftAllPens 'Lift the pens on all the objects in my interior.') (command lowerAllPens 'Lower the pens on all the objects in my interior.') (command trailStyleForAllPens: 'Set the trail style for pens of all objects within' TrailStyle) (command clearTurtleTrails 'Clear all the pen trails in the interior.') (slot hasPenTrails 'Whether there are any pen trails on the playfield' Boolean readOnly Player getHasPenTrails unused unused) (slot penTrailGraphic 'The graphic comprising the current pen trails.' Graphic readOnly Player getPenTrailGraphic Player unused unused)))! ! !Player methodsFor: 'pen' stamp: 'sw 9/9/2007 03:07'! getHasPenTrails "Answer whether the receiver has any pen trails." ^ self costume renderedMorph hasPenTrails! ! !Player methodsFor: 'pen' stamp: 'sw 9/10/2007 00:58'! getPenTrailGraphic "Answer a Form containing a snapshot of my pen trails." ^ (costume renderedMorph turtleTrailsForm ifNil: [ScriptingSystem formAtKey: #NoTrails]) trimBordersOfColor: Color transparent ! ! !Player methodsFor: 'scripts-kernel' stamp: 'sw 9/10/2007 00:29'! addIdiosyncraticMenuItemsTo: aMenu forSlotSymol: slotSym "The menu provided has the receiver as its argument, and is used as the menu for the given slot-symbol in a line of a Viewer. Add special-case items" (#(copy getNewClone newClone) includes: slotSym) ifTrue: [aMenu add: 'give me a copy now' translated action: #handTheUserACopy]. (slotSym == #penTrailGraphic) ifTrue: [aMenu add: 'hand me a picture of pen trail' translated action: #handUserPictureOfPenTrail]. " (slotSym == #dropShadow) ifTrue: [aMenu add: 'set shadow offset' translated action: #setShadowOffset]. (slotSym == #useGradientFill) ifTrue: [aMenu add: 'set gradient origin...' translated action: #setGradientOffset. aMenu add: 'set gradient direction...' translated action: #setGradientDirection]." ! ! !Player methodsFor: 'slot getters/setters' stamp: 'sw 9/10/2007 00:38'! handUserPictureOfPenTrail "Called from the user-interface: hand the user a picture of the pen trail" self getHasPenTrails ifFalse: [^ self inform: 'no pen trails present' translated] ifTrue: [ActiveHand attachMorph: (SketchMorph new form: self getPenTrailGraphic)]! ! Player removeSelector: #hasPenTrails! "Postscript:" ScriptingSystem saveForm: (Form extent: 31@30 depth: 16 fromArray: #( 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677222904 1677197312) offset: 0@0) atKey: #NoTrails. !