OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::ParamsPanel Class Reference

Class ParamsPanel. More...

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/ParamsPanel.hpp>

Inheritance diagram for Slic3r::GUI::ParamsPanel:
Collaboration diagram for Slic3r::GUI::ParamsPanel:

Classes

class  SettingsPagePrebuild
struct  Highlighter

Public Member Functions

 ParamsPanel (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(1800, 1080), long style=wxTAB_TRAVERSAL, const wxString &type=wxEmptyString)
 ~ParamsPanel ()
void rebuild_panels ()
void create_layout ()
void clear_page ()
void OnActivate ()
void select_default_tab ()
LazyBase & settings_page_prebuild ()
void set_active_tab (wxPanel *tab)
bool is_active_and_shown_tab (wxPanel *tab)
void update_mode ()
void msw_rescale ()
void switch_to_global ()
void switch_to_object (bool with_tips=false)
void notify_object_config_changed ()
void switch_to_object_if_has_object_configs ()
StaticBox * get_top_panel ()
wxPanel * filament_panel ()
wxScrolledWindow * get_paged_view ()
wxPanel * get_current_tab ()

Protected Member Functions

void OnToggled (wxCommandEvent &event)

Protected Attributes

wxBoxSizer * m_top_sizer { nullptr }
wxBoxSizer * m_left_sizer { nullptr }
wxBoxSizer * m_mode_sizer { nullptr }
StaticBox * m_top_panel { nullptr }
ScalableButton * m_process_icon { nullptr }
wxStaticText * m_title_label { nullptr }
SwitchButton * m_mode_region { nullptr }
ScalableButton * m_tips_arrow {nullptr}
bool m_tips_arror_blink {false}
ScalableButton * m_mode_icon { nullptr }
ModeSwitchButton * m_mode_view { nullptr }
wxStaticLine * m_staticline_print { nullptr }
wxPanel * m_tab_print { nullptr }
wxPanel * m_tab_print_plate { nullptr }
wxPanel * m_tab_print_object { nullptr }
wxStaticLine * m_staticline_print_object { nullptr }
wxPanel * m_tab_print_part { nullptr }
wxPanel * m_tab_print_layer { nullptr }
wxStaticLine * m_staticline_print_part { nullptr }
wxStaticLine * m_staticline_filament { nullptr }
wxPanel * m_tab_filament { nullptr }
wxStaticLine * m_staticline_printer { nullptr }
wxPanel * m_tab_printer { nullptr }
wxBoxSizer * m_button_sizer { nullptr }
wxWindow * m_export_to_file { nullptr }
wxWindow * m_import_from_file { nullptr }
wxScrolledWindow * m_page_view { nullptr }
wxBoxSizer * m_page_sizer { nullptr }
ScalableButton * m_setting_btn { nullptr }
ScalableButton * m_search_btn { nullptr }
ScalableButton * m_compare_btn { nullptr }
wxBitmap m_toggle_on_icon
wxBitmap m_toggle_off_icon
wxPanel * m_current_tab { nullptr }
Slic3r::GUI::ParamsPanel::SettingsPagePrebuild * this
bool m_has_object_config { false }
struct Slic3r::GUI::ParamsPanel::Highlighter m_highlighter

Private Member Functions

void free_sizers ()
void delete_subwindows ()
void refresh_tabs ()

Detailed Description

Class ParamsPanel.

Constructor & Destructor Documentation

◆ ParamsPanel()

