diff options
author | crupest <crupest@outlook.com> | 2022-02-13 19:13:15 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-02-13 19:13:15 +0800 |
commit | 308cdd54083dde627be738820f798ad25e73c300 (patch) | |
tree | ee0d0c342ff5ba2c6389df4a0c07550e55520eda /src/ui | |
parent | ecda6570b707617c4b9365180684bbe94f43e4f9 (diff) | |
download | cru-308cdd54083dde627be738820f798ad25e73c300.tar.gz cru-308cdd54083dde627be738820f798ad25e73c300.tar.bz2 cru-308cdd54083dde627be738820f798ad25e73c300.zip |
...
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/controls/CheckBox.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ui/controls/CheckBox.cpp b/src/ui/controls/CheckBox.cpp index ab8af2e8..d41d1cb6 100644 --- a/src/ui/controls/CheckBox.cpp +++ b/src/ui/controls/CheckBox.cpp @@ -1,10 +1,15 @@ #include "cru/ui/controls/CheckBox.h" +#include "cru/ui/helper/ClickDetector.h" #include "cru/ui/render/BorderRenderObject.h" namespace cru::ui::controls { CheckBox::CheckBox() - : container_render_object_(new render::BorderRenderObject()) { + : container_render_object_(new render::BorderRenderObject()), + click_detector_(this) { container_render_object_->SetAttachedControl(this); + + click_detector_.ClickEvent()->AddHandler( + [this](const helper::ClickEventArgs&) { Toggle(); }); } CheckBox::~CheckBox() {} |