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

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

Inheritance diagram for Slic3r::GUI::ExtruderOptionsGroup:
Collaboration diagram for Slic3r::GUI::ExtruderOptionsGroup:

Public Member Functions

 ExtruderOptionsGroup (wxWindow *parent, const wxString &title, const wxString &icon, DynamicPrintConfig *config=nullptr, bool is_tab_opt=false, column_t extra_clmn=nullptr)
void on_change_OG (const t_config_option_key &opt_id, const boost::any &value) override
const wxString & config_category () const throw ()
int config_type () const override throw ()
const t_opt_map & opt_map () const throw ()
void set_config_category_and_type (const wxString &category, int type)
void set_config (DynamicPrintConfig *config)
Option get_option (const std::string &opt_key, int opt_index=-1)
Line create_single_option_line (const std::string &title, const std::string &path=std::string(), int idx=-1)
Line create_single_option_line (const Option &option, const std::string &path=std::string()) const
void append_single_option_line (const Option &option, const std::string &path=std::string())
void append_single_option_line (const std::string title, const std::string &path=std::string(), int idx=-1)
void back_to_initial_value (const std::string &opt_key) override
void back_to_sys_value (const std::string &opt_key) override
void back_to_config_value (const DynamicPrintConfig &config, const std::string &opt_key)
void on_kill_focus (const std::string &opt_key) override
void reload_config ()
void Hide ()
void Show (const bool show)
bool is_visible (ConfigOptionMode mode)
bool update_visibility (ConfigOptionMode mode)
void msw_rescale ()
void sys_color_changed ()
void refresh ()
boost::any config_value (const std::string &opt_key, int opt_index, bool deserialize)
boost::any get_config_value (const DynamicPrintConfig &config, const std::string &opt_key, int opt_index=-1)
boost::any get_config_value2 (const DynamicPrintConfig &config, const std::string &opt_key, int opt_index=-1)
bool commit_config_value (const t_config_option_key &opt_key, int opt_index=-1)
Field * get_fieldc (const t_config_option_key &opt_key, int opt_index)
std::pair< OG_CustomCtrl *, bool * > get_custom_ctrl_with_blinking_ptr (const t_config_option_key &opt_key, int opt_index)
wxWindow * parent () const
 Returns a copy of the pointer of the parent wxWindow. Accessor function is because users are not allowed to change the parent but defining it as const means a lot of const_casts to deal with wx functions.
wxWindow * ctrl_parent () const
void append_line (const Line &line)
void activate_line (Line &line)
Line * get_line (const std::string &opt_key)
bool activate (std::function< void()> throw_if_canceled=[](){}, int horiz_alignment=wxALIGN_LEFT)
void clear (bool destroy_custom_ctrl=false)
void append_separator ()
Field * get_field (const t_config_option_key &id) const
bool set_value (const t_config_option_key &id, const boost::any &value, bool change_event=false)
boost::any get_value (const t_config_option_key &id)
void show_field (const t_config_option_key &opt_key, bool show=true)
void hide_field (const t_config_option_key &opt_key)
void enable_field (const t_config_option_key &opt_key, bool enable=true)
void disable_field (const t_config_option_key &opt_key)
void set_name (const wxString &new_name)
void enable ()
void disable ()
void set_grid_vgap (int gap)
void clear_fields_except_of (const std::vector< std::string > left_fields)
void hide_labels ()
wxGridSizer * get_grid_sizer ()
const std::vector< Line > & get_lines ()
bool is_legend_line ()
void set_max_win_width (int max_win_width)
bool is_activated ()
void remove_option_if (std::function< bool(std::string const &)> const &comp)

Static Public Member Functions

static wxString get_url (const std::string &path_end)
static bool launch_browser (const std::string &path_end)

Public Attributes

const bool staticbox {true}
bool split_multi_line {false}
bool option_label_at_right {false}
wxWindow * stb { nullptr }
const wxString icon
const wxString title
bool m_labels_hidden {false}
size_t label_width = 20
wxSizer * sizer {nullptr}
OG_CustomCtrl * custom_ctrl { nullptr }
int ctrl_horiz_alignment { wxALIGN_LEFT}
column_t extra_column {nullptr}
t_change m_on_change { nullptr }
t_kill_focus m_fill_empty_value { nullptr }
std::function< DynamicPrintConfig()> m_get_initial_config { nullptr }
std::function< DynamicPrintConfig()> m_get_sys_config { nullptr }
std::function< bool()> have_sys_config { nullptr }
std::function< void(wxWindow *win)> rescale_extra_column_item { nullptr }
std::function< void(wxWindow *win)> rescale_near_label_widget { nullptr }
std::function< void(const t_config_option_key &opt_key)> edit_custom_gcode { nullptr }
wxFont sidetext_font {wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT) }
wxFont label_font {wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT) }
int sidetext_width { -1 }
int sublabel_width { -1 }
bool draw_multi_extruder { false }

Protected Member Functions

void change_opt_value (const t_config_option_key &opt_key, const boost::any &value, int opt_index=0)
const t_field & build_field (const t_config_option_key &id, const ConfigOptionDef &opt)
 Generate a wxSizer or wxWindow from a configuration option Precondition: opt resolves to a known ConfigOption Postcondition: fields contains a wx gui object.
const t_field & build_field (const t_config_option_key &id)
const t_field & build_field (const Option &opt)
std::string pick_plugin (const ConfigOptionDef &opt)

Protected Attributes

const DynamicPrintConfig * m_config {nullptr}
ModelConfig * m_modelconfig { nullptr }
t_opt_map m_opt_map
wxString m_config_category
int m_config_type
std::map< t_config_option_key, Option > m_options
wxWindow * m_parent {nullptr}
std::vector< ConfigOptionMode > m_options_mode
std::vector< wxWindow * > m_extra_column_item_ptrs
std::vector< Line > m_lines
t_optionfield_map m_fields
 Field list, contains unique_ptrs of the derived type. using types that need to know what it is beyond the public interface need to cast based on the related ConfigOptionDef.
bool m_disabled {false}
wxGridSizer * m_grid_sizer {nullptr}
bool m_use_custom_ctrl { false }
bool m_use_custom_ctrl_as_parent { false }

Detailed Description

Constructor & Destructor Documentation

◆ ExtruderOptionsGroup()

Slic3r::GUI::ExtruderOptionsGroup::ExtruderOptionsGroup ( wxWindow * parent,
const wxString & title,
const wxString & icon,
DynamicPrintConfig * config = nullptr,
bool is_tab_opt = false,
column_t extra_clmn = nullptr )
inline
400 :
401 ConfigOptionsGroup(parent, title, icon, config, is_tab_opt, extra_clmn) {}
ConfigOptionsGroup(wxWindow *parent, const wxString &title, const wxString &icon, DynamicPrintConfig *config=nullptr, bool is_tab_opt=false, column_t extra_clmn=nullptr)
Definition OptionsGroup.hpp:311
const wxString icon
Definition OptionsGroup.hpp:160
const wxString title
Definition OptionsGroup.hpp:161
wxWindow * parent() const
Returns a copy of the pointer of the parent wxWindow. Accessor function is because users are not allo...
Definition OptionsGroup.hpp:190

References Slic3r::GUI::ConfigOptionsGroup::ConfigOptionsGroup(), Slic3r::GUI::OptionsGroup::icon, Slic3r::GUI::OptionsGroup::parent(), and Slic3r::GUI::OptionsGroup::title.

Here is the call graph for this function:

Member Function Documentation

◆ activate()

bool Slic3r::GUI::OptionsGroup::activate ( std::function< void()> throw_if_canceled = [](){},
int horiz_alignment = wxALIGN_LEFT )
inherited
537{
538 if (sizer) //(!sizer->IsEmpty())
539 return false;
540
541 try {
542 if (staticbox) {
543 // ORCA match style of wxStaticBox between platforms
544 LabeledStaticBox* stb = new LabeledStaticBox(m_parent, _(title));
545 // wxGetApp().UpdateDarkUI(stb);
546 this->stb = stb;
547 sizer = new wxStaticBoxSizer(stb, wxVERTICAL);
548 } else {
549 // BBS: new layout
550 ::StaticLine* stl = new ::StaticLine(m_parent, false, _(title), icon);
551 stl->SetFont(Label::Head_14);
552 stl->SetForegroundColour("#363636"); // ORCA Match Parameters title color with tab title color
553 sizer = new wxBoxSizer(wxVERTICAL);
554 if (title.IsEmpty()) {
555 stl->Hide();
556 } else {
557 sizer->Add(stl, 0, wxEXPAND);
558 sizer->AddSpacer(8);
559 }
560 this->stb = stl;
561 }
562
563 auto num_columns = 1U;
564 size_t grow_col = 1;
565
566 if (label_width == 0)
567 grow_col = 0;
568 else
569 num_columns++;
570
571 if (extra_column) {
572 num_columns++;
573 grow_col++;
574 }
575
576 m_grid_sizer = new wxFlexGridSizer(0, num_columns, 1, 0);
577 static_cast<wxFlexGridSizer*>(m_grid_sizer)->SetFlexibleDirection(wxBOTH);
578 static_cast<wxFlexGridSizer*>(m_grid_sizer)->AddGrowableCol(grow_col);
579
580 sizer->Add(m_grid_sizer, 0, wxEXPAND | wxALL, !staticbox ? 0 : 5);
581
582 // activate lines
583 for (Line& line : m_lines) {
584 throw_if_canceled();
585 activate_line(line);
586 }
587
588 ctrl_horiz_alignment = horiz_alignment;
589 if (custom_ctrl)
590 custom_ctrl->init_max_win_width();
591 } catch (UIBuildCanceled&) {
592 auto p = sizer;
593 this->clear();
594 p->Clear(true);
595 delete p;
596 throw;
597 }
598
599 return true;
600}
#define _(s)
Definition 3mf.cpp:306
static wxFont Head_14
Definition Label.hpp:45
std::vector< Line > m_lines
Definition OptionsGroup.hpp:264
void clear(bool destroy_custom_ctrl=false)
Definition OptionsGroup.cpp:605
const bool staticbox
Definition OptionsGroup.hpp:155
int ctrl_horiz_alignment
Definition OptionsGroup.hpp:166
column_t extra_column
Definition OptionsGroup.hpp:167
wxSizer * sizer
Definition OptionsGroup.hpp:164
wxGridSizer * m_grid_sizer
Definition OptionsGroup.hpp:271
size_t label_width
Definition OptionsGroup.hpp:163
wxWindow * stb
Definition OptionsGroup.hpp:159
wxWindow * m_parent
Definition OptionsGroup.hpp:260
void activate_line(Line &line)
Definition OptionsGroup.cpp:309
OG_CustomCtrl * custom_ctrl
Definition OptionsGroup.hpp:165

References _, activate_line(), clear(), ctrl_horiz_alignment, custom_ctrl, extra_column, Label::Head_14, icon, label_width, m_grid_sizer, m_lines, m_parent, sizer, staticbox, stb, and title.

Here is the call graph for this function:

◆ activate_line()

void Slic3r::GUI::OptionsGroup::activate_line ( Line & line)
inherited

To correct translation by context have to use wxGETTEXT_IN_CONTEXT macro from wxWidget 3.1.1

.target<wxWindow>()

requires verification

istead of (opt != option_set.back())

requires verification

