Hi Alex,
This starts to look good.
The next thing is to specify where nested children go :). For example, I
would want to be able to specify that the nested children should be in the
blue rectangle. For this, we would probably need something in the direction
of a ChildrenShape :). Also, the other challenge is to not let the RTNest
make the decision of where to place the children.
What do you say?
Doru
On Sun, Apr 27, 2014 at 9:37 PM, Alexandre Bergel
<alexandre.bergel(a)me.com>wrote;wrote:
Hi!
I’ve worked a bit on the composition.
So far, we have three ways to compose shapes:
1 - RTCompositeShape. This is the composition that is used with +
-=-=-=-=-=-=-=-=-=-=
| v s1 s2 e |
v := RTView new.
s1 := RTBox new size: #yourself; color: Color blue.
s2 := RTEllipse new size: [ :value | value / 2 ]; color: Color red.
e := (RTCompositeShape with: s1 with: s2) elementOn: 50.
v add: e.
v
-=-=-=-=-=-=-=-=-=-=
2 - RTHorizontalCompositeShape
Here is the effect of replacing RTCompositeShape
by RTHorizontalCompositeShape in the previous example
3 - RTVerticalCompositeShape
All the shapes composed with RTCompositeShape have the same size. This is
useful for example if you do: (RTBox new + RTLabel) elementOn: ‘Hello
World’. You typically want the label and the box have the same size. When
you want to line up shapes, I guess you do not care of having all the
shapes of the same size.
This new behavior for horizontal and vertical should address what you need
Leo.
The nice thing, in my opinion, is that we should be able to have any kind
of strategy, for example, a grid of shapes. This is really a matter of
small programming.
Let me know if this is what you expect. Just update Roassal for this.
Cheers,
Alexandre
On Apr 25, 2014, at 5:55 AM, Leo Perard <leo.perard(a)gmail.com> wrote:
On Thu, Apr 24, 2014 at 10:00 PM, Alexandre Bergel <
alexandre.bergel(a)me.com> wrote:
How can I reproduce this bug? What do you do exactly?
With this example you can reproduce it easily :
view := RTView new.
box := RTBox new color: Color green.
label := RTLabel new.
el := (RTCompositeShape new shape1: box; shape2: label).
el := (RTHorizontalCompositeShape new shape1: el; shape2: (RTEllipse new
color: Color red)) elementOn: 'Hello World'.
view add: el.
view addMenu: 'Color' callback: [ el shape shape2 color: Color blue. el
update. view signalUpdate ].
view open
And even if I don't have a composite shape composed with another composite
shape, the update is not good.
--
Leo Perard
_______________________________________________
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
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev