X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fslider.cpp;h=7123458c0e41b7268ce44b7c556543dfd2af9aa1;hb=deebbb5d23f7bdad0e25fe7eeb0a3e5a4eaf761f;hp=7a0029e05b79e430839bf560d5ff1fe7757c33ba;hpb=2b70e8801c43875ed3f4135bdd0141265cff0312;p=libs%2Fgltk.git diff --git a/source/slider.cpp b/source/slider.cpp index 7a0029e..7123458 100644 --- a/source/slider.cpp +++ b/source/slider.cpp @@ -27,7 +27,10 @@ void Slider::set_value(double v) } if(value!=old_value) + { signal_value_changed.emit(value); + rebuild(); + } } void Slider::set_range(double a, double b) @@ -48,7 +51,7 @@ void Slider::start_drag(int p) dragging = true; drag_start_pos = p; drag_start_value = value; - state |= ACTIVE; + set_state(ACTIVE); } void Slider::drag(int p) @@ -60,22 +63,17 @@ void Slider::drag(int p) void Slider::end_drag() { dragging = false; - state &= ~ACTIVE; + clear_state(ACTIVE); } Slider::Loader::Loader(Slider &s): - Widget::Loader(s) + DataFile::DerivedObjectLoader(s) { add("range", &Slider::min, &Slider::max); add("step", &Slider::step); add("value", &Slider::value); } -Slider &Slider::Loader::get_object() const -{ - return static_cast(obj); -} - } // namespace GLtk } // namespace Msp