310{
311 if (line.is_separator())
312 return;
313
315
316 if (line.full_width && (line.widget != nullptr || !line.get_extra_widgets().empty())) {
317 // BBS: new layout
318 const auto h_sizer = new wxBoxSizer(wxHORIZONTAL);
319 sizer->Add(h_sizer, 1, wxEXPAND | wxALL, (wxOSX && !staticbox) ? 0 : 15);
320 if (line.widget != nullptr) {
321 // description lines
322 sizer->Add(line.widget(this->ctrl_parent()), 0, wxEXPAND | wxALL, (wxOSX && !staticbox) ? 0 : 15);
323 return;
324 }
325 if (!line.get_extra_widgets().empty()) {
326 bool is_first_item = true;
327 for (auto extra_widget : line.get_extra_widgets()) {
328 h_sizer->Add(extra_widget(this->ctrl_parent()), is_first_item ? 1 : 0, wxLEFT, titleWidth * wxGetApp().em_unit());
329 is_first_item = false;
330 }
331 return;
332 }
333 }
334
335 auto option_set = line.get_options();
336 bool is_legend_line = option_set.front().opt.gui_type == ConfigOptionDef::GUIType::legend;
337
339 custom_ctrl = new OG_CustomCtrl(is_legend_line || !staticbox ? this->parent() : static_cast<wxWindow*>(this->stb), this);
340 // BBS: new layout
341 custom_ctrl->SetLabel("");
342 if (is_legend_line)
343 sizer->Add(custom_ctrl, 0, wxEXPAND | wxLEFT, (wxOSX && !staticbox) ? 0 : 10);
344 else
345 sizer->Add(custom_ctrl, 0, wxEXPAND | wxALL, !staticbox ? 0 : 5);
346 }
347
348 // Set sidetext width for a better alignment of options in line
349 // "m_show_modified_btns==true" means that options groups are in tabs
350 if (option_set.size() > 1 && m_use_custom_ctrl) {
353 }
354
355 // if we have a single option with no label, no sidetext just add it directly to sizer
356 if (option_set.size() == 1 && label_width == 0 && option_set.front().opt.full_width && option_set.front().opt.sidetext.size() == 0 &&
357 option_set.front().side_widget == nullptr && line.get_extra_widgets().size() == 0) {
358 const auto& option = option_set.front();
359 const auto& field = build_field(option);
360
361 // BBS: new layout
362 const auto h_sizer = new wxBoxSizer(wxHORIZONTAL);
363 sizer->Add(h_sizer, 1, wxEXPAND | wxALL, (wxOSX && !staticbox) ? 0 : 5);
364
365 int left_padding = option.opt.multiline ? 0 : titleWidth * wxGetApp().em_unit();
366 if (m_labels_hidden)
367 left_padding = 0;
368
369 if (is_window_field(field)) {
370 int flags = wxEXPAND;
371 if (left_padding > 0)
372 flags |= wxLEFT;
373 h_sizer->Add(field->getWindow(), 1, flags, left_padding);
374 }
375 if (is_sizer_field(field)) {
376 int flags = wxEXPAND;
377 if (left_padding > 0)
378 flags |= wxLEFT;
379 h_sizer->Add(field->getSizer(), 1, flags, left_padding);
380 }
381 return;
382 }
383
384 auto grid_sizer = m_grid_sizer;
385
386 if (custom_ctrl)
388
389 // if we have an extra column, build it
390 if (extra_column) {
391 m_extra_column_item_ptrs.push_back(extra_column(this->ctrl_parent(), line));
392 grid_sizer->Add(m_extra_column_item_ptrs.back(), 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 3);
393 }
394
395 // Build a label if we have it
396 wxStaticText* label = nullptr;
397 if (label_width != 0) {
398 if (custom_ctrl) {
399 if (line.near_label_widget)
400 line.near_label_widget_win = line.near_label_widget(this->ctrl_parent());
401 } else {
402 if (!line.near_label_widget || !line.label.IsEmpty()) {
403 // Only create the label if it is going to be displayed.
404 long label_style = staticbox ? 0 : wxALIGN_RIGHT;
405#ifdef __WXGTK__
406 // workaround for correct text align of the StaticBox on Linux
407 // flags wxALIGN_RIGHT and wxALIGN_CENTRE don't work when Ellipsize flags are _not_ given.
408 // Text is properly aligned only when Ellipsize is checked.
409 label_style |= staticbox ? 0 : wxST_ELLIPSIZE_END;
410#endif /* __WXGTK__ */
411 label = new wxStaticText(this->ctrl_parent(), wxID_ANY, line.label + (line.label.IsEmpty() ? "" : ": "), wxDefaultPosition,
412 wxSize(label_width * wxGetApp().em_unit(), -1), label_style);
413 label->SetBackgroundStyle(wxBG_STYLE_PAINT);
414 label->SetFont(wxGetApp().normal_font());
415 label->Wrap(label_width * wxGetApp().em_unit()); // avoid a Linux/GTK bug
416 }
417 if (!line.near_label_widget)
418 grid_sizer->Add(label, 0, (staticbox ? 0 : wxALIGN_RIGHT | wxRIGHT) | wxALIGN_CENTER_VERTICAL, line.label.IsEmpty() ? 0 : 5);
419 else if (!line.label.IsEmpty()) {
420 // If we're here, we have some widget near the label
421 // so we need a horizontal sizer to arrange these things
422 auto sizer = new wxBoxSizer(wxHORIZONTAL);
423 grid_sizer->Add(sizer, 0, wxEXPAND | (staticbox ? wxALL : wxBOTTOM | wxTOP | wxLEFT), staticbox ? 0 : 1);
424 sizer->Add(label, 0, (staticbox ? 0 : wxALIGN_RIGHT | wxRIGHT) | wxALIGN_CENTER_VERTICAL, 5);
425 }
426 if (label != nullptr && line.label_tooltip != "")
427 label->SetToolTip(line.label_tooltip);
428 line.label_widget = label;
429 }
430 }
431
432 // If there's a widget, build it and add the result to the sizer.
433 if (line.widget != nullptr) {
434 auto wgt = line.widget(this->ctrl_parent());
435 if (custom_ctrl)
436 line.widget_sizer = wgt;
437 else
438 grid_sizer->Add(wgt, 0, wxEXPAND | wxBOTTOM | wxTOP, (wxOSX || line.label.IsEmpty()) ? 0 : 5);
439 return;
440 }
441
442 // If we're here, we have more than one option or a single option with sidetext
443 // so we need a horizontal sizer to arrange these things
444 auto sizer = custom_ctrl ? nullptr : new wxBoxSizer(wxHORIZONTAL);
445 if (!custom_ctrl)
446 grid_sizer->Add(sizer, 0, wxEXPAND | (staticbox ? wxALL : wxBOTTOM | wxTOP | wxLEFT), staticbox ? 0 : 1);
447 // If we have a single option with no sidetext just add it directly to the grid sizer
448 if (option_set.size() == 1 && option_set.front().opt.sidetext.size() == 0 && option_set.front().side_widget == nullptr &&
449 line.get_extra_widgets().size() == 0) {
450 const auto& option = option_set.front();
451 const auto& field = build_field(option);
452
453 if (!custom_ctrl) {
454 int flags = option.opt.full_width ? wxEXPAND : wxALIGN_CENTER_VERTICAL;
455 if (m_labels_hidden)
456 flags &= ~wxALIGN_CENTER_VERTICAL;
457 int border = (wxOSX || !staticbox) ? 0 : 2;
458
459 if (is_window_field(field))
460 sizer->Add(field->getWindow(), option.opt.full_width ? 1 : 0, wxBOTTOM | wxTOP | flags, border);
461 if (is_sizer_field(field))
462 sizer->Add(field->getSizer(), 1, flags, 0);
463 }
464 return;
465 }
466
467 bool is_multioption_line = option_set.size() > 1;
468 for (auto opt : option_set) {
469 ConfigOptionDef option = opt.opt;
470 wxSizer* sizer_tmp = sizer;
471 // add label if any
472 if ((is_multioption_line || line.label.IsEmpty()) && !option.label.empty() && !custom_ctrl) {
474 wxString str_label = (option.label == L_CONTEXT("Top", "Layers") || option.label == L_CONTEXT("Bottom", "Layers")) ?
475 _L_CONTEXT(option.label, "Layers") :
476 _(option.label);
477 label = new wxStaticText(this->ctrl_parent(), wxID_ANY, str_label + ": ", wxDefaultPosition, // wxDefaultSize);
478 wxSize(sublabel_width != -1 ? sublabel_width * wxGetApp().em_unit() : -1, -1), wxALIGN_RIGHT);
479 label->SetBackgroundStyle(wxBG_STYLE_PAINT);
480 label->SetFont(wxGetApp().normal_font());
481 sizer_tmp->Add(label, 0, wxALIGN_CENTER_VERTICAL, 0);
482 }
483
484 // add field
485 const Option& opt_ref = opt;
486 auto& field = build_field(opt_ref);
487 if (!custom_ctrl) {
488 if (option_set.size() == 1 && option_set.front().opt.full_width) {
489 const auto v_sizer = new wxBoxSizer(wxVERTICAL);
490 sizer_tmp->Add(v_sizer, 1, wxEXPAND);
491 is_sizer_field(field) ? v_sizer->Add(field->getSizer(), 0, wxEXPAND) : v_sizer->Add(field->getWindow(), 0, wxEXPAND);
492 break;
493 }
494
495 is_sizer_field(field) ? sizer_tmp->Add(field->getSizer(), 0, wxALIGN_CENTER_VERTICAL, 0) :
496 sizer_tmp->Add(field->getWindow(), 0, wxALIGN_CENTER_VERTICAL, 0);
497
498 // add sidetext if any
499 if (!field->combine_side_text() && (!option.sidetext.empty() || sidetext_width > 0)) {
500 auto sidetext = new wxStaticText(this->ctrl_parent(), wxID_ANY, _(option.sidetext), wxDefaultPosition,
501 wxSize(sidetext_width != -1 ? sidetext_width * wxGetApp().em_unit() : -1, -1),
502 wxALIGN_LEFT);
503 sidetext->SetBackgroundStyle(wxBG_STYLE_PAINT);
504 sidetext->SetFont(wxGetApp().normal_font());
505 sizer_tmp->Add(sidetext, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 4);
506 }
507
508 // add side widget if any
509 if (opt.side_widget != nullptr) {
510 sizer_tmp->Add(opt.side_widget(this->ctrl_parent()) , 0, wxLEFT | wxALIGN_CENTER_VERTICAL,
511 1);
512 }
513
514 if (opt.opt_id != option_set.back().opt_id)
515 sizer_tmp->AddSpacer(6);
516 }
517 }
518
519 // add extra sizers if any
520 for (auto extra_widget : line.get_extra_widgets()) {
521 if (line.get_extra_widgets().size() == 1 && !staticbox) {
522 // extra widget for non-staticbox option group (like for the frequently used parameters on the sidebar) should be wxALIGN_RIGHT
523 const auto v_sizer = new wxBoxSizer(wxVERTICAL);
524 sizer->Add(v_sizer, option_set.size() == 1 ? 0 : 1, wxEXPAND);
525 v_sizer->Add(extra_widget(this->ctrl_parent()), 0, wxALIGN_RIGHT);
526 return;
527 }
528
529 line.extra_widget_sizer = extra_widget(this->ctrl_parent());
530 if (!custom_ctrl)
531 sizer->Add(line.extra_widget_sizer, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 4);
532 }
533}
#define L_CONTEXT(s, context)
Definition DesignOffer.hpp:17
#define wxOSX
Definition Field.cpp:94
class WXDLLIMPEXP_FWD_CORE wxStaticText
Definition ProgressDialog.hpp:30
@ legend
Definition Config.hpp:2331
static int def_width()
Definition Field.cpp:401
static int def_width_thinner()
Definition Field.cpp:403
int sidetext_width
Definition OptionsGroup.hpp:183
bool m_labels_hidden
Definition OptionsGroup.hpp:162
const t_field & build_field(const t_config_option_key &id, const ConfigOptionDef &opt)
Generate a wxSizer or wxWindow from a configuration option Precondition: opt resolves to a known Conf...
Definition OptionsGroup.cpp:57
bool is_legend_line()
Definition OptionsGroup.cpp:178
int sublabel_width
Definition OptionsGroup.hpp:184
bool m_use_custom_ctrl
Definition OptionsGroup.hpp:273
wxWindow * ctrl_parent() const
Definition OptionsGroup.cpp:171
std::vector< wxWindow * > m_extra_column_item_ptrs
Definition OptionsGroup.hpp:262
bool m_use_custom_ctrl_as_parent
Definition OptionsGroup.hpp:276
bool is_window_field(const t_field &obj)
Covenience function to determine whether this field is a valid window field.
Definition Field.hpp:319
constexpr int titleWidth
Definition OG_CustomCtrl.cpp:36
bool is_sizer_field(const t_field &obj)
Covenience function to determine whether this field is a valid sizer field.
Definition Field.hpp:322
#define _L_CONTEXT(s, ctx)
Definition I18N.hpp:15
int em_unit(wxWindow *win)
Definition wxExtensions.cpp:424

References _, _L_CONTEXT, build_field(), ctrl_parent(), custom_ctrl, Slic3r::GUI::Field::def_width(), Slic3r::GUI::Field::def_width_thinner(), em_unit(), extra_column, Slic3r::GUI::Line::extra_widget_sizer, Slic3r::GUI::Line::full_width, Slic3r::GUI::Line::get_extra_widgets(), Slic3r::GUI::Line::get_options(), is_legend_line(), Slic3r::GUI::Line::is_separator(), Slic3r::GUI::is_sizer_field(), Slic3r::GUI::is_window_field(), L_CONTEXT, Slic3r::ConfigOptionDef::label, Slic3r::GUI::Line::label, Slic3r::GUI::Line::label_tooltip, Slic3r::GUI::Line::label_widget, label_width, Slic3r::ConfigOptionDef::legend, m_extra_column_item_ptrs, m_grid_sizer, m_labels_hidden, m_use_custom_ctrl, m_use_custom_ctrl_as_parent, Slic3r::GUI::Line::near_label_widget, Slic3r::GUI::Line::near_label_widget_win, parent(), Slic3r::ConfigOptionDef::sidetext, sidetext_width, sizer, staticbox, stb, sublabel_width, Slic3r::GUI::titleWidth, Slic3r::GUI::Line::widget, Slic3r::GUI::Line::widget_sizer, wxOSX, and wxStaticText.

Referenced by activate().

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

◆ append_line()

