X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fslider.h;h=a2395766a258d6182a04d69fef4a1ccd5ee7bcb7;hb=08b66dd1b4478fef61525ad2dad1a1fb54eab0f0;hp=d4ae46b632040fe9b6fb8dd8c90a21a7a5125af8;hpb=c062ca892fc6e10f74a76991b5d4b4349c046b5f;p=libs%2Fgltk.git diff --git a/source/slider.h b/source/slider.h index d4ae46b..a239576 100644 --- a/source/slider.h +++ b/source/slider.h @@ -7,21 +7,46 @@ namespace Msp { namespace GLtk { +/** +Sliders are used to adjust numeric values visually. This class provides the +common interface for sliders - see classes HSlider and VSlider for concrete +variations. +*/ class Slider: public Widget { public: + class Loader: public DataFile::DerivedObjectLoader + { + public: + Loader(Slider &); + }; + sigc::signal signal_value_changed; - void set_value(double); - void set_range(double, double); - void set_step(double); - double get_value() const { return value; } protected: double min, max; double value; double step; - Slider(const Resources &); + bool dragging; + double drag_start_pos; + double drag_start_value; + unsigned drag_area_size; + unsigned slider_size; + + Slider(); + +public: + void set_value(double); + void set_range(double, double); + void set_step(double); + double get_value() const { return value; } + +protected: + void click(int); + void start_drag(int); + void drag(int); + void end_drag(); }; } // namespace GLtk