1419 :
PopupWindow(extruder, wxBORDER_NONE | wxPU_CONTAINS_CONTROLS)
1420 {
1421 SetBackgroundColour(*wxWHITE);
1422 auto msg =
new wxStaticText(
this, wxID_ANY,
_L(
"Set the number of AMS installed on the nozzle."));
1424 msg->SetForegroundColour("#262E30");
1425 msg->Wrap(FromDIP(280));
1426 auto box = new StaticBox(this, wxID_ANY);
1427 box->SetBackgroundColor(0xF8F8F8);
1428 box->SetBorderWidth(0);
1429 auto img4 = new ScalableButton(box, wxID_ANY, "ams_4_tray", {}, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, false, 44);
1430
1431 auto img1 = new ScalableButton(box, wxID_ANY, "ams_1_tray", {}, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, false, 44);
1432
1435 txt4->SetBackgroundColour(0xF8F8F8);
1436 txt4->SetForegroundColour("#262E30");
1439 txt1->SetBackgroundColour(0xF8F8F8);
1440 txt1->SetForegroundColour("#262E30");
1441 int ams4 = 0, ams1 = 0;
1442 int oth4 = 0, oth1 = 0;
1445 auto val4 = new SpinInput(box, {}, {}, wxDefaultPosition, {FromDIP(60), -1}, 0, 0, 4 - oth4, ams4);
1446 auto val1 = new SpinInput(box, {}, {}, wxDefaultPosition, {FromDIP(60), -1}, 0, 0, 8 - oth1, ams1);
1447 auto event_handler = [index, val4, val1, extruder](auto &evt) {
1448 SetAMSCount(index, val4->GetValue(), val1->GetValue());
1450 };
1451 val4->Bind(wxEVT_SPINCTRL, event_handler);
1452 val1->Bind(wxEVT_SPINCTRL, event_handler);
1453
1454 wxSizer * sizer = new wxBoxSizer(wxVERTICAL);
1455 sizer->Add(msg, 0, wxTOP | wxLEFT | wxRIGHT, FromDIP(10));
1456 wxSizer *sizer2 = new wxBoxSizer(wxVERTICAL);
1457 wxSizer *sizer21 = new wxBoxSizer(wxHORIZONTAL);
1458 sizer21->Add(img4, 0, wxALIGN_CENTRE);
1459 sizer21->Add(txt4, 2, wxLEFT | wxALIGN_CENTRE, FromDIP(10));
1460 sizer21->Add(val4, 1, wxLEFT | wxALIGN_CENTRE, FromDIP(10));
1461 sizer2->Add(sizer21, 0, wxLEFT | wxRIGHT | wxTOP | wxEXPAND, FromDIP(14));
1462 sizer2->AddSpacer(FromDIP(6));
1463 wxSizer *sizer22 = new wxBoxSizer(wxHORIZONTAL);
1464 sizer22->Add(img1, 0, wxALIGN_CENTRE);
1465 sizer22->Add(txt1, 2, wxLEFT | wxALIGN_CENTRE, FromDIP(10));
1466 sizer22->Add(val1, 1, wxLEFT | wxALIGN_CENTRE, FromDIP(10));
1467 sizer2->Add(sizer22, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, FromDIP(14));
1468 box->SetSizer(sizer2);
1469 sizer->Add(box, 0, wxTOP | wxBOTTOM | wxLEFT | wxRIGHT | wxEXPAND, FromDIP(14));
1470 SetSizer(sizer);
1471
1472 Layout();
1473 Fit();
1474
1475 Bind(wxEVT_PAINT, [this](wxPaintEvent& evt) {
1476 wxPaintDC dc(this);
1478 dc.SetBrush(*wxTRANSPARENT_BRUSH);
1479 dc.DrawRoundedRectangle(0, 0, GetSize().x, GetSize().y, 0);
1480 });
1481
1482 SetBackgroundColour(*wxWHITE);
1483 wxGetApp().UpdateDarkUIWin(this);
1484 }
#define _L(s)
Definition OBJ.cpp:34
class WXDLLIMPEXP_FWD_CORE wxStaticText
Definition ProgressDialog.hpp:30
static wxFont Body_14
Definition Label.hpp:53
static wxColour darkModeColorFor(wxColour const &color)
Definition StateColor.cpp:219