void Slic3r::GUI::OptionsGroup::append_line ( const Line & line)
inherited
260{
261 m_lines.emplace_back(line);
262
263 // Feed the searcher the row's wiki path (Line::label_path, for the Speed Dial's "open wiki"
264 // affordance) and the label the row actually draws, so a setting action is named like the page.
265 if (m_use_custom_ctrl) {
266 Search::SettingsIndex& index = wxGetApp().sidebar().settings_index();
267 const Preset::Type type = static_cast<Preset::Type>(config_type());
268 const bool multi = line.get_options().size() > 1;
269 for (const auto& opt : line.get_options()) {
270 if (!line.label_path.empty())
271 index.set_path(opt.opt_id, type, line.label_path);
272 // Mirror the sub-label OG_CustomCtrl draws for a multi-option row, so the palette
273 // names each field like the page does.
274 const std::string& leaf_src = opt.opt.label;
275 const wxString leaf = (leaf_src == L_CONTEXT("Top", "Layers") || leaf_src == L_CONTEXT("Bottom", "Layers")) ?
276 _L_CONTEXT(leaf_src, "Layers") :
277 _(leaf_src);
278 index.set_line_label(opt.opt_id, type, Search::compose_display_label(line.label, leaf, multi),
279 Search::compose_display_label(line.label_en, from_u8(leaf_src), multi));
280 }
281 }
282
283 if (line.full_width && (line.widget != nullptr || !line.get_extra_widgets().empty()))
284 return;
285
286 auto option_set = line.get_options();
287 for (auto opt : option_set)
288 m_options.emplace(opt.opt_id, opt);
289
290 // add mode value for current line to m_options_mode
291 if (!option_set.empty())
292 m_options_mode.push_back(option_set[0].opt.mode);
293}
std::vector< ConfigOptionMode > m_options_mode
Definition OptionsGroup.hpp:261
virtual int config_type() const
Definition OptionsGroup.hpp:299
std::map< t_config_option_key, Option > m_options
Definition OptionsGroup.hpp:259
Type
Definition Preset.hpp:244
wxString from_u8(const std::string &str)
Definition GUI.cpp:544
wxString compose_display_label(const wxString &line_label, const wxString &leaf_label, bool multi)
Definition SettingsIndex.hpp:39

References _, _L_CONTEXT, Slic3r::Search::compose_display_label(), config_type(), Slic3r::GUI::from_u8(), Slic3r::GUI::Line::full_width, Slic3r::GUI::Line::get_extra_widgets(), Slic3r::GUI::Line::get_options(), L_CONTEXT, Slic3r::GUI::Line::label, Slic3r::GUI::Line::label_en, Slic3r::GUI::Line::label_path, m_lines, m_options, m_options_mode, m_use_custom_ctrl, Slic3r::Search::SettingsIndex::set_line_label(), Slic3r::Search::SettingsIndex::set_path(), and Slic3r::GUI::Line::widget.

Referenced by append_single_option_line(), Slic3r::GUI::Tab::build_preset_description_line(), and Slic3r::GUI::Tab::create_line_with_widget().

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

◆ append_separator()

void Slic3r::GUI::OptionsGroup::append_separator ( )
inherited
307{ m_lines.emplace_back(Line()); }

References m_lines.

◆ append_single_option_line() [1/2]

void Slic3r::GUI::ConfigOptionsGroup::append_single_option_line ( const Option & option,
const std::string & path = std::string() )
inlineinherited
338 {
340 }
void append_single_option_line(const Option &option, const std::string &path=std::string())
Definition OptionsGroup.hpp:206

References Slic3r::GUI::OptionsGroup::append_single_option_line().

Referenced by append_single_option_line(), and Slic3r::GUI::PhysicalPrinterDialog::build_printhost_settings().

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

◆ append_single_option_line() [2/2]

void Slic3r::GUI::ConfigOptionsGroup::append_single_option_line ( const std::string title,
const std::string & path = std::string(),
int idx = -1 )
inlineinherited
342 {
343 Option option = get_option(title, idx);
344 append_single_option_line(option, path);
345 }
void append_single_option_line(const Option &option, const std::string &path=std::string())
Definition OptionsGroup.hpp:338
Option get_option(const std::string &opt_key, int opt_index=-1)
Definition OptionsGroup.cpp:678

References append_single_option_line(), get_option(), and Slic3r::GUI::OptionsGroup::title.

Here is the call graph for this function:

◆ back_to_config_value()

