]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/slider.h
Make sure classes follow the rule of 0/3/5
[libs/gltk.git] / source / slider.h
index 7b878d21fb2f1f6a32be486d4154c05e273c65ed..057b194a2c532d7d96f9a96c421a63b2f21bb84f 100644 (file)
@@ -34,19 +34,20 @@ public:
 
 protected:
        Direction dir;
-       double min, max;
-       double value;
-       double step;
-       double page_size;
-
-       bool dragging;
-       double drag_start_pos;
-       double drag_start_value;
-       unsigned drag_area_size;
-       unsigned drag_area_offset;
-       unsigned slider_min_size;
-       unsigned slider_size;
-       unsigned total_margin;
+       double min = 0.0;
+       double max = 1.0;
+       double value = 0.0;
+       double step = 0.1;
+       double page_size = 0.25;
+
+       bool dragging = false;
+       double drag_start_pos = 0.0;
+       double drag_start_value = 0.0;
+       unsigned drag_area_size = 0;
+       unsigned drag_area_offset = 0;
+       unsigned slider_min_size = 1;
+       unsigned slider_size = 1;
+       unsigned total_margin = 0;
 
        Slider(Direction);
 
@@ -58,17 +59,17 @@ public:
        double get_value() const { return value; }
 
 protected:
-       virtual void autosize_special(const Part &, Geometry &) const;
-       virtual void rebuild_special(const Part &);
+       void autosize_special(const Part &, Geometry &) const override;
+       void rebuild_special(const Part &) override;
 
 public:
-       virtual void button_press(int, int, unsigned);
-       virtual void button_release(int, int, unsigned);
-       virtual void pointer_motion(int, int);
+       void button_press(int, int, unsigned) override;
+       void button_release(int, int, unsigned) override;
+       void pointer_motion(int, int) override;
 
 protected:
-       virtual void on_size_change();
-       virtual void on_style_change();
+       void on_size_change() override;
+       void on_style_change() override;
 };
 
 
@@ -77,7 +78,7 @@ class MSPGLTK_API VSlider: public Slider
 public:
        VSlider(): Slider(VERTICAL) { }
 
-       virtual const char *get_class() const { return "vslider"; }
+       const char *get_class() const override { return "vslider"; }
 };
 
 class MSPGLTK_API HSlider: public Slider
@@ -85,7 +86,7 @@ class MSPGLTK_API HSlider: public Slider
 public:
        HSlider(): Slider(HORIZONTAL) { }
 
-       virtual const char *get_class() const { return "hslider"; }
+       const char *get_class() const override { return "hslider"; }
 };
 
 } // namespace GLtk