Slic3r::GUI::ParamsPanel::ParamsPanel ( wxWindow * parent,
wxWindowID id = wxID_ANY,
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxSize( 1800,1080 ),
long style = wxTAB_TRAVERSAL,
const wxString & type = wxEmptyString )
250 : wxPanel( parent, id, pos, size, style, name )
251{
252 // BBS: new layout
253 SetBackgroundColour(*wxWHITE);
254#if __WXOSX__
255 m_top_sizer = new wxBoxSizer(wxHORIZONTAL);
256 m_top_sizer->SetSizeHints(this);
257 this->SetSizer(m_top_sizer);
258
259 // Create additional panel to Fit() it from OnActivate()
260 // It's needed for tooltip showing on OSX
261 m_tmp_panel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBK_LEFT | wxTAB_TRAVERSAL);
262 auto sizer = new wxBoxSizer(wxHORIZONTAL);
263 m_tmp_panel->SetSizer(sizer);
264 m_tmp_panel->Layout();
265
266#else
267 ParamsPanel*panel = this;
268 m_top_sizer = new wxBoxSizer(wxHORIZONTAL);
269 m_top_sizer->SetSizeHints(panel);
270 panel->SetSizer(m_top_sizer);
271#endif //__WXOSX__
272
273 if (dynamic_cast<Notebook*>(parent)) {
274 // BBS: new layout
275 m_top_panel = new StaticBox(this, wxID_ANY, wxDefaultPosition);
276 m_top_panel->SetBackgroundColor(0xF8F8F8);
277 m_top_panel->SetBackgroundColor2(0xF1F1F1);
278
279 m_process_icon = new ScalableButton(m_top_panel, wxID_ANY, "process");
280
281 m_title_label = new Label(m_top_panel, _L("Process"));
282
283 //int width, height;
284 // BBS: new layout
285 m_mode_region = new SwitchButton(m_top_panel);
286 m_mode_region->SetMaxSize({em_unit(this) * 12, -1});
287 m_mode_region->SetLabels(_L("Global"), _L("Objects"));
288 //m_mode_region->GetSize(&width, &height);
289 m_tips_arrow = new ScalableButton(m_top_panel, wxID_ANY, "tips_arrow");
290 m_tips_arrow->Hide();
291
292 m_mode_icon = new ScalableButton(m_top_panel, wxID_ANY, "advanced"); // ORCA
293 m_mode_icon->Bind(wxEVT_BUTTON, [this](wxCommandEvent e) {
294 if (wxGetApp().get_mode() == comDevelop || m_mode_view == nullptr)
295 return; // prevent change on dev mode
296
297 const int selection = m_mode_view->GetSelection();
298 m_mode_view->SelectAndNotify((selection + 1) % 3);
299 });
300 m_mode_icon->SetToolTip(_L("Cycle settings visibility"));
301 m_mode_view = new ModeSwitchButton(m_top_panel);
302 bool isDevMode = wxGetApp().get_mode() == comDevelop;
303 m_mode_view->SetSelection(mode_to_selection(isDevMode ? comExpert : wxGetApp().get_saved_mode()));
304 m_mode_view->SetDevMode(isDevMode);
305
306 // BBS: new layout
307 //m_search_btn = new ScalableButton(m_top_panel, wxID_ANY, "search", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true);
308 //m_search_btn->SetToolTip(format_wxstr(_L("Search in settings [%1%]"), _L("Ctrl+") + "F");
309 //m_search_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &) { wxGetApp().plater()->search(false); });
310
311 m_compare_btn = new ScalableButton(m_top_panel, wxID_ANY, "compare", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true);
312 m_compare_btn->SetToolTip(_L("Compare presets"));
313 m_compare_btn->Bind(wxEVT_BUTTON, ([](wxCommandEvent e) { DiffPresetDialog::ensure()->show(); }));
314
315 m_setting_btn = new ScalableButton(m_top_panel, wxID_ANY, "table", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true);
316 m_setting_btn->SetToolTip(_L("View all object's settings"));
317 m_setting_btn->Bind(wxEVT_BUTTON, [](wxCommandEvent &) { wxGetApp().plater()->PopupObjectTable(-1, -1, {0, 0}); });
318
319 m_highlighter.set_timer_owner(this, 0);
320 this->Bind(wxEVT_TIMER, [this](wxTimerEvent &)
321 {
322 m_highlighter.blink();
323 });
324 }
325
326
327
328 //m_export_to_file = new Button( this, _L("Export To File"), "");
329 //m_import_from_file = new Button( this, _L("Import From File") );
330
331 // Initialize the page.
332#if __WXOSX__
333 auto page_parent = m_tmp_panel;
334#else
335 auto page_parent = this;
336#endif
337
338 // BBS: fix scroll to tip view
339 class PageScrolledWindow : public wxScrolledWindow
340 {
341 public:
342 PageScrolledWindow(wxWindow *parent)
343 : wxScrolledWindow(parent,
344 wxID_ANY,
345 wxDefaultPosition,
346 wxDefaultSize,
347 wxVSCROLL // hide hori-bar will cause hidden field mis-position
348 | wxTAB_TRAVERSAL // Allows for traversal via tab key
349 )
350 {
351 // ShowScrollBar(GetHandle(), SB_BOTH, FALSE);
352 Bind(wxEVT_SCROLL_CHANGED, [this](auto &e) {
353 wxWindow *child = dynamic_cast<wxWindow *>(e.GetEventObject());
354 if (child != this)
355 EnsureVisible(child);
356 });
357 }
358 virtual bool ShouldScrollToChildOnFocus(wxWindow *child)
359 {
360 EnsureVisible(child);
361 return false;
362 }
363 void EnsureVisible(wxWindow* win)
364 {
365 const wxRect viewRect(m_targetWindow->GetClientRect());
366 const wxRect winRect(m_targetWindow->ScreenToClient(win->GetScreenPosition()), win->GetSize());
367 if (viewRect.Contains(winRect)) {
368 return;
369 }
370 if (winRect.GetWidth() > viewRect.GetWidth() || winRect.GetHeight() > viewRect.GetHeight()) {
371 return;
372 }
373 int stepx, stepy;
374 GetScrollPixelsPerUnit(&stepx, &stepy);
375
376 int startx, starty;
377 GetViewStart(&startx, &starty);
378 // first in vertical direction:
379 if (stepy > 0) {
380 int diff = 0;
381
382 if (winRect.GetTop() < 0) {
383 diff = winRect.GetTop();
384 } else if (winRect.GetBottom() > viewRect.GetHeight()) {
385 diff = winRect.GetBottom() - viewRect.GetHeight() + 1;
386 // round up to next scroll step if we can't get exact position,
387 // so that the window is fully visible:
388 diff += stepy - 1;
389 }
390 starty = (starty * stepy + diff) / stepy;
391 }
392 // then horizontal:
393 if (stepx > 0) {
394 int diff = 0;
395 if (winRect.GetLeft() < 0) {
396 diff = winRect.GetLeft();
397 } else if (winRect.GetRight() > viewRect.GetWidth()) {
398 diff = winRect.GetRight() - viewRect.GetWidth() + 1;
399 // round up to next scroll step if we can't get exact position,
400 // so that the window is fully visible:
401 diff += stepx - 1;
402 }
403 startx = (startx * stepx + diff) / stepx;
404 }
405 Scroll(startx, starty);
406 }
407 };
408
409 m_page_view = new PageScrolledWindow(page_parent);
410 m_page_view->SetBackgroundColour(*wxWHITE);
411 m_page_sizer = new wxBoxSizer(wxVERTICAL);
412
413 m_page_view->SetSizer(m_page_sizer);
414 m_page_view->SetScrollbars(1, FromDIP(20), 1, 2);
415 //m_page_view->SetScrollRate( 5, 5 );
416
417 if (m_mode_region)
418 m_mode_region->Bind(wxEVT_TOGGLEBUTTON, &ParamsPanel::OnToggled, this);
419 //Bind(wxEVT_BUTTON, [this](wxCommandEvent &) { wxGetApp().plater()->search(false); }, wxID_FIND);
420 //m_export_to_file->Bind(wxEVT_BUTTON, [this](wxCommandEvent &) { wxGetApp().mainframe->export_config(); });
421 //m_import_from_file->Bind(wxEVT_BUTTON, [this](wxCommandEvent &) { wxGetApp().mainframe->load_config_file(); });
422}
#define _L(s)
Definition OBJ.cpp:34
#define style
Definition WipeTowerDialog.cpp:101
void show(Preset::Type type=Preset::TYPE_INVALID)
Definition UnsavedChangesDialog.cpp:2054
static DiffPresetDialog * ensure()
Definition Lazy.hpp:186
ModeSwitchButton * m_mode_view
Definition ParamsPanel.hpp:92
StaticBox * m_top_panel
Definition ParamsPanel.hpp:85
ParamsPanel(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(1800, 1080), long style=wxTAB_TRAVERSAL, const wxString &type=wxEmptyString)
Definition ParamsPanel.cpp:249
ScalableButton * m_mode_icon
Definition ParamsPanel.hpp:91
wxStaticText * m_title_label
Definition ParamsPanel.hpp:87
void OnToggled(wxCommandEvent &event)
Definition ParamsPanel.cpp:603
ScalableButton * m_tips_arrow
Definition ParamsPanel.hpp:89
struct Slic3r::GUI::ParamsPanel::Highlighter m_highlighter
SwitchButton * m_mode_region
Definition ParamsPanel.hpp:88
ScalableButton * m_setting_btn
Definition ParamsPanel.hpp:119
ScalableButton * m_compare_btn
Definition ParamsPanel.hpp:121
wxBoxSizer * m_top_sizer
Definition ParamsPanel.hpp:81
ScalableButton * m_process_icon
Definition ParamsPanel.hpp:86
wxScrolledWindow * m_page_view
Definition ParamsPanel.hpp:116
wxBoxSizer * m_page_sizer
Definition ParamsPanel.hpp:117
int mode_to_selection(ConfigOptionMode mode)
Definition ParamsPanel.cpp:47
@ comDevelop
Definition Config.hpp:225
@ comExpert
Definition Config.hpp:224
Slic3r::Polygons diff(const Slic3r::Polygon &subject, const Slic3r::Polygon &clip, ApplySafetyOffset do_safety_offset)
Definition ClipperUtils.cpp:731
int em_unit(wxWindow *win)
Definition wxExtensions.cpp:424

