]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/list.h
Use the override specifier when overriding a virtual function
[libs/gltk.git] / source / list.h
index 37d4d7a33201bdf80894508bd8ab8dd58a962fa2..060fb813f405cc9b29fb762c8a5ac93e7feedc61 100644 (file)
@@ -67,14 +67,14 @@ public:
                Item();
 
        public:
-               virtual const char *get_class() const { return "listitem"; }
+               const char *get_class() const override { return "listitem"; }
 
        protected:
-               virtual void autosize_special(const Part &, Geometry &) const;
+               void autosize_special(const Part &, Geometry &) const override;
        public:
                void set_active(bool);
 
-               virtual void render_special(const Part &, GL::Renderer &) const;
+               void render_special(const Part &, GL::Renderer &) const override;
        };
 
        class SimpleItem: public Item
@@ -82,7 +82,7 @@ public:
        protected:
                SimpleItem() = default;
 
-               virtual void on_style_change();
+               void on_style_change() override;
        };
 
        class MultiColumnItem: public Item
@@ -93,7 +93,7 @@ public:
                virtual void check_widths(std::vector<unsigned> &) const;
                virtual void set_widths(const std::vector<unsigned> &);
 
-               virtual void on_style_change();
+               void on_style_change() override;
        };
 
 private:
@@ -129,7 +129,7 @@ private:
                TypedItemFactory(const ListData &d)
                { set_data(d); }
 
-               virtual void set_data(const ListData &d)
+               void set_data(const ListData &d) override
                {
                        if(const ListDataStore<ValueType> *ds = dynamic_cast<const ListDataStore<ValueType> *>(&d))
                                data = ds;
@@ -137,7 +137,7 @@ private:
                                throw incompatible_data(typeid(ValueType));
                }
 
-               virtual Item *create_item(unsigned i) const
+               Item *create_item(unsigned i) const override
                {
                        return new I(data->get(i));
                }
@@ -182,10 +182,10 @@ public:
        List(ListData &);
        virtual ~List();
 
-       virtual const char *get_class() const { return "list"; }
+       const char *get_class() const override { return "list"; }
 
 private:
-       virtual void autosize_special(const Part &, Geometry &) const;
+       void autosize_special(const Part &, Geometry &) const override;
 
 public:
        void set_data(ListData &);
@@ -216,19 +216,19 @@ public:
 private:
        void set_selected_item(Widget *);
 
-       virtual void rebuild_special(const Part &);
-       virtual void render_special(const Part &, GL::Renderer &) const;
+       void rebuild_special(const Part &) override;
+       void render_special(const Part &, GL::Renderer &) const override;
 
 public:
-       virtual bool key_press(unsigned, unsigned);
-       virtual void button_press(int, int, unsigned);
-       virtual void touch_press(int, int, unsigned);
-       virtual void touch_release(int, int, unsigned);
-       virtual void touch_motion(int, int, unsigned);
-       virtual void focus_in();
-       virtual bool navigate(Navigation);
+       bool key_press(unsigned, unsigned) override;
+       void button_press(int, int, unsigned) override;
+       void touch_press(int, int, unsigned) override;
+       void touch_release(int, int, unsigned) override;
+       void touch_motion(int, int, unsigned) override;
+       void focus_in() override;
+       bool navigate(Navigation) override;
 private:
-       virtual void on_style_change();
+       void on_style_change() override;
 
        void move_focus(Navigation, bool);
        void set_focus_index(int);