diff options
Diffstat (limited to 'src/ui/controls')
-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() {} |