]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/slider.h
Add a persistent view size attribute to List
[libs/gltk.git] / source / slider.h
index 8eb373667405dbb17cc25bb22fc5f9167b985eb9..6612c619aaaea80ae2445cd548edd9d38fcd742e 100644 (file)
@@ -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<Slider, Widget::Loader>
+       {
+       public:
+               Loader(Slider &);
+       };
+
+       sigc::signal<void, double> signal_value_changed;
+
 protected:
        double min, max;
        double value;
        double step;
 
-public:
-       sigc::signal<void, double> 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