112 :
PopupWindow(parent, wxBORDER_NONE | wxPU_CONTAINS_CONTROLS)
113{
114 const wxString AutoForFlushLabel =
_L(
"Filament-Saving Mode");
115 const wxString AutoForMatchLabel =
_L(
"Convenience Mode");
116 const wxString ManualLabel =
_L(
"Custom Mode");
117
118 const wxString AutoForFlushDetail =
_L(
"Generates filament grouping for the left and right nozzles based on the most filament-saving principles to minimize waste.");
119 const wxString AutoForMatchDetail =
_L(
"Generates filament grouping for the left and right nozzles based on the printer's actual filament status, reducing the need for manual filament adjustment.");
120 const wxString ManualDetail =
_L(
"Manually assign filament to the left or right nozzle");
121
122 const wxString AutoForFlushDesp = "";
123 const wxString ManualDesp = "";
124 const wxString AutoForMatchDesp = "";
125
126
127 wxBoxSizer *top_sizer = new wxBoxSizer(wxVERTICAL);
128 const int horizontal_margin = FromDIP(16);
129 const int vertical_margin = FromDIP(15);
130 const int vertical_padding = FromDIP(12);
131 const int ratio_spacing = FromDIP(4);
132
134
139
140
141 std::vector<wxString> btn_texts = {AutoForFlushLabel, AutoForMatchLabel, ManualLabel};
142 std::vector<wxString> btn_desps = {AutoForFlushDesp, AutoForMatchDesp, ManualDesp};
143 std::vector<wxString> mode_details = {AutoForFlushDetail, AutoForMatchDetail, ManualDetail};
144
145 top_sizer->AddSpacer(vertical_margin);
147
149 wxBoxSizer *button_sizer = new wxBoxSizer(wxHORIZONTAL);
150 radio_btns[idx] =
new wxBitmapButton(
this, wxID_ANY,
unchecked_bmp, wxDefaultPosition, wxDefaultSize, wxNO_BORDER);
152
157
162
163#if 0
164 global_mode_tags[idx] =
new wxBitmapButton(
this, wxID_ANY,
global_tag_bmp, wxDefaultPosition, wxDefaultSize, wxNO_BORDER);
166 global_mode_tags[idx]->SetToolTip(
_L(
"Global settings"));
167#endif
168 button_sizer->Add(
radio_btns[idx], 0, wxALIGN_CENTER);
169 button_sizer->AddSpacer(ratio_spacing);
171 button_sizer->Add(
button_desps[idx], 0, wxALIGN_CENTER);
172
173
174
175 wxBoxSizer *label_sizer = new wxBoxSizer(wxHORIZONTAL);
176
182
183 label_sizer->AddSpacer(
radio_btns[idx]->GetRect().width + ratio_spacing);
184 label_sizer->Add(
detail_infos[idx], 1, wxALIGN_CENTER_VERTICAL);
185
186 top_sizer->Add(button_sizer, 0, wxLEFT | wxRIGHT, horizontal_margin);
187 top_sizer->Add(label_sizer, 0, wxLEFT | wxRIGHT, horizontal_margin);
188 top_sizer->AddSpacer(vertical_padding);
189
191
194
198 }
199
200
202
203 {
204 wxBoxSizer *button_sizer = new wxBoxSizer(wxHORIZONTAL);
205
206
207 auto wiki_btn = new Button(this, "", "toolbar_wiki", 0, 15);
208 wiki_btn->SetToolTip(
_L(
"Wiki Guide") +
"\n" +
"https://e.bambulab.com/t?c=mOkvsXkJ9pldGYp9");
210 wiki_btn->SetCanFocus(false);
212
213 auto video_btn = new Button(this, "", "toolbar_video_guide", 0, 15);
214 video_btn->SetToolTip(
_L(
"Video Guide"));
216 video_btn->SetCanFocus(false);
217 video_btn->Bind(wxEVT_LEFT_DOWN, ([](auto& e) {
219 wxGetApp().app_config->set("play_slicing_video", "false");
220 }));
221
222 button_sizer->Add(wiki_btn , 0, wxLEFT, horizontal_margin + FromDIP(3));
223 button_sizer->Add(video_btn, 0, wxLEFT, FromDIP(10));
224
225 top_sizer->Add(button_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, horizontal_margin);
226 }
227
228 top_sizer->AddSpacer(vertical_margin);
229 SetSizerAndFit(top_sizer);
230
233
234 GUI::wxGetApp().UpdateDarkUIWin(this);
235
240}
#define _L(s)
Definition OBJ.cpp:34
static wxFont Body_12
Definition Label.hpp:55
static wxFont Body_14
Definition Label.hpp:53
bool open_filament_group_wiki()
Definition FilamentGroupPopup.cpp:93
bool play_dual_extruder_slice_video()
Definition FilamentGroupPopup.cpp:72
static const wxColour LabelEnableColor
Definition FilamentGroupPopup.cpp:34
static FilamentMapMode get_prefered_map_mode()
Definition FilamentGroupPopup.cpp:48
static const wxColour BackGroundColor
Definition FilamentGroupPopup.cpp:37
static const wxColour GreyColor
Definition FilamentGroupPopup.cpp:36