27 : wxPanel(parent, id)
28{
29 SetBackgroundColour(*wxWHITE);
30 SetBackgroundStyle(wxBG_STYLE_PAINT);
31
34
35 auto sizer = new wxBoxSizer(wxHORIZONTAL);
36
39
41 m_btn->SetBackgroundColour(*wxWHITE);
42
43 m_label =
new Label(
this, label);
44
45 sizer->AddSpacer(FromDIP(8));
46 sizer->Add(
m_btn, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, FromDIP(6));
47 sizer->AddSpacer(FromDIP(8));
48 sizer->Add(
m_label, 0, wxALIGN_CENTER);
49 sizer->AddSpacer(FromDIP(8));
50
51 SetSizer(sizer);
52 Layout();
53 Fit();
54
55 auto forward_click_to_parent = [this](auto &event) {
56 wxCommandEvent click_event(wxEVT_BUTTON, GetId());
57 click_event.SetEventObject(this);
58 this->ProcessEvent(click_event);
59 };
60
61 m_btn->Bind(wxEVT_LEFT_DOWN, forward_click_to_parent);
62 m_label->Bind(wxEVT_LEFT_DOWN, forward_click_to_parent);
63 this->Bind(wxEVT_LEFT_DOWN, forward_click_to_parent);
64
68
70}
wxBitmap create_scaled_bitmap(const std::string &bmp_name_in, wxWindow *win, const int px_cnt, const bool grayscale, const std::string &new_color, const bool menu_bitmap, const bool resize, const bool bitmap2, const std::vector< std::string > &array_new_color)
Definition wxExtensions.cpp:448