mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:57:44 +00:00
Add a CheckBox widget.
This commit is contained in:
parent
c7463aad11
commit
16576112b0
13 changed files with 177 additions and 36 deletions
26
Widgets/CheckBox.h
Normal file
26
Widgets/CheckBox.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
|
||||
#include "Widget.h"
|
||||
#include <AK/String.h>
|
||||
|
||||
class CheckBox final : public Widget {
|
||||
public:
|
||||
explicit CheckBox(Widget* parent);
|
||||
virtual ~CheckBox() override;
|
||||
|
||||
String caption() const { return m_caption; }
|
||||
void setCaption(String&&);
|
||||
|
||||
bool isChecked() const { return m_isChecked; }
|
||||
void setIsChecked(bool);
|
||||
|
||||
private:
|
||||
virtual void onPaint(PaintEvent&) override;
|
||||
virtual void onMouseDown(MouseEvent&) override;
|
||||
|
||||
virtual const char* className() const override { return "CheckBox"; }
|
||||
|
||||
String m_caption;
|
||||
bool m_isChecked { false };
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue