]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/slider.h
Pass coordinates relative to the receiving widget's geometry
[libs/gltk.git] / source / slider.h
index d4ae46b632040fe9b6fb8dd8c90a21a7a5125af8..6c95526f13f2699f14c89049fe5f252510383a2e 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:
-       sigc::signal<void, double> signal_value_changed;
+       class Loader: public Widget::Loader
+       {
+       public:
+               Loader(Slider &);
+               Slider &get_object() const;
+       };
 
-       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;
 
+       bool dragging;
+       double drag_start_pos;
+       double drag_start_value;
+       unsigned drag_area_size;
+
+public:
+       sigc::signal<void, double> signal_value_changed;
+
+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