diff --git a/src/UI/UI_button.hpp b/src/UI/UI_button.hpp index d682666..2696aa9 100644 --- a/src/UI/UI_button.hpp +++ b/src/UI/UI_button.hpp @@ -13,7 +13,7 @@ class UI_button : public UI_item void from_json(const json& j) override; json to_json() const override; - void click() const; + void click() const override; private: std::function p_on_click = nullptr; }; \ No newline at end of file diff --git a/src/UI/UI_combobox.hpp b/src/UI/UI_combobox.hpp index 330e105..0e9a76b 100644 --- a/src/UI/UI_combobox.hpp +++ b/src/UI/UI_combobox.hpp @@ -14,7 +14,7 @@ class UI_combobox : public UI_x_boxes UI_combobox(const json& j); void set_selected(size_t selected); - void set_selected(std::string selected); + void set_selected(std::string selected) override; size_t selected() const; std::string selected_text() const; diff --git a/src/UI/UI_item.hpp b/src/UI/UI_item.hpp index 4efa6ad..ae53215 100644 --- a/src/UI/UI_item.hpp +++ b/src/UI/UI_item.hpp @@ -34,6 +34,10 @@ class UI_item { virtual json to_json() const; + virtual void click() const {}; + virtual void set_selected(std::string selected) {UNUSED(selected);}; + virtual void set_value(double value) {UNUSED(value);}; + protected: std::string p_id; std::string p_type; diff --git a/src/UI/UI_slider.hpp b/src/UI/UI_slider.hpp index b4dddba..c36976b 100644 --- a/src/UI/UI_slider.hpp +++ b/src/UI/UI_slider.hpp @@ -9,7 +9,7 @@ class UI_slider : public UI_item UI_slider(std::string id, std::string text, Color fg_color, Color bg_color, double min, double max, double value, std::function on_change = nullptr); UI_slider(const json& j); - void set_value(double value); + void set_value(double value) override; double value() const; void from_json(const json& j) override;