void Slic3r::GUI::ConfigOptionsGroup::back_to_config_value ( const DynamicPrintConfig & config,
const std::string & opt_key )
inherited
813{
814 boost::any value;
815 if (opt_key == "extruders_count") {
816 auto* nozzle_diameter = dynamic_cast<const ConfigOptionFloats*>(config.option("nozzle_diameter"));
817 value = int(nozzle_diameter->values.size());
818 }
819#if 0
820 // BBS
821 else if (opt_key == "bed_temperature" || opt_key == "bed_temperature_initial_layer") {
822 // BBS: config is preset initial value, not presets.m_edited_preset,
823 // so bed_type value does not contains modification.
824 //int bed_type = config.opt_enum("bed_type", 0);
825 if (!this->get_field("bed_type")) {
826 value = 0;
827 throw Slic3r::InvalidArgument("Too old 3MF which has no bed_type field.");
828 } else {
829 int bed_type = boost::any_cast<int>(this->get_field("bed_type")->get_value());
830 const ConfigOptionInts* bed_temps = dynamic_cast<const ConfigOptionInts*>(config.option(opt_key));
831 value = bed_type < bed_temps->size() ? bed_temps->get_at(bed_type) : 0;
832 }
833 }
834#endif
835 else if (opt_key == "printer_agent")
836 {
837 // A deregistered/"(missing)" saved id has no selectable row, so the field yields no
838 // value. Restore the saved id directly instead of letting the generic revert path read
839 // the field value back into the edited config.
840 const std::string saved_id = config.opt_string("printer_agent");
841 set_value(opt_key, saved_id);
842 this->change_opt_value(opt_key, saved_id);
843 OptionsGroup::on_change_OG(opt_key, saved_id);
844 return;
845 }
846 else if (m_opt_map.find(opt_key) == m_opt_map.end() ||
847 // This option don't have corresponded field
848 opt_key == "printable_area" || opt_key == "compatible_printers" || opt_key == "compatible_prints" || opt_key == "thumbnails" ||
849 opt_key == "bed_custom_texture" || opt_key == "bed_custom_model") {
850 value = get_config_value(config, opt_key);
851 set_value(opt_key, value);
852 this->change_opt_value(opt_key, get_value(opt_key));
853 OptionsGroup::on_change_OG(opt_key, get_value(opt_key));
854 return;
855 } else {
856 auto opt_id = m_opt_map.find(opt_key)->first;
857 std::string opt_short_key = m_opt_map.at(opt_id).first;
858 int opt_index = m_opt_map.at(opt_id).second;
859 value = get_config_value(config, opt_short_key, opt_index);
860 }
861
862 // BBS: restore all pages in preset
863 if (set_value(opt_key, value))
864 on_change_OG(opt_key, get_value(opt_key));
865 else if (m_opt_map.find(opt_key) != m_opt_map.end()) {
866 auto opt_id = m_opt_map.find(opt_key)->first;
867 std::string opt_short_key = m_opt_map.at(opt_id).first;
868 int opt_index = m_opt_map.at(opt_id).second;
869 on_change_OG(opt_key, get_config_value2(config, opt_short_key, opt_index));
870 }
871}
size_t size() const override
Definition Config.hpp:722
boost::any get_config_value(const DynamicPrintConfig &config, const std::string &opt_key, int opt_index=-1)
Definition OptionsGroup.cpp:1075
void on_change_OG(const t_config_option_key &opt_id, const boost::any &value) override
Definition OptionsGroup.cpp:694
void change_opt_value(const t_config_option_key &opt_key, const boost::any &value, int opt_index=0)
Definition OptionsGroup.cpp:1376
t_opt_map m_opt_map
Definition OptionsGroup.hpp:387
boost::any get_config_value2(const DynamicPrintConfig &config, const std::string &opt_key, int opt_index=-1)
Definition OptionsGroup.cpp:1233
virtual void on_change_OG(const t_config_option_key &opt_id, const boost::any &value)
Definition OptionsGroup.cpp:672
boost::any get_value(const t_config_option_key &id)
Definition OptionsGroup.hpp:220
bool set_value(const t_config_option_key &id, const boost::any &value, bool change_event=false)
Definition OptionsGroup.hpp:215
Field * get_field(const t_config_option_key &id) const
Definition OptionsGroup.hpp:210
zaa_minimize_perimeter_height nozzle_diameter((ConfigOptionBool, reduce_infill_retraction))((ConfigOptionBool
ConfigOptionIntsTempl< false > ConfigOptionInts
Definition Config.hpp:1154
ConfigOptionFloatsTempl< false > ConfigOptionFloats
Definition Config.hpp:1015

References change_opt_value(), Slic3r::ConfigOptionVector< int >::get_at(), get_config_value(), get_config_value2(), Slic3r::GUI::OptionsGroup::get_field(), Slic3r::GUI::OptionsGroup::get_value(), m_opt_map, Slic3r::nozzle_diameter(), on_change_OG(), Slic3r::GUI::OptionsGroup::on_change_OG(), Slic3r::DynamicConfig::opt_string(), Slic3r::ConfigBase::option(), Slic3r::GUI::OptionsGroup::set_value(), and Slic3r::ConfigOptionVector< int >::size().

Referenced by back_to_initial_value(), and back_to_sys_value().

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

◆ back_to_initial_value()

void Slic3r::GUI::ConfigOptionsGroup::back_to_initial_value ( const std::string & opt_key)
overridevirtualinherited

Reimplemented from Slic3r::GUI::OptionsGroup.

797{
798 if (m_get_initial_config == nullptr)
799 return;
801}
void back_to_config_value(const DynamicPrintConfig &config, const std::string &opt_key)
Definition OptionsGroup.cpp:812
std::function< DynamicPrintConfig()> m_get_initial_config
Definition OptionsGroup.hpp:172

References back_to_config_value(), and Slic3r::GUI::OptionsGroup::m_get_initial_config.

Here is the call graph for this function:

◆ back_to_sys_value()

void Slic3r::GUI::ConfigOptionsGroup::back_to_sys_value ( const std::string & opt_key)
overridevirtualinherited

Reimplemented from Slic3r::GUI::OptionsGroup.

804{
805 if (m_get_sys_config == nullptr)
806 return;
807 if (!have_sys_config())
808 return;
810}
std::function< DynamicPrintConfig()> m_get_sys_config
Definition OptionsGroup.hpp:173
std::function< bool()> have_sys_config
Definition OptionsGroup.hpp:174

References back_to_config_value(), Slic3r::GUI::OptionsGroup::have_sys_config, and Slic3r::GUI::OptionsGroup::m_get_sys_config.

Here is the call graph for this function:

◆ build_field() [1/3]

const t_field & Slic3r::GUI::OptionsGroup::build_field ( const Option & opt)
protectedinherited
50{ return build_field(opt.opt_id, opt.opt); }

References build_field().

Here is the call graph for this function:

◆ build_field() [2/3]

const t_field & Slic3r::GUI::OptionsGroup::build_field ( const t_config_option_key & id)
protectedinherited
52{
53 const ConfigOptionDef& opt = m_options.at(id).opt;
54 return build_field(id, opt);
55}

References build_field(), and m_options.

Here is the call graph for this function:

◆ build_field() [3/3]

const t_field & Slic3r::GUI::OptionsGroup::build_field ( const t_config_option_key & id,
const ConfigOptionDef & opt )
protectedinherited

Generate a wxSizer or wxWindow from a configuration option Precondition: opt resolves to a known ConfigOption Postcondition: fields contains a wx gui object.

This function will be called from Field. Call OptionGroup._on_change(...)

This function will be called from Field.

58{
59 // Check the gui_type field first, fall through
60 // is the normal type.
61 switch (opt.gui_type) {
62 case ConfigOptionDef::GUIType::select_open: m_fields.emplace(id, Choice::Create<Choice>(this->ctrl_parent(), opt, id)); break;
65 case ConfigOptionDef::GUIType::i_enum_open: m_fields.emplace(id, Choice::Create<Choice>(this->ctrl_parent(), opt, id)); break;
67 case ConfigOptionDef::GUIType::legend: // StaticText
68 m_fields.emplace(id, StaticText::Create<StaticText>(this->ctrl_parent(), opt, id));
69 break;
70 case ConfigOptionDef::GUIType::one_string: m_fields.emplace(id, TextCtrl::Create<TextCtrl>(this->ctrl_parent(), opt, id)); break;
75 break;
76 default:
77 switch (opt.type) {
80 case coFloat:
81 case coFloats:
82 case coPercent:
83 case coPercents:
84 case coString:
85 case coStrings:
86 m_fields.emplace(id, TextCtrl::Create<TextCtrl>(this->ctrl_parent(), opt, id));
87 break;
88 case coBool:
89 case coBools:
90 m_fields.emplace(id, CheckBox::Create<CheckBox>(this->ctrl_parent(), opt, id));
91 break;
92 case coInt:
93 case coInts:
94 m_fields.emplace(id, SpinCtrl::Create<SpinCtrl>(this->ctrl_parent(), opt, id));
95 break;
96 case coEnum:
97 case coEnums:
98 m_fields.emplace(id, Choice::Create<Choice>(this->ctrl_parent(), opt, id));
99 break;
100 case coPoint:
101 case coPoints:
102 m_fields.emplace(id, PointCtrl::Create<PointCtrl>(this->ctrl_parent(), opt, id));
103 break;
104 case coNone: break;
105 default:
106 throw Slic3r::LogicError("This control doesn't exist till now"); break;
107 }
108 }
109 // Grab a reference to fields for convenience
110 const t_field& field = m_fields[id];
111 field->m_on_change = [this](const std::string& opt_id, const boost::any& value) {
114 if (!m_disabled)
115 this->on_change_OG(opt_id, value);
116 };
117 field->m_on_kill_focus = [this](const std::string& opt_id) {
119 if (!m_disabled)
120 this->on_kill_focus(opt_id);
121 };
122 field->m_parent = parent();
123
124 if (edit_custom_gcode && opt.is_code) {
125 field->m_fn_edit_value = [this](std::string opt_id) {
126 if (!m_disabled)
127 this->edit_custom_gcode(opt_id);
128 };
129 field->set_edit_tooltip(_L("Edit Custom G-code"));
130 }
131
132 field->m_back_to_initial_value = [this](std::string opt_id) {
133 if (!m_disabled)
134 this->back_to_initial_value(opt_id);
135 };
136 field->m_back_to_sys_value = [this](std::string opt_id) {
137 if (!this->m_disabled)
138 this->back_to_sys_value(opt_id);
139 };
140
141 if (auto plugin_field = dynamic_cast<PluginField*>(field.get())) {
142 plugin_field->set_selector([this, plugin_field]() -> std::string {
143 if (m_disabled)
144 return {};
145 return this->pick_plugin(plugin_field->m_opt);
146 });
147 }
148
149 // The dialog behind the button edits one preset's overrides, so it has to know which preset. Set
150 // here because fields are built lazily on activate() — too late for the Tab to reach in afterwards.
151 if (auto plugin_config_field = dynamic_cast<PluginConfigField*>(field.get()))
152 if (auto config_group = dynamic_cast<ConfigOptionsGroup*>(this))
153 plugin_config_field->set_preset_type(config_group->config_type());
154
155 // assign function objects for callbacks, etc.
156 return field;
157}
#define _L(s)
Definition OBJ.cpp:34
@ plugin_config
Definition Config.hpp:2336
@ printer_agent_select
Definition Config.hpp:2338
@ slider
Definition Config.hpp:2329
@ f_enum_open
Definition Config.hpp:2323
@ i_enum_open
Definition Config.hpp:2321
@ one_string
Definition Config.hpp:2333
@ color
Definition Config.hpp:2325
@ plugin_picker
Definition Config.hpp:2334
@ select_open
Definition Config.hpp:2327
static t_field Create(wxWindow *parent, const ConfigOptionDef &opt, const t_config_option_key &id)
Factory method for generating new derived classes.
Definition Field.hpp:278
virtual void on_kill_focus(const std::string &opt_key)
Definition OptionsGroup.hpp:292
t_optionfield_map m_fields
Field list, contains unique_ptrs of the derived type. using types that need to know what it is beyond...
Definition OptionsGroup.hpp:269
virtual void back_to_sys_value(const std::string &opt_key)
Definition OptionsGroup.hpp:295
virtual void back_to_initial_value(const std::string &opt_key)
Definition OptionsGroup.hpp:294
bool m_disabled
Definition OptionsGroup.hpp:270
std::string pick_plugin(const ConfigOptionDef &opt)
Definition OptionsGroup.cpp:732
std::function< void(const t_config_option_key &opt_key)> edit_custom_gcode
Definition OptionsGroup.hpp:179
std::unique_ptr< Field > t_field
Definition Field.hpp:56
@ coFloatsOrPercents
Definition Config.hpp:202
@ coString
Definition Config.hpp:192
@ coPoint
Definition Config.hpp:204
@ coBools
Definition Config.hpp:212
@ coEnum
Definition Config.hpp:214
@ coPercents
Definition Config.hpp:198
@ coInts
Definition Config.hpp:190
@ coPoints
Definition Config.hpp:206
@ coInt
Definition Config.hpp:188
@ coNone
Definition Config.hpp:182
@ coBool
Definition Config.hpp:210
@ coFloat
Definition Config.hpp:184
@ coEnums
Definition Config.hpp:216
@ coFloatOrPercent
Definition Config.hpp:200
@ coStrings
Definition Config.hpp:194
@ coFloats
Definition Config.hpp:186
@ coPercent
Definition Config.hpp:196

References _L, back_to_initial_value(), back_to_sys_value(), Slic3r::coBool, Slic3r::coBools, Slic3r::coEnum, Slic3r::coEnums, Slic3r::coFloat, Slic3r::coFloatOrPercent, Slic3r::coFloats, Slic3r::coFloatsOrPercents, Slic3r::coInt, Slic3r::coInts, Slic3r::ConfigOptionDef::color, Slic3r::coNone, Slic3r::coPercent, Slic3r::coPercents, Slic3r::coPoint, Slic3r::coPoints, Slic3r::coString, Slic3r::coStrings, Slic3r::GUI::Field::Create(), ctrl_parent(), edit_custom_gcode, Slic3r::ConfigOptionDef::f_enum_open, Slic3r::ConfigOptionDef::i_enum_open, Slic3r::ConfigOptionDef::legend, m_disabled, m_fields, on_change_OG(), on_kill_focus(), Slic3r::ConfigOptionDef::one_string, parent(), pick_plugin(), Slic3r::ConfigOptionDef::plugin_config, Slic3r::ConfigOptionDef::plugin_picker, Slic3r::ConfigOptionDef::printer_agent_select, Slic3r::ConfigOptionDef::select_open, and Slic3r::ConfigOptionDef::slider.

Referenced by activate_line(), build_field(), and build_field().

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

◆ change_opt_value()

void Slic3r::GUI::ConfigOptionsGroup::change_opt_value ( const t_config_option_key & opt_key,
const boost::any & value,
int opt_index = 0 )
protectedinherited
1378{
1379 Slic3r::GUI::change_opt_value(const_cast<DynamicPrintConfig&>(*m_config), opt_key, value, opt_index);
1380 if (m_modelconfig)
1381 m_modelconfig->touch();
1382}
ModelConfig * m_modelconfig
Definition OptionsGroup.hpp:386
const DynamicPrintConfig * m_config
Definition OptionsGroup.hpp:384
void change_opt_value(DynamicPrintConfig &config, const t_config_option_key &opt_key, const boost::any &value, int opt_index)
Definition GUI.cpp:140

References Slic3r::GUI::change_opt_value(), m_config, and m_modelconfig.

Referenced by back_to_config_value(), on_change_OG(), and Slic3r::GUI::ExtruderOptionsGroup::on_change_OG().

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

◆ clear()

void Slic3r::GUI::OptionsGroup::clear ( bool destroy_custom_ctrl = false)
inherited
606{
607 if (!sizer)
608 return;
609
610 m_grid_sizer = nullptr;
611 sizer = nullptr;
612 stb = nullptr; // BBS: fix pointer
613
614 for (Line& line : m_lines) {
615 if (line.near_label_widget_win)
616 line.near_label_widget_win = nullptr;
617 line.label_widget = nullptr;
618
619 if (line.widget_sizer) {
620 line.widget_sizer->Clear(true);
621 line.widget_sizer = nullptr;
622 }
623
624 if (line.extra_widget_sizer) {
625 line.extra_widget_sizer->Clear(true);
626 line.extra_widget_sizer = nullptr;
627 }
628 }
629
630 if (custom_ctrl) {
631 for (auto const& item : m_fields) {
632 wxWindow* win = item.second.get()->getWindow();
633 if (win) {
634 free_window(win);
635 win = nullptr;
636 }
637 }
638 // BBS: custom_ctrl already destroyed from sizer->clear(), no need to destroy here anymore
639 if (destroy_custom_ctrl)
640 // custom_ctrl->Destroy();
641 custom_ctrl = nullptr;
642 else
643 custom_ctrl = nullptr;
644 }
645
647 m_fields.clear();
648}
void free_window(wxWindow *win)
Definition Field.cpp:937

References custom_ctrl, Slic3r::GUI::free_window(), m_extra_column_item_ptrs, m_fields, m_grid_sizer, m_lines, sizer, and stb.

Referenced by ~OptionsGroup(), and activate().

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

◆ clear_fields_except_of()

void Slic3r::GUI::OptionsGroup::clear_fields_except_of ( const std::vector< std::string > left_fields)
inherited
662{
663 auto it = m_fields.begin();
664 while (it != m_fields.end()) {
665 if (std::find(left_fields.begin(), left_fields.end(), it->first) == left_fields.end())
666 it = m_fields.erase(it);
667 else
668 it++;
669 }
670}

References m_fields.

◆ commit_config_value()

bool Slic3r::GUI::ConfigOptionsGroup::commit_config_value ( const t_config_option_key & opt_key,
int opt_index = -1 )
inherited
1336{
1337 if (m_config == nullptr)
1338 return false;
1339
1340 // m_opt_map is filled while the option lines are created, so it still resolves the option when
1341 // the group's controls (and thus its fields) have not been built yet.
1342 const std::string opt_id = option_id_in_map(m_opt_map, opt_key, opt_index);
1343 if (opt_id.empty())
1344 return false;
1345
1346 on_change_OG(opt_id, get_config_value2(*m_config, opt_key, opt_index));
1347 return true;
1348}
std::string option_id_in_map(const t_opt_map &options, const t_config_option_key &opt_key, int &opt_index)
Definition OptionsGroup.hpp:129

References get_config_value2(), m_config, m_opt_map, on_change_OG(), and Slic3r::GUI::option_id_in_map().

Here is the call graph for this function:

◆ config_category()

const wxString & Slic3r::GUI::ConfigOptionsGroup::config_category ( ) const
throw ( )
inlineinherited
323{ return m_config_category; }
wxString m_config_category
Definition OptionsGroup.hpp:388

References m_config_category.

Referenced by get_option().

Here is the caller graph for this function:

◆ config_type()

int Slic3r::GUI::ConfigOptionsGroup::config_type ( ) const
throw ( )
inlineoverridevirtualinherited

Reimplemented from Slic3r::GUI::OptionsGroup.

324{ return m_config_type; }
int m_config_type
Definition OptionsGroup.hpp:389

References m_config_type.

Referenced by get_option().

Here is the caller graph for this function:

◆ config_value()

boost::any Slic3r::GUI::ConfigOptionsGroup::config_value ( const std::string & opt_key,
int opt_index,
bool deserialize )
inherited
1057{
1058 if (opt_key == "bed_type")
1059 return boost::any((int) BedType::btPC);
1060
1061 if (deserialize) {
1062 // Want to edit a vector value(currently only multi - strings) in a single edit box.
1063 // Aggregate the strings the old way.
1064 // Currently used for the post_process config value only.
1065 if (opt_index != -1)
1066 throw Slic3r::OutOfRange("Can't deserialize option indexed value");
1067 // return join(';', m_config->get(opt_key)});
1068 return get_config_value(*m_config, opt_key);
1069 } else {
1070 // return opt_index == -1 ? m_config->get(opt_key) : m_config->get_at(opt_key, opt_index);
1071 return get_config_value(*m_config, opt_key, opt_index);
1072 }
1073}
@ btPC
Definition PrintConfig.hpp:509
@ OutOfRange
Definition Thumbnails.hpp:21

References Slic3r::btPC, get_config_value(), m_config, and Slic3r::OutOfRange.

Referenced by reload_config().

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

◆ create_single_option_line() [1/2]

Line Slic3r::GUI::ConfigOptionsGroup::create_single_option_line ( const Option & option,
const std::string & path = std::string() ) const
inlineinherited
335 {
336 return OptionsGroup::create_single_option_line(option, path);
337 }
Line create_single_option_line(const Option &option, const std::string &path=std::string()) const
Definition OptionsGroup.cpp:650

References Slic3r::GUI::OptionsGroup::create_single_option_line().

Here is the call graph for this function:

◆ create_single_option_line() [2/2]

Line Slic3r::GUI::ConfigOptionsGroup::create_single_option_line ( const std::string & title,
const std::string & path = std::string(),
int idx = -1 )
inlineinherited
331 {
332 Option option = get_option(title, idx);
333 return OptionsGroup::create_single_option_line(option, path);
334 }

References Slic3r::GUI::OptionsGroup::create_single_option_line(), get_option(), and Slic3r::GUI::OptionsGroup::title.

Referenced by Slic3r::GUI::Tab::create_line_with_widget().

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

◆ ctrl_parent()

wxWindow * Slic3r::GUI::OptionsGroup::ctrl_parent ( ) const
inherited
172{
173 // BBS: new layout
174 return this->custom_ctrl && m_use_custom_ctrl_as_parent ? static_cast<wxWindow*>(this->custom_ctrl) :
175 (staticbox ? static_cast<wxWindow*>(this->stb) : this->parent());
176}

References custom_ctrl, m_use_custom_ctrl_as_parent, parent(), staticbox, and stb.

Referenced by activate_line(), and build_field().

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

◆ disable()

void Slic3r::GUI::OptionsGroup::disable ( )
inlineinherited
237{ for (auto& field : m_fields) field.second->disable(); }

References m_fields.

◆ disable_field()

void Slic3r::GUI::OptionsGroup::disable_field ( const t_config_option_key & opt_key)
inlineinherited
232{ enable_field(opt_key, false); }
void enable_field(const t_config_option_key &opt_key, bool enable=true)
Definition OptionsGroup.cpp:250

References enable_field().

Here is the call graph for this function:

◆ enable()

void Slic3r::GUI::OptionsGroup::enable ( )
inlineinherited
236{ for (auto& field : m_fields) field.second->enable(); }

References m_fields.

Referenced by enable_field().

Here is the caller graph for this function:

◆ enable_field()

void Slic3r::GUI::OptionsGroup::enable_field ( const t_config_option_key & opt_key,
bool enable = true )
inherited
251{
252 if (Field* f = get_field(opt_key); f) {
253 f->toggle(enable);
254 }
255}
void enable()
Definition OptionsGroup.hpp:236
static double f(double x, double z_sin, double z_cos, bool vertical, bool flip)
Definition FillGyroid.cpp:124

References enable(), Slic3r::f(), and get_field().

Referenced by disable_field().

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

◆ get_config_value()

boost::any Slic3r::GUI::ConfigOptionsGroup::get_config_value ( const DynamicPrintConfig & config,
const std::string & opt_key,
int opt_index = -1 )
inherited
1076{
1077 size_t idx = opt_index == -1 ? 0 : opt_index;
1078
1079 boost::any ret;
1080 wxString text_value = wxString("");
1081 const ConfigOptionDef* opt = config.def()->get(opt_key);
1082
1083 if (opt->nullable) {
1084 switch (opt->type) {
1085 case coPercents:
1086 case coFloats: {
1087 if (opt_index < 0 ? config.option(opt_key)->is_nil() :
1088 dynamic_cast<ConfigOptionVectorBase const*>(config.option(opt_key))->is_nil(opt_index))
1089 ret = _(L("N/A"));
1090 else {
1091 double val = opt->type == coFloats ? config.option<ConfigOptionFloatsNullable>(opt_key)->get_at(idx) :
1092 config.option<ConfigOptionPercentsNullable>(opt_key)->get_at(idx);
1093 ret = double_to_string(val);
1094 }
1095 break;
1096 }
1097 case coFloatsOrPercents: {
1098 if (opt_index < 0 ? config.option(opt_key)->is_nil() :
1099 dynamic_cast<ConfigOptionVectorBase const*>(config.option(opt_key))->is_nil(opt_index))
1100 ret = _(L("N/A"));
1101 else {
1102 const auto& value = config.option<ConfigOptionFloatsOrPercentsNullable>(opt_key)->get_at(idx);
1103 text_value = double_to_string(value.value);
1104 if (value.percent)
1105 text_value += "%";
1106
1107 ret = text_value;
1108 }
1109 break;
1110 }
1111 case coBools: ret = config.option<ConfigOptionBoolsNullable>(opt_key)->values[idx]; break;
1112 case coInts: ret = config.option<ConfigOptionIntsNullable>(opt_key)->get_at(idx); break;
1113 case coEnums: ret = config.option<ConfigOptionEnumsGenericNullable>(opt_key)->get_at(idx); break;
1114 default: break;
1115 }
1116 return ret;
1117 }
1118
1119 switch (opt->type) {
1120 case coFloatOrPercent: {
1121 const auto& value = *config.option<ConfigOptionFloatOrPercent>(opt_key);
1122
1123 text_value = double_to_string(value.value);
1124 if (value.percent)
1125 text_value += "%";
1126
1127 ret = text_value;
1128 break;
1129 }
1130 case coFloatsOrPercents: {
1131 const auto& value = config.option<ConfigOptionFloatsOrPercents>(opt_key)->get_at(idx);
1132
1133 text_value = double_to_string(value.value);
1134 if (value.percent)
1135 text_value += "%";
1136
1137 ret = text_value;
1138 break;
1139 }
1140 case coPercent: {
1141 double val = config.option<ConfigOptionPercent>(opt_key)->value;
1142 ret = double_to_string(val); // += "%";
1143 } break;
1144 case coPercents:
1145 case coFloats:
1146 case coFloat: {
1147 if (opt_key == "extruder_printable_height") {
1148 auto opt_values = dynamic_cast<const ConfigOptionFloatsNullable*>(config.option(opt_key))->values;
1149 if (!opt_values.empty()) {
1150 double val = opt_values[idx];
1151 ret = double_to_string(val);
1152 }
1153 } else {
1154 double val = opt->type == coFloats ? config.opt_float(opt_key, idx) :
1155 opt->type == coFloat ? config.opt_float(opt_key) :
1156 config.option<ConfigOptionPercents>(opt_key)->get_at(idx);
1157 ret = double_to_string(val);
1158 }
1159 break;
1160 }
1161 case coString: ret = from_u8(config.opt_string(opt_key)); break;
1162 case coStrings:
1163 if (opt_key == "compatible_printers" || opt_key == "compatible_prints") {
1164 ret = config.option<ConfigOptionStrings>(opt_key)->values;
1165 break;
1166 }
1167 if (opt->gui_type == ConfigOptionDef::GUIType::plugin_picker) {
1168 ret = config.option<ConfigOptionStrings>(opt_key)->values;
1169 break;
1170 }
1171 if (config.option<ConfigOptionStrings>(opt_key)->values.empty())
1172 ret = text_value;
1173 else if (opt->gui_flags == "serialized") {
1174 std::vector<std::string> values = config.option<ConfigOptionStrings>(opt_key)->values;
1175 if (!values.empty() && !values[0].empty())
1176 for (auto el : values)
1177 text_value += el + ";";
1178 ret = text_value;
1179 } else
1180 ret = from_u8(config.opt_string(opt_key, static_cast<unsigned int>(idx)));
1181 break;
1182 case coBool: ret = config.opt_bool(opt_key); break;
1183 case coBools: ret = config.opt_bool(opt_key, idx); break;
1184 case coInt: ret = config.opt_int(opt_key); break;
1185 case coInts: ret = config.opt_int(opt_key, idx); break;
1186 case coEnum:
1187 if (!config.has("first_layer_sequence_choice") && opt_key == "first_layer_sequence_choice") {
1188 // reset to Auto value
1189 ret = 0;
1190 break;
1191 }
1192 if (!config.has("other_layers_sequence_choice") && opt_key == "other_layers_sequence_choice") {
1193 // reset to Auto value
1194 ret = 0;
1195 break;
1196 }
1197 if (!config.has("curr_bed_type") && opt_key == "curr_bed_type") {
1198 // reset to global value
1199 DynamicConfig& global_cfg = wxGetApp().preset_bundle->project_config;
1200 ret = global_cfg.option("curr_bed_type")->getInt();
1201 break;
1202 }
1203 ret = config.option(opt_key)->getInt();
1204 break;
1205 // BBS
1206 case coEnums: ret = config.opt_int(opt_key, idx); break;
1207 case coPoint: ret = config.option<ConfigOptionPoint>(opt_key)->value; break;
1208 case coPoints:
1209 if (opt_key == "printable_area")
1210 ret = get_thumbnails_string(config.option<ConfigOptionPoints>(opt_key)->values);
1211 else if (opt_key == "bed_exclude_area")
1212 ret = from_u8(config.option<ConfigOptionPoints>(opt_key)->serialize());
1213 else if (opt_key == "wrapping_exclude_area")
1214 ret = get_thumbnails_string(config.option<ConfigOptionPoints>(opt_key)->values);
1215 else
1216 ret = config.option<ConfigOptionPoints>(opt_key)->get_at(idx);
1217 break;
1218 case coPointsGroups:
1219 if (opt_key == "extruder_printable_area") {
1220 auto values = config.option<ConfigOptionPointsGroups>(opt_key)->values;
1221 if (!values.empty())
1222 ret = get_thumbnails_string(config.option<ConfigOptionPointsGroups>(opt_key)->get_at(idx));
1223 } else
1224 ret = config.option<ConfigOptionPointsGroups>(opt_key)->get_at(idx);
1225 break;
1226 case coNone:
1227 default: break;
1228 }
1229 return ret;
1230}
#define L(s)
Definition ExtrusionEntity.cpp:25
std::vector< double > values
Definition Config.hpp:418
wxString double_to_string(double const value, const int max_precision)
Definition Field.cpp:99
wxString get_thumbnails_string(const std::vector< Vec2d > &values)
Definition Field.cpp:135
ConfigOptionBoolsTempl< true > ConfigOptionBoolsNullable
Definition Config.hpp:2067
ConfigOptionPercentsTempl< true > ConfigOptionPercentsNullable
Definition Config.hpp:1335
ConfigOptionIntsTempl< true > ConfigOptionIntsNullable
Definition Config.hpp:1155
ConfigOptionFloatsTempl< true > ConfigOptionFloatsNullable
Definition Config.hpp:1016
ConfigOptionFloatsOrPercentsTempl< true > ConfigOptionFloatsOrPercentsNullable
Definition Config.hpp:1532
ConfigOptionPercentsTempl< false > ConfigOptionPercents
Definition Config.hpp:1334
ConfigOptionEnumsGenericTempl< true > ConfigOptionEnumsGenericNullable
Definition Config.hpp:2312
@ coPointsGroups
Definition Config.hpp:217
ConfigOptionFloatsOrPercentsTempl< false > ConfigOptionFloatsOrPercents
Definition Config.hpp:1531

References _, Slic3r::coBool, Slic3r::coBools, Slic3r::coEnum, Slic3r::coEnums, Slic3r::coFloat, Slic3r::coFloatOrPercent, Slic3r::coFloats, Slic3r::coFloatsOrPercents, Slic3r::coInt, Slic3r::coInts, Slic3r::coNone, Slic3r::coPercent, Slic3r::coPercents, Slic3r::coPoint, Slic3r::coPoints, Slic3r::coPointsGroups, Slic3r::coString, Slic3r::coStrings, Slic3r::DynamicPrintConfig::def(), Slic3r::GUI::double_to_string(), Slic3r::GUI::from_u8(), Slic3r::ConfigDef::get(), Slic3r::ConfigOptionVector< T >::get_at(), Slic3r::GUI::get_thumbnails_string(), Slic3r::ConfigOption::getInt(), Slic3r::ConfigOptionResolver::has(), Slic3r::ConfigOption::is_nil(), Slic3r::ConfigOptionVectorBase::is_nil(), L, Slic3r::DynamicConfig::opt_bool(), Slic3r::DynamicConfig::opt_float(), Slic3r::DynamicConfig::opt_int(), Slic3r::DynamicConfig::opt_string(), Slic3r::ConfigBase::option(), Slic3r::ConfigOptionDef::plugin_picker, Slic3r::ConfigOptionPoints::serialize(), and Slic3r::ConfigOptionVector< T >::values.

Referenced by back_to_config_value(), config_value(), and Slic3r::GUI::Tab::on_value_change().

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

◆ get_config_value2()

boost::any Slic3r::GUI::ConfigOptionsGroup::get_config_value2 ( const DynamicPrintConfig & config,
const std::string & opt_key,
int opt_index = -1 )
inherited
1234{
1235 size_t idx = opt_index == -1 ? 0 : opt_index;
1236
1237 boost::any ret;
1238 const ConfigOptionDef* opt = config.def()->get(opt_key);
1239
1240 if (opt->nullable) {
1241 switch (opt->type) {
1242 case coPercents:
1243 case coFloats: {
1244 if (config.option(opt_key)->is_nil())
1246 else {
1247 double val = opt->type == coFloats ? config.option<ConfigOptionFloatsNullable>(opt_key)->get_at(idx) :
1248 config.option<ConfigOptionPercentsNullable>(opt_key)->get_at(idx);
1249 ret = val;
1250 }
1251 } break;
1252 case coFloatsOrPercents: {
1253 if (config.option(opt_key)->is_nil())
1255 else {
1256 const auto& value = config.option<ConfigOptionFloatsOrPercentsNullable>(opt_key)->get_at(idx);
1257 wxString text_value = double_to_string(value.value);
1258 if (value.percent)
1259 text_value += "%";
1260
1261 ret = text_value;
1262 }
1263 break;
1264 }
1265 case coBools: ret = config.option<ConfigOptionBoolsNullable>(opt_key)->values[idx]; break;
1266 case coInts: ret = config.option<ConfigOptionIntsNullable>(opt_key)->get_at(idx); break;
1267 default: break;
1268 }
1269 return ret;
1270 }
1271
1272 switch (opt->type) {
1273 case coFloatOrPercent: {
1274 const auto& value = *config.option<ConfigOptionFloatOrPercent>(opt_key);
1275
1276 wxString text_value = double_to_string(value.value);
1277 if (value.percent)
1278 text_value += "%";
1279
1280 ret = into_u8(text_value);
1281 break;
1282 }
1283 case coPercent: {
1284 double val = config.option<ConfigOptionPercent>(opt_key)->value;
1285 ret = val;
1286 } break;
1287 case coPercents:
1288 case coFloats:
1289 case coFloat: {
1290 double val = opt->type == coFloats ? config.opt_float(opt_key, idx) :
1291 opt->type == coFloat ? config.opt_float(opt_key) :
1292 config.option<ConfigOptionPercents>(opt_key)->get_at(idx);
1293 ret = val;
1294 } break;
1295 case coString: ret = config.opt_string(opt_key); break;
1296 case coStrings:
1297 if (opt_key == "compatible_printers" || opt_key == "compatible_prints") {
1298 ret = config.option<ConfigOptionStrings>(opt_key)->values;
1299 break;
1300 }
1301 if (opt->gui_type == ConfigOptionDef::GUIType::plugin_picker) {
1302 ret = config.option<ConfigOptionStrings>(opt_key)->values;
1303 break;
1304 }
1305 if (config.option<ConfigOptionStrings>(opt_key)->values.empty())
1306 ret = std::string();
1307 else if (opt->gui_flags == "serialized") {
1308 ret = config.option<ConfigOptionStrings>(opt_key)->values;
1309 } else
1310 ret = config.opt_string(opt_key, static_cast<unsigned int>(idx));
1311 break;
1312 case coBool: ret = config.opt_bool(opt_key); break;
1313 case coBools: ret = static_cast<unsigned char>(config.opt_bool(opt_key, idx)); break;
1314 case coInt: ret = config.opt_int(opt_key); break;
1315 case coInts: ret = config.opt_int(opt_key, idx); break;
1316 case coEnum: ret = config.option(opt_key)->getInt(); break;
1317 case coEnums: ret = config.opt_int(opt_key, idx); break;
1318 case coPoint: ret = config.option<ConfigOptionPoint>(opt_key)->value; break;
1319 case coPoints:
1320 if (opt_key == "printable_area")
1321 ret = get_thumbnails_string(config.option<ConfigOptionPoints>(opt_key)->values);
1322 else if (opt_key == "bed_exclude_area")
1323 ret = from_u8(config.option<ConfigOptionPoints>(opt_key)->serialize());
1324 else if (opt_key == "wrapping_exclude_area")
1325 ret = get_thumbnails_string(config.option<ConfigOptionPoints>(opt_key)->values);
1326 else
1327 ret = config.option<ConfigOptionPoints>(opt_key)->get_at(idx);
1328 break;
1329 case coNone:
1330 default: break;
1331 }
1332 return ret;
1333}
static FloatOrPercent nil_value()
Definition Config.hpp:1424
static double nil_value()
Definition Config.hpp:899
std::string into_u8(const wxString &str)
Definition GUI.cpp:549

References Slic3r::coBool, Slic3r::coBools, Slic3r::coEnum, Slic3r::coEnums, Slic3r::coFloat, Slic3r::coFloatOrPercent, Slic3r::coFloats, Slic3r::coFloatsOrPercents, Slic3r::coInt, Slic3r::coInts, Slic3r::coNone, Slic3r::coPercent, Slic3r::coPercents, Slic3r::coPoint, Slic3r::coPoints, Slic3r::coString, Slic3r::coStrings, Slic3r::DynamicPrintConfig::def(), Slic3r::GUI::double_to_string(), Slic3r::GUI::from_u8(), Slic3r::ConfigDef::get(), Slic3r::GUI::get_thumbnails_string(), Slic3r::ConfigOption::getInt(), Slic3r::GUI::into_u8(), Slic3r::ConfigOption::is_nil(), Slic3r::ConfigOptionFloatsOrPercentsTempl< true >::nil_value(), Slic3r::ConfigOptionFloatsTempl< true >::nil_value(), Slic3r::DynamicConfig::opt_bool(), Slic3r::DynamicConfig::opt_float(), Slic3r::DynamicConfig::opt_int(), Slic3r::DynamicConfig::opt_string(), Slic3r::ConfigBase::option(), Slic3r::ConfigOptionDef::plugin_picker, Slic3r::ConfigOptionPoints::serialize(), and Slic3r::ConfigOptionVector< T >::values.

Referenced by back_to_config_value(), and commit_config_value().

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

◆ get_custom_ctrl_with_blinking_ptr()

std::pair< OG_CustomCtrl *, bool * > Slic3r::GUI::ConfigOptionsGroup::get_custom_ctrl_with_blinking_ptr ( const t_config_option_key & opt_key,
int opt_index )
inherited
1361{
1362 Field* field = get_fieldc(opt_key, opt_index);
1363
1364 if (field)
1365 return {custom_ctrl, field->get_blink_ptr()};
1366
1367 for (Line& line : m_lines)
1368 for (const Option& opt : line.get_options())
1369 if (opt.opt_id == opt_key && line.widget)
1370 return {custom_ctrl, line.get_blink_ptr()};
1371
1372 return {nullptr, nullptr};
1373}
Field * get_fieldc(const t_config_option_key &opt_key, int opt_index)
Definition OptionsGroup.cpp:1350

References Slic3r::GUI::OptionsGroup::custom_ctrl, Slic3r::GUI::UndoValueUIManager::get_blink_ptr(), get_fieldc(), and Slic3r::GUI::OptionsGroup::m_lines.

Here is the call graph for this function:

◆ get_field()

Field * Slic3r::GUI::OptionsGroup::get_field ( const t_config_option_key & id) const
inlineinherited
210 {
211 if (m_fields.find(id) == m_fields.end()) return nullptr;
212 return m_fields.at(id).get();
213 }

References m_fields.

Referenced by Slic3r::GUI::ConfigOptionsGroup::back_to_config_value(), enable_field(), Slic3r::GUI::ConfigOptionsGroup::get_fieldc(), and show_field().

Here is the caller graph for this function:

◆ get_fieldc()

Field * Slic3r::GUI::ConfigOptionsGroup::get_fieldc ( const t_config_option_key & opt_key,
int opt_index )
inherited
1351{
1352 Field* field = get_field(opt_key);
1353 if (field != nullptr)
1354 return field;
1355 std::string opt_id = opt_key + '#' + std::to_string(opt_index);
1356 return get_field(opt_id);
1357}

References Slic3r::GUI::OptionsGroup::get_field().

Referenced by get_custom_ctrl_with_blinking_ptr(), and Slic3r::GUI::ObjectTableSettings::update_extra_column_visible_status().

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

◆ get_grid_sizer()

wxGridSizer * Slic3r::GUI::OptionsGroup::get_grid_sizer ( )
inlineinherited
248{ return m_grid_sizer; }

References m_grid_sizer.

Referenced by Slic3r::GUI::ObjectTableSettings::update_extra_column_visible_status().

Here is the caller graph for this function:

◆ get_line()

Line * Slic3r::GUI::OptionsGroup::get_line ( const std::string & opt_key)
inherited
297{
298 for (int index = 0; index < m_lines.size(); index++) {
299 for (auto& opt : m_lines[index].get_options())
300 if (opt.opt_id == opt_key)
301 return &(m_lines[index]);
302 }
303
304 return nullptr;
305}

References m_lines.

Referenced by Slic3r::GUI::ObjectTableSettings::update_extra_column_visible_status().

Here is the caller graph for this function:

◆ get_lines()

const std::vector< Line > & Slic3r::GUI::OptionsGroup::get_lines ( )
inlineinherited
249{ return m_lines; }

References m_lines.

◆ get_option()

Option Slic3r::GUI::ConfigOptionsGroup::get_option ( const std::string & opt_key,
int opt_index = -1 )
inherited
679{
680 if (!m_config->has(opt_key)) {
681 std::cerr << "No " << opt_key << " in ConfigOptionsGroup config.\n";
682 }
683
684 std::string opt_id = opt_index == -1 ? opt_key : opt_key + "#" + std::to_string(opt_index);
685 std::pair<std::string, int> pair(opt_key, opt_index);
686 m_opt_map.emplace(opt_id, pair);
687
688 if (m_use_custom_ctrl) // fill group and category values just for options from Settings Tab
689 wxGetApp().sidebar().settings_index().add_key(opt_id, static_cast<Preset::Type>(this->config_type()), title, this->config_category(), this->icon);
690
691 return Option(*m_config->def()->get(opt_key), opt_id);
692}
const wxString & config_category() const
Definition OptionsGroup.hpp:323
int config_type() const override
Definition OptionsGroup.hpp:324

References config_category(), config_type(), Slic3r::GUI::OptionsGroup::icon, m_config, m_opt_map, Slic3r::GUI::OptionsGroup::m_use_custom_ctrl, and Slic3r::GUI::OptionsGroup::title.

Referenced by append_single_option_line(), and create_single_option_line().

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

◆ get_url()

wxString Slic3r::GUI::OptionsGroup::get_url ( const std::string & path_end)
staticinherited
1405{
1406 // BBS
1407 wxString str = from_u8(path_end);
1408 auto pos = str.find(L'#');
1409 if (pos != size_t(-1)) {
1410 pos++;
1411 wxString anchor = str.Mid(pos).Lower();
1412 anchor.Replace(L" ", "-");
1413 str = str.Left(pos) + anchor;
1414 }
1415 // Orca: point to sf wiki for seam parameters
1416 return wxString::Format(L"https://www.orcaslicer.com/wiki/%s", from_u8(path_end));
1417}
Vec3d pos(const Pt &p)
Definition ReprojectPointsOnMesh.hpp:16

References Slic3r::GUI::from_u8(), and L.

Referenced by launch_browser(), Slic3r::GUI::ActionRegistry::materialize_setting_actions(), Slic3r::GUI::OG_CustomCtrl::OnMotion(), and Slic3r::GUI::ogStaticText::SetPathEnd().

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

◆ get_value()

boost::any Slic3r::GUI::OptionsGroup::get_value ( const t_config_option_key & id)
inlineinherited
220 {
221 boost::any out;
222 if (m_fields.find(id) == m_fields.end()) ;
223 else
224 out = m_fields.at(id)->get_value();
225 return out;
226 }

References m_fields.

Referenced by Slic3r::GUI::ConfigOptionsGroup::back_to_config_value().

Here is the caller graph for this function:

◆ Hide()

void Slic3r::GUI::ConfigOptionsGroup::Hide ( )
inherited
895{ Show(false); }
void Show(const bool show)
Definition OptionsGroup.cpp:897

References Show().

Here is the call graph for this function:

◆ hide_field()

void Slic3r::GUI::OptionsGroup::hide_field ( const t_config_option_key & opt_key)
inlineinherited
229{ show_field(opt_key, false); }
void show_field(const t_config_option_key &opt_key, bool show=true)
Definition OptionsGroup.cpp:208

References show_field().

Here is the call graph for this function:

◆ hide_labels()

void Slic3r::GUI::OptionsGroup::hide_labels ( )
inlineinherited
242{ label_width = 0; m_labels_hidden = true; }

References label_width, and m_labels_hidden.

◆ is_activated()

bool Slic3r::GUI::OptionsGroup::is_activated ( )
inlineinherited
255{ return sizer != nullptr; }

References sizer.

◆ is_legend_line()

bool Slic3r::GUI::OptionsGroup::is_legend_line ( )
inherited
179{
180 if (m_lines.size() == 1) {
181 const std::vector<Option>& option_set = m_lines.front().get_options();
182 return !option_set.empty() && option_set.front().opt.gui_type == ConfigOptionDef::GUIType::legend;
183 }
184 return false;
185}

References Slic3r::ConfigOptionDef::legend, and m_lines.

Referenced by activate_line().

Here is the caller graph for this function:

◆ is_visible()

bool Slic3r::GUI::ConfigOptionsGroup::is_visible ( ConfigOptionMode mode)
inherited
907{
908 if (m_options_mode.empty())
909 return true;
910 if (m_options_mode.size() == 1)
911 return m_options_mode[0] <= mode;
912
913 size_t hidden_row_cnt = 0;
914 for (auto opt_mode : m_options_mode)
915 if (opt_mode > mode)
916 hidden_row_cnt++;
917
918 return hidden_row_cnt != m_options_mode.size();
919}

References Slic3r::GUI::OptionsGroup::m_options_mode.

◆ launch_browser()

bool Slic3r::GUI::OptionsGroup::launch_browser ( const std::string & path_end)
staticinherited
1419{ return wxLaunchDefaultBrowser(OptionsGroup::get_url(path_end)); }
static wxString get_url(const std::string &path_end)
Definition OptionsGroup.cpp:1404

References get_url().

Referenced by Slic3r::GUI::OG_CustomCtrl::CtrlLine::launch_browser().

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

◆ msw_rescale()

void Slic3r::GUI::ConfigOptionsGroup::msw_rescale ( )
inherited
965{
966 // update bitmaps for extra column items (like "mode markers" or buttons on settings panel)
968 for (auto extra_col : m_extra_column_item_ptrs)
969 rescale_extra_column_item(extra_col);
970
971 // update undo buttons : rescale bitmaps
972 for (const auto& field : m_fields)
973 field.second->msw_rescale();
974
975 auto rescale = [](wxSizer* sizer) {
976 for (wxSizerItem* item : sizer->GetChildren())
977 if (item->IsWindow()) {
978 wxWindow* win = item->GetWindow();
979 // check if window is ScalableButton
980 ScalableButton* sc_btn = dynamic_cast<ScalableButton*>(win);
981 if (sc_btn) {
982 sc_btn->msw_rescale();
983 sc_btn->SetSize(sc_btn->GetBestSize());
984 return;
985 }
986 // check if window is wxButton
987 wxButton* btn = dynamic_cast<wxButton*>(win);
988 if (btn) {
989 btn->SetSize(btn->GetBestSize());
990 return;
991 }
992 }
993 };
994
995 // scale widgets and extra widgets if any exists
996 for (const Line& line : m_lines) {
997 if (line.widget_sizer)
998 rescale(line.widget_sizer);
999 if (line.extra_widget_sizer)
1000 rescale(line.extra_widget_sizer);
1001 }
1002
1003 if (custom_ctrl)
1004 custom_ctrl->msw_rescale();
1005
1006 if (auto line = dynamic_cast<::StaticLine*>(stb))
1007 line->Rescale();
1008}
class WXDLLIMPEXP_FWD_CORE wxButton
Definition ProgressDialog.hpp:27
void msw_rescale()
Definition wxExtensions.cpp:1114
std::function< void(wxWindow *win)> rescale_extra_column_item
Definition OptionsGroup.hpp:176

References Slic3r::GUI::OptionsGroup::custom_ctrl, Slic3r::GUI::OptionsGroup::m_extra_column_item_ptrs, Slic3r::GUI::OptionsGroup::m_fields, Slic3r::GUI::OptionsGroup::m_lines, ScalableButton::msw_rescale(), Slic3r::GUI::OptionsGroup::rescale_extra_column_item, Slic3r::GUI::OptionsGroup::sizer, Slic3r::GUI::OptionsGroup::stb, and wxButton.

Here is the call graph for this function:

◆ on_change_OG()

void Slic3r::GUI::ExtruderOptionsGroup::on_change_OG ( const t_config_option_key & opt_id,
const boost::any & value )
overridevirtual

Reimplemented from Slic3r::GUI::ConfigOptionsGroup.

1386{
1387 if (!m_opt_map.empty()) {
1388 auto it = m_opt_map.find(opt_id);
1389 if (it == m_opt_map.end()) {
1390 OptionsGroup::on_change_OG(opt_id, value);
1391 return;
1392 }
1393
1394 auto itOption = it->second;
1395 const std::string& opt_key = itOption.first;
1396
1397 int opt_index = itOption.second;
1398 this->change_opt_value(opt_key, value, opt_index == -1 ? 0 : opt_index);
1399 }
1400
1401 OptionsGroup::on_change_OG(opt_id, value);
1402}

References Slic3r::GUI::ConfigOptionsGroup::change_opt_value(), Slic3r::GUI::ConfigOptionsGroup::m_opt_map, and Slic3r::GUI::OptionsGroup::on_change_OG().

Here is the call graph for this function:

◆ on_kill_focus()

void Slic3r::GUI::ConfigOptionsGroup::on_kill_focus ( const std::string & opt_key)
overridevirtualinherited

Reimplemented from Slic3r::GUI::OptionsGroup.

874{
876 m_fill_empty_value(opt_key);
877 else
879}
void reload_config()
Definition OptionsGroup.cpp:881
t_kill_focus m_fill_empty_value
Definition OptionsGroup.hpp:171

References Slic3r::GUI::OptionsGroup::m_fill_empty_value, and reload_config().

Here is the call graph for this function:

◆ opt_map()

const t_opt_map & Slic3r::GUI::ConfigOptionsGroup::opt_map ( ) const
throw ( )
inlineinherited
325{ return m_opt_map; }

References m_opt_map.

◆ parent()

wxWindow * Slic3r::GUI::OptionsGroup::parent ( ) const
inlineinherited

Returns a copy of the pointer of the parent wxWindow. Accessor function is because users are not allowed to change the parent but defining it as const means a lot of const_casts to deal with wx functions.

190{ return m_parent; }

References m_parent.

Referenced by Slic3r::GUI::ConfigOptionsGroup::ConfigOptionsGroup(), Slic3r::GUI::ConfigOptionsGroup::ConfigOptionsGroup(), Slic3r::GUI::ConfigOptionsGroup::ConfigOptionsGroup(), Slic3r::GUI::ConfigOptionsGroup::ConfigOptionsGroup(), Slic3r::GUI::ExtruderOptionsGroup::ExtruderOptionsGroup(), activate_line(), build_field(), and ctrl_parent().

Here is the caller graph for this function:

◆ pick_plugin()

std::string Slic3r::GUI::OptionsGroup::pick_plugin ( const ConfigOptionDef & opt)
protectedinherited
733{
734 Slic3r::PluginManager& manager = Slic3r::PluginManager::instance();
736 if (plugin_type == Slic3r::PluginCapabilityType::Unknown) {
737 MessageDialog dlg(m_parent,
738 opt.plugin_type.empty() ? _L("This setting does not specify a plugin capability type.")
739 : _L("This setting specifies an unrecognized plugin capability type: ") + "'" + opt.plugin_type + "'.",
740 _L("Plugin Selection"),
741 wxOK | wxICON_WARNING
742 );
743 dlg.CenterOnParent();
744 dlg.ShowModal();
745
746 return {};
747 }
748
749 struct CapabilityRef { std::string plugin_key; std::string name; };
750 std::vector<CapabilityRef> caps;
751 for (const auto& capability : manager.get_plugin_capabilities(/*plugin_key=*/"", plugin_type, /*only_enabled=*/true))
752 caps.push_back({capability->audit_plugin_key(), capability->name()});
753 std::sort(caps.begin(), caps.end(), [](const CapabilityRef& lhs, const CapabilityRef& rhs) {
754 return lhs.name == rhs.name ? lhs.plugin_key < rhs.plugin_key : lhs.name < rhs.name;
755 });
756
757 if (caps.empty()) {
758 MessageDialog dlg(m_parent,
759 _L("No plugins capabilities available for this type.\nEnable or install some to use."),
760 _L("Plugin Selection"),
761 wxOK | wxICON_INFORMATION
762 );
763 dlg.CenterOnParent();
764 dlg.ShowModal();
765 return {};
766 }
767
768 std::vector<PluginPickerDialog::CapabilityEntry> entries;
769 entries.reserve(caps.size());
770 for (const auto& cap : caps) {
771 Slic3r::PluginDescriptor descriptor;
772 wxString package_name = manager.try_get_plugin_descriptor(cap.plugin_key, descriptor)
773 ? from_u8(descriptor.name) : from_u8(cap.plugin_key);
774 entries.push_back({
775 cap.plugin_key, cap.name, from_u8(cap.name) + from_u8(" \xE2\x80\x94 ") + package_name, package_name
776 });
777 }
778
779 PluginPickerDialog dlg(m_parent, from_u8(opt.plugin_type), std::move(entries));
780 if (dlg.ShowModal() != wxID_OK)
781 return {};
782 const auto selection = dlg.selected_capability();
783 if (selection.plugin_key.empty() || selection.name.empty())
784 return {};
785
786 // Only the bare capability name is stored; the full "name;uuid;capability" reference is derived when
787 // the preset is serialized (see ConfigBase::save_plugin_collection). Resolve here to reject bad picks.
788 Slic3r::PluginDescriptor descriptor;
789 if (!manager.try_get_plugin_descriptor(selection.plugin_key, descriptor) || descriptor.name.empty())
790 return {};
791
792 BOOST_LOG_TRIVIAL(info) << "Picked plugin capability: " << selection.name;
793 return selection.name;
794}
std::vector< std::shared_ptr< PluginCapabilityInterface > > get_plugin_capabilities(const std::string &plugin_key="", PluginCapabilityType type=PluginCapabilityType::Unknown, bool only_enabled=true) const
Definition PluginManager.cpp:592
static PluginManager & instance()
Definition PluginManager.cpp:74
bool try_get_plugin_descriptor(const std::string &plugin_key, PluginDescriptor &out) const
Definition PluginManager.cpp:502
PluginCapabilityType
Definition PythonPluginInterface.hpp:17
@ Unknown
Definition PythonPluginInterface.hpp:17
PluginCapabilityType plugin_capability_type_from_string(std::string_view value)
Definition PythonPluginInterface.hpp:72
std::string name
Definition PluginDescriptor.hpp:55

References _L, Slic3r::GUI::from_u8(), Slic3r::PluginManager::get_plugin_capabilities(), Slic3r::PluginManager::instance(), m_parent, Slic3r::PluginDescriptor::name, Slic3r::plugin_capability_type_from_string(), Slic3r::GUI::PluginPickerDialog::selected_capability(), Slic3r::GUI::DPIAware< P >::ShowModal(), Slic3r::PluginManager::try_get_plugin_descriptor(), and Slic3r::Unknown.

Referenced by build_field().

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

◆ refresh()

void Slic3r::GUI::ConfigOptionsGroup::refresh ( )
inherited
1051{
1052 if (custom_ctrl)
1053 custom_ctrl->Refresh();
1054}

References Slic3r::GUI::OptionsGroup::custom_ctrl.

◆ reload_config()

void Slic3r::GUI::ConfigOptionsGroup::reload_config ( )
inherited
882{
883 for (auto& kvp : m_opt_map) {
884 // Name of the option field (name of the configuration key, possibly suffixed with '#' and the index of a scalar inside a vector.
885 const std::string& opt_id = kvp.first;
886 // option key (may be scalar or vector)
887 const std::string& opt_key = kvp.second.first;
888 // index in the vector option, zero for scalars
889 int opt_index = kvp.second.second;
890 const ConfigOptionDef& option = m_options.at(opt_id).opt;
891 this->set_value(opt_id, config_value(opt_key, opt_index, option.gui_flags == "serialized"));
892 }
893}
boost::any config_value(const std::string &opt_key, int opt_index, bool deserialize)
Definition OptionsGroup.cpp:1056

References config_value(), Slic3r::ConfigOptionDef::gui_flags, m_opt_map, Slic3r::GUI::OptionsGroup::m_options, and Slic3r::GUI::OptionsGroup::set_value().

Referenced by on_kill_focus().

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

◆ remove_option_if()

void Slic3r::GUI::OptionsGroup::remove_option_if ( std::function< bool(std::string const &)> const & comp)
inherited
194{
195 for (auto& l : m_lines) {
196 auto& opts = const_cast<std::vector<Option>&>(l.get_options());
197 opts.erase(std::remove_if(opts.begin(), opts.end(), [&comp](Option& o) { return comp(o.opt.opt_key); }), opts.end());
198 l.undo_to_sys = true;
199 }
200 for (int i = m_lines.size() - 1; i >= 0; --i) {
201 if (m_lines[i].get_options().empty())
202 m_options_mode.erase(m_options_mode.begin() + i);
203 }
204 m_lines.erase(std::remove_if(m_lines.begin(), m_lines.end(), [](auto& l) { return l.get_options().empty(); }), m_lines.end());
205 // TODO: remove items from g->m_options;
206}
bool empty(const BoundingBoxBase< PointType, PointsType > &bb)
Definition BoundingBox.hpp:273

References Slic3r::empty(), m_lines, and m_options_mode.

Here is the call graph for this function:

◆ set_config()

void Slic3r::GUI::ConfigOptionsGroup::set_config ( DynamicPrintConfig * config)
inlineinherited
328 {
329 m_config = config; m_modelconfig = nullptr; }

References m_config, and m_modelconfig.

◆ set_config_category_and_type()

void Slic3r::GUI::ConfigOptionsGroup::set_config_category_and_type ( const wxString & category,
int type )
inlineinherited
327{ m_config_category = category; m_config_type = type; }

References m_config_category, and m_config_type.

◆ set_grid_vgap()

void Slic3r::GUI::OptionsGroup::set_grid_vgap ( int gap)
inlineinherited
238{ m_grid_sizer->SetVGap(gap); }

References m_grid_sizer.

◆ set_max_win_width()

void Slic3r::GUI::OptionsGroup::set_max_win_width ( int max_win_width)
inherited
188{
189 if (custom_ctrl)
190 custom_ctrl->set_max_win_width(max_win_width);
191}

References custom_ctrl.

◆ set_name()

void Slic3r::GUI::OptionsGroup::set_name ( const wxString & new_name)
inherited
257{ stb->SetLabel(new_name); }

References stb.

◆ set_value()

bool Slic3r::GUI::OptionsGroup::set_value ( const t_config_option_key & id,
const boost::any & value,
bool change_event = false )
inlineinherited
215 {
216 if (m_fields.find(id) == m_fields.end()) return false;
217 m_fields.at(id)->set_value(value, change_event);
218 return true;
219 }

References m_fields.

Referenced by Slic3r::GUI::ConfigOptionsGroup::back_to_config_value(), Slic3r::GUI::Tab::on_value_change(), and Slic3r::GUI::ConfigOptionsGroup::reload_config().

Here is the caller graph for this function:

◆ Show()

void Slic3r::GUI::ConfigOptionsGroup::Show ( const bool show)
inherited
898{
899 sizer->ShowItems(show);
900#if 0 // #ifdef __WXGTK__
901 m_panel->Show(show);
902 m_grid_sizer->Show(show);
903#endif /* __WXGTK__ */
904}

References Slic3r::GUI::OptionsGroup::m_grid_sizer, and Slic3r::GUI::OptionsGroup::sizer.

Referenced by Hide(), and update_visibility().

Here is the caller graph for this function:

◆ show_field()

void Slic3r::GUI::OptionsGroup::show_field ( const t_config_option_key & opt_key,
bool show = true )
inherited
209{
210 Field* field = get_field(opt_key);
211 if (!field)
212 return;
213 wxWindow* win = field->getWindow();
214 if (!win)
215 return;
216 wxSizerItem* win_item = m_grid_sizer->GetItem(win, true);
217 if (!win_item)
218 return;
219
220 const size_t cols = (size_t) m_grid_sizer->GetCols();
221 const size_t rows = (size_t) m_grid_sizer->GetEffectiveRowsCount();
222
223 auto show_row = [this, show, cols, win_item](wxSizerItem* item, size_t row_shift) {
224 // check if item contanes required win
225 if (!item->IsWindow() || item != win_item)
226 return false;
227 // show/hide hole line contanes this window
228 for (size_t i = 0; i < cols; ++i)
229 m_grid_sizer->Show(row_shift + i, show);
230 return true;
231 };
232
233 size_t row_shift = 0;
234 for (size_t j = 0; j < rows; ++j) {
235 for (size_t i = 0; i < cols; ++i) {
236 wxSizerItem* item = m_grid_sizer->GetItem(row_shift + i);
237 if (!item)
238 continue;
239 if (item->IsSizer()) {
240 for (wxSizerItem* child_item : item->GetSizer()->GetChildren())
241 if (show_row(child_item, row_shift))
242 return;
243 } else if (show_row(item, row_shift))
244 return;
245 }
246 row_shift += cols;
247 }
248}
size_t cols(const T &raster)
Definition MarchingSquares.hpp:173
size_t rows(const T &raster)
Definition MarchingSquares.hpp:171

References get_field(), Slic3r::GUI::Field::getWindow(), and m_grid_sizer.

Referenced by hide_field().

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

◆ sys_color_changed()

void Slic3r::GUI::ConfigOptionsGroup::sys_color_changed ( )
inherited
1011{
1012#ifdef _WIN32
1013 if (staticbox && stb) {
1014 wxGetApp().UpdateAllStaticTextDarkUI(stb);
1015 // update bitmaps for extra column items (like "delete" buttons on settings panel)
1016 for (auto extra_col : m_extra_column_item_ptrs)
1017 wxGetApp().UpdateDarkUI(extra_col);
1018 }
1019
1020 if (custom_ctrl)
1021 wxGetApp().UpdateDarkUI(custom_ctrl);
1022#endif
1023
1024 auto update = [](wxSizer* sizer) {
1025 for (wxSizerItem* item : sizer->GetChildren())
1026 if (item->IsWindow()) {
1027 wxWindow* win = item->GetWindow();
1028 // check if window is ScalableButton
1029 if (ScalableButton* sc_btn = dynamic_cast<ScalableButton*>(win)) {
1030 sc_btn->msw_rescale();
1031 return;
1032 }
1033 wxGetApp().UpdateDarkUI(win, dynamic_cast<wxButton*>(win) != nullptr);
1034 }
1035 };
1036
1037 // scale widgets and extra widgets if any exists
1038 for (const Line& line : m_lines) {
1039 if (line.widget_sizer)
1040 update(line.widget_sizer);
1041 if (line.extra_widget_sizer)
1042 update(line.extra_widget_sizer);
1043 }
1044
1045 // update undo buttons : rescale bitmaps
1046 for (const auto& field : m_fields)
1047 field.second->sys_color_changed();
1048}

References Slic3r::GUI::OptionsGroup::custom_ctrl, Slic3r::GUI::OptionsGroup::m_extra_column_item_ptrs, Slic3r::GUI::OptionsGroup::m_fields, Slic3r::GUI::OptionsGroup::m_lines, Slic3r::GUI::OptionsGroup::sizer, Slic3r::GUI::OptionsGroup::staticbox, Slic3r::GUI::OptionsGroup::stb, and wxButton.

◆ update_visibility()

bool Slic3r::GUI::ConfigOptionsGroup::update_visibility ( ConfigOptionMode mode)
inherited
922{
923 if (m_options_mode.empty() || !m_grid_sizer)
924 return true;
925
926 if (custom_ctrl) {
927 bool show = custom_ctrl->update_visibility(mode);
928 this->Show(show);
929 return show;
930 }
931
932 int opt_mode_size = m_options_mode.size();
933 if (m_grid_sizer->GetEffectiveRowsCount() != opt_mode_size && opt_mode_size == 1)
934 return m_options_mode[0] <= mode;
935
936 Show(true);
937
938 int coef = 0;
939 int hidden_row_cnt = 0;
940 const int cols = m_grid_sizer->GetCols();
941 Line* line = &m_lines.front();
942 size_t line_opt_end = line->get_options().size();
943 for (auto opt_mode : m_options_mode) {
944 const bool show = opt_mode <= mode && line->toggle_visible;
945 if (--line_opt_end == 0) {
946 ++line;
947 line_opt_end = line->get_options().size();
948 }
949 if (!show) {
950 hidden_row_cnt++;
951 for (int i = 0; i < cols; ++i)
952 m_grid_sizer->Show(coef + i, show);
953 }
954 coef += cols;
955 }
956
957 if (hidden_row_cnt == opt_mode_size) {
958 sizer->ShowItems(false);
959 return false;
960 }
961 return true;
962}

References Slic3r::GUI::OptionsGroup::custom_ctrl, Slic3r::GUI::Line::get_options(), Slic3r::GUI::OptionsGroup::m_grid_sizer, Slic3r::GUI::OptionsGroup::m_lines, Slic3r::GUI::OptionsGroup::m_options_mode, Show(), Slic3r::GUI::OptionsGroup::sizer, and Slic3r::GUI::Line::toggle_visible.

Here is the call graph for this function:

Member Data Documentation

◆ ctrl_horiz_alignment

int Slic3r::GUI::OptionsGroup::ctrl_horiz_alignment { wxALIGN_LEFT}
inherited
166{ wxALIGN_LEFT};

Referenced by activate().

◆ custom_ctrl

◆ draw_multi_extruder

bool Slic3r::GUI::OptionsGroup::draw_multi_extruder { false }
inherited
185{ false };

◆ edit_custom_gcode

std::function<void(const t_config_option_key& opt_key)> Slic3r::GUI::OptionsGroup::edit_custom_gcode { nullptr }
inherited
179{ nullptr };

Referenced by build_field().

◆ extra_column

column_t Slic3r::GUI::OptionsGroup::extra_column {nullptr}
inherited
167{nullptr};

Referenced by OptionsGroup(), activate(), and activate_line().

◆ have_sys_config

std::function<bool()> Slic3r::GUI::OptionsGroup::have_sys_config { nullptr }
inherited

◆ icon

◆ label_font

wxFont Slic3r::GUI::OptionsGroup::label_font {wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT) }
inherited
182{wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT) };

