X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fslider.h;h=057b194a2c532d7d96f9a96c421a63b2f21bb84f;hb=b59fab7e533ef96d72c92b224d4f24718bc6b0a1;hp=7b878d21fb2f1f6a32be486d4154c05e273c65ed;hpb=56c41b294aa47a38ac3e1be70d4868f260cb4274;p=libs%2Fgltk.git diff --git a/source/slider.h b/source/slider.h index 7b878d2..057b194 100644 --- a/source/slider.h +++ b/source/slider.h @@ -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