References ParamsPanel(), _L, Slic3r::comDevelop, Slic3r::comExpert, Slic3r::diff(), em_unit(), Slic3r::GUI::LazyInstance< DiffPresetDialog >::ensure(), m_compare_btn, m_highlighter, m_mode_icon, m_mode_region, m_mode_view, m_page_sizer, m_page_view, m_process_icon, m_setting_btn, m_tips_arrow, m_title_label, m_top_panel, m_top_sizer, OnToggled(), Slic3r::GUI::DiffPresetDialog::show(), and style.

Referenced by ParamsPanel(), and Slic3r::GUI::ParamsPanel::SettingsPagePrebuild::SettingsPagePrebuild().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~ParamsPanel()

Slic3r::GUI::ParamsPanel::~ParamsPanel ( )
891{
892#if 0
893 free_sizers();
894 delete m_top_sizer;
895
897#endif
898 // BBS: fix double destruct of OG_CustomCtrl
899 Tab* cur_tab = dynamic_cast<Tab*> (m_current_tab);
900 if (cur_tab)
901 cur_tab->clear_pages();
902}
void delete_subwindows()
Definition ParamsPanel.cpp:810
wxPanel * m_current_tab
Definition ParamsPanel.hpp:126
void free_sizers()
Definition ParamsPanel.cpp:793

References Slic3r::GUI::Tab::clear_pages(), delete_subwindows(), free_sizers(), m_current_tab, and m_top_sizer.

Here is the call graph for this function:

Member Function Documentation

◆ clear_page()

void Slic3r::GUI::ParamsPanel::clear_page ( )
564{
565 if (m_page_sizer)
566 m_page_sizer->Clear(true);
567}

References m_page_sizer.

◆ create_layout()