◆ label_width

size_t Slic3r::GUI::OptionsGroup::label_width = 20
inherited

◆ m_config

const DynamicPrintConfig* Slic3r::GUI::ConfigOptionsGroup::m_config {nullptr}
protectedinherited

◆ m_config_category

wxString Slic3r::GUI::ConfigOptionsGroup::m_config_category
protectedinherited

◆ m_config_type

int Slic3r::GUI::ConfigOptionsGroup::m_config_type
protectedinherited

◆ m_disabled

bool Slic3r::GUI::OptionsGroup::m_disabled {false}
protectedinherited
270{false};

Referenced by build_field().

◆ m_extra_column_item_ptrs

std::vector<wxWindow*> Slic3r::GUI::OptionsGroup::m_extra_column_item_ptrs
protectedinherited

◆ m_fields

t_optionfield_map Slic3r::GUI::OptionsGroup::m_fields
protectedinherited

Field list, contains unique_ptrs of the derived type. using types that need to know what it is beyond the public interface need to cast based on the related ConfigOptionDef.

Referenced by build_field(), clear(), clear_fields_except_of(), disable(), enable(), get_field(), get_value(), Slic3r::GUI::ConfigOptionsGroup::msw_rescale(), set_value(), and Slic3r::GUI::ConfigOptionsGroup::sys_color_changed().

