[squeak-dev] The Trunk: ToolBuilder-Morphic-mt.115.mcz

Chris Muller asqueaker at gmail.com
Thu Apr 2 15:05:01 UTC 2015


On Thu, Apr 2, 2015 at 1:54 AM,  <commits at source.squeak.org> wrote:
> Marcel Taeumel uploaded a new version of ToolBuilder-Morphic to project The Trunk:
> http://source.squeak.org/trunk/ToolBuilder-Morphic-mt.115.mcz
>
> ==================== Summary ====================
>
> Name: ToolBuilder-Morphic-mt.115
> Author: mt
> Time: 2 April 2015, 8:54:11.711 am
> UUID: 873458fe-19e8-0449-a9d1-c52476bc1077
> Ancestors: ToolBuilder-Morphic-cmm.114
>
> Revert something that was re-introduced in cmm.112 but already reverted before.

Okay, I thought you wanted your version from April 1st.  Thanks for
reverting back to Andreas' version instead of making a new copy of it.

> #selectPath:in: must send #setSelectedMorph: because both are callbacks from #update: within the tree morph.
>
> #selection only talks to the model. We do not have an equivalent for tree-path selection, which talks to the model, yet.
>
> =============== Diff against ToolBuilder-Morphic-cmm.114 ===============
>
> Item was changed:
>   ----- Method: PluggableTreeMorph>>selectPath:in: (in category 'selection') -----
>   selectPath: path in: listItem
> +       path isEmpty ifTrue: [^self setSelectedMorph: nil].
> -       path isEmpty ifTrue: [^self selection: 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
> -                               ^self selection: each complexContents
>                         ].
> +                       each firstChild ifNil: [^self setSelectedMorph: nil].
> -                       each firstChild ifNil: [^self selection: nil].
>                         ^self selectPath: path allButFirst in: each firstChild
>                 ].
>         ].
> +       ^self setSelectedMorph: nil
> -       ^self selection: nil
>
>   !
>
> Item was changed:
>   ----- Method: PluggableTreeMorph>>setSelectedMorph: (in category 'selection') -----
>   setSelectedMorph: aMorph
>         selectedWrapper := aMorph complexContents.
> +
>         "Let the model now about the selected object, not wrapper."
>         setSelectionSelector ifNotNil: [:symbol |
>                 model
>                         perform: symbol
> +                       with: (selectedWrapper ifNotNil: [:w | w item])].
> +
> -                       with: (selectedWrapper ifNotNil: [ selectedWrapper 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: [:w | w parent ifNotNil: [:pw | pw item]])].!
> -                       with: (selectedWrapper ifNotNil: [selectedWrapper parent ifNotNil: [: parentWrapper | parentWrapper item]])].!
>

I'm not sure why you like that style better but, okay.  I found it
slightly harder to read due to the unnecessary block args.


More information about the Squeak-dev mailing list