void Slic3r::GUI::ParamsPanel::create_layout ( )
425{
426#ifdef __WINDOWS__
427 this->SetDoubleBuffered(true);
428 m_page_view->SetDoubleBuffered(true);
429#endif //__WINDOWS__
430
431 m_left_sizer = new wxBoxSizer( wxVERTICAL );
432 // BBS: new layout
433 m_left_sizer->SetMinSize( wxSize(40 * em_unit(this), -1 ) );
434
435 if (m_top_panel) {
436 m_mode_sizer = new wxBoxSizer( wxHORIZONTAL );
437 m_mode_sizer->Add(m_process_icon, 0, wxALIGN_CENTER | wxLEFT , FromDIP(SidebarProps::TitlebarMargin()));
438 m_mode_sizer->Add(m_title_label , 0, wxALIGN_CENTER | wxLEFT , FromDIP(SidebarProps::ElementSpacing()));
439 m_mode_sizer->Add(m_mode_region , 0, wxALIGN_CENTER | wxLEFT , FromDIP(SidebarProps::WideSpacing()));
440 m_mode_sizer->Add(m_tips_arrow , 0, wxALIGN_CENTER | wxLEFT , FromDIP(SidebarProps::ElementSpacing()));
441 m_mode_sizer->AddSpacer(FromDIP(SidebarProps::IconSpacing())); // ensure there is spacing after control when sidebar has less width
442 m_mode_sizer->AddStretchSpacer();
443 m_mode_sizer->Add(m_mode_icon , 0, wxALIGN_CENTER | wxRIGHT, FromDIP(SidebarProps::ElementSpacing()));
444 m_mode_sizer->Add(m_mode_view , 0, wxALIGN_CENTER | wxRIGHT, FromDIP(SidebarProps::WideSpacing()));
445 m_mode_sizer->Add(m_setting_btn , 0, wxALIGN_CENTER | wxRIGHT, FromDIP(SidebarProps::WideSpacing()));
446 m_mode_sizer->Add(m_compare_btn , 0, wxALIGN_CENTER | wxRIGHT, FromDIP(SidebarProps::TitlebarMargin()));
447 //m_mode_sizer->Add( m_search_btn, 0, wxALIGN_CENTER );
448 //m_mode_sizer->AddSpacer(16);
449 m_mode_sizer->SetMinSize(-1, FromDIP(30));
450 m_top_panel->SetSizer(m_mode_sizer);
451 //m_left_sizer->Add( m_top_panel, 0, wxEXPAND );
452 }
453
454 if (m_tab_print) {
455 //m_print_sizer = new wxBoxSizer( wxHORIZONTAL );
456 //m_print_sizer->Add( m_tab_print, 1, wxEXPAND | wxALL, 5 );
457 //m_left_sizer->Add( m_print_sizer, 1, wxEXPAND, 5 );
458 m_left_sizer->Add( m_tab_print, 0, wxEXPAND );
459 }
460
461 if (m_tab_print_plate) {
462 m_left_sizer->Add(m_tab_print_plate, 0, wxEXPAND);
463 }
464
465 if (m_tab_print_object) {
466 m_left_sizer->Add( m_tab_print_object, 0, wxEXPAND );
467 }
468
469 if (m_tab_print_part) {
470 m_left_sizer->Add( m_tab_print_part, 0, wxEXPAND );
471 }
472
473 if (m_tab_print_layer) {
474 m_left_sizer->Add(m_tab_print_layer, 0, wxEXPAND);
475 }
476
477 if (m_tab_filament) {
478 //m_filament_sizer = new wxBoxSizer( wxVERTICAL );
479 //m_filament_sizer->Add( m_tab_filament, 1, wxEXPAND | wxALL, 5 );
480 // m_left_sizer->Add( m_filament_sizer, 1, wxEXPAND, 5 );
481 m_left_sizer->Add( m_tab_filament, 0, wxEXPAND );
482 }
483
484 if (m_tab_printer) {
485 //m_printer_sizer = new wxBoxSizer( wxVERTICAL );
486 //m_printer_sizer->Add( m_tab_printer, 1, wxEXPAND | wxALL, 5 );
487 m_left_sizer->Add( m_tab_printer, 0, wxEXPAND );
488 }
489
490 //m_left_sizer->Add( m_printer_sizer, 1, wxEXPAND, 1 );
491
492 //m_button_sizer = new wxBoxSizer( wxHORIZONTAL );
493
494 //m_button_sizer->Add( m_export_to_file, 0, wxALL, 5 );
495
496 //m_button_sizer->Add( m_import_from_file, 0, wxALL, 5 );
497
498 //m_left_sizer->Add( m_button_sizer, 0, wxALIGN_CENTER, 5 );
499
500 m_top_sizer->Add(m_left_sizer, 1, wxEXPAND);
501
502 //m_right_sizer = new wxBoxSizer( wxVERTICAL );
503
504 //m_right_sizer->Add( m_page_view, 1, wxEXPAND | wxALL, 5 );
505
506 //m_top_sizer->Add( m_right_sizer, 1, wxEXPAND, 5 );
507 // BBS: new layout
508 m_left_sizer->AddSpacer(6 * em_unit(this) / 10);
509#if __WXOSX__
510 m_left_sizer->Add(m_tmp_panel, 1, wxEXPAND | wxALL, 0);
511 m_tmp_panel->GetSizer()->Add( m_page_view, 1, wxEXPAND );
512#else
513 m_left_sizer->Add( m_page_view, 1, wxEXPAND );
514#endif
515
516 //this->SetSizer( m_top_sizer );
517 this->Layout();
518}
wxPanel * m_tab_print_part
Definition ParamsPanel.hpp:100
wxPanel * m_tab_print_plate
Definition ParamsPanel.hpp:97
wxPanel * m_tab_print
Definition ParamsPanel.hpp:96
wxPanel * m_tab_filament
Definition ParamsPanel.hpp:105
wxBoxSizer * m_mode_sizer
Definition ParamsPanel.hpp:83
wxBoxSizer * m_left_sizer
Definition ParamsPanel.hpp:82
wxPanel * m_tab_print_object
Definition ParamsPanel.hpp:98
wxPanel * m_tab_printer
Definition ParamsPanel.hpp:108
wxPanel * m_tab_print_layer
Definition ParamsPanel.hpp:101
static int ElementSpacing()
Definition Plater.hpp:153
static int WideSpacing()
Definition Plater.hpp:152
static int IconSpacing()
Definition Plater.hpp:151
static int TitlebarMargin()
Definition Plater.hpp:148

References Slic3r::GUI::SidebarProps::ElementSpacing(), em_unit(), Slic3r::GUI::SidebarProps::IconSpacing(), m_compare_btn, m_left_sizer, m_mode_icon, m_mode_region, m_mode_sizer, m_mode_view, m_page_view, m_process_icon, m_setting_btn, m_tab_filament, m_tab_print, m_tab_print_layer, m_tab_print_object, m_tab_print_part, m_tab_print_plate, m_tab_printer, m_tips_arrow, m_title_label, m_top_panel, m_top_sizer, Slic3r::GUI::SidebarProps::TitlebarMargin(), and Slic3r::GUI::SidebarProps::WideSpacing().

Referenced by rebuild_panels().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ delete_subwindows()

