'From Squeak3.5 of ''11 April 2003'' [latest update: #5180] on 27 April 2003 at 6:13:04 pm'! "Change Set: AppearanceMenuReg-sbw Date: 22 November 2002 Author: Stephan B. Wessels SM Name: Appearance Menu Registry Provides a menu registry for the world appearance menu. For example... TheWorldMenu registerAppearanceCommand: { 'set desktop image...'. {FileList2. #openMorphicViewWithPreviewInWorld}. 'open up an image browser to choose a new desktop background'}. Date Update ------------- ----------------------------------------------------------------------------------- 15-apr-2003 Update release for Squeak 3.5 and added an example in the preamble comments. 22-nov-2002 initial release" ! Object subclass: #TheWorldMenu instanceVariableNames: 'myProject myWorld myHand ' classVariableNames: 'AppearanceMenuRegistry OpenMenuRegistry ProjectMenuRegistry ' poolDictionaries: '' category: 'Morphic-Kernel'! !TheWorldMenu methodsFor: '*appearanceMenuReg' stamp: 'sbw 11/22/2002 18:30'! appearanceMenu "Build the appearance menu for the world." | screenCtrl menu | screenCtrl _ ScreenController new. menu _ self menu: 'appearance...'. self fillIn: menu from: {{'preferences...'. {Preferences. #openFactoredPanel}. 'Opens a "Preferences Panel" which allows you to alter many settings'}. {'choose theme...'. {Preferences. #offerThemesMenu}. 'Presents you with a menu of themes; each item''s balloon-help will tell you about the theme. If you choose a theme, many different preferences that come along with that theme are set at the same time; you can subsequently change any settings by using a Preferences Panel'}. nil. {'window colors...'. {Preferences. #windowSpecificationPanel}. 'Lets you specify colors for standard system windows.'}. {'system fonts...'. {self. #standardFontDo}. 'Choose the standard fonts to use for code, lists, menus, window titles, etc.'}. {'text highlight color...'. {Preferences. #chooseTextHighlightColor}. 'Choose which color should be used for text highlighting in Morphic.'}. {'insertion point color...'. {Preferences. #chooseInsertionPointColor}. 'Choose which color to use for the text insertion point in Morphic.'}. {'keyboard focus color'. {Preferences. #chooseKeyboardFocusColor}. 'Choose which color to use for highlighting which pane has the keyboard focus'}. nil. {#menuColorString. {Preferences. #toggleMenuColorPolicy}. 'Governs whether menu colors should be derived from the desktop color.'}. {#roundedCornersString. {Preferences. #toggleRoundedCorners}. 'Governs whether morphic windows and menus should have rounded corners.'}. nil. {'full screen on'. {screenCtrl. #fullScreenOn}. 'puts you in full-screen mode, if not already there.'}. {'full screen off'. {screenCtrl. #fullScreenOff}. 'if in full-screen mode, takes you out of it.'}. nil. {'set display depth...'. {self. #setDisplayDepth}. 'choose how many bits per pixel.'}. {'set desktop color...'. {self. #changeBackgroundColor}. 'choose a uniform color to use as desktop background.'}. {'set gradient color...'. {self. #setGradientColor}. 'choose second color to use as gradient for desktop background.'}. {'use texture background'. {#myWorld. #setStandardTexture}. 'apply a graph-paper-like texture background to the desktop.'}. nil. {'clear turtle trails from desktop'. {#myWorld. #clearTurtleTrails}. 'remove any pigment laid down on the desktop by objects moving with their pens down.'}. {'pen-trail arrowhead size...'. {Preferences. #setArrowheads}. 'choose the shape to be used in arrowheads on pen trails.'}}. self fillIn: menu from: self class registeredAppearanceCommands , {nil}. ^ menu! ! !TheWorldMenu class methodsFor: '*appearanceMenuReg' stamp: 'sbw 11/22/2002 18:09'! registerAppearanceCommand: anArray "The array received should be of form {'A Label String'. {TargetObject. #command} 'A Help String'} ; the final element is optional but if present will be used to supply balloon help for the menu item in the Appearance menu. If any previous registration of the same label string is already known, delete the old one." self unregisterAppearanceCommand: anArray first. AppearanceMenuRegistry addLast: anArray! ! !TheWorldMenu class methodsFor: '*appearanceMenuReg' stamp: 'sbw 11/22/2002 18:06'! registeredAppearanceCommands "Answer the list of dynamic appearance menu commands" AppearanceMenuRegistry ifNil: [AppearanceMenuRegistry _ OrderedCollection new]. ^ AppearanceMenuRegistry! ! !TheWorldMenu class methodsFor: '*appearanceMenuReg' stamp: 'sbw 11/22/2002 18:08'! unregisterAppearanceCommand: label "Remove the appearance command with the given label from the registry " self registeredAppearanceCommands removeAllSuchThat: [:e | e first = label]! ! !TheWorldMenu class methodsFor: '*appearanceMenuReg' stamp: 'sbw 11/22/2002 18:09'! unregisterAppearanceCommandWithReceiver: aReceiver "Remove the appearance command with the given object as receiver from the registry" self registeredAppearanceCommands removeAllSuchThat: [:e | e second first == aReceiver]! !