]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/hslider.h
Properly account for margins in sliders
[libs/gltk.git] / source / hslider.h
index 0ce63770777580c0c7e5c67ae4d01a208f79e954..0d840fe961525ccab760bb9c9e4210a5ca6636a9 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspgltk
-Copyright © 2007  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifndef MSP_GLTK_HSLIDER_H_
 #define MSP_GLTK_HSLIDER_H_
 
@@ -15,24 +8,29 @@ namespace GLtk {
 
 /**
 Horizontal slider widget.  A special part named "slider" will be positioned at
-the current value of the widget.  The fill_x attribute is ignored.
+the current value of the widget.
 */
 class HSlider: public Slider
 {
 private:
-       bool dragging;
-       int drag_start_x;
-       double drag_start_value;
+       unsigned total_margin;
+
+public:
+       HSlider();
+
+       virtual const char *get_class() const { return "hslider"; }
+
+private:
+       virtual void autosize_special(const Part &, Geometry &) const;
+       virtual void rebuild_special(const Part &);
 
 public:
-       HSlider(const Resources &);
-       void button_press(int, int, unsigned);
-       void button_release(int, int, unsigned);
-       void pointer_motion(int, int);
+       virtual void button_press(int, int, unsigned);
+       virtual void button_release(int, int, unsigned);
+       virtual void pointer_motion(int, int);
 private:
-       const char *get_class() const { return "hslider"; }
-       void render_part(const Part &) const;
-       unsigned get_slider_width() const;
+       virtual void on_geometry_change();
+       virtual void on_style_change();
 };
 
 } // namespace GLtk