'From Squeak3.3alpha of 18 January 2002 [latest update: #4888] on 14 June 2002 at 1:55:20 pm'! "Change Set: plugInSuppliesFlap-sw Date: 14 June 2002 Author: Scott Wallace Provides single Supplies flap for the plug-in, with contents exactly as proposed by Kim Rose and BJ Allen-Conn. This lone Supplies flap can now also be installed in a stand-alone image, via a new menu item in the flaps menu, which is available only after you have destroyed existing shared flaps."! !Flaps class methodsFor: 'menu support' stamp: 'sw 6/11/2002 14:05'! enableEToyFlaps "Start using global flaps, plug-in version, given that they were not present." Cursor wait showWhile: [self addAndEnableEToyFlaps. self enableGlobalFlaps]! ! !Flaps class methodsFor: 'predefined flaps' stamp: 'sw 6/11/2002 14:31'! addAndEnableEToyFlaps "Initialize the standard default out-of-box set of global flaps. This method creates them and places them in my class variable #SharedFlapTabs, but does not itself get them displayed." SharedFlapTabs ifNotNil: [^ self]. SharedFlapTabs _ OrderedCollection new. SharedFlapTabs add: (self newSuppliesFlapFromQuads: self quadsDefiningPlugInSuppliesFlap positioning: #right). "The #center designation doesn't quite work at the moment" SharedFlapTabs add: self newNavigatorFlap. self enableGlobalFlapWithID: 'Supplies'. self enableGlobalFlapWithID: 'Navigator'. SharedFlapsAllowed _ true. Project current flapsSuppressed: false. ^ SharedFlapTabs "Flaps addAndEnableEToyFlaps"! ! !Flaps class methodsFor: 'predefined flaps' stamp: 'sw 6/11/2002 14:00'! newSuppliesFlap "Answer a fully-instantiated flap named 'Supplies' to be placed at the bottom of the screen; this is for the non-plug-in-version" ^ self newSuppliesFlapFromQuads: self quadsDefiningSuppliesFlap positioning: #right! ! !Flaps class methodsFor: 'predefined flaps' stamp: 'sw 6/11/2002 14:00'! newSuppliesFlapFromQuads: quads positioning: positionSymbol "Answer a fully-instantiated flap named 'Supplies' to be placed at the bottom of the screen. Use #center as the positionSymbol to have it centered at the bottom of the screen, or #right to have it placed off near the right edge." | aFlapTab aStrip hPosition | aStrip _ PartsBin newPartsBinWithOrientation: #leftToRight from: quads. aFlapTab _ FlapTab new referent: aStrip beSticky. aFlapTab setName: 'Supplies' edge: #bottom color: Color red lighter. hPosition _ positionSymbol == #center ifTrue: [(Display width // 2) - (aFlapTab width // 2)] ifFalse: [Display width - (aFlapTab width + 22)]. aFlapTab position: (hPosition @ (self currentWorld height - aFlapTab height)). aFlapTab setBalloonText: aFlapTab balloonTextForFlapsMenu. aStrip extent: self currentWorld width @ 78. aStrip beFlap: true. aStrip color: Color red muchLighter. aStrip autoLineLayout: true. ^ aFlapTab "Flaps replaceGlobalFlapwithID: 'Supplies' "! ! !Flaps class methodsFor: 'predefined flaps' stamp: 'sw 6/14/2002 13:48'! quadsDefiningPlugInSuppliesFlap "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' 'A tool that lets you see and control all the running scripts in your project') (TrashCanMorph new 'Trash' 'A tool for discarding objects') (PaintInvokingMorph new 'Paint' 'Drop this into an area to start making a fresh painting there') (TextMorph authoringPrototype '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'))! ! !Flaps class methodsFor: 'predefined flaps' stamp: 'sw 6/11/2002 14:33'! quadsDefiningWidgetsFlap "Answer a structure defining the default Widgets flap" ^ #( (TrashCanMorph new 'Trash' 'A tool for discarding objects') (AllScriptsTool allScriptsToolForActiveWorld 'All Scripts' 'A tool that lets you see and control all the running scripts in your project') (PaintInvokingMorph new 'Paint' 'Drop this into an area to start making a fresh painting there') (GeeMailMorph new 'Gee-Mail' 'A place to present annotated content') (RecordingControlsMorph authoringPrototype 'Sound' 'A device for making sound recordings.') (MPEGMoviePlayerMorph authoringPrototype 'Movie Player' 'A Player for MPEG movies') (FrameRateMorph authoringPrototype 'Frame Rate' 'An indicator of how fast your system is running') (MagnifierMorph newRound 'Magnifier' 'A magnifying glass') (ScriptingSystem newScriptingSpace 'Scripting' 'A confined place for drawing and scripting, with its own private stop/step/go buttons.') (ScriptingSystem holderWithAlphabet 'Alphabet' 'A source for single-letter objects') (BouncingAtomsMorph new 'Bouncing Atoms' 'Atoms, mate') (ObjectsTool newStandAlone 'Object Catalog' 'A tool that lets you browse the catalog of objects') )! ! !TheWorldMenu methodsFor: 'windows & flaps menu' stamp: 'sw 6/11/2002 13:46'! formulateFlapsMenu: aMenu "Fill aMenu with appropriate content" aMenu addTitle: 'flaps'. aMenu addStayUpItem. Preferences classicNavigatorEnabled ifTrue: [aMenu addUpdating: #navigatorShowingString enablementSelector: #enableProjectNavigator target: Preferences selector: #togglePreference: argumentList: #(showProjectNavigator). aMenu balloonTextForLastItem: (Preferences preferenceAt: #showProjectNavigator) helpString]. Flaps sharedFlapsAllowed ifTrue: [self fillIn: aMenu from: {{#suppressFlapsString. {CurrentProjectRefactoring. #currentToggleFlapsSuppressed}. 'Whether prevailing flaps should be shown in the project right now or not.'}}. aMenu addUpdating: #automaticFlapLayoutString target: Preferences selector: #togglePreference: argumentList: #(automaticFlapLayout). aMenu balloonTextForLastItem: (Preferences preferenceAt: #automaticFlapLayout) helpString. aMenu addLine. Flaps addIndividualGlobalFlapItemsTo: aMenu]. self fillIn: aMenu from: { nil. {'make a new flap'. {Flaps. #addLocalFlap}. 'Create a new flap. You can later make it into a shared flap is you wish.'}. nil.}. Flaps sharedFlapsAllowed ifTrue: [aMenu addWithLabel: 'put shared flaps on bottom' enablementSelector: #showSharedFlaps target: Flaps selector: #sharedFlapsAlongBottom argumentList: #(). aMenu balloonTextForLastItem: 'Group all the standard shared flaps along the bottom edge of the screen'. self fillIn: aMenu from: { {'destroy all shared flaps'. {Flaps. #disableGlobalFlaps}. 'Destroy all the shared flaps and disable their use in all projects.'}}] ifFalse: [aMenu add: 'install default shared flaps' target: Flaps action: #enableGlobalFlaps. aMenu balloonTextForLastItem: 'Create the default set of shared flaps'. aMenu add: 'install etoy flaps' target: Flaps action: #enableEToyFlaps. aMenu balloonTextForLastItem: 'Put up the default etoy flaps: a custom Suplies flap and the Navigator flap'. aMenu addLine]. self fillIn: aMenu from: { nil. {'about flaps...'. {Flaps . #explainFlaps}. 'Gives a window full of details about how to use flaps.'}}! !