aboutsummaryrefslogtreecommitdiff
path: root/include/gui/Widget.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/gui/Widget.hpp')
-rw-r--r--include/gui/Widget.hpp12
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