Chris Muller uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-cmm.109.mcz ==================== Summary ==================== Name: ToolBuilder-Morphic-cmm.109 Author: cmm Time: 1 April 2015, 11:12:32.023 am UUID: 109fa949-8213-4e07-855c-90ad83b6ab07 Ancestors: ToolBuilder-Morphic-mt.111 - PluggableTreeMorph support for Vertical Smart Splitters. - Let single-level filtering also be a navigation gesture. - After filtering a Tree, refit the column-widths to the filtered results. - SimpleHierarchicalListMorph support mouseOverForKeyboardFocus. - Fix selection rendering in PluggableTreeMorph (FileList and SqueakMap). =============== Diff against ToolBuilder-Morphic-mt.111 =============== Item was added: + ----- Method: PluggableTreeMorph>>bottomVisibleRowIndex (in category 'geometry') ----- + bottomVisibleRowIndex + | itemAtBottom | + itemAtBottom := self itemFromPoint: self bottomLeft + (3 @ -3). + ^ itemAtBottom + ifNil: [ scroller submorphs size ] + ifNotNil: + [ : item | scroller submorphs indexOf: item ]! Item was added: + ----- Method: PluggableTreeMorph>>charactersOccluded (in category 'geometry') ----- + charactersOccluded + ^ self visibleItems + inject: 0 + into: + [ : sum : each | sum + each charactersOccluded ]! Item was changed: ----- Method: PluggableTreeMorph>>filterTree (in category 'filtering') ----- filterTree + self hasFilter ifFalse: + [ self removeFilter. + ^ self ]. - - self hasFilter ifFalse: [ - self removeFilter. - ^ self]. - self indicateFiltered. - "Clean up the tree." (self selectedMorph + ifNil: [ self roots ] + ifNotNil: + [ : m | {m} ]) do: + [ : item | | filteredItems | + item applyFilter: lastKeystrokes. + item visible ifFalse: + [ "Do not hide the item where the filter is based on." + item show. + item isExpanded ifFalse: [ item toggleExpandedState ] ]. + filteredItems := self filteredItems. + "If configured as a navigation tool, advance the selection." + (PluggableTreeMorph maximumSearchDepth = 1 and: [ PluggableTreeMorph filterByLabelsOnly not ]) ifTrue: + [ (filteredItems notEmpty and: [ selectedMorph ~= filteredItems last ]) ifTrue: + [ self setSelectedMorph: (filteredItems after: selectedMorph). + selectedMorph isExpanded ifFalse: [ selectedMorph toggleExpandedState ] ] ] ]. + self adjustSubmorphPositions! - ifNil: [self roots] - ifNotNil: [:m | {m}]) do: [:item | - item applyFilter: lastKeystrokes. - item visible ifFalse: [ - "Do not hide the item where the filter is based on." - item show. - item isExpanded ifTrue: [item toggleExpandedState]]]. - - self adjustSubmorphPositions.! Item was added: + ----- Method: PluggableTreeMorph>>filteredItems (in category 'filtering') ----- + filteredItems + "Answer the items which visible because they matched the current filters." + ^ self items select: [ : each | each visible ]! Item was added: + ----- Method: PluggableTreeMorph>>items (in category 'accessing') ----- + items + ^ scroller submorphs! Item was added: + ----- Method: PluggableTreeMorph>>keyboardFocusChange: (in category 'event handling') ----- + keyboardFocusChange: aBoolean + aBoolean ifFalse: + [ PluggableListMorph clearFilterAutomatically ifTrue: + [ self hasFilter ifTrue: [ self removeFilter ] ] ]! Item was changed: ----- Method: PluggableTreeMorph>>selectPath:in: (in category 'selection') ----- selectPath: path in: listItem path isEmpty ifTrue: [^self setSelectedMorph: nil]. listItem withSiblingsDo: [:each | (each complexContents item = path first) ifTrue: [ each isExpanded ifFalse: [ each toggleExpandedState. self adjustSubmorphPositions. ]. each changed. path size = 1 ifTrue: [ ^self setSelectedMorph: each ]. each firstChild ifNil: [^self setSelectedMorph: nil]. ^self selectPath: path allButFirst in: each firstChild ]. ]. ^self setSelectedMorph: nil ! Item was changed: ----- Method: PluggableTreeMorph>>setSelectedMorph: (in category 'selection') ----- setSelectedMorph: aMorph selectedWrapper := aMorph complexContents. + self selection: selectedWrapper. - "Let the model now about the selected object, not wrapper." setSelectionSelector ifNotNil: [:symbol | model perform: symbol + with: (selectedWrapper ifNotNil: [ selectedWrapper item ])]. - with: (selectedWrapper ifNotNil: [:w | w item])]. "The model may not have access to the parent object in terms of this tree structure." setSelectedParentSelector ifNotNil: [:symbol | model perform: symbol + with: (selectedWrapper ifNotNil: [selectedWrapper parent ifNotNil: [: parentWrapper | parentWrapper item]])].! - with: (selectedWrapper ifNotNil: [:w | w parent ifNotNil: [:pw | pw item]])].! Item was added: + ----- Method: PluggableTreeMorph>>topVisibleRowIndex (in category 'geometry') ----- + topVisibleRowIndex + ^ scroller submorphs indexOf: (self itemFromPoint: self topLeft+(3@3))! Item was added: + ----- Method: PluggableTreeMorph>>visibleItems (in category 'geometry') ----- + visibleItems + ^ self items + copyFrom: self topVisibleRowIndex + to: self bottomVisibleRowIndex! |
Hey Chris,
yay, we need to strive for more consistency in the tools. This is a step in the right direction. :-) Here are some minor remarks: #setSelectedMorph: - Calling #selection: from within that is against the rules. This is only called as a reaction to model change. See #update:. #filterTree - Maybe we should not filter the children of the current selection but start with the siblings? Best, Marcel |
Free forum by Nabble | Edit this page |