2019-01-20 04:49:48 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "GWidget.h"
|
|
|
|
|
#include <AK/AKString.h>
|
|
|
|
|
|
|
|
|
|
class GCheckBox final : public GWidget {
|
|
|
|
|
public:
|
|
|
|
|
explicit GCheckBox(GWidget* parent);
|
|
|
|
|
virtual ~GCheckBox() override;
|
|
|
|
|
|
|
|
|
|
String caption() const { return m_caption; }
|
2019-01-21 00:46:08 +01:00
|
|
|
void set_caption(String&&);
|
2019-01-20 04:49:48 +01:00
|
|
|
|
2019-01-21 00:46:08 +01:00
|
|
|
bool is_checked() const { return m_checked; }
|
|
|
|
|
void set_checked(bool);
|
2019-01-20 04:49:48 +01:00
|
|
|
|
|
|
|
|
private:
|
2019-01-21 00:46:08 +01:00
|
|
|
virtual void paint_event(GPaintEvent&) override;
|
|
|
|
|
virtual void mousedown_event(GMouseEvent&) override;
|
2019-01-20 04:49:48 +01:00
|
|
|
|
|
|
|
|
virtual const char* class_name() const override { return "GCheckBox"; }
|
|
|
|
|
|
|
|
|
|
String m_caption;
|
2019-01-21 00:46:08 +01:00
|
|
|
bool m_checked { false };
|
2019-01-20 04:49:48 +01:00
|
|
|
};
|
|
|
|
|
|