Page 1 of 2

Selector checkmark

PostPosted: Sun Mar 29, 2020 1:35 am
by tektoog
Hey,
After all these years, I feel kind of dumb to ask for that but, I actually just realised that :? :(
When using submenus with the stock selector, how do you get the checkmark to also show up in the first menu branch?
Selector Checkmark.fsm
(3.55 KiB) Downloaded 962 times

Is it only possible, or do I have to use a ruby type selector?
A great thanks in advance for your answers... ;)

Re: Selector checkmark

PostPosted: Sun Mar 29, 2020 2:23 am
by trogluddite
AFAIK, there isn't a way to check a sub-menu heading. It's only possible to check a single item, and it has to be one of the selectable indexes. It works the same way in Ruby, too (and the same for Ruby's option to "grey out" an item).

I'd really like the ability to use arrays to specify multiple ticks or grey-outs - it would be really handy for creating drop-down menus with multiple toggled options etc. There are really only two workarounds...

1) Dynamically modify the options-list string to include your own marker characters when they're needed. This is relatively simple, but it never looks as nice as a proper tick-mark, no matter what characters or font you choose.

2) Build a completely custom selector from basic GUI primitives. This can look very smart, but is a lot harder work, as you'd have to do all of the drawing and mouse handling yourself.

Re: Selector checkmark

PostPosted: Sun Mar 29, 2020 3:07 am
by tektoog
Trog, thanks for your answer… ;)
… which is the one I was afraid of... :(
trogluddite wrote:There are really only two workarounds...

This is the conclusion I came to also… but,... I will live with the mark on the second layer ;) :?
Another small detail, but which has all its importance when you want to present a polished end project…

Should be another small update that would present FS at its best... ;)

Re: Selector checkmark

PostPosted: Sun Mar 29, 2020 9:26 am
by tulamide
I would additionally also love the ability to insert seperator lines, as in other Windows menus. (I had this weird dream that since then feels like it was real, where I accidentally found an ascii sign that inserted a seperator line)

Re: Selector checkmark

PostPosted: Sun Mar 29, 2020 12:05 pm
by Spogg
tulamide wrote:...(I had this weird dream that since then feels like it was real, where I accidentally found an ascii sign that inserted a seperator line)


At least your dreams about FlowStone make sense! :lol:

Re: Selector checkmark

PostPosted: Thu Jun 25, 2020 4:13 pm
by DaveyBoy
Just came accross this post while searching for drop list posts . . . .

Tulamide wrote:
I would additionally also love the ability to insert seperator lines, as in other Windows menus.


well now you can :D

Image

It won't be the prettiest code you've ever seen . . but it works

Trog wrote:
Build a completely custom selector from basic GUI primitives. This can look very smart, but is a lot harder work, as you'd have to do all of the drawing and mouse handling yourself.


Well I've had a lot of Flow_time recently and someone had to do it :)

This is still very much a work in progress. Tick marks and separaters are done . . I'm now looking at sub-menus and greying out . . could take a while!

Windows Menus 32.fsm
(18.46 KiB) Downloaded 872 times

Windows Menus 64.fsm
(18.72 KiB) Downloaded 868 times


Windows Menus 32 - repaired.fsm
Omitted to name wireless input causing cfg file to not be written - fixed
(18.47 KiB) Downloaded 877 times


Enjoy :)

Re: Selector checkmark

PostPosted: Thu Jun 25, 2020 7:16 pm
by tulamide
DaveyBoy wrote:Tulamide wrote:
I would additionally also love the ability to insert seperator lines, as in other Windows menus.


well now you can :D

That's a really nice one! And the code is structered well, it is no problem to follow it. Maybe somewhere in the future we could outsource the graphics elements, so that it is easier for people to adapt it to their style. Other than that: hats off! I can imagine the time it took to create.
Thank you for sharing!

Re: Selector checkmark

PostPosted: Thu Jun 25, 2020 8:41 pm
by RJHollins
That is some nice work DaveyBoy :)

Re: Selector checkmark

PostPosted: Fri Jun 26, 2020 1:09 am
by tektoog
DaveyBoy wrote:well now you can

Haaaaaaaaaaa!!!! :D
What a good soul you are!!! ;)
Nice work there!
I didn't get that part though... Maybe you could explain it?
Code: Select all
   #   ---------------------------------------   
   when 100   #   File - New               Put Droplist finished code here |
   #   if @menus[@menu_over][:items][@item_over] == true                  |
   #      Do Something                                          |
   #   else Do something else                                       |
   #   end                                                      |
   when 101   #   File - Open                                       |      
   #                                                         |
   when 203   #   Edit - Copy                                       |
   #                                                         |
   when 414   #   Options - Midi Stop                                 |
   #                                                         |
   when 502   #   Help - Check for updates                           V
   
   # etc
   
   # etc
   
   #   ---------------------------------------
   end

DaveyBoy wrote:This is still very much a work in progress. Tick marks and separaters are done . . I'm now looking at sub-menus and greying out . . could take a while!

Could you maybe also post a functional example of the edit menu? like implementing the undo/redo, cut/copy/paste functions?
But maybe is it too much demanding? ;)

As Tulamide already said
tulamide wrote:hats off!

It looks really "professional" and polished... Good job!!!

Re: Selector checkmark

PostPosted: Sun Jun 28, 2020 7:49 pm
by DaveyBoy
Thanks for the kind words guys.

Tulamide wrote:
I can imagine the time it took to create.


Writing 'Flow_time' instead of 'Flow-time' is a bit of a givaway :lol:

Tektoog - The best way I can think of to explain is to think of banks of switches.
The first bank (File) starts from 100 the second bank {Edit) from 200 . . and so on.

This could all have been put in the mouseLDown method but I thought it better to do it this way

The input numbers are virtual inputs (as opposed to physical inputs) to the Ruby code box and when you select or tick/untick a menu item the event method sees this and acts accordingly. You just need to put some logic in the appropriate event number to make it do what you want it to do.

in the attached example I've implemented the File - Open item and all the Options items. The latter are changing the state of boolean variables. I've put the outputs in the watch panel (was easier for me :) )

Windows Menus 32 v1.0.1.fsm
(23.76 KiB) Downloaded 882 times


I hope this explains it better :D

in my original reply, in the 32 bit version I omitted to name a wireless input which would have caused the config file not to be written, this has now been fixed.