diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-09-25 17:29:17 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-09-25 17:29:17 +0200 |
commit | 497217a3e09b577f650aaf503356588515067ca8 (patch) | |
tree | 2fd43b747957510c55d66caf81df30732c39c398 /include/gui/Widget.hpp | |
parent | 663a36df4aaea583e7cd56ad35b26d05f6151746 (diff) |
widgets
Diffstat (limited to 'include/gui/Widget.hpp')
-rw-r--r-- | include/gui/Widget.hpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/gui/Widget.hpp b/include/gui/Widget.hpp index cf81d69..81f47b5 100644 --- a/include/gui/Widget.hpp +++ b/include/gui/Widget.hpp @@ -9,13 +9,21 @@ namespace mgl { namespace gsr { class Widget { + friend class WidgetContainer; public: - virtual ~Widget() = default; + Widget(); + Widget(const Widget&) = delete; + Widget& operator=(const Widget&) = delete; + virtual ~Widget(); - virtual void on_event(mgl::Event &event, mgl::Window &window) = 0; + // Return true to allow other widgets to also process the event + virtual bool on_event(mgl::Event &event, mgl::Window &window) = 0; virtual void draw(mgl::Window &window) = 0; virtual void set_position(mgl::vec2f position); + + virtual mgl::vec2f get_position() const; protected: mgl::vec2f position; + bool move_to_top = false; }; }
\ No newline at end of file |