From 614c9d27ff0aa8eeff663469979af191c07792e3 Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 12 Feb 2022 22:21:47 +0800 Subject: ... --- src/ui/controls/CheckBox.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/ui/controls/CheckBox.cpp (limited to 'src/ui/controls/CheckBox.cpp') diff --git a/src/ui/controls/CheckBox.cpp b/src/ui/controls/CheckBox.cpp new file mode 100644 index 00000000..ab8af2e8 --- /dev/null +++ b/src/ui/controls/CheckBox.cpp @@ -0,0 +1,21 @@ +#include "cru/ui/controls/CheckBox.h" +#include "cru/ui/render/BorderRenderObject.h" + +namespace cru::ui::controls { +CheckBox::CheckBox() + : container_render_object_(new render::BorderRenderObject()) { + container_render_object_->SetAttachedControl(this); +} + +CheckBox::~CheckBox() {} + +void CheckBox::SetChecked(bool checked) { + if (checked == checked_) return; + checked_ = checked; + checked_change_event_.Raise(checked); +} + +void CheckBox::ApplyBorderStyle(const style::ApplyBorderStyleInfo& style) { + container_render_object_->ApplyBorderStyle(style); +} +} // namespace cru::ui::controls -- cgit v1.2.3