This commit is contained in:
dec05eba
2022-09-25 17:29:17 +02:00
parent 663a36df4a
commit 497217a3e0
14 changed files with 609 additions and 393 deletions

View File

@@ -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;
};
}