]> git.tdb.fi Git - libs/gltk.git/blob - source/hslider.h
Reorder class members
[libs/gltk.git] / source / hslider.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_HSLIDER_H_
9 #define MSP_GLTK_HSLIDER_H_
10
11 #include "slider.h"
12
13 namespace Msp {
14 namespace GLtk {
15
16 /**
17 Horizontal slider widget.  A special part named "slider" will be positioned at
18 the current value of the widget.  The fill_x attribute is ignored.
19 */
20 class HSlider: public Slider
21 {
22 private:
23         bool dragging;
24         int drag_start_x;
25         double drag_start_value;
26
27 public:
28         HSlider(const Resources &);
29         void button_press(int, int, unsigned);
30         void button_release(int, int, unsigned);
31         void pointer_motion(int, int);
32 private:
33         const char *get_class() const { return "hslider"; }
34         void render_part(const Part &) const;
35         unsigned get_slider_width() const;
36 };
37
38 } // namespace GLtk
39 } // namespace Msp
40
41 #endif