202 :wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize)
203{
205 m_bmp_add = ScalableBitmap(
this,
"add_filament");
206
207 SetBackgroundColour(*wxWHITE);
208
209 wxBoxSizer* top_sizer = new wxBoxSizer(wxVERTICAL);
210
211 wxBoxSizer* title_sizer = new wxBoxSizer(wxHORIZONTAL);
212 m_other_layer_print_seq_choice =
new ComboBox(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(240), -1), 0, NULL, wxCB_READONLY);
218 title_sizer->Add(other_layer_txt, 0, wxALIGN_CENTER | wxALIGN_LEFT, 0);
219 title_sizer->AddStretchSpacer();
221
222 wxBoxSizer* buttons_sizer = new wxBoxSizer(wxHORIZONTAL);
223 ScalableButton* add_layers_btn =
new ScalableButton(
this, wxID_ANY,
m_bmp_add);
224 add_layers_btn->SetBackgroundColour(GetBackgroundColour());
225 ScalableButton* delete_layers_btn =
new ScalableButton(
this, wxID_ANY,
m_bmp_delete);
226 delete_layers_btn->SetBackgroundColour(GetBackgroundColour());
227 buttons_sizer->Add(add_layers_btn, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER, FromDIP(5));
228 buttons_sizer->Add(delete_layers_btn, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER, FromDIP(5));
229 buttons_sizer->Show(false);
230
232 wxBoxSizer* layer_panel_sizer = new wxBoxSizer(wxVERTICAL);
236
237 top_sizer->Add(title_sizer, 0, wxEXPAND, 0);
238 top_sizer->Add(buttons_sizer, 0, wxALIGN_CENTER, 0);
240
241 SetSizer(top_sizer);
242 Layout();
243 top_sizer->Fit(this);
244
245
247 if (e.GetSelection() == 0) {
249 buttons_sizer->Show(false);
250 }
251 else if (e.GetSelection() == 1) {
253 buttons_sizer->Show(true);
254 }
255 m_parent->Layout();
256 m_parent->Fit();
257 });
258 add_layers_btn->Bind(wxEVT_BUTTON, [this](wxEvent&) {
259 Freeze();
261 m_parent->Layout();
262 m_parent->Fit();
263 Thaw();
264 });
265 delete_layers_btn->Bind(wxEVT_BUTTON, [this](wxEvent&) {
267 m_parent->Layout();
268 m_parent->Fit();
269 });
270 Bind(EVT_NEED_RESORT_LAYERS, [this](auto& evt) {
271 std::vector<LayerSeqInfo> result;
275 result.push_back({ begin_layer_number, end_layer_number,
m_drag_canvas_list[i]->get_shape_list_order() });
276 }
277 if (!std::is_sorted(result.begin(), result.end())) {
278 std::sort(result.begin(), result.end());
280 }
282 });
283 Bind(EVT_SET_BED_TYPE_CONFIRM, [this](auto& evt) {
284 std::vector<LayerSeqInfo> result;
288
290 MessageDialog msg_dlg(
nullptr,
_L(
"Please input layer value (>= 2)."), wxEmptyString, wxICON_WARNING | wxOK);
291 msg_dlg.ShowModal();
292 evt.SetString("Invalid");
293 return;
294 }
295
296 result.push_back({ begin_layer_number, end_layer_number,
m_drag_canvas_list[i]->get_shape_list_order() });
297 }
299 });
300}
#define _L(s)
Definition OBJ.cpp:34
class WXDLLIMPEXP_FWD_CORE wxStaticText
Definition ProgressDialog.hpp:30
static wxFont Body_14
Definition Label.hpp:53