2018-10-11 01:48:09 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Widget.h"
|
|
|
|
#include <AK/String.h>
|
|
|
|
|
|
|
|
class Button final : public Widget {
|
|
|
|
public:
|
|
|
|
explicit Button(Widget* parent);
|
|
|
|
virtual ~Button() override;
|
|
|
|
|
|
|
|
String caption() const { return m_caption; }
|
|
|
|
void setCaption(String&&);
|
|
|
|
|
|
|
|
private:
|
2018-10-13 22:51:50 +02:00
|
|
|
virtual void paintEvent(PaintEvent&) override;
|
|
|
|
virtual void mouseDownEvent(MouseEvent&) override;
|
|
|
|
virtual void mouseUpEvent(MouseEvent&) override;
|
2018-10-11 01:48:09 +02:00
|
|
|
|
|
|
|
virtual const char* className() const override { return "Button"; }
|
|
|
|
|
|
|
|
String m_caption;
|
2018-10-12 15:52:41 +02:00
|
|
|
bool m_beingPressed { false };
|
2018-10-11 01:48:09 +02:00
|
|
|
};
|
|
|
|
|