1
// ----------------------------------------------------------------------------
5
// This file is part of flrig.
7
// flrig is free software; you can redistribute it and/or modify
8
// it under the terms of the GNU General Public License as published by
9
// the Free Software Foundation; either version 3 of the License, or
10
// (at your option) any later version.
12
// flrig is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
// GNU General Public License for more details.
17
// You should have received a copy of the GNU General Public License
18
// along with this program. If not, see <http://www.gnu.org/licenses/>.
19
// ----------------------------------------------------------------------------
21
//======================================================================
22
// class wheel_slider - based on Fl_Slider
23
// class wheel_value_slider - based on Fl_Value_Slider
24
//======================================================================
27
#include "ValueSlider.h"
29
int Fl_Wheel_Slider::handle(int event)
31
if (event != FL_MOUSEWHEEL || !Fl::event_inside(this))
32
return Fl_Slider::handle(event);
34
if ( !((d = Fl::event_dy()) || (d = Fl::event_dx())) )
35
return Fl_Slider::handle(event);
37
value(clamp(increment(value(), d)));
42
int Fl_Wheel_Value_Slider::handle(int event)
44
if (event != FL_MOUSEWHEEL || !Fl::event_inside(this))
45
return Fl_Value_Slider::handle(event);
47
if ( !((d = Fl::event_dy()) || (d = Fl::event_dx())) )
48
return Fl_Value_Slider::handle(event);
50
value(clamp(increment(value(), d)));