Hi again,
I just improved and fixed behavior of menus. Now you should not get all the strange behavior as before.
So you can define menus and submenus with colors and highlights, there is an Highlight when the mouse enter the menus, the submenu open but disapear when you go somewhere out of the menu or the submenu. There is a second stronger highlight when the menu is clicked. When clicked, the menu is locked and should not disapear unless you click again or go to another menu.
Try it by yourself with these examples: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
RTAnimatedScatterPlotExample new exampleEvolutionOfGraphET2 inspect.
RTMenuBuilderExamples new example06
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
sincerely,
Pierre
2014-12-11 18:35 GMT-03:00 Alexandre Bergel alexandre.bergel@me.com:
Nice. It is also a good way to showcase some of Roassal strengths about
interaction (well, until we can say put morphic menus instead, or improve said morphic menus to be as simple to create).
I hope the base behavior of the menus is available separately so that we
can make use of it elsewhere (legends, labels, etc...), given how valuable it can be :)
Indeed! This is an excellent exercise!
Just to give a bit of context: We are not trying to make Roassal a GUI framework. Morphic and Spec do it nicely and there is no reason to compete. Instead, we just want to provide a very minimal set of widgets (for now buttons, simple menu, labels) to smoothen the user experience when interacting with data.
You'll end up very close; but this can be a nice reminder of how simple
the Morphic API should be in many cases.
Yes!
Alexandre
Thierry
Cheers, Pierre & Alexandre
On Dec 11, 2014, at 6:16 PM, Pierre CHANSON <chans.pierre@gmail.com mailto:chans.pierre@gmail.com> wrote:
Hi everyone,
I changed the RTMenuBuilder in Roassal2, especially it's behavior, default colors and added more features as the definition of the highlight color.
I also changed a bit the architecture but could still be a lot
improved.
We can also add a lot of different features to really specify the look of the menu using the builder so let me know if you have any ideas, comments.
You can have a look with the example 06:
-=-=-=-=-=-=-=-=-=-=-=-=-=-= | v b | v := RTView new.
b := RTMenuBuilder new view: v. b menu: 'add' submenu: '10' callback: [ | es | es := (RTLabel new color: [ :tt| Color random ]) elementsOn: (1 to: 10). es do: [ :e | e translateTo: ((500 atRandom @ 500 atRandom) - (250 @ 250)) ]. v addAll: es. v canvas signalUpdate ].
b menu: 'add' submenu: '20' callback: [ | es | es := (RTLabel new color: [ :tt| Color random ]) elementsOn: (1 to: 20). es do: [ :e | e translateTo: ((500 atRandom @ 500 atRandom) - (250 @ 250)) ]. v addAll: es. v canvas signalUpdate ].
b menu: 'remove' submenu: 'odd' background: (Color blue alpha:0.3) callback: [ (v elements select: [ :e | e model odd ]) do: #remove. v canvas signalUpdate ]. b menu: 'remove' submenu: 'even' background: Color red callback: [ (v elements select: [ :e | e model even ]) do: #remove. v canvas signalUpdate ].
b menu: 'shuffle' highlight: Color lightBlue callback: [ | tra | tra := RTSmoothLayoutTranslator new. tra nbCycles: 0.5. (v elements do: [ :e | tra translate: e to: ((500 atRandom @ 500 atRandom) - (250 @ 250)) ]) ].
v open
sincerely yours,
Pierre Chanson _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch mailto:Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev