564{
565 wxColour disable_color = wxColour(0xCECECE);
566
567 dc.SetPen(*wxTRANSPARENT_PEN);
568
569 if (
is_enable) {dc.SetBrush(wxBrush(0xeeeeee));
570 } else {dc.SetBrush(disable_color);}
571 dc.DrawRoundedRectangle(0, 0, GetSize().x, GetSize().y, 8);
572
573
575 is_enable ? dc.SetBrush(wxBrush(wxColour(0, 150, 136))) : dc.SetBrush(disable_color);
576 dc.DrawRoundedRectangle(0, 0, GetSize().x / 2, GetSize().y, 8);
577 }
578
580 dc.SetTextForeground(*wxWHITE);
581 } else {
582 dc.SetTextForeground(0x333333);
583 }
584
587
588 auto left_txt_size = dc.GetTextExtent(
leftLabel);
589 dc.DrawText(
leftLabel, wxPoint((GetSize().x / 2 - left_txt_size.x) / 2, (GetSize().y - left_txt_size.y) / 2));
590
591
593 if (
is_enable) {dc.SetBrush(wxBrush(wxColour(0, 150, 136)));
594 } else {dc.SetBrush(disable_color);}
595 dc.DrawRoundedRectangle(GetSize().x / 2, 0, GetSize().x / 2, GetSize().y, 8);
596 }
597
598 auto right_txt_size = dc.GetTextExtent(
rightLabel);
600 dc.SetTextForeground(*wxWHITE);
601 } else {
602 dc.SetTextForeground(0x333333);
603 }
604 dc.DrawText(
rightLabel, wxPoint((GetSize().x / 2 - right_txt_size.x) / 2 + GetSize().x / 2, (GetSize().y - right_txt_size.y) / 2));
605
606}
static wxFont Body_13
Definition Label.hpp:54
static void get_suitable_font_size(int max_height, wxDC &dc)
Definition WxFontUtils.cpp:309
bool switch_left
Definition SwitchButton.hpp:110
bool is_enable
Definition SwitchButton.hpp:112
bool switch_right
Definition SwitchButton.hpp:111