'From Squeakland 3.8.5976 of 25 August 2004 [latest update: #293] on 2 September 2004 at 3:53:12 pm'! "Change Set: ModerateTextFlapTweaks-nk Date: 2 September 2004 Author: Ned Konz / disconnected by Marcus and Bert Changes various initializations of the Supplies flaps and objects tool to simplify the text-like prototypes. "! !Morph class methodsFor: 'scripting' stamp: 'bf 9/11/2004 17:18'! hasAdditionsToViewerCategories ^ self class selectors anySatisfy: [:each | each == #additionsToViewerCategories or: [(each beginsWith: 'additionsToViewerCategory') and: [(each at: 26 ifAbsent: []) ~= $:]]]! ! !TextMorph methodsFor: 'accessing' stamp: 'nk 8/30/2004 05:43'! fontName: fontName pointSize: fontSize | newTextStyle | newTextStyle _ ((TextStyle named: fontName asSymbol) ifNil: [ TextStyle default ]) copy. newTextStyle ifNil: [self error: 'font ', fontName, ' not found.']. textStyle _ newTextStyle. text addAttribute: (TextFontChange fontNumber: (newTextStyle fontIndexOfPointSize: fontSize)). paragraph ifNotNil: [paragraph textStyle: newTextStyle]! ! !TextMorph class methodsFor: 'parts bin' stamp: 'nk 9/2/2004 17:13'! boldAuthoringPrototype "TextMorph boldAuthoringPrototype openInHand" | text | text := Text string: 'Text' translated attributes: { TextEmphasis bold. }. ^self new contentsWrapped: text; fontName: 'BitstreamVeraSans' pointSize: 24; paragraph; margins: 4@0; extent: 79@36; fit; yourself ! ! !Flaps class methodsFor: 'flaps registry' stamp: 'nk 9/2/2004 15:49'! defaultsQuadsDefiningSuppliesFlap "Answer a list of quads which define the objects to appear in the default Supplies flap. previously in quadsDefiningSuppliesFlap" ^ #( (RectangleMorph authoringPrototype 'Rectangle' 'A rectangle') (RectangleMorph roundRectPrototype 'RoundRect' 'A rectangle with rounded corners') (EllipseMorph authoringPrototype 'Ellipse' 'An ellipse or circle') (StarMorph authoringPrototype 'Star' 'A star') (CurveMorph authoringPrototype 'Curve' 'A curve') (PolygonMorph authoringPrototype 'Polygon' 'A straight-sided figure with any number of sides') (TextMorph boldAuthoringPrototype 'Text' 'Text that you can edit into anything you desire.') (ScriptingSystem prototypicalHolder 'Holder' 'A place for storing alternative pictures in an animation, etc.') (ImageMorph authoringPrototype 'Picture' 'A non-editable picture of something') (ScriptableButton authoringPrototype 'Button' 'A Scriptable button') (SimpleSliderMorph authoringPrototype 'Slider' 'A slider for showing and setting numeric values.') (PasteUpMorph authoringPrototype 'Playfield' 'A place for assembling parts or for staging animations') (BookMorph authoringPrototype 'Book' 'A multi-paged structure') (TabbedPalette authoringPrototype 'TabbedPalette' 'A structure with tabs') (JoystickMorph authoringPrototype 'Joystick' 'A joystick-like control') (ClockMorph authoringPrototype 'Clock' 'A simple digital clock') (BookMorph previousPageButton 'PreviousPage' 'A button that takes you to the previous page') (BookMorph nextPageButton 'NextPage' 'A button that takes you to the next page') ) asOrderedCollection! ! !Flaps class methodsFor: 'predefined flaps' stamp: 'nk 9/2/2004 15:49'! 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' '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.') (TrashCanMorph new 'Trash' 'A tool for discarding objects') (GrabPatchMorph new 'Grab Patch' 'Allows you to create a new Sketch by grabbing a rectangular patch from the screen') (LassoPatchMorph new 'Lasso' 'Allows you to create a new Sketch by lassoing an area from the screen') (StickyPadMorph newStandAlone 'Sticky Pad' 'Each time you obtain one of these pastel, translucent, borderless rectangles, it will be a different color from the previous time.') "(PaintInvokingMorph new 'Paint' 'Drop this into an area to start making a fresh painting there')" (TextMorph boldAuthoringPrototype 'Text' 'Text that you can edit into anything you desire.') (RecordingControlsMorph authoringPrototype 'Sound' 'A device for making sound recordings.') (RectangleMorph authoringPrototype 'Rectangle' 'A rectangle') (RectangleMorph roundRectPrototype 'RoundRect' 'A rectangle with rounded corners') (EllipseMorph authoringPrototype 'Ellipse' 'An ellipse or circle') (StarMorph authoringPrototype 'Star' 'A star') (CurveMorph authoringPrototype 'Curve' 'A curve') (PolygonMorph authoringPrototype 'Polygon' 'A straight-sided figure with any number of sides') (ScriptableButton authoringPrototype 'Button' 'A Scriptable button') (BookMorph nextPageButton 'NextPage' 'A button that takes you to the next page') (BookMorph previousPageButton 'PreviousPage' 'A button that takes you to the previous page') (ScriptingSystem prototypicalHolder 'Holder' 'A place for storing alternative pictures in an animation, etc.') (PasteUpMorph authoringPrototype 'Playfield' 'A place for assembling parts or for staging animations') (SimpleSliderMorph authoringPrototype 'Slider' 'A slider for showing and setting numeric values.') (JoystickMorph authoringPrototype 'Joystick' 'A joystick-like control') (BookMorph authoringPrototype 'Book' 'A multi-paged structure') (ClockMorph authoringPrototype 'Clock' 'A simple digital clock') (RandomNumberTile new 'Random' 'A random-number tile for use with tile scripting')) asOrderedCollection! ! !GeeMailMorph class methodsFor: 'parts bin' stamp: 'nk 9/2/2004 15:39'! descriptionForPartsBin ^ self partName: 'GeeMail' categories: #('Presentation') documentation: 'A place to assemble content and associated flowing text'! ! !TTSampleStringMorph class methodsFor: 'parts bin' stamp: 'nk 9/2/2004 15:42'! descriptionForPartsBin ^ self partName: 'TrueType banner' categories: #('Demo') documentation: 'A short text in a beautiful font. Use the resize handle to change size.'! ! !TextMorph class methodsFor: 'parts bin' stamp: 'nk 9/2/2004 15:38'! supplementaryPartsDescriptions ^ { DescriptionForPartsBin formalName: 'Text (border)' categoryList: #('Text') documentation: 'A text field with border' globalReceiverSymbol: #TextMorph nativitySelector: #borderedPrototype. " DescriptionForPartsBin formalName: 'Text (fancy)' categoryList: #('Text') documentation: 'A text field with a rounded shadowed border, with a fancy font.' globalReceiverSymbol: #TextMorph nativitySelector: #fancyPrototype." DescriptionForPartsBin formalName: 'Text' categoryList: #('Basic' 'Text') documentation: 'A raw piece of text which you can edit into anything you want' globalReceiverSymbol: #TextMorph nativitySelector: #boldAuthoringPrototype. } ! ! TextMorph class removeSelector: #descriptionForPartsBin! StringMorph class removeSelector: #descriptionForPartsBin! "Postscript: " ObjectsTool allInstancesDo: [ :ea | ea delete ]. Flaps initializeFlapsQuads. PartsBin clearThumbnailCache. (Flaps globalFlapTabsIfAny collect: [ :ea | ea flapID ]) do: [ :id | Flaps replaceGlobalFlapwithID: id ]. !