#pragma once #include "GWidget.h" #include #include class GButton final : public GWidget { public: explicit GButton(GWidget* parent); virtual ~GButton() override; String caption() const { return m_caption; } void setCaption(String&&); Function onClick; private: virtual void paintEvent(GPaintEvent&) override; virtual void mouseDownEvent(GMouseEvent&) override; virtual void mouseUpEvent(GMouseEvent&) override; virtual const char* class_name() const override { return "Button"; } String m_caption; bool m_beingPressed { false }; };