> Could anyone suggest me a sample code about the possibility to move a =
> slider by the up/down keys?
> Thank you in advance.
> Ivano

Hi,
I don't have time right know to build an example, but looking at the Fl_Slider 
code we have:
int Fl_Slider::handle(int event, int X, int Y, int W, int H) {
..
 case FL_KEYBOARD :
    switch (Fl::event_key()) {
      case FL_Up:
        if (horizontal()) return 0;
        handle_push();
        handle_drag(clamp(increment(value(),-1)));
        handle_release();
        return 1;
      case FL_Down:
        if (horizontal()) return 0;
        handle_push();
        handle_drag(clamp(increment(value(),1)));
        handle_release();
        return 1;
      case FL_Left:
        if (!horizontal()) return 0;
        handle_push();
        handle_drag(clamp(increment(value(),-1)));
        handle_release();
        return 1;
      case FL_Right:
        if (!horizontal()) return 0;
        handle_push();
        handle_drag(clamp(increment(value(),1)));
        handle_release();
        return 1;
      default:
        return 0;
    }
.
}

So, by the code, we know that we already have support for up and down, but just 
when the component is vertical. If you want to have up and down keys changing a 
horizontal slider, then you probably are going to need to subclass Fl_Slider 
and override 'int Fl_Slider::handle(int event, int X, int Y, int W, int H)' 
method handling Fl_Up and Fl_down to handle both cases(horintal and vertical), 
and the other events you could just forward to Fl_Slider::handle().
Sorry for not post a complete solution, but I think that this ideas could solve 
your problem!
J. Marcelo Auler
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to