The Trunk: ToolBuilder-Morphic-mt.115.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: ToolBuilder-Morphic-mt.115.mcz

commits-2
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.

#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]])].!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: ToolBuilder-Morphic-mt.115.mcz

Chris Muller-3
On Thu, Apr 2, 2015 at 1:54 AM,  <[hidden email]> 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.