Easy!
Just add the line "outterNode resizeStrategy: ROShrinkingParent new."
The complete script is:
-=-=-=-=-=-=-=-=-=-=-=-=
outterNode := view node: 'hello' forIt: [
view shape rectangle withText.
view interaction on: ROMouseClick do: [ :event |
outterNode removeElement: event element.
ROHorizontalLineLayout on: outterNode elements.
ROShrikingSize on: outterNode.
event element signalUpdate ].
view nodes: (1 to: 20).
].
"Make the outter node shrink when it can"
outterNode resizeStrategy: ROShrinkingParent new.
-=-=-=-=-=-=-=-=-=-=-=-=
You need to update Roassal to 1.120 for this however.
Cheers,
Alexandre
On Sep 15, 2012, at 11:07 PM, Ben Coman <btc(a)openInWorld.com> wrote:
Thanks Alexandre. That works well for when elements
are removed. Could you also extend the example so that the bounding box shrinks
dynamically as items are dragged around.
For example, if I drag for node '10' downwards, currently the parent extent grows
dynamically, but if I move '10' back to its original position, it does not
shrink.
cheers -ben
Alexandre Bergel wrote:
Hi Ben!
You will find a first shoot of this feature. Using the Mondrian DSL, you can have:
outterNode := view node: 'hello' forIt: [
view shape rectangle withText.
view interaction on: ROMouseClick do: [ :event |
outterNode removeElement: event element.
ROHorizontalLineLayout on: outterNode elements.
ROShrikingSize on: outterNode.
event element signalUpdate ].
view nodes: (1 to: 20).
].
It is also available from the Example/Mondrian/interactions/shrikingSize menu.
In Roassal 1.118
Cheers,
Alexandre
On Sep 10, 2012, at 3:01 PM, Ben Coman
<btc(a)openInWorld.com>
wrote:
Just one more thing that has been playing on my
mind. It is really a nice feature that the parent element grows when the child is moved
past its boundary, but would be more good if it also shrank when the child element is
moved back towards center.
cheers ben
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.