[Pkg] The Trunk: Tools-cmm.570.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Apr 1 16:10:00 UTC 2015
Chris Muller uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-cmm.570.mcz
==================== Summary ====================
Name: Tools-cmm.570
Author: cmm
Time: 1 April 2015, 11:09:22.929 am
UUID: 7827a351-1a4d-4e83-bbef-7e900993ee62
Ancestors: Tools-mt.569
- SimpleHierarchicalListMorph's now honor preferences:
mouseOverForKeyboardFocus
Vertical Smart Splitters
Filterable Lists Clear Automatically
- After filtering Tree, refit the column-widths to the filtered results.
=============== Diff against Tools-mt.569 ===============
Item was added:
+ ----- Method: IndentingListItemMorph>>charactersOccluded (in category 'private') -----
+ charactersOccluded
+ "Answer the number of characters occluded in my #visibleList by my right edge."
+ | listIndex leftEdgeOfRightmostColumn eachString indexOfLastVisible iconWidth totalWidth |
+ listIndex := 0.
+ leftEdgeOfRightmostColumn := container columns
+ ifNil: [ 0 ]
+ ifNotNil:
+ [ : cols | (1 to: cols size - 1)
+ inject: 0
+ into:
+ [ : sum : each | sum + (self widthOfColumn: each) ] ].
+ eachString := container columns
+ ifNil: [ self complexContents asString ]
+ ifNotNil:
+ [ : cols | self contentsAtColumn: container columns size ].
+ iconWidth := self icon
+ ifNil: [ 0 ]
+ ifNotNil:
+ [ : icon | icon width + 2 ].
+ totalWidth := self toggleBounds right.
+ indexOfLastVisible := ((1 to: eachString size)
+ detect:
+ [ : stringIndex | (totalWidth:=totalWidth+(self fontToUse widthOf: (eachString at: stringIndex))) >
+ (container width -
+ (container scrollBar
+ ifNil: [ 0 ]
+ ifNotNil: [ container scrollBar width ]) - iconWidth - leftEdgeOfRightmostColumn) ]
+ ifNone: [ eachString size + 1 ]) - 1.
+ ^ eachString size - indexOfLastVisible!
Item was changed:
----- Method: IndentingListItemMorph>>drawOn: (in category 'drawing') -----
drawOn: aCanvas
| tRect sRect columnScanner columnLeft |
self backgroundColor ifNotNil: [:c |
aCanvas fillRectangle: self innerBounds color: c].
tRect := self toggleRectangle.
self drawToggleOn: aCanvas in: tRect.
sRect := bounds withLeft: tRect right + 4.
sRect := sRect top: sRect top + sRect bottom - self fontToUse height // 2.
(container columns isNil or: [(contents asString indexOf: Character tab) = 0]) ifTrue: [
icon ifNotNil: [
aCanvas
translucentImage: icon
at: sRect left @ (self top + (self height - icon height // 2)).
sRect := sRect left: sRect left + icon width + 2.
].
aCanvas drawString: contents asString in: sRect font: self fontToUse color: color.
] ifFalse: [
columnLeft := sRect left.
columnScanner := ReadStream on: contents asString.
container columns withIndexDo: [ :widthSpec :column | | columnRect columnData columnWidth |
"Draw icon."
column = self class iconColumnIndex ifTrue: [
icon ifNotNil: [
aCanvas
translucentImage: icon
at: columnLeft @ (self top + (self height - icon height // 2)).
columnLeft := columnLeft + icon width + 2]].
+ columnWidth := self widthOfColumn: column.
- columnWidth := widthSpec isNumber
- ifTrue: [widthSpec]
- ifFalse: [widthSpec isBlock
- ifTrue: [widthSpec cull: container cull: self]
- ifFalse: [widthSpec ifNil: [self width] ifNotNil: [50 "Fall back"]]].
columnRect := columnLeft @ sRect top extent: columnWidth @ sRect height.
columnData := columnScanner upTo: Character tab.
"Draw string."
columnData ifNotEmpty: [
aCanvas drawString: columnData in: columnRect font: self fontToUse color: color].
"Compute next column offset."
columnLeft := columnRect right + 5.
column = 1 ifTrue: [columnLeft := columnLeft - tRect right + self left].
].
]!
Item was added:
+ ----- Method: IndentingListItemMorph>>widthOfColumn: (in category 'accessing - columns') -----
+ widthOfColumn: columnIndex
+ | widthOrSpec |
+ container columns ifNil: [ ^ self width ].
+ widthOrSpec := container columns at: columnIndex.
+ ^ widthOrSpec isNumber
+ ifTrue: [ widthOrSpec ]
+ ifFalse:
+ [ widthOrSpec isBlock
+ ifTrue:
+ [ widthOrSpec
+ cull: container
+ cull: self ]
+ ifFalse:
+ [ widthOrSpec
+ ifNil: [ self width ]
+ ifNotNil: [ "Fall back"
+ 50 ] ] ]!
Item was changed:
----- Method: ObjectExplorer>>buildWith: (in category 'toolbuilder') -----
buildWith: builder
| windowSpec treeSpec textSpec |
windowSpec := builder pluggableWindowSpec new.
windowSpec
model: self;
children: OrderedCollection new;
label: #label.
treeSpec := builder pluggableTreeSpec new.
treeSpec
model: self;
nodeClass: self class nodeClass;
roots: #getList;
keyPress: #explorerKey:from:event:;
getSelected: #currentSelection;
setSelected: #currentSelection:;
setSelectedParent: #currentParent:;
menu: #genericMenu:;
autoDeselect: false;
columns: (ObjectExplorerWrapper showContentsInColumns
ifTrue: [{
+ [:listMorph | (listMorph filteredItems collect: [:item |
- [:listMorph | (listMorph scroller submorphs collect: [:item |
item preferredWidthOfColumn: 1]) max].
+ nil "take all the space"}]);
- nil "take all the space"}]
- ifFalse: []);
frame: (0 at 0 corner: 1 at 0.85).
windowSpec children add: treeSpec.
textSpec := builder pluggableTextSpec new.
textSpec
model: self;
menu: #codePaneMenu:shifted:;
help: 'Evaluate expressions for the current tree selection...' translated;
frame: (0 at 0.85 corner: 1 at 1).
windowSpec children add: textSpec.
^ builder build: windowSpec!
More information about the Packages
mailing list