STR #2

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 #2

Application:FLTK Library
Status:4 - Pending
Priority:1 - Request for Enhancement, e.g. asking for a feature
Scope:3 - Applies to all machines and operating systems
Subsystem:Core Library
Summary:Unclamped ROLLER with delta()
Created By:dr_steve.users.sf
Assigned To:matt
Fix Version:Unassigned
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

Post File ]
Name/Time/Date Filename/Size top right image
#1 dr_steve.users.sf
22:32 Apr 04, 2003
bottom left image   bottom right image

Trouble Report Comments:

Post Text ]
Name/Time/Date Text top right image
#1 dr_steve.users.sf
22:30 Apr 04, 2003
 (Sorry if this is partially duplicated. Stupid

I am relatively new to fltk, and am experimenting with
it for some cross-platform OpenGL work. To control
certain environments, I need an unclamped Fl_Roller
with a delta() function.

1. Unclamped. Is not bounded by any range, will keep
rolling endlessly in either direction.
2. Delta. In addition to value(), double delta() that
returns the change since the last event.

This is relatively easy to implement by subclassing
Fl_Roller and cut/pasting a little:

class Fl_Delta_Roller: public Fl_Roller {
double delta_;
int handle(int event);
void handle_push() { delta_ = 0;
FL_EXPORT void handle_drag(double newvalue) {
delta_ = newvalue - value();

Fl_Delta_Roller(int x, int y, int w, int h,
char* l=NULL): Fl_Roller(x, y, w, h, l) {}
double delta() { return delta_; }
int Fl_Delta_Roller::handle(int event) {
static int ipos;
int newpos = horizontal() ? Fl::event_x() :
switch (event) {
case FL_PUSH:
ipos = newpos;
return 1;
case FL_DRAG:
return 1;
return 1;
return 0;

The main changes are to eliminate the clamp() from the
FL_DRAG event in handle(int event), and to put shells
around handle_push and handle_drag to track individual
events. Oh yeah, add delta() to return the delta_.

Can this be incorporated into an upcoming release
(assuming fltk 2.0)? Add in a Roller/Valuator
function clamping(bool) to allow the user to disable
clamping and the bits for delta and there is no need
for the separate Fl_Delta_Roller class. Likewise,
other valuators (dial) may have use of this as well.


#2 dr_steve.users.sf
22:31 Apr 04, 2003
Blast, the tabs were destroyed and the code is highly
difficult to read.  I'm attaching the excerpt as a
separate file.
#3 mike
22:31 Apr 04, 2003
Sounds like a useful addition, even for 1.1...

Will look into it...
17:42 May 15, 2003
I would echo the usefullness of an unclamped roller. This would be useful in 3D where you want to continuously dolly through 360 degrees.  
#5 mike
18:18 May 25, 2003
Reassigned to 2.0; no new features for 1.x...  
#6 fabien
04:45 Apr 12, 2006
I did that uncampled feature as well with a complete graphical mixing table software implementation project I developed once.

Maybe I should have a look.

Mike, will I make your day today ? (i spent some time to understand what that meant in english) :)
#7 dejan
08:37 Dec 15, 2007
I think this can be added into the original Roller. Constructor would accept an additional argument clamped, which by default would be true. If false it will behave as DeltaRoller explained in this request.
What You say?
#8 mike
09:12 Dec 15, 2007
The constructor is the wrong place - just make it a separate method to turn clamping on/off, which should probably be in the base class so all valuators can be clamped or unclamped...  
bottom left image   bottom right image

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 ''.