◆ m_fill_empty_value

t_kill_focus Slic3r::GUI::OptionsGroup::m_fill_empty_value { nullptr }
inherited
171{ nullptr };

Referenced by Slic3r::GUI::ConfigOptionsGroup::on_kill_focus().

◆ m_get_initial_config

std::function<DynamicPrintConfig()> Slic3r::GUI::OptionsGroup::m_get_initial_config { nullptr }
inherited

◆ m_get_sys_config

std::function<DynamicPrintConfig()> Slic3r::GUI::OptionsGroup::m_get_sys_config { nullptr }
inherited

◆ m_grid_sizer

wxGridSizer* Slic3r::GUI::OptionsGroup::m_grid_sizer {nullptr}
protectedinherited

◆ m_labels_hidden

bool Slic3r::GUI::OptionsGroup::m_labels_hidden {false}
inherited
162{false};

Referenced by activate_line(), and hide_labels().

◆ m_lines

◆ m_modelconfig

ModelConfig* Slic3r::GUI::ConfigOptionsGroup::m_modelconfig { nullptr }
protectedinherited
386{ nullptr };

Referenced by ConfigOptionsGroup(), change_opt_value(), on_change_OG(), and set_config().

◆ m_on_change

t_change Slic3r::GUI::OptionsGroup::m_on_change { nullptr }
inherited
168{ nullptr };

