Hello,
Is it possible to do popup views in Roassal 2 as we could do with ROPopupView? I didn't find any example related to this in Roassal 2. tx, Usman _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi Usman,
Yes, you can. In Roassal2, there is no more PopupView. We have introduced the notion of group, and you can set group in the popup. Consider the following example: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | v els | v := RTView new. v @ RTDraggableView. els := (RTBox new size: 20) elementsOn: (1 to: 100). els + RTLabel. els @ (RTPopup new group: [ :group :el | el model timesRepeat: [ group add: (RTBox new size: 10; color: (Color purple alpha: 0.5)) element ]. RTGridLayout on: group. ]). els @ RTDraggable. v addAll: els. RTGridLayout on: els. v open. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Here is the result with having the mouse above “6”. The key is the following: RTPopup new group: [ :group :el | … ] group is an empty group. You need to add what you want to be displayed in the popup. el is the element on which the mouse is above. Does this help? Cheers, Alexandre On Mar 19, 2014, at 11:30 AM, Usman Bhatti <[hidden email]> wrote: Hello, -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Yes it helps.
I did with the view builder and it worked! view := RTMondrianViewBuilder new. view interaction noInteractions. view interaction popup group: [ :group :el |
el model timesRepeat: [ group add: (RTBox new size: 10; color: (Color purple alpha: 0.5)) element.
]. RTGridLayout on:group ]. view shape rectangle size: #yourself. view nodes: (1 to:50).
view gridLayout. view open Is there a way to add a background color to the popup because I tried to hack into the code but could not succeed. Usman On Wed, Mar 19, 2014 at 8:24 PM, Alexandre Bergel <[hidden email]> wrote:
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi!
-=-=-=-=-=-=-=-=-=-= | view | view := RTMondrianViewBuilder new. view interaction noInteractions. view interaction popup group: [ :group :el | | background elements | elements := OrderedCollection new. background := (RTBox new color: (Color green alpha: 0.5)) element. el model timesRepeat: [ elements add: (RTBox new size: 10; color: (Color purple alpha: 0.5)) element. ]. RTGridLayout on: elements. RTNest new centerOn: background elements: elements. group add: background . group addAll: elements ]. view shape rectangle size: #yourself. view nodes: (1 to:50). view gridLayout. view open -=-=-=-=-=-=-=-=-=-= For the curious, I have attached a screenshot Alexandre On Mar 21, 2014, at 8:48 AM, Usman Bhatti <[hidden email]> wrote: Yes it helps. -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Tx Alex.
Two questions: - do we have a layout with a legend because I would like to put a title on the popup (top left/center). As it is the popup in Roassal2 is an RTGroup (collection), I cannot do much with it from the visualization point of view. I am thinking it might be worthwhile to create an abstraction for the canvas of the popup view because it is used quite often and it was present in Roassal1.
- when the visualization is huge, the camera is pointed to the bottom right of the canvas. Is there a way to focus the camera @ the top of the visualization. usman On Fri, Mar 21, 2014 at 1:46 PM, Alexandre Bergel <[hidden email]> wrote:
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
- do we have a layout with a legend because I would like to put a title on the popup (top left/center). As it is the popup in Roassal2 is an RTGroup (collection), I cannot do much with it from the visualization point of view. I am thinking it might be worthwhile to create an abstraction for the canvas of the popup view because it is used quite often and it was present in Roassal1. Currently we have no explicit support for legend. This is something that has to be added manually therefore. Here is a small example: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | view | view := RTMondrianViewBuilder new. view interaction noInteractions. view interaction popup group: [ :group :el | | background elements cls legend1 legend2 | elements := RTGroup new. background := (RTBox new color: (Color green alpha: 0.8)) element. el model timesRepeat: [ cls := RTEllipse. 50 atRandom > 25 ifTrue: [ cls := RTBox ]. elements add: (cls new size: 10; color: (Color purple alpha: 0.5)) element ]. RTGridLayout on: elements. "Legend Good" legend1 := RTGroup new. legend1 add: (RTBox new size: 10; color: (Color purple alpha: 0.5)) element. legend1 add: (RTLabel elementOn: '= Good'). RTHorizontalLineLayout on: legend1. "Legend Bad" legend2 := RTGroup new. legend2 add: (RTEllipse new size: 10; color: (Color purple alpha: 0.5)) element. legend2 add: (RTLabel elementOn: '= Bad'). RTHorizontalLineLayout on: legend2. RTVerticalLineLayout new gapSize: 0; on: (Array with: legend1 with: legend2 with: elements). RTNest new centerOn: background elements: (Array with: legend1 with: legend2 with: elements). group add: background. group addAll: legend1. group addAll: legend2. group addAll: elements ]. view shape rectangle size: #yourself. view nodes: (1 to:50). view gridLayout. view open -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Free forum by Nabble | Edit this page |