41 YAssert(r.Width > 2 && r.Height > 2,
"Boundary is too small.");
43 yunseq(r.X += off1, r.Y += off1,
44 r.Width -= off2, r.Height -= off2);
47 using namespace Drawing;
51 bool is_pressed =
false,
bool is_locked =
false,
52 bool is_ticked =
false,
bool is_focused =
false,
55 YAssert(
bool(g),
"Invalid context found.");
58 if(
YB_LIKELY(r.Width > 10 && r.Height > 10))
61 Color cs[]{{222, 249, 250}, {177, 223, 253}, {213, 254, 254}};
65 if(!(is_locked || is_focused))
82 const Color c1(4, 34, 113), c2(108, 166, 208);
83 Point p1(r.X + 2, r.Y + r.Height / 2), p2(r.X + r.Width / 2 - 1,
84 r.Y + r.Height - 3), p3(r.X + r.Width - 2, r.Y + 1);
102 CheckBox::CheckBox(
const Rect& r)
106 FetchEvent<Click>(*this) += [
this](TouchEventArgs&&){
108 Ticked(TickedArgs(*
this, bTicked));
113 CheckBox::SetTicked(
bool b)
115 const bool old_tick(bTicked);
118 if(bTicked != old_tick)
123 CheckBox::Tick(
bool b)
138 PaintBox(e.Target, (e.ClipArea =
Rect(e.Location,
GetSizeOf(*
this))));
142 CheckButton::CheckButton(
const Rect& r)
151 const auto& pt(e.Location);