Referenced by on_change_OG().

◆ m_opt_map

◆ m_options

std::map<t_config_option_key, Option> Slic3r::GUI::OptionsGroup::m_options
protectedinherited

◆ m_options_mode

std::vector<ConfigOptionMode> Slic3r::GUI::OptionsGroup::m_options_mode
protectedinherited

◆ m_parent

wxWindow* Slic3r::GUI::OptionsGroup::m_parent {nullptr}
protectedinherited
260{nullptr};

Referenced by OptionsGroup(), activate(), parent(), and pick_plugin().

◆ m_use_custom_ctrl

bool Slic3r::GUI::OptionsGroup::m_use_custom_ctrl { false }
protectedinherited

◆ m_use_custom_ctrl_as_parent

bool Slic3r::GUI::OptionsGroup::m_use_custom_ctrl_as_parent { false }
protectedinherited
276{ false };

Referenced by activate_line(), and ctrl_parent().

◆ option_label_at_right

bool Slic3r::GUI::OptionsGroup::option_label_at_right {false}
inherited
157{false};

◆ rescale_extra_column_item

std::function<void(wxWindow* win)> Slic3r::GUI::OptionsGroup::rescale_extra_column_item { nullptr }
inherited
176{ nullptr };

Referenced by Slic3r::GUI::ConfigOptionsGroup::msw_rescale().

◆ rescale_near_label_widget

std::function<void(wxWindow* win)> Slic3r::GUI::OptionsGroup::rescale_near_label_widget { nullptr }
inherited
177{ nullptr };

◆ sidetext_font

wxFont Slic3r::GUI::OptionsGroup::sidetext_font {wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT) }
inherited
181{wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT) };

◆ sidetext_width

int Slic3r::GUI::OptionsGroup::sidetext_width { -1 }
inherited
183{ -1 };

Referenced by activate_line().

◆ sizer

◆ split_multi_line

bool Slic3r::GUI::OptionsGroup::split_multi_line {false}
inherited
156{false};

◆ staticbox

const bool Slic3r::GUI::OptionsGroup::staticbox {true}
inherited

◆ stb

◆ sublabel_width

int Slic3r::GUI::OptionsGroup::sublabel_width { -1 }
inherited
184{ -1 };

Referenced by activate_line().

◆ title


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