void Slic3r::GUI::ParamsPanel::delete_subwindows ( )
private
811{
812 if (m_title_label)
813 {
814 delete m_title_label;
815 m_title_label = nullptr;
816 }
817
818 if (m_mode_region)
819 {
820 delete m_mode_region;
821 m_mode_region = nullptr;
822 }
823
824 if (m_mode_view)
825 {
826 m_mode_view = nullptr;
827 }
828
829 if (m_mode_icon) // ORCA m_title_view replacement
830 {
831 delete m_mode_icon;
832 m_mode_icon = nullptr;
833 }
834
835 if (m_search_btn)
836 {
837 delete m_search_btn;
838 m_search_btn = nullptr;
839 }
840
842 {
843 delete m_staticline_print;
844 m_staticline_print = nullptr;
845 }
846
848 {
850 m_staticline_print_part = nullptr;
851 }
852
854 {
857 }
858
860 {
862 m_staticline_filament = nullptr;
863 }
864
866 {
868 m_staticline_printer = nullptr;
869 }
870
872 {
873 delete m_export_to_file;
874 m_export_to_file = nullptr;
875 }
876
878 {
879 delete m_import_from_file;
880 m_import_from_file = nullptr;
881 }
882
883 if (m_page_view)
884 {
885 delete m_page_view;
886 m_page_view = nullptr;
887 }
888}
wxStaticLine * m_staticline_printer
Definition ParamsPanel.hpp:106
wxStaticLine * m_staticline_filament
Definition ParamsPanel.hpp:103
wxStaticLine * m_staticline_print_object
Definition ParamsPanel.hpp:99
wxWindow * m_export_to_file
Definition ParamsPanel.hpp:112
ScalableButton * m_search_btn
Definition ParamsPanel.hpp:120
wxStaticLine * m_staticline_print
Definition ParamsPanel.hpp:94
wxWindow * m_import_from_file
Definition ParamsPanel.hpp:113
wxStaticLine * m_staticline_print_part
Definition ParamsPanel.hpp:102

References m_export_to_file, m_import_from_file, m_mode_icon, m_mode_region, m_mode_view, m_page_view, m_search_btn, m_staticline_filament, m_staticline_print, m_staticline_print_object, m_staticline_print_part, m_staticline_printer, and m_title_label.

Referenced by ~ParamsPanel().

Here is the caller graph for this function:

◆ filament_panel()

wxPanel * Slic3r::GUI::ParamsPanel::filament_panel ( )
inline
188{ return m_tab_filament; }

References m_tab_filament.

◆ free_sizers()

void Slic3r::GUI::ParamsPanel::free_sizers ( )
private
794{
795 if (m_top_sizer)
796 {
797 m_top_sizer->Clear(false);
798 //m_top_sizer = nullptr;
799 }
800
801 m_left_sizer = nullptr;
802 //m_right_sizer = nullptr;
803 m_mode_sizer = nullptr;
804 //m_print_sizer = nullptr;
805 //m_filament_sizer = nullptr;
806 //m_printer_sizer = nullptr;
807 m_button_sizer = nullptr;
808}
wxBoxSizer * m_button_sizer
Definition ParamsPanel.hpp:111

References m_button_sizer, m_left_sizer, m_mode_sizer, and m_top_sizer.

Referenced by ~ParamsPanel(), and rebuild_panels().

Here is the caller graph for this function:

◆ get_current_tab()

wxPanel * Slic3r::GUI::ParamsPanel::get_current_tab ( )
inline
191{ return m_current_tab; }

References m_current_tab.

◆ get_paged_view()

wxScrolledWindow * Slic3r::GUI::ParamsPanel::get_paged_view ( )
inline
190{ return m_page_view;}

References m_page_view.

◆ get_top_panel()

StaticBox * Slic3r::GUI::ParamsPanel::get_top_panel ( )
inline
186{ return m_top_panel; }

References m_top_panel.

◆ is_active_and_shown_tab()

bool Slic3r::GUI::ParamsPanel::is_active_and_shown_tab ( wxPanel * tab)
677{
678 if (m_current_tab == tab)
679 return true;
680 else
681 return false;
682}

References m_current_tab.

◆ msw_rescale()

void Slic3r::GUI::ParamsPanel::msw_rescale ( )
715{
716 if (m_process_icon) m_process_icon->msw_rescale();
717 if (m_setting_btn) m_setting_btn->msw_rescale();
718 if (m_search_btn) m_search_btn->msw_rescale();
719 if (m_compare_btn) m_compare_btn->msw_rescale();
720 if (m_tips_arrow) m_tips_arrow->msw_rescale();
721 m_left_sizer->SetMinSize(wxSize(40 * em_unit(this), -1));
722 if (m_mode_sizer)
723 m_mode_sizer->SetMinSize(-1, 3 * em_unit(this));
724 if (m_mode_region)
725 ((SwitchButton* )m_mode_region)->Rescale();
726 if (m_mode_icon) m_mode_icon->msw_rescale();
727 if (m_mode_view)
728 {
729 m_mode_view->Rescale();
730 }
732 if (tab) dynamic_cast<Tab*>(tab)->msw_rescale();
733 }
734 //((Button*)m_export_to_file)->Rescale();
735 //((Button*)m_import_from_file)->Rescale();
736}
void msw_rescale()
Definition ParamsPanel.cpp:714

References em_unit(), m_compare_btn, m_left_sizer, m_mode_icon, m_mode_region, m_mode_sizer, m_mode_view, m_process_icon, m_search_btn, m_setting_btn, m_tab_filament, m_tab_print, m_tab_print_layer, m_tab_print_object, m_tab_print_part, m_tab_print_plate, m_tab_printer, m_tips_arrow, and msw_rescale().

Referenced by msw_rescale().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ notify_object_config_changed()

void Slic3r::GUI::ParamsPanel::notify_object_config_changed ( )
755{
756 auto & model = wxGetApp().model();
757 bool has_config = false;
758 for (auto obj : model.objects) {
759 if (!obj->config.empty()) {
760 SettingsFactory::Bundle cat_options = SettingsFactory::get_bundle(&obj->config.get(), true);
761 if (cat_options.size() > 0) {
762 has_config = true;
763 break;
764 }
765 }
766 for (auto volume : obj->volumes) {
767 if (!volume->config.empty()) {
768 SettingsFactory::Bundle cat_options = SettingsFactory::get_bundle(&volume->config.get(), true);
769 if (cat_options.size() > 0) {
770 has_config = true;
771 break;
772 }
773 }
774 }
775 if (has_config) break;
776 }
777 if (has_config == m_has_object_config) return;
778 m_has_object_config = has_config;
779 if (has_config)
780 m_mode_region->SetTextColor2(StateColor(std::pair{0xfffffe, (int) StateColor::Checked}, std::pair{wxGetApp().get_label_clr_modified(), 0}));
781 else
782 m_mode_region->SetTextColor2(StateColor());
783 m_mode_region->Rescale();
784}
bool m_has_object_config
Definition ParamsPanel.hpp:144
@ Checked
Definition StateColor.hpp:18
static Bundle get_bundle(const DynamicPrintConfig *config, bool is_object_settings, bool is_layer_settings=false)
Definition GUI_Factories.cpp:299
std::map< std::string, std::vector< std::string > > Bundle
Definition GUI_Factories.hpp:34

