On 17 Jun 2008, at 19:11, Jane wrote:

> int
> SpinnerM::handle(int ev)
> {
>     int res = Fl_Spinner::handle(ev);
>     if (ev == FL_MOUSEWHEEL)
>     {
>         int dy = Fl::event_dy();
>         double v1 = value();
>         if (v1 + dy == minimum() || v1 + dy == maximum())
>             return 1;

A couple of extra points:

1: the test

        (v1 + dy) == minimum()...

will almost certainly fail on some systems, since dy is not always  
+/-1. It is very often +/-1 on win32 systems, but other OS (like this  
Mac) return a bigger range of values. So...

        ...(v1 + dy) < minimum()...

might be more like it.

2: are you sure about the sign of dy? I think it may have the  
opposite sign to what you might expect, so (v1 - dy) might be more  
what you'd want...



>         value(v1 + dy);
>         do_callback();
>         return 1;
>     }
>     return res;
> }

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to