'From etoys2.1 of 26 July 2007 [latest update: #1607] on 10 September 2007 at 1:58:50 am'! "Change Set: objCatAdjustments-sw Date: 10 September 2007 Author: Scott Wallace Some recategorizing and renamings of objects-catalog and supplies-bin entries as per consultations with Kathleen Harness. 'Watch' renamed 'Clock'; former 'Clock' renamed 'Digital Clock'. The 'Press Me' Button is removed from the Supplies bin and from the Basic category of the objects catalog. For the moment, Triangle is retained as a separate entity, though we are not unanimously in favor of this so this could change. A PolygonMorph configured as a curve is now used for the Curve item (i.e. CurveMorph is basically now disenfranchised.) Compromised icons in the objects catalog are restored."! !ClockMorph class methodsFor: 'parts bin' stamp: 'sw 9/10/2007 01:24'! descriptionForPartsBin "Answer a description for use in parts bins." ^ self partName: 'Digital Clock' translatedNoop categories: {'Just for Fun' translatedNoop} documentation: 'A digital clock' translatedNoop! ! !EventRecordingSpace methodsFor: 'sugar flaps' stamp: 'sw 9/10/2007 01:26'! sugarPartsBinQuads "Answer definitions for the contents of the supplies bin within the sugar-nav-bar of the event theatre." ^ #( (ObjectsTool newStandAlone 'Object Catalog' 'A tool that lets you browse the catalog of available objects') (AllScriptsTool allScriptsToolForActiveWorld 'All Scripts' 'Stop, Step, and Go buttons for controlling all your scripts at once. The tool can also be "opened up" to control each script in your project individually.') (AllPlayersTool allPlayersToolForActiveWorld 'Players' 'A tool listing all the scripted objects in the project.') (TrashCanMorph new 'Trash' 'A tool for discarding objects') (TextMorph boldAuthoringPrototype 'Text' 'Text that you can edit into anything you desire.') (RecordingControls authoringPrototype 'Sound Recorder' 'A device for making sound recordings.') (RectangleMorph authoringPrototype 'Rectangle' 'A rectangle') (EllipseMorph authoringPrototype 'Ellipse' 'An ellipse or circle') (PolygonMorph authoringPrototype 'Triangle' 'A three-sided polygon') (StarMorph authoringPrototype 'Star' 'A star') (BookMorph authoringPrototype 'Book' 'A multi-paged structure') (ScriptingSystem prototypicalHolder 'Holder' 'A place for storing alternative pictures in an animation, etc.') (JoystickMorph authoringPrototype 'Joystick' 'A joystick-like control') (PasteUpMorph authoringPrototype 'Playfield' 'A place for assembling parts or for staging animations')) asOrderedCollection! ! !Flaps class methodsFor: 'flaps registry' stamp: 'sw 9/6/2007 17:06'! defaultsQuadsDefiningSuppliesFlap "Answer a list of quads which define the objects to appear in the default Supplies flap. previously in quadsDefiningSuppliesFlap" ^ { {#RectangleMorph. #authoringPrototype. 'Rectangle' translatedNoop. 'A rectangle' translatedNoop}. {#RectangleMorph. #roundRectPrototype. 'RoundRect' translatedNoop. 'A rectangle with rounded corners' translatedNoop}. {#EllipseMorph. #authoringPrototype. 'Ellipse' translatedNoop. 'An ellipse or circle' translatedNoop}. {#StarMorph. #authoringPrototype. 'Star' translatedNoop. 'A star' translatedNoop}. {#PolygonMorph. #curvePrototype. 'Curve' translatedNoop. 'A curve' translatedNoop}. {#PolygonMorph. #authoringPrototype. 'Polygon' translatedNoop. 'A straight-sided figure with any number of sides' translatedNoop}. {#TextMorph . #boldAuthoringPrototype. 'Text' translatedNoop. 'Text that you can edit into anything you desire.' translatedNoop}. {#ScriptingSystem. #prototypicalHolder. 'Holder' translatedNoop. 'A place for storing alternative pictures in an animation, etc.' translatedNoop}. {#ImageMorph. #authoringPrototype. 'Picture' translatedNoop. 'A non-editable picture of something' translatedNoop}. {#ScriptableButton. #authoringPrototype. 'Button' translatedNoop. 'A Scriptable button' translatedNoop}. {#SimpleSliderMorph. #authoringPrototype. 'Slider' translatedNoop. 'A slider for showing and setting numeric values.' translatedNoop}. {#PasteUpMorph. #authoringPrototype. 'Playfield' translatedNoop. 'A place for assembling parts or for staging animations' translatedNoop}. {#BookMorph. #authoringPrototype. 'Book' translatedNoop. 'A multi-paged structure' translatedNoop}. {#TabbedPalette. #authoringPrototype. 'TabbedPalette' translatedNoop. 'A structure with tabs' translatedNoop}. {#JoystickMorph . #authoringPrototype. 'Joystick' translatedNoop. 'A joystick-like control' translatedNoop}. {#ClockMorph. #authoringPrototype. 'Clock' translatedNoop. 'A simple digital clock' translatedNoop}. {#BookMorph. #previousPageButton. 'PreviousPage' translatedNoop. 'A button that takes you to the previous page' translatedNoop}. {#BookMorph. #nextPageButton. 'NextPage' translatedNoop. 'A button that takes you to the next page' translatedNoop} } asOrderedCollection! ! !Flaps class methodsFor: 'predefined flaps' stamp: 'sw 9/6/2007 16:00'! defaultsQuadsDefiningPlugInSuppliesFlap "Answer a list of quads which define the objects to appear in the default Supplies flap used in the Plug-in image" ^ { {#ObjectsTool. #newStandAlone. 'Object Catalog' translatedNoop. 'A tool that lets you browse the catalog of available objects' translatedNoop}. {#AllScriptsTool. #AllScriptsToolForActiveWorld. 'All Scripts' translatedNoop. 'Stop, Step, and Go buttons for controlling all your scripts at once. The tool can also be "opened up" to control each script in your project individually.' translatedNoop}. {#AllPlayersTool. #allPlayersToolForActiveWorld. 'Players' translatedNoop. 'A tool listing all the scripted objects in the project.' translatedNoop}. {#TrashCanMorph. #new . 'Trash' translatedNoop. 'A tool for discarding objects' translatedNoop}. {#TextMorph . #boldAuthoringPrototype. 'Text' translatedNoop. 'Text that you can edit into anything you desire.' translatedNoop}. {#RecordingControls. #authoringPrototype. 'Sound Recorder' translatedNoop. 'A device for making sound recordings.' translatedNoop}. {#RectangleMorph. #authoringPrototype. 'Rectangle' translatedNoop. 'A rectangle' translatedNoop}. {#EllipseMorph. #authoringPrototype. 'Ellipse' translatedNoop. 'An ellipse or circle' translatedNoop}. {#PolygonMorph. #trianglePrototype. 'Triangle' translatedNoop. 'A three-sided polygon. Shift-click to get handles to allow you to reshape the triangle.' translatedNoop}. {#StarMorph. #authoringPrototype. 'Star' translatedNoop. 'A star' translatedNoop}. {#ScriptingSystem. #prototypicalHolder. 'Holder' translatedNoop. 'A place for storing alternative pictures in an animation, etc.' translatedNoop}. {#JoystickMorph . #authoringPrototype. 'Joystick' translatedNoop. 'A joystick-like control' translatedNoop}. {#PasteUpMorph. #authoringPrototype. 'Playfield' translatedNoop. 'A place for assembling parts or for staging animations' translatedNoop} } asOrderedCollection! ! !Flaps class methodsFor: 'predefined flaps' stamp: 'sw 9/6/2007 17:06'! newLoneSuppliesFlap "Answer a fully-instantiated flap named 'Supplies' to be placed at the bottom of the screen, for use when it is the only flap shown upon web launch. We're still evidently nurturing this method along, but it is a disused branch, whose lone sender has no senders..." | aFlapTab aStrip leftEdge | "Flaps setUpSuppliesFlapOnly" aStrip _ PartsBin newPartsBinWithOrientation: #leftToRight andColor: Color red muchLighter from: { {#TrashCanMorph. #new . 'Trash' translatedNoop. 'A tool for discarding objects' translatedNoop}. {#ScriptingSystem. #scriptControlButtons. 'Status' translatedNoop. 'Buttons to run, stop, or single-step scripts' translatedNoop}. {#AllScriptsTool. #allScriptsToolForActiveWorld. 'All Scripts' translatedNoop. 'A tool that lets you control all the running scripts in your world' translatedNoop}. {#PaintInvokingMorph. #new. 'Paint' translatedNoop. 'Drop this into an area to start making a fresh painting there' translatedNoop}. {#RectangleMorph. #authoringPrototype. 'Rectangle' translatedNoop. 'A rectangle' translatedNoop}. {#RectangleMorph. #roundRectPrototype. 'RoundRect' translatedNoop. 'A rectangle with rounded corners' translatedNoop}. {#EllipseMorph. #authoringPrototype. 'Ellipse' translatedNoop. 'An ellipse or circle' translatedNoop}. {#StarMorph. #authoringPrototype. 'Star' translatedNoop. 'A star' translatedNoop}. {#PolygonMorph. #curvePrototype. 'Curve' translatedNoop. 'A curve' translatedNoop}. {#PolygonMorph . #authoringPrototype. 'Polygon' translatedNoop. 'A straight-sided figure with any number of sides' translatedNoop}. {#TextMorph . #authoringPrototype. 'Text' translatedNoop. 'Text that you can edit into anything you desire.' translatedNoop}. {#SimpleSliderMorph . #authoringPrototype. 'Slider' translatedNoop. 'A slider for showing and setting numeric values.' translatedNoop}. {#JoystickMorph . #authoringPrototype. 'Joystick' translatedNoop. 'A joystick-like control' translatedNoop}. {#ScriptingSystem. #prototypicalHolder. 'Holder' translatedNoop. 'A place for storing alternative pictures in an animation, etc.' translatedNoop}. " {#ScriptableButton. #authoringPrototype. 'Button' translatedNoop. 'A Scriptable button' translatedNoop}." {#PasteUpMorph. #authoringPrototype. 'Playfield' translatedNoop. 'A place for assembling parts or for staging animations' translatedNoop}. {#BookMorph. #authoringPrototype. 'Book' translatedNoop. 'A multi-paged structure' translatedNoop}. {#TabbedPalette. #authoringPrototype. 'Tabs' translatedNoop. 'A structure with tabs' translatedNoop}. {#RecordingControls. #authoringPrototype. 'Sound Recorder' translatedNoop. 'A device for making sound recordings.' translatedNoop}. {#MagnifierMorph. #newRound . 'Magnifier' translatedNoop. 'A magnifying glass' translatedNoop}. {#ImageMorph. #authoringPrototype. 'Picture' translatedNoop. 'A non-editable picture of something' translatedNoop}. {#ClockMorph. #authoringPrototype, 'Clock' translatedNoop, 'A simple digital clock' translatedNoop}. {#BookMorph, #previousPageButton, 'Previous' translatedNoop, 'A button that takes you to the previous page' translatedNoop}. {#BookMorph, #nextPageButton, 'Next' translatedNoop, 'A button that takes you to the next page' translatedNoop}. }. aFlapTab _ FlapTab new referent: aStrip beSticky. aFlapTab setName: 'Supplies' translated edge: #bottom color: Color red lighter. aStrip extent: self currentWorld width @ 78. leftEdge _ ((Display width - (16 + aFlapTab width)) + 556) // 2. aFlapTab position: (leftEdge @ (self currentWorld height - aFlapTab height)). aStrip beFlap: true. aStrip autoLineLayout: true. ^ aFlapTab! ! !PolygonMorph methodsFor: 'editing' stamp: 'sw 9/7/2007 23:16'! addHandles "Place control-handles on the receiver, for adding and repositioning vertices." | handle newVert tri wantsTriangles | wantsTriangles := (self hasProperty: #noNewVertices) not. self removeHandles. handles _ OrderedCollection new. tri _ Array with: 0@-8 with: 8@6 with: -6@6. vertices withIndexDo: [:vertPt :vertIndex | handle _ EllipseMorph newBounds: (Rectangle center: vertPt extent: 16@16) color: (vertIndex = self vertexCursor ifTrue: [Color blue] ifFalse: [Color yellow]). handle on: #mouseMove send: #dragVertex:event:fromHandle: to: self withValue: vertIndex. handle on: #mouseUp send: #dropVertex:event:fromHandle: to: self withValue: vertIndex. self addMorph: handle. handles addLast: handle. (closed or: [vertIndex < vertices size]) ifTrue: [newVert _ PolygonMorph vertices: (tri collect: [:p | p + (vertPt + (vertices atWrap: vertIndex+1) // 2)]) color: Color green borderWidth: 1 borderColor: Color black. wantsTriangles ifTrue: [newVert on: #mouseDown send: #newVertex:event:fromHandle: to: self withValue: vertIndex] ifFalse: [newVert color: Color transparent; borderWidth: 0; lock]. self addMorph: newVert. handles addLast: newVert]]. smoothCurve ifTrue: [self updateHandles; layoutChanged]. self changed! ! !PolygonMorph methodsFor: 'initialization' stamp: 'sw 9/10/2007 01:23'! defaultBorderColor "answer the default border color/fill style for the receiver" ^ Color black "Until September 2007, this had long been... ^ Color r: 0.0 g: 0.419 b: 0.935"! ! !PolygonMorph methodsFor: 'initialization' stamp: 'sw 9/6/2007 15:54'! initialize "initialize the state of the receiver. This sets up a 4-sided polygon as the default." super initialize. vertices _ Array with: 15 @ 0 with: 45 @ 20 with: 60@60 with: 0 @ 60. vertexCursor _ 1. closed _ true. smoothCurve _ false. arrows _ #none. self computeBounds! ! !PolygonMorph class methodsFor: 'instance creation' stamp: 'sw 9/8/2007 00:51'! curvePrototype "Answer an instance of the receiver that will serve as a prototypical curve" | aa | aa _ self new. aa vertices: (Array with: 0@80 with: 70@90 with: 60@0) color: Color orange lighter borderWidth: 4 borderColor: Color black. aa beSmoothCurve. aa setNameTo: 'Curve'. aa makeForwardArrow. "is already open" aa computeBounds. ^ aa " PolygonMorph curvePrototype openInHand "! ! !PolygonMorph class methodsFor: 'instance creation' stamp: 'sw 9/10/2007 01:24'! supplementaryPartsDescriptions "Answer a list of DescriptionForPartsBin objects that characterize objects that this class wishes to contribute to Stationery bins *other* than by the standard default #newStandAlone protocol" ^ {DescriptionForPartsBin formalName: 'Arrow' translatedNoop categoryList: {'Graphics' translatedNoop} documentation: 'A line with an arrowhead. Shift-click to get handles and move the ends.' translatedNoop globalReceiverSymbol: #PolygonMorph nativitySelector: #arrowPrototype. DescriptionForPartsBin formalName: 'Triangle' translatedNoop categoryList: {'Graphics' translatedNoop} documentation: 'A three-sided polygon.' translatedNoop globalReceiverSymbol: #PolygonMorph nativitySelector: #trianglePrototype. DescriptionForPartsBin formalName: 'Curve' translatedNoop categoryList: {'Graphics' translatedNoop. 'Basic' translatedNoop} documentation: 'A smooth wiggly curve, or a curved solid. Shift-click to get handles and move the points. Using the halo menu, can be coverted into a polygon, and can be made "open" rather than closed.' translatedNoop globalReceiverSymbol: #PolygonMorph nativitySelector: #curvePrototype. } ! ! !PolygonMorph class methodsFor: 'instance creation' stamp: 'sw 9/10/2007 01:57'! trianglePrototype "Answer an instance of the receiver that will serve as a prototypical triangle" | aa | aa _ self new. aa vertices: {0.0@0.0. 138.0@0.0. -37.0@-74.0} color: (TranslucentColor r: 0.387 g: 1.0 b: 0.548 alpha: 0.463) borderWidth: 3 borderColor: Color black. aa setProperty: #noNewVertices toValue: true. aa setNameTo: 'Triangle'. aa makeForwardArrow. "is already open" aa computeBounds. aa addHandles. ^ aa " PolygonMorph trianglePrototype openInHand "! ! !CurveMorph class methodsFor: 'parts bin' stamp: 'sw 9/10/2007 01:24'! formerDescriptionForPartsBin "Formerly, the definition that resulted in there being a Curve in the objects catalog, etc. We now use a generic PolygonMorph, configured to be curve-like, instead..." ^ self partName: 'Curve' translatedNoop categories: {'Graphics' translatedNoop. 'Basic' translatedNoop} documentation: 'A smooth wiggly curve, or a curved solid. Shift-click to get handles and move the points. Using the halo menu, can be coverted into a polygon, and can be made "open" rather than closed.' translatedNoop! ! !ScriptableButton class methodsFor: 'name' stamp: 'sw 9/4/2007 15:53'! descriptionForPartsBin "Answer a description for use in bulding parts bins. In latest take, this is not seen in any explicit category, but rather only in alphabetic or 'find' retrievals." ^ self partName: 'Button' translatedNoop categories: {"'Scripting' translatedNoop. 'Basic' translatedNoop"} documentation: 'A button to use with tile scripting; its script will be a method of its containing playfield' translatedNoop! ! !WatchMorph class methodsFor: 'parts bin' stamp: 'sw 9/4/2007 15:49'! descriptionForPartsBin "Answer a description for use in parts bins." ^ self partName: 'Clock' translatedNoop categories: #('Just for Fun') documentation: 'An analog clock face' translatedNoop! ! CurveMorph class removeSelector: #descriptionForPartsBin! "Postscript:" #(Badge Clock Curve 'Grab Patch' Lasso Paint Polygon 'Sticky Pad' 'Text chat+' Triangle) do: [:n | PartsBin uncacheThumbnailFor: n]. SugarLibrary clearDefault. SugarNavigatorBar refreshButRetainOldContents.!