15 void Slider::set_value(double v)
17 double old_value = value;
25 unsigned steps = static_cast<unsigned>((v-min)/step+0.5);
26 value = min+steps*step;
31 signal_value_changed.emit(value);
36 void Slider::set_range(double a, double b)
43 void Slider::set_step(double s)
49 void Slider::start_drag(int p)
53 drag_start_value = value;
57 void Slider::drag(int p)
60 set_value(drag_start_value+(p-drag_start_pos)*(max-min)/drag_area_size);
63 void Slider::end_drag()
70 Slider::Loader::Loader(Slider &s):
71 DataFile::DerivedObjectLoader<Slider, Widget::Loader>(s)
73 add("range", &Slider::min, &Slider::max);
74 add("step", &Slider::step);
75 add("value", &Slider::value);