Hi Roberto,
If I understood correctly, I was thinking of something like this:
view nodes: (1 to: 12) forEach: [:n | view shape label. view interaction forwarder. view node: 'Month name'. view shape rectangleWithoutBorder . view interaction forwarder. view node: 'days' forIt:[ view shape label. view interaction forwarder. view nodes: (1 to: 30). view gridLayout. ]. view verticalLineLayout . ]. view gridLayout .
This is having a node for the header a node for the days. For the interaction, using "interaction forwarder" I think makes what you want. Does this work for you?
Vanessa.
On 12/07/2012 05:55 AM, roberto.minelli@usi.ch wrote:
Hi,
It's me again! ;) I'm building a calendar visualization inspired by http://www.xconomy.com/wordpress/wp-content/images/2012/11/skeuo-calendar.pn....
Each node of visualization will be a month that contains:
- An header (with (a) the name of the month and (b) the headers for the columns containing 'Mon' 'Tue' 'Wed' etc.)
- Inner nodes for the days
I created such visualization without the headers and now I'm wondering which is the clearer solution to add them.
As I wrote in the previous mail, I'm using nodes:forEach: to generate the visualization with inner nodes.
The first solution that came to my mind is to nest another nodes:forEach to draw the headers. Let me explain:
view nodes: months forEach: [ :month | … headers := OrderedCollection with: month name . headers addAll: #('Sun' 'Mon' 'Tue' 'Wed' 'Thu' 'Fri' 'Sat' ).
view nodes: headers forFirst: [ :header | 'The first header is an instance of the Month class, which is used as a key in the Dictionary that represents my data.' 'Thus I use that to recover the days for the current month from the dictionary'
days := myData at: header. view nodes: days.
] ]
Notice that nodes:forFirst: is a message I implemented that works like nodes:forEach: but only considers the first node of nodes and attaches the inner nodes only to that element.
I feel this solution is a bit of a hack. How would you do it in a cleaner way?
Another question concerns drag & drop. I set my inner nodes (i.e, days) to be not draggable since I do not want the user to drag them, but I want the user to be able to drag the entire shape representing a month (i.e., outer node). As an effect to drag the month you should explicitly start the dragging from the outer node but this is counter intuitive. I'd like to be able to drag the month also from its inner nodes (days).
Is there a way to propagate the interaction and from the inner nodes I can drag the container shape? ____
Thanks in advance, Roberto
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev