X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fslider.h;h=6612c619aaaea80ae2445cd548edd9d38fcd742e;hb=c8291177b545ec81930603a5915234a60296db51;hp=8eb373667405dbb17cc25bb22fc5f9167b985eb9;hpb=c2635c5a3dca6a6cea5562fd387beb0662b18cf0;p=libs%2Fgltk.git diff --git a/source/slider.h b/source/slider.h index 8eb3736..6612c61 100644 --- a/source/slider.h +++ b/source/slider.h @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of libmspgltk -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_GLTK_SLIDER_H_ #define MSP_GLTK_SLIDER_H_ @@ -16,26 +9,42 @@ namespace GLtk { /** Sliders are used to adjust numeric values visually. This class provides the -common interface for sliders - see classes HSlider and VSlider (NYI) for -concrete variations. +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; + protected: double min, max; double value; double step; -public: - sigc::signal signal_value_changed; + bool dragging; + double drag_start_pos; + double drag_start_value; + unsigned drag_area_size; + + Slider(); -protected: - Slider(const Resources &); public: void set_value(double); void set_range(double, double); void set_step(double); double get_value() const { return value; } + +protected: + void start_drag(int); + void drag(int); + void end_drag(); }; } // namespace GLtk