References StateColor::Checked, Slic3r::GUI::SettingsFactory::get_bundle(), m_has_object_config, and m_mode_region.

Here is the call graph for this function:

◆ OnActivate()

void Slic3r::GUI::ParamsPanel::OnActivate ( )
571{
572 if (m_current_tab == NULL)
574 Tab* cur_tab = dynamic_cast<Tab *> (m_current_tab);
575 if (cur_tab)
576 cur_tab->OnActivate();
577}
void select_default_tab()
Definition ParamsPanel.cpp:579

References m_current_tab, Slic3r::GUI::Tab::OnActivate(), and select_default_tab().

Here is the call graph for this function:

◆ OnToggled()

void Slic3r::GUI::ParamsPanel::OnToggled ( wxCommandEvent & event)
protected
604{
605 if (m_mode_region && m_mode_region->GetId() == event.GetId()) {
606 wxWindowUpdateLocker locker(GetParent());
607 set_active_tab(nullptr);
608 event.Skip();
609 return;
610 }
611
612 event.Skip();
613}
void set_active_tab(wxPanel *tab)
Definition ParamsPanel.cpp:616

References m_mode_region, and set_active_tab().

Referenced by ParamsPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rebuild_panels()

void Slic3r::GUI::ParamsPanel::rebuild_panels ( )
521{
522 refresh_tabs();
523 free_sizers();
525}
void create_layout()
Definition ParamsPanel.cpp:424
void refresh_tabs()
Definition ParamsPanel.cpp:527

References create_layout(), free_sizers(), and refresh_tabs().

Here is the call graph for this function:

◆ refresh_tabs()

void Slic3r::GUI::ParamsPanel::refresh_tabs ( )
private
528{
529 auto& tabs_list = wxGetApp().tabs_list;
530 auto print_tech = wxGetApp().preset_bundle->printers.get_selected_preset().printer_technology();
531 for (auto tab : tabs_list)
532 if (tab->supports_printer_technology(print_tech))
533 {
534 if (tab->GetParent() != this) continue;
535 switch (tab->type())
536 {
539 m_tab_print = tab;
540 break;
541
544 m_tab_filament = tab;
545 break;
546
548 m_tab_printer = tab;
549 break;
550 default:
551 break;
552 }
553 }
554 if (m_top_panel) {
555 m_tab_print_plate = wxGetApp().get_plate_tab();
556 m_tab_print_object = wxGetApp().get_model_tab();
557 m_tab_print_part = wxGetApp().get_model_tab(true);
558 m_tab_print_layer = wxGetApp().get_layer_tab();
559 }
560 return;
561}
@ TYPE_SLA_PRINT
Definition Preset.hpp:247
@ TYPE_PRINTER
Definition Preset.hpp:250
@ TYPE_PRINT
Definition Preset.hpp:246
@ TYPE_SLA_MATERIAL
Definition Preset.hpp:249
@ TYPE_FILAMENT
Definition Preset.hpp:248

References m_tab_filament, m_tab_print, m_tab_print_layer, m_tab_print_object, m_tab_print_part, m_tab_print_plate, m_tab_printer, m_top_panel, Slic3r::Preset::TYPE_FILAMENT, Slic3r::Preset::TYPE_PRINT, Slic3r::Preset::TYPE_PRINTER, Slic3r::Preset::TYPE_SLA_MATERIAL, and Slic3r::Preset::TYPE_SLA_PRINT.

Referenced by rebuild_panels().

Here is the caller graph for this function:

◆ select_default_tab()

void Slic3r::GUI::ParamsPanel::select_default_tab ( )
580{
581 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": first time opened, set current tab to print");
582 // BBS: open/close tab
583 //m_current_tab = m_tab_print;
585}

References m_tab_filament, m_tab_print, and set_active_tab().

Referenced by OnActivate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_active_tab()

