Skip to content
Snippets Groups Projects
Select Git revision
  • d77f8aa92c768c9a5594613eff3de045b66de769
  • main default protected
2 results

widget.hpp

Blame
  • widget.hpp 415 B
    #ifndef WIDGET_HPP
    #define WIDGET_HPP
    
    
    #include "graphics.hpp"
    
    class Widget {
    protected:
        int x, y, width, height;
        bool selected;
    public:
        Widget(int x_, int y_, int w_, int h_);
        virtual void draw() const = 0;
        virtual void handle(genv::event ev) = 0;
        virtual bool is_selected(int mx, int my) const;
        virtual void set_focus(bool f);
        virtual ~Widget() {}
    };
    
    #endif