aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-02-12 22:21:47 +0800
committercrupest <crupest@outlook.com>2022-02-12 22:21:47 +0800
commit614c9d27ff0aa8eeff663469979af191c07792e3 (patch)
tree08905333656e2a9e473d65f16bfc4819ea19624e /src/ui/controls
parent0f91e36d49cbdadedce96009954810bffd614359 (diff)
downloadcru-614c9d27ff0aa8eeff663469979af191c07792e3.tar.gz
cru-614c9d27ff0aa8eeff663469979af191c07792e3.tar.bz2
cru-614c9d27ff0aa8eeff663469979af191c07792e3.zip
...
Diffstat (limited to 'src/ui/controls')
-rw-r--r--src/ui/controls/CheckBox.cpp21
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