David T. Lewis uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-dtl.106.mcz ==================== Summary ==================== Name: ST80-dtl.106 Author: dtl Time: 14 February 2010, 10:18:41.199 pm UUID: f5e706d7-bcd7-4057-8010-789b6b58e4de Ancestors: ST80-dtl.105 Implement Project>>textWindows to remove MVC/Morphic dependencies from Utilities class> storeTextWindowContentsToFileNamed: Fix bug in #storeTextWindowContentsToFileNamed: in which text windows with duplicate window titles were not saved. Remove explicit MVC references from SystemDictionary>>majorShrink. Remove explicit MVC reference from SystemDictionary>>discardOddsAndEnds. =============== Diff against ST80-dtl.105 =============== Item was changed: ----- Method: StandardSystemView class>>doCacheBits (in category 'class initialization') ----- doCacheBits "StandardSystemView doCacheBits - Enable fast window repaint feature" CacheBits := true. + ScheduledControllers ifNotNilDo: [:sc | sc unCacheWindows; restore]! - ScheduledControllers unCacheWindows. - ScheduledControllers restore! Item was added: + ----- Method: MVCProject>>textWindows (in category 'utilities') ----- + textWindows + "Answer a dictionary of all system windows for text display keyed by window title. + Generate new window titles as required to ensure unique keys in the dictionary." + + | aDict windows title | + aDict := Dictionary new. + windows := ScheduledControllers controllersSatisfying: + [:c | (c model isKindOf: StringHolder)]. + windows do: + [:aController | | textToUse aTextView | + aTextView := aController view subViews detect: [:m | m isKindOf: PluggableTextView] ifNone: [nil]. + textToUse := aTextView + ifNil: [aController model contents] + ifNotNil: [aTextView controller text]. "The latest edits, whether accepted or not" + title := aController view label. + (aDict includesKey: title) ifTrue: [ | newKey | "Ensure unique keys in aDict" + (1 to: 100) detect: [:e | + newKey := title, '-', e asString. + (aDict includesKey: newKey) not]. + title := newKey]. + aDict at: title put: textToUse]. + ^ aDict! Item was added: + ----- Method: Utilities class>>openScratchWorkspaceLabeled:contents: (in category '*ST80-Support') ----- + openScratchWorkspaceLabeled: labelString contents: initialContents + "Open a scratch text view with the given label on the given string. A scratch text view won't warn you about unsaved changes when you close it." + "Utilities openScratchWorkspaceLabeled: 'Scratch' contents: 'Hello. world!!'" + + | model topView stringView | + model := StringHolder new contents: initialContents. + topView := StandardSystemView new. + topView + model: model; + label: labelString; + minimumSize: 180@120. + topView borderWidth: 1. + stringView := PluggableTextView on: model + text: #contents + accept: nil + readSelection: #contentsSelection + menu: #codePaneMenu:shifted:. + stringView + askBeforeDiscardingEdits: false; + window: (0@0 extent: 180@120). + topView addSubView: stringView. + topView controller open. + ! |
Free forum by Nabble | Edit this page |