]> git.tdb.fi Git - libs/gltk.git/blob - source/slider.h
Refactor filling from Part to Alignment
[libs/gltk.git] / source / slider.h
1 /* $Id$
2
3 This file is part of libmspgltk
4 Copyright © 2007  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GLTK_SLIDER_H_
9 #define MSP_GLTK_SLIDER_H_
10
11 #include <sigc++/sigc++.h>
12 #include "widget.h"
13
14 namespace Msp {
15 namespace GLtk {
16
17 /**
18 Sliders are used to adjust numeric values visually.  This class provides the
19 common interface for sliders - see classes HSlider and VSlider for concrete
20 variations.
21 */
22 class Slider: public Widget
23 {
24 public:
25         class Loader: public Widget::Loader
26         {
27         public:
28                 Loader(Slider &);
29                 Slider &get_object() const;
30         };
31
32 protected:
33         double min, max;
34         double value;
35         double step;
36
37 public:
38         sigc::signal<void, double> signal_value_changed;
39
40 protected:
41         Slider(const Resources &);
42 public:
43         void set_value(double);
44         void set_range(double, double);
45         void set_step(double);
46         double get_value() const { return value; }
47 };
48
49 } // namespace GLtk
50 } // namespace Msp
51
52 #endif