void Slic3r::GUI::ParamsPanel::set_active_tab ( wxPanel * tab)
617{
618 Tab* cur_tab = dynamic_cast<Tab *> (tab);
619
620 if (cur_tab == nullptr) {
621 if (!m_mode_region->GetValue()) {
622 cur_tab = (Tab*) m_tab_print;
623 } else if (m_tab_print_part && ((TabPrintModel*) m_tab_print_part)->has_model_config()) {
624 cur_tab = (Tab*) m_tab_print_part;
625 } else if (m_tab_print_layer && ((TabPrintModel*)m_tab_print_layer)->has_model_config()) {
626 cur_tab = (Tab*)m_tab_print_layer;
627 } else if (m_tab_print_object && ((TabPrintModel*) m_tab_print_object)->has_model_config()) {
628 cur_tab = (Tab*) m_tab_print_object;
629 } else if (m_tab_print_plate && ((TabPrintPlate*)m_tab_print_plate)->has_model_config()) {
630 cur_tab = (Tab*)m_tab_print_plate;
631 }
632 Show(cur_tab != nullptr);
633 wxGetApp().sidebar().show_object_list(m_mode_region->GetValue());
634 if (m_current_tab == cur_tab)
635 return;
636 if (cur_tab)
637 cur_tab->restore_last_select_item();
638 return;
639 }
640
641 m_current_tab = tab;
642 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": set current to %1%, type=%2%") % cur_tab % cur_tab?cur_tab->type():-1;
643 update_mode();
644
645 // BBS: open/close tab
646 for (auto t : std::vector<std::pair<wxPanel*, wxStaticLine*>>({
650 {m_tab_print_layer, nullptr},
651 {m_tab_print_plate, nullptr},
654 if (!t.first) continue;
655 t.first->Show(tab == t.first);
656 if (!t.second) continue;
657 t.second->Show(tab == t.first);
658 //m_left_sizer->GetItem(t)->SetProportion(tab == t ? 1 : 0);
659 }
660 m_left_sizer->Layout();
661 if (auto dialog = dynamic_cast<wxDialog*>(GetParent())) {
662 wxString title = cur_tab->type() == Preset::TYPE_FILAMENT ? _L("Material settings") : _L("Printer settings");
663 dialog->SetTitle(title);
664 }
665
666 auto tab_print = dynamic_cast<Tab *>(m_tab_print);
667 if (cur_tab == m_tab_print) {
668 if (tab_print)
669 tab_print->toggle_line("print_flow_ratio", false);
670 } else {
671 if (tab_print)
672 tab_print->toggle_line("print_flow_ratio", false);
673 }
674}
void update_mode()
Definition ParamsPanel.cpp:684

References _L, m_current_tab, m_left_sizer, m_mode_region, m_staticline_filament, m_staticline_print, m_staticline_print_object, m_staticline_print_part, m_staticline_printer, m_tab_filament, m_tab_print, m_tab_print_layer, m_tab_print_object, m_tab_print_part, m_tab_print_plate, m_tab_printer, Slic3r::GUI::Tab::restore_last_select_item(), Slic3r::GUI::Tab::type(), Slic3r::Preset::TYPE_FILAMENT, and update_mode().

Referenced by OnToggled(), select_default_tab(), switch_to_global(), switch_to_object(), and switch_to_object_if_has_object_configs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ settings_page_prebuild()

LazyBase & Slic3r::GUI::ParamsPanel::settings_page_prebuild ( )
inline
175{ return m_settings_page_prebuild; }

◆ switch_to_global()

void Slic3r::GUI::ParamsPanel::switch_to_global ( )
739{
740 m_mode_region->SetValue(false);
741 set_active_tab(nullptr);
742}

References m_mode_region, and set_active_tab().

Here is the call graph for this function:

◆ switch_to_object()

void Slic3r::GUI::ParamsPanel::switch_to_object ( bool with_tips = false)
745{
746 m_mode_region->SetValue(true);
747 set_active_tab(nullptr);
748 if (with_tips) {
750 m_highlighter.blink();
751 }
752}
bool m_tips_arror_blink
Definition ParamsPanel.hpp:90

References m_highlighter, m_mode_region, m_tips_arror_blink, m_tips_arrow, m_top_panel, and set_active_tab().

Here is the call graph for this function:

◆ switch_to_object_if_has_object_configs()

void Slic3r::GUI::ParamsPanel::switch_to_object_if_has_object_configs ( )
787{
789 m_mode_region->SetValue(true);
790 set_active_tab(nullptr);
791}

References m_has_object_config, m_mode_region, and set_active_tab().

Here is the call graph for this function:

◆ update_mode()

void Slic3r::GUI::ParamsPanel::update_mode ( )
685{
686 int app_mode = Slic3r::GUI::wxGetApp().get_mode();
687 auto sync_mode_view = [&](ModeSwitchButton* mode_view) {
688 if (mode_view == nullptr)
689 return;
690
691 if (app_mode == comDevelop) {
692 mode_view->SetSelection(mode_to_selection(comExpert));
693 mode_view->SetDevMode(true);
694 return;
695 }
696
697 mode_view->SetSelection(mode_to_selection(Slic3r::GUI::wxGetApp().get_saved_mode()));
698 if (mode_view->GetDevMode())
699 mode_view->SetDevMode(false);
700 };
701
702 sync_mode_view(m_mode_view);
703 sync_mode_view(m_current_tab ? dynamic_cast<Tab*>(m_current_tab)->m_mode_view : nullptr);
704
705 auto sync_mode_icon = [&](ScalableButton* mode_icon) {
706 if (mode_icon == nullptr)
707 return;
708 mode_icon->Show(app_mode != comDevelop);
709 };
710 sync_mode_icon(m_mode_icon);
711 sync_mode_icon(m_current_tab ? dynamic_cast<Tab*>(m_current_tab)->m_mode_icon : nullptr);
712}

References Slic3r::comDevelop, Slic3r::comExpert, m_current_tab, m_mode_icon, and m_mode_view.

Referenced by set_active_tab().

Here is the caller graph for this function:

Member Data Documentation

◆ m_button_sizer

wxBoxSizer* Slic3r::GUI::ParamsPanel::m_button_sizer { nullptr }
protected
111{ nullptr };

Referenced by free_sizers().

◆ m_compare_btn

ScalableButton* Slic3r::GUI::ParamsPanel::m_compare_btn { nullptr }
protected
121{ nullptr };

Referenced by ParamsPanel(), create_layout(), and msw_rescale().

◆ m_current_tab

wxPanel* Slic3r::GUI::ParamsPanel::m_current_tab { nullptr }
protected

◆ m_export_to_file

wxWindow* Slic3r::GUI::ParamsPanel::m_export_to_file { nullptr }
protected
112{ nullptr };

Referenced by delete_subwindows().

◆ m_has_object_config

bool Slic3r::GUI::ParamsPanel::m_has_object_config { false }
protected

◆ m_highlighter

struct Slic3r::GUI::ParamsPanel::Highlighter Slic3r::GUI::ParamsPanel::m_highlighter
protected

Referenced by ParamsPanel(), and switch_to_object().

◆ m_import_from_file

wxWindow* Slic3r::GUI::ParamsPanel::m_import_from_file { nullptr }
protected
113{ nullptr };

Referenced by delete_subwindows().

◆ m_left_sizer

wxBoxSizer* Slic3r::GUI::ParamsPanel::m_left_sizer { nullptr }
protected
82{ nullptr };

Referenced by create_layout(), free_sizers(), msw_rescale(), and set_active_tab().

◆ m_mode_icon

ScalableButton* Slic3r::GUI::ParamsPanel::m_mode_icon { nullptr }
protected
91{ nullptr }; // ORCA

Referenced by ParamsPanel(), create_layout(), delete_subwindows(), msw_rescale(), and update_mode().

◆ m_mode_region

◆ m_mode_sizer

wxBoxSizer* Slic3r::GUI::ParamsPanel::m_mode_sizer { nullptr }
protected
83{ nullptr };

Referenced by create_layout(), free_sizers(), and msw_rescale().

◆ m_mode_view

ModeSwitchButton* Slic3r::GUI::ParamsPanel::m_mode_view { nullptr }
protected

◆ m_page_sizer

wxBoxSizer* Slic3r::GUI::ParamsPanel::m_page_sizer { nullptr }
protected
117{ nullptr };

Referenced by ParamsPanel(), and clear_page().

◆ m_page_view

wxScrolledWindow* Slic3r::GUI::ParamsPanel::m_page_view { nullptr }
protected
116{ nullptr };

Referenced by ParamsPanel(), create_layout(), delete_subwindows(), and get_paged_view().

◆ m_process_icon

ScalableButton* Slic3r::GUI::ParamsPanel::m_process_icon { nullptr }
protected
86{ nullptr };

Referenced by ParamsPanel(), create_layout(), and msw_rescale().

◆ m_search_btn

ScalableButton* Slic3r::GUI::ParamsPanel::m_search_btn { nullptr }
protected
120{ nullptr };

Referenced by delete_subwindows(), and msw_rescale().

◆ m_setting_btn

ScalableButton* Slic3r::GUI::ParamsPanel::m_setting_btn { nullptr }
protected
119{ nullptr };

Referenced by ParamsPanel(), create_layout(), and msw_rescale().

◆ m_staticline_filament

wxStaticLine* Slic3r::GUI::ParamsPanel::m_staticline_filament { nullptr }
protected
103{ nullptr };

Referenced by delete_subwindows(), and set_active_tab().

◆ m_staticline_print

wxStaticLine* Slic3r::GUI::ParamsPanel::m_staticline_print { nullptr }
protected
94{ nullptr };

Referenced by delete_subwindows(), and set_active_tab().

◆ m_staticline_print_object

wxStaticLine* Slic3r::GUI::ParamsPanel::m_staticline_print_object { nullptr }
protected
99{ nullptr };

Referenced by delete_subwindows(), and set_active_tab().

◆ m_staticline_print_part

wxStaticLine* Slic3r::GUI::ParamsPanel::m_staticline_print_part { nullptr }
protected
102{ nullptr };

Referenced by delete_subwindows(), and set_active_tab().

◆ m_staticline_printer

wxStaticLine* Slic3r::GUI::ParamsPanel::m_staticline_printer { nullptr }
protected
106{ nullptr };

Referenced by delete_subwindows(), and set_active_tab().

◆ m_tab_filament

wxPanel* Slic3r::GUI::ParamsPanel::m_tab_filament { nullptr }
protected

◆ m_tab_print

wxPanel* Slic3r::GUI::ParamsPanel::m_tab_print { nullptr }
protected

◆ m_tab_print_layer

wxPanel* Slic3r::GUI::ParamsPanel::m_tab_print_layer { nullptr }
protected
101{ nullptr };

Referenced by create_layout(), msw_rescale(), refresh_tabs(), and set_active_tab().

◆ m_tab_print_object

wxPanel* Slic3r::GUI::ParamsPanel::m_tab_print_object { nullptr }
protected
98{ nullptr };

Referenced by create_layout(), msw_rescale(), refresh_tabs(), and set_active_tab().

◆ m_tab_print_part

wxPanel* Slic3r::GUI::ParamsPanel::m_tab_print_part { nullptr }
protected
100{ nullptr };

Referenced by create_layout(), msw_rescale(), refresh_tabs(), and set_active_tab().

◆ m_tab_print_plate

wxPanel* Slic3r::GUI::ParamsPanel::m_tab_print_plate { nullptr }
protected
97{ nullptr };

Referenced by create_layout(), msw_rescale(), refresh_tabs(), and set_active_tab().

◆ m_tab_printer

wxPanel* Slic3r::GUI::ParamsPanel::m_tab_printer { nullptr }
protected
108{ nullptr };

Referenced by create_layout(), msw_rescale(), refresh_tabs(), and set_active_tab().

◆ m_tips_arror_blink

bool Slic3r::GUI::ParamsPanel::m_tips_arror_blink {false}
protected
90{false};

Referenced by switch_to_object().

◆ m_tips_arrow

ScalableButton* Slic3r::GUI::ParamsPanel::m_tips_arrow {nullptr}
protected
89{nullptr};

Referenced by ParamsPanel(), create_layout(), msw_rescale(), and switch_to_object().

◆ m_title_label

wxStaticText* Slic3r::GUI::ParamsPanel::m_title_label { nullptr }
protected
87{ nullptr };

Referenced by ParamsPanel(), create_layout(), and delete_subwindows().

◆ m_toggle_off_icon

wxBitmap Slic3r::GUI::ParamsPanel::m_toggle_off_icon
protected

◆ m_toggle_on_icon

wxBitmap Slic3r::GUI::ParamsPanel::m_toggle_on_icon
protected

◆ m_top_panel

StaticBox* Slic3r::GUI::ParamsPanel::m_top_panel { nullptr }
protected

◆ m_top_sizer

wxBoxSizer* Slic3r::GUI::ParamsPanel::m_top_sizer { nullptr }
protected
81{ nullptr };

Referenced by ParamsPanel(), ~ParamsPanel(), create_layout(), and free_sizers().

◆ this

Slic3r::GUI::ParamsPanel::SettingsPagePrebuild * Slic3r::GUI::ParamsPanel::this
protected

The documentation for this class was generated from the following files: