Re: [fltk.general] How to make a 3 position toggel switch

2013-04-21 Thread chris
Fl_Radio_Button may be what you need (if I understand your description
 correctly).

Cheers,
chris


I need to make a 3 position (on-off-on) toggle switch widget.

Can someone to point me to a toggle switch widget?

If one does not exist, can someone point me to an example/tutorial on how to 
make a custom toggle switch widget?

Thank You,

Frank G. Haymes
___
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk


Re: [fltk.general] How to make a 3 position toggel switch

2013-04-21 Thread Greg Ercolano
On 04/21/13 02:09, Ian MacArthur wrote:
 Can someone to point me to a toggle switch widget?
 
 There's no 3-position switch that I'm aware of.
 When I needed this, I just put 3 radio-buttons in a group and that was fine - 
 and trivial to do.

Ya, or an Fl_Menu_Button with three items in it -- less screen real 
estate.
Use that if the user only needs to see which state the switch is in.

Otherwise, use the radio button approach if it's more useful that the 
user
see all three things, and which one of the three is on.

A toggle switch or 3 position dial would simulate the real world 
better,
but is perhaps not a good paradigm visually.

But if you really want to go that route, paint three images of the 
switch
in the various positions, and derive a class from Fl_Button that has one
of the switch images assigned as the image() for the button, and each 
hit
of the button switches the image() to show the other painting of the 
switch.
Set it up so that each hit toggles to the next of the three states. Use 
a char
or int to keep track of the current state, and just cycle through it 
each click;
0-1-2-1-0-1-2.. or 0-1-2-0-1-2.. whichever is best.
___
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk