diff options
author | crupest <crupest@outlook.com> | 2022-02-12 22:21:47 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-02-12 22:21:47 +0800 |
commit | 614c9d27ff0aa8eeff663469979af191c07792e3 (patch) | |
tree | 08905333656e2a9e473d65f16bfc4819ea19624e /src/ui/controls/CheckBox.cpp | |
parent | 0f91e36d49cbdadedce96009954810bffd614359 (diff) | |
download | cru-614c9d27ff0aa8eeff663469979af191c07792e3.tar.gz cru-614c9d27ff0aa8eeff663469979af191c07792e3.tar.bz2 cru-614c9d27ff0aa8eeff663469979af191c07792e3.zip |
...
Diffstat (limited to 'src/ui/controls/CheckBox.cpp')
-rw-r--r-- | src/ui/controls/CheckBox.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
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 |