]> git.tdb.fi Git - libs/gltk.git/blob - source/hslider.h
Implement autosize() method for most widgets
[libs/gltk.git] / source / hslider.h
1 /* $Id$
2
3 This file is part of libmspgltk
4 Copyright © 2007, 2010-2011  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.
19 */
20 class HSlider: public Slider
21 {
22 private:
23         unsigned slider_size;
24
25 public:
26         HSlider();
27
28         virtual const char *get_class() const { return "hslider"; }
29
30         virtual void autosize();
31
32 private:
33         virtual void render_special(const Part &) const;
34
35 public:
36         virtual void button_press(int, int, unsigned);
37         virtual void button_release(int, int, unsigned);
38         virtual void pointer_motion(int, int);
39 private:
40         virtual void on_geometry_change();
41         virtual void on_style_change();
42 };
43
44 } // namespace GLtk
45 } // namespace Msp
46
47 #endif