1
Fork 0
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:
Andreas Kling 2018-10-12 14:15:14 +02:00
parent c7463aad11
commit 16576112b0
13 changed files with 177 additions and 36 deletions

26
Widgets/CheckBox.h Normal file
View 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 };
};