]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/slider.h
Store the Resources reference only in Root widget
[libs/gltk.git] / source / slider.h
index d4ae46b632040fe9b6fb8dd8c90a21a7a5125af8..c4326e3eac0edf5571ac29b96ee82adb3ba63abc 100644 (file)
@@ -1,3 +1,10 @@
+/* $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_
 
 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 Widget::Loader
+       {
+       public:
+               Loader(Slider &);
+               Slider &get_object() const;
+       };
+
+protected:
+       double min, max;
+       double value;
+       double step;
+
+       bool dragging;
+       double drag_start_pos;
+       double drag_start_value;
+       unsigned drag_area_size;
+
 public:
        sigc::signal<void, double> signal_value_changed;
 
+protected:
+       Slider();
+public:
        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 &);
+       void start_drag(int);
+       void drag(int);
+       void end_drag();
 };
 
 } // namespace GLtk