'From Squeak3.1alpha of 5 February 2001 [latest update: #3693] on 23 February 2001 at 10:54:14 am'! "Change Set: UseNewTilesOrOld Date: 19 February 2001 Author: Dan Ingalls Provides a simple do-it to recreate all viewers and scriptors in place: self currentWorld recreateScripts. This will be invoked when the value of the #largeTile preference is changed. "! !PasteUpMorph methodsFor: 'scripting' stamp: 'di 2/19/2001 15:29'! recreateScripts "self currentWorld recreateScripts." Preferences enable: #universalTiles. Preferences enable: #capitalizedReferences. "Rebuild viewers" self flapTabs do: [:ff | (ff isMemberOf: ViewerFlapTab) ifTrue: [ff referent submorphsDo: [:m | (m isKindOf: StandardViewer) ifTrue: [m recreateCategories]]]]. "Rebuild scriptors" ((self flapTabs collect: [:t | t referent]) copyWith: self) do: [:w | w allScriptEditors do: [:scrEd | scrEd unhibernate]]. ! ! !Preferences class methodsFor: 'preferences dictionary' stamp: 'di 2/23/2001 10:47'! noteThatFlag: prefSymbol justChangedTo: aBoolean "Provides a hook so that a user's toggling of a preference might precipitate some immediate action" | keep | prefSymbol == #useGlobalFlaps ifTrue: [aBoolean ifFalse: "Turning off use of flaps" [keep _ self confirm: 'Do you want to preserve the existing global flaps for future use?'. Utilities globalFlapTabsIfAny do: [:aFlapTab | Utilities removeFlapTab: aFlapTab keepInList: keep. aFlapTab isInWorld ifTrue: [self error: 'Flap problem']]. keep ifFalse: [Utilities clobberFlapTabList]] ifTrue: "Turning on use of flaps" [Smalltalk isMorphic ifTrue: [self currentWorld enableGlobalFlaps]]]. prefSymbol == #roundedWindowCorners ifTrue: [Display repaintMorphicDisplay]. prefSymbol == #optionalButtons ifTrue: [Utilities replacePartSatisfying: [:el | (el isKindOf: MorphThumbnail) and: [(el morphRepresented isKindOf: SystemWindow) and: [el morphRepresented model isKindOf: FileList]]] inGlobalFlapSatisfying: [:f1 | f1 wording = 'Tools'] with: FileList openAsMorph applyModelExtent]. (prefSymbol == #optionalButtons or: [prefSymbol == #annotationPanes]) ifTrue: [Utilities replaceBrowserInToolsFlap]. (prefSymbol == #smartUpdating) ifTrue: [SystemWindow allSubInstancesDo: [:aWindow | aWindow amendSteppingStatus]]. (prefSymbol == #eToyFriendly) ifTrue: [ScriptingSystem customizeForEToyUsers: aBoolean]. ((prefSymbol == #infiniteUndo) and: [aBoolean not]) ifTrue: [CommandHistory resetAllHistory]. (prefSymbol == #showProjectNavigator) ifTrue: [Project current assureNavigatorPresenceMatchesPreference]. (prefSymbol == #largeTiles) ifTrue: [World recreateScripts]. prefSymbol == #universalTiles ifTrue: [(self isProjectPreference: prefSymbol) ifFalse: [^ self inform: 'This is bad -- you should not have done that, because the change will take effect for *all projects*, including pre-existing ones. Unfortunately this check is done after the damage is done, so you are hosed. Fortunately, however, you can simply reverse your choice right now and no deep damage will probably have been done.']. aBoolean ifFalse: [self inform: 'CAUTION -- this branch is not supported; once you go to universal tiles in a project, basically there is no going back, so kindly just toggle this preference back to true... sorry (If you really want to use "classic tile" open up a new project that does NOT have the universalTiles already set.)'] ifTrue: [Preferences capitalizedReferences ifFalse: [Preferences enable: #capitalizedReferences. self inform: 'Note that the "capitalizedReferences" flag has now been automatically set to true for you, since this is required for the use of universal tiles.']. World isMorph ifTrue: [World recreateScripts]]]! ! !Preferences class methodsFor: 'initial values' stamp: 'di 2/23/2001 10:52'! initialValuesAdditionscriptinglargeTiles ^ #(#(#largeTiles #false #(#scripting) 'Governs whether universal tiles should appear and act like classic tiles when scripting in this project.') )! ! !ScriptEditorMorph methodsFor: 'other' stamp: 'di 2/19/2001 10:12'! recreateScript | aUserScript | aUserScript _ playerScripted class userScriptForPlayer: playerScripted selector: scriptName. aUserScript recreateScriptFrom: self! ! !StandardViewer methodsFor: 'categories' stamp: 'di 2/19/2001 10:39'! recreateCategories "To change from old to new tiles" | cats | cats _ self categoriesCurrentlyShowing. self removeAllMorphsIn: self categoryMorphs. cats do: [:cat | self addCategoryViewerFor: cat]! ! !UniclassScript methodsFor: 'versions' stamp: 'di 2/19/2001 10:09'! recreateScriptFrom: anEditor "Used to revert to old tiles" formerScriptingTiles isEmptyOrNil ifTrue: [^ self]. anEditor reinsertSavedTiles: formerScriptingTiles last second. isTextuallyCoded _ false! ! !UserScript methodsFor: 'versions' stamp: 'di 2/19/2001 10:05'! recreateScriptFrom: anEditor "Used to revert to old tiles" formerScriptEditors isEmptyOrNil ifTrue: [^ self]. self revertScriptVersionFrom: anEditor installing: formerScriptEditors last! !