Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.256.mcz ==================== Summary ==================== Name: Tools-eem.256 Author: eem Time: 14 August 2010, 6:39:45.243 pm UUID: b6d2c00a-55b7-42ec-911b-8eb801388d7f Ancestors: Tools-cbr.255 Fix multi-window menu labelling for unselected windows (old code broke if system organization changed). =============== Diff against Tools-cbr.255 =============== Item was changed: ----- Method: PackagePaneBrowser>>multiWindowName (in category 'multi-window support') ----- multiWindowName "Answer the string to display for the receiver in a multi-window." ^String streamContents: [:s| | str | self package ifNil: [s nextPut: $a; space; nextPutAll: self defaultBrowserTitle] ifNotNil: [:pkg| + self selectedClass + ifNil: [self selectedSystemCategoryName + ifNil: [s nextPutAll: pkg] + ifNotNil: [:cat| s nextPutAll: cat]] + ifNotNil: + [:class| + s nextPutAll: pkg; space; print: class. + self metaClassIndicated ifTrue: + [s nextPutAll: ' class']]]. - s nextPutAll: pkg; space. - self selectedClass ifNotNil: [:class| s print: class]. - self metaClassIndicated ifTrue: - [s nextPutAll: ' class']]. (str := self selectedMessageName) notNil ifTrue: [s nextPutAll: '>>'; nextPutAll: str] ifFalse: [(str := self selectedMessageCategoryName) notNil ifTrue: [s space; nextPut: ${; nextPutAll: str; nextPut: $}]]]! Item was added: + ----- Method: PackagePaneBrowser>>multiWindowNameForState: (in category 'multi-window support') ----- + multiWindowNameForState: savedStateMessage + "Answer the string to display for the receiver in a multi-window." + | getarg | + getarg := [:keyword| savedStateMessage arguments at: (savedStateMessage selector keywords indexOf: keyword)]. + ^String streamContents: + [:s| + (getarg value: 'restoreToPackage:') + ifNil: [s nextPut: $a; space; nextPutAll: self defaultBrowserTitle] + ifNotNil: + [:pkg| + s nextPutAll: pkg. + (getarg value: 'className:') + ifNil: [(getarg value: 'category:') ifNotNil: + [:categoryName| s nextPut: $-; nextPutAll: categoryName]] + ifNotNil: + [:className| + s space; nextPutAll: className. + (getarg value: 'meta:') ifTrue: + [s nextPutAll: ' class']. + self isHierarchy ifTrue: + [s space; nextPutAll: ' Hierarchy']. + (getarg value: 'selector:') + ifNil: [(getarg value: 'protocol:') ifNotNil: + [:protocol| s space; nextPut: ${; nextPutAll: protocol; nextPut: $}]] + ifNotNil: [:selector| s nextPutAll: '>>'; nextPutAll: selector]]]]! Item was added: + ----- Method: Browser>>multiWindowNameForState: (in category 'multi-window support') ----- + multiWindowNameForState: savedStateMessage + "Answer the string to display for the receiver in a multi-window." + | getarg | + getarg := [:keyword| savedStateMessage arguments at: (savedStateMessage selector keywords indexOf: keyword)]. + ^String streamContents: + [:s| + (getarg value: 'className:') + ifNil: [(getarg value: 'restoreToCategory:') + ifNil: [s nextPut: $a; space; nextPutAll: self defaultBrowserTitle] + ifNotNil: [:categoryName| s nextPutAll: categoryName]] + ifNotNil: + [:className| + s nextPutAll: className. + (getarg value: 'meta:') ifTrue: + [s nextPutAll: ' class']. + self isHierarchy ifTrue: + [s space; nextPutAll: ' Hierarchy']. + (getarg value: 'selector:') + ifNil: [(getarg value: 'protocol:') ifNotNil: + [:protocol| s space; nextPut: ${; nextPutAll: protocol; nextPut: $}]] + ifNotNil: [:selector| s nextPutAll: '>>'; nextPutAll: selector]]]! Item was changed: ----- Method: SavedMultiWindowState>>selectWindowsMenu (in category 'operations') ----- selectWindowsMenu | menu currentItem | menu := MenuMorph new defaultTarget: self. models withIndexDo: + [:model :index| | modelLabel | + modelLabel := index = currentModelIndex + ifTrue: [model multiWindowName] + ifFalse: [model multiWindowNameForState: (modelStates at: index) first]. + models size > 1 ifTrue: + [modelLabel := index printString, '. ', modelLabel]. - [:model :index| | entry | - entry := models size > 1 - ifTrue: [index printString, '. ', model multiWindowName] - ifFalse: [model multiWindowName]. menu add: (index = currentModelIndex + ifTrue: [Text string: modelLabel attribute: TextEmphasis bold] - ifTrue: [Text string: entry attribute: TextEmphasis bold] ifFalse: [((modelStates at: index) last anySatisfy: [:editState| editState notNil]) + ifTrue: [Text string: modelLabel attribute: TextColor red] + ifFalse: [modelLabel]]) - ifTrue: [Text string: entry attribute: TextColor red] - ifFalse: [entry]]) target: self selector: #selectWindowIndex: argument: index. index = currentModelIndex ifTrue: [currentItem := menu lastItem]]. menu addLine; add: 'new window' target: self selector: #addNewWindow; add: 'copy this window' target: self selector: #copyWindow; add: 'remove this window' target: self selector: #removeCurrentWindow. models size <= 1 ifTrue: [menu lastItem isEnabled: false]. menu selectItem: currentItem event: nil. ^menu! |
Free forum by Nabble | Edit this page |