Hi Ben!
...where the two labels overlap. I think you would gain a lot if you could do something like the following...
n1 := ROElement spriteOn: 'XX___'.
n1 + (shape1 := ROLabel new text: #model).
n1 + (ROLabel new text: #bounds; offset: [ shape1 bottomLeftCorner ] ).
rawView add: n1.
I have improved the way shapes are drawn. If you update, you can then create the following class:
-=-=-=-=-=-=-=-=-=-=-=-=
ROShape subclass: #ROTranslatingShape
instanceVariableNames: 'offset'
initialize
super initialize.
offset := 0 @ 0
chainedDrawOn: aCanvas for: aROElement
aROElement translateBy: offset negated.
super chainedDrawOn: aCanvas for: aROElement.
aROElement translateBy: offset.
offset: aPoint
offset := aPoint
-=-=-=-=-=-=-=-=-=-=-=-=
I've attached the .cs for convenience.
You can then do the following:
el := ROElement new + ROBorder + (ROTranslatingShape new offset: 20 @ 20) + ROBox .
el extent: 50 @ 50.
el @ RODraggable.
rawView add: el.
Without the translation, you have
el := ROElement new + ROBorder + ROBox .
el extent: 50 @ 50.
el @ RODraggable @ ROPopup.
rawView add: el.
I haven't included ROTranslatingShape in Roassal. I first would like to see use cases of it.
Let me know how it goes.
Cheers,
Alexandre
Alexandre Bergel wrote:
Hi Ben,
Currently no. We definitely need a better way to specific layouts and their composition. However this will take time before we have this.
How would you like to specific the layout?
Cheers,
Alexandre
On Aug 30, 2012, at 6:10 PM, Ben Coman
<btc@openInWorld.com>
wrote:
I have been looking at the ROExample "Nesting" examples and expanded #nesting2 with another level as shown in the code below, such that there is the outer view, middle "#1" nodes and inner "#2" nodes. However the initial state of this has much of the middle node1 and inner node2 nodes overlapping.
How can these be made for the circle layout to leave spacing between the middle node1 nodes?
cheers -ben
--------------------
| view nodes1 |
view := ROView new.
view add: (ROElement sprite addAll: (nodes1 := ROElement spritesOn: (1 to: 10))).
nodes1 do: [:n | n addShape: ROLabel].
nodes1 do:
[ :node1 |
( (node1 model) *100+1 to: (node1 model)*100+5 ) do:
[ :x |
node1 add: ( (ROElement spriteOn: x) addShape: ROLabel).
].
ROGridLayout on: node1 elements.
].
ROCircleLayout on: nodes1.
view openInWindow.
_______________________________________________