summaryrefslogtreecommitdiff
path: root/Widgets/CheckBox.h
blob: 638b5fb629586401c49c4cb4868070ba0d5aeb0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include "Widget.h"
#include <AK/AKString.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 paintEvent(PaintEvent&) override;
    virtual void mouseDownEvent(MouseEvent&) override;

    virtual const char* class_name() const override { return "CheckBox"; }

    String m_caption;
    bool m_isChecked { false };
};