mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 16:17:45 +00:00
More hacking on Widgets.
This commit is contained in:
parent
aee66e0119
commit
f337616741
15 changed files with 135 additions and 19 deletions
22
Widgets/Button.h
Normal file
22
Widgets/Button.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
#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:
|
||||
virtual void onPaint(PaintEvent&) override;
|
||||
virtual void onMouseDown(MouseEvent&) override;
|
||||
|
||||
virtual const char* className() const override { return "Button"; }
|
||||
|
||||
String m_caption;
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue