FLTK logo

STR #1839

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]

Return to Bugs & Features | Roadmap 2.0 | Post Text | Post File | SVN ⇄ GIT ]

STR #1839

Application:FLTK Library
Status:5 - New
Priority:1 - Request for Enhancement, e.g. asking for a feature
Scope:3 - Applies to all machines and operating systems
Summary:Dial should have no bounds
Created By:Jonathan
Assigned To:Unassigned
Fix Version:Unassigned
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

Post File ]

No files

Trouble Report Comments:

Post Text ]
Name/Time/Date Text  
#1 Jonathan
03:19 Nov 30, 2007
It would be useful to have a dial-widget without bounds.
I wanted to use it for an angle-input and it is realy bad, if the user wants to change from 355 to 5 degrees, and has to go round the whole circle.
It would be realy nice to have an option for this.
#2 thorha
16:28 Nov 30, 2007
This is easy to do with the existing functionality.

Make your callback something like this:

void angle_cb(Widget *v, void *ob)
        Dial *sd;

        sd = (Dial*)v;

        float val;
        float angle;

        val = (float) sd->value();

        // Limit values, this makes the dial to rotate without limits
        if(val>0.75) sd->value(val-0.5);
        if(val<0.25) sd->value(val+0.5);

        // Get the range back
        angle = 720 * val;
        if (angle >= 360.0) angle-=360.0;

// Do something with angle


When you create the dial you do it like this:

test_dir = new LineDial(505,130,200,200,"Test dial angles");

Thor Henning Amdahl

Return to Bugs & Features | Post Text | Post File ]


Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.