aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/CheckBox.cpp
blob: ab8af2e8f7d61085e2889a2b46b54b31c53a266a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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