mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-25 01:31:14 -06:00
parent
255b23f0fc
commit
aee136cedd
14 changed files with 168 additions and 164 deletions
|
|
@ -294,6 +294,9 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config)
|
|||
toggle_field("support_material_extruder", have_support_material || have_skirt);
|
||||
toggle_field("support_material_speed", have_support_material || have_brim || have_skirt);
|
||||
|
||||
toggle_field("raft_contact_distance", have_raft && !have_support_soluble);
|
||||
toggle_field("raft_expansion", have_raft);
|
||||
|
||||
bool has_ironing = config->opt_bool("ironing");
|
||||
for (auto el : { "ironing_type", "ironing_flowrate", "ironing_spacing", "ironing_speed" })
|
||||
toggle_field(el, has_ironing);
|
||||
|
|
|
|||
|
|
@ -93,8 +93,8 @@ void Field::PostInitialize()
|
|||
{
|
||||
case coPercents:
|
||||
case coFloats:
|
||||
case coStrings:
|
||||
case coBools:
|
||||
case coStrings:
|
||||
case coBools:
|
||||
case coInts: {
|
||||
auto tag_pos = m_opt_id.find("#");
|
||||
if (tag_pos != std::string::npos)
|
||||
|
|
@ -112,7 +112,7 @@ void Field::PostInitialize()
|
|||
BUILD();
|
||||
|
||||
// For the mode, when settings are in non-modal dialog, neither dialog nor tabpanel doesn't receive wxEVT_KEY_UP event, when some field is selected.
|
||||
// So, like a workaround check wxEVT_KEY_UP event for the Filed and switch between tabs if Ctrl+(1-4) was pressed
|
||||
// So, like a workaround check wxEVT_KEY_UP event for the Filed and switch between tabs if Ctrl+(1-4) was pressed
|
||||
if (getWindow())
|
||||
getWindow()->Bind(wxEVT_KEY_UP, [](wxKeyEvent& evt) {
|
||||
if ((evt.GetModifiers() & wxMOD_CONTROL) != 0) {
|
||||
|
|
@ -136,7 +136,7 @@ void Field::PostInitialize()
|
|||
// tab panel should be focused for correct navigation between tabs
|
||||
wxGetApp().tab_panel()->SetFocus();
|
||||
}
|
||||
|
||||
|
||||
evt.Skip();
|
||||
});
|
||||
}
|
||||
|
|
@ -149,7 +149,7 @@ int Field::def_width_thinner() { return 4; }
|
|||
void Field::on_kill_focus()
|
||||
{
|
||||
// call the registered function if it is available
|
||||
if (m_on_kill_focus!=nullptr)
|
||||
if (m_on_kill_focus!=nullptr)
|
||||
m_on_kill_focus(m_opt_id);
|
||||
}
|
||||
|
||||
|
|
@ -158,7 +158,7 @@ void Field::on_set_focus(wxEvent& event)
|
|||
// to allow the default behavior
|
||||
event.Skip();
|
||||
// call the registered function if it is available
|
||||
if (m_on_set_focus!=nullptr)
|
||||
if (m_on_set_focus!=nullptr)
|
||||
m_on_set_focus(m_opt_id);
|
||||
}
|
||||
|
||||
|
|
@ -197,7 +197,7 @@ wxString Field::get_tooltip_text(const wxString& default_string)
|
|||
if (tooltip.length() > 0)
|
||||
tooltip_text = tooltip + "\n" + _(L("default value")) + "\t: " +
|
||||
(boost::iends_with(opt_id, "_gcode") ? "\n" : "") + default_string +
|
||||
(boost::iends_with(opt_id, "_gcode") ? "" : "\n") +
|
||||
(boost::iends_with(opt_id, "_gcode") ? "" : "\n") +
|
||||
_(L("parameter name")) + "\t: " + opt_id;
|
||||
|
||||
return tooltip_text;
|
||||
|
|
@ -221,7 +221,7 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true
|
|||
case coPercents:
|
||||
case coFloats:
|
||||
case coFloat:{
|
||||
if (m_opt.type == coPercent && !str.IsEmpty() && str.Last() == '%')
|
||||
if (m_opt.type == coPercent && !str.IsEmpty() && str.Last() == '%')
|
||||
str.RemoveLast();
|
||||
else if (!str.IsEmpty() && str.Last() == '%')
|
||||
{
|
||||
|
|
@ -335,7 +335,7 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true
|
|||
set_value(stVal, false); // it's no needed but can be helpful, when inputted value contained "," instead of "."
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
m_value = std::string(str.ToUTF8().data());
|
||||
break; }
|
||||
|
||||
|
|
@ -362,8 +362,8 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true
|
|||
out_of_range_val = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
invalid_val = true;
|
||||
break;
|
||||
}
|
||||
|
|
@ -415,7 +415,7 @@ void TextCtrl::BUILD() {
|
|||
if (m_opt.height >= 0) size.SetHeight(m_opt.height*m_em_unit);
|
||||
if (m_opt.width >= 0) size.SetWidth(m_opt.width*m_em_unit);
|
||||
|
||||
wxString text_value = wxString("");
|
||||
wxString text_value = wxString("");
|
||||
|
||||
switch (m_opt.type) {
|
||||
case coFloatOrPercent:
|
||||
|
|
@ -430,21 +430,21 @@ void TextCtrl::BUILD() {
|
|||
text_value = wxString::Format(_T("%i"), int(m_opt.default_value->getFloat()));
|
||||
text_value += "%";
|
||||
break;
|
||||
}
|
||||
}
|
||||
case coPercents:
|
||||
case coFloats:
|
||||
case coFloat:
|
||||
{
|
||||
double val = m_opt.type == coFloats ?
|
||||
m_opt.get_default_value<ConfigOptionFloats>()->get_at(m_opt_idx) :
|
||||
m_opt.type == coFloat ?
|
||||
m_opt.type == coFloat ?
|
||||
m_opt.default_value->getFloat() :
|
||||
m_opt.get_default_value<ConfigOptionPercents>()->get_at(m_opt_idx);
|
||||
text_value = double_to_string(val);
|
||||
m_last_meaningful_value = text_value;
|
||||
break;
|
||||
}
|
||||
case coString:
|
||||
case coString:
|
||||
text_value = m_opt.get_default_value<ConfigOptionString>()->value;
|
||||
break;
|
||||
case coStrings:
|
||||
|
|
@ -458,7 +458,7 @@ void TextCtrl::BUILD() {
|
|||
text_value = get_thumbnails_string(m_opt.get_default_value<ConfigOptionPoints>()->values);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
const long style = m_opt.multiline ? wxTE_MULTILINE : wxTE_PROCESS_ENTER/*0*/;
|
||||
|
|
@ -492,7 +492,7 @@ void TextCtrl::BUILD() {
|
|||
}
|
||||
|
||||
temp->Bind(wxEVT_SET_FOCUS, ([this](wxEvent& e) { on_set_focus(e); }), temp->GetId());
|
||||
|
||||
|
||||
temp->Bind(wxEVT_LEFT_DOWN, ([temp](wxEvent& event)
|
||||
{
|
||||
//! to allow the default handling
|
||||
|
|
@ -510,7 +510,7 @@ void TextCtrl::BUILD() {
|
|||
{
|
||||
e.Skip();
|
||||
#ifdef __WXOSX__
|
||||
// OSX issue: For some unknown reason wxEVT_KILL_FOCUS is emitted twice in a row in some cases
|
||||
// OSX issue: For some unknown reason wxEVT_KILL_FOCUS is emitted twice in a row in some cases
|
||||
// (like when information dialog is shown during an update of the option value)
|
||||
// Thus, suppress its second call
|
||||
if (bKilledFocus)
|
||||
|
|
@ -541,7 +541,7 @@ void TextCtrl::BUILD() {
|
|||
*/
|
||||
// recast as a wxWindow to fit the calling convention
|
||||
window = dynamic_cast<wxWindow*>(temp);
|
||||
}
|
||||
}
|
||||
|
||||
bool TextCtrl::value_was_changed()
|
||||
{
|
||||
|
|
@ -561,7 +561,7 @@ bool TextCtrl::value_was_changed()
|
|||
case coPercents:
|
||||
case coFloats:
|
||||
case coFloat: {
|
||||
if (m_opt.nullable && std::isnan(boost::any_cast<double>(m_value)) &&
|
||||
if (m_opt.nullable && std::isnan(boost::any_cast<double>(m_value)) &&
|
||||
std::isnan(boost::any_cast<double>(val)))
|
||||
return false;
|
||||
return boost::any_cast<double>(m_value) != boost::any_cast<double>(val);
|
||||
|
|
@ -599,9 +599,9 @@ void TextCtrl::set_value(const boost::any& value, bool change_event/* = false*/)
|
|||
|
||||
if (!change_event) {
|
||||
wxString ret_str = static_cast<wxTextCtrl*>(window)->GetValue();
|
||||
/* Update m_value to correct work of next value_was_changed().
|
||||
* But after checking of entered value, don't fix the "incorrect" value and don't show a warning message,
|
||||
* just clear m_value in this case.
|
||||
/* Update m_value to correct work of next value_was_changed().
|
||||
* But after checking of entered value, don't fix the "incorrect" value and don't show a warning message,
|
||||
* just clear m_value in this case.
|
||||
*/
|
||||
get_value_by_opt_type(ret_str, false);
|
||||
}
|
||||
|
|
@ -633,7 +633,7 @@ void TextCtrl::msw_rescale()
|
|||
Field::msw_rescale();
|
||||
auto size = wxSize(def_width() * m_em_unit, wxDefaultCoord);
|
||||
|
||||
if (m_opt.height >= 0)
|
||||
if (m_opt.height >= 0)
|
||||
size.SetHeight(m_opt.height*m_em_unit);
|
||||
else if (parent_is_custom_ctrl && opt_height > 0)
|
||||
size.SetHeight(lround(opt_height*m_em_unit));
|
||||
|
|
@ -667,15 +667,15 @@ void CheckBox::BUILD() {
|
|||
if (m_opt.height >= 0) size.SetHeight(m_opt.height*m_em_unit);
|
||||
if (m_opt.width >= 0) size.SetWidth(m_opt.width*m_em_unit);
|
||||
|
||||
bool check_value = m_opt.type == coBool ?
|
||||
m_opt.default_value->getBool() : m_opt.type == coBools ?
|
||||
m_opt.get_default_value<ConfigOptionBools>()->get_at(m_opt_idx) :
|
||||
bool check_value = m_opt.type == coBool ?
|
||||
m_opt.default_value->getBool() : m_opt.type == coBools ?
|
||||
m_opt.get_default_value<ConfigOptionBools>()->get_at(m_opt_idx) :
|
||||
false;
|
||||
|
||||
m_last_meaningful_value = static_cast<unsigned char>(check_value);
|
||||
|
||||
// Set Label as a string of at least one space simbol to correct system scaling of a CheckBox
|
||||
auto temp = new wxCheckBox(m_parent, wxID_ANY, wxString(" "), wxDefaultPosition, size);
|
||||
// Set Label as a string of at least one space simbol to correct system scaling of a CheckBox
|
||||
auto temp = new wxCheckBox(m_parent, wxID_ANY, wxString(" "), wxDefaultPosition, size);
|
||||
temp->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
||||
if (!wxOSX) temp->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||
temp->SetValue(check_value);
|
||||
|
|
@ -686,7 +686,7 @@ void CheckBox::BUILD() {
|
|||
on_change_field();
|
||||
}), temp->GetId());
|
||||
|
||||
temp->SetToolTip(get_tooltip_text(check_value ? "true" : "false"));
|
||||
temp->SetToolTip(get_tooltip_text(check_value ? "true" : "false"));
|
||||
|
||||
// recast as a wxWindow to fit the calling convention
|
||||
window = dynamic_cast<wxWindow*>(temp);
|
||||
|
|
@ -772,14 +772,14 @@ void SpinCtrl::BUILD() {
|
|||
break;
|
||||
}
|
||||
|
||||
const int min_val = m_opt.min == INT_MIN
|
||||
const int min_val = m_opt.min == INT_MIN
|
||||
#ifdef __WXOSX__
|
||||
// We will forcibly set the input value for SpinControl, since the value
|
||||
// We will forcibly set the input value for SpinControl, since the value
|
||||
// inserted from the keyboard is not updated under OSX.
|
||||
// So, we can't set min control value bigger then 0.
|
||||
// Otherwise, it couldn't be possible to input from keyboard value
|
||||
// Otherwise, it couldn't be possible to input from keyboard value
|
||||
// less then min_val.
|
||||
|| m_opt.min > 0
|
||||
|| m_opt.min > 0
|
||||
#endif
|
||||
? 0 : m_opt.min;
|
||||
const int max_val = m_opt.max < 2147483647 ? m_opt.max : 2147483647;
|
||||
|
|
@ -815,8 +815,8 @@ void SpinCtrl::BUILD() {
|
|||
propagate_value();
|
||||
}));
|
||||
|
||||
temp->Bind(wxEVT_SPINCTRL, ([this](wxCommandEvent e) { propagate_value(); }), temp->GetId());
|
||||
|
||||
temp->Bind(wxEVT_SPINCTRL, ([this](wxCommandEvent e) { propagate_value(); }), temp->GetId());
|
||||
|
||||
temp->Bind(wxEVT_TEXT_ENTER, ([this](wxCommandEvent e)
|
||||
{
|
||||
e.Skip();
|
||||
|
|
@ -837,7 +837,7 @@ void SpinCtrl::BUILD() {
|
|||
tmp_value = parsed && value >= INT_MIN && value <= INT_MAX ? (int)value : UNDEF_VALUE;
|
||||
|
||||
#ifdef __WXOSX__
|
||||
// Forcibly set the input value for SpinControl, since the value
|
||||
// Forcibly set the input value for SpinControl, since the value
|
||||
// inserted from the keyboard or clipboard is not updated under OSX
|
||||
if (tmp_value != UNDEF_VALUE) {
|
||||
wxSpinCtrl* spin = static_cast<wxSpinCtrl*>(window);
|
||||
|
|
@ -849,7 +849,7 @@ void SpinCtrl::BUILD() {
|
|||
}
|
||||
#endif
|
||||
}), temp->GetId());
|
||||
|
||||
|
||||
temp->SetToolTip(get_tooltip_text(text_value));
|
||||
|
||||
// recast as a wxWindow to fit the calling convention
|
||||
|
|
@ -901,7 +901,7 @@ void Choice::BUILD() {
|
|||
if (m_opt.height >= 0) size.SetHeight(m_opt.height*m_em_unit);
|
||||
if (m_opt.width >= 0) size.SetWidth(m_opt.width*m_em_unit);
|
||||
|
||||
choice_ctrl* temp;
|
||||
choice_ctrl* temp;
|
||||
if (!m_opt.gui_type.empty() && m_opt.gui_type.compare("select_open") != 0) {
|
||||
m_is_editable = true;
|
||||
temp = new choice_ctrl(m_parent, wxID_ANY, wxString(""), wxDefaultPosition, size);
|
||||
|
|
@ -1053,10 +1053,10 @@ void Choice::set_value(const std::string& value, bool change_event) //! Redunda
|
|||
}
|
||||
|
||||
choice_ctrl* field = dynamic_cast<choice_ctrl*>(window);
|
||||
idx == m_opt.enum_values.size() ?
|
||||
idx == m_opt.enum_values.size() ?
|
||||
field->SetValue(value) :
|
||||
field->SetSelection(idx);
|
||||
|
||||
|
||||
m_disable_change_event = false;
|
||||
}
|
||||
|
||||
|
|
@ -1074,7 +1074,7 @@ void Choice::set_value(const boost::any& value, bool change_event)
|
|||
case coString:
|
||||
case coStrings: {
|
||||
wxString text_value;
|
||||
if (m_opt.type == coInt)
|
||||
if (m_opt.type == coInt)
|
||||
text_value = wxString::Format(_T("%i"), int(boost::any_cast<int>(value)));
|
||||
else
|
||||
text_value = boost::any_cast<wxString>(value);
|
||||
|
|
@ -1102,7 +1102,7 @@ void Choice::set_value(const boost::any& value, bool change_event)
|
|||
{
|
||||
if (!m_opt.enum_values.empty()) {
|
||||
std::string key;
|
||||
t_config_enum_values map_names = ConfigOptionEnum<InfillPattern>::get_enum_values();
|
||||
t_config_enum_values map_names = ConfigOptionEnum<InfillPattern>::get_enum_values();
|
||||
for (auto it : map_names) {
|
||||
if (val == it.second) {
|
||||
key = it.first;
|
||||
|
|
@ -1177,7 +1177,7 @@ boost::any& Choice::get_value()
|
|||
{
|
||||
choice_ctrl* field = dynamic_cast<choice_ctrl*>(window);
|
||||
|
||||
wxString ret_str = field->GetValue();
|
||||
wxString ret_str = field->GetValue();
|
||||
|
||||
// options from right panel
|
||||
std::vector <std::string> right_panel_options{ "support", "pad", "scale_unit" };
|
||||
|
|
@ -1187,7 +1187,7 @@ boost::any& Choice::get_value()
|
|||
|
||||
if (m_opt.type == coEnum)
|
||||
{
|
||||
int ret_enum = field->GetSelection();
|
||||
int ret_enum = field->GetSelection();
|
||||
if (m_opt_id == "top_fill_pattern" || m_opt_id == "bottom_fill_pattern" || m_opt_id == "fill_pattern")
|
||||
{
|
||||
if (!m_opt.enum_values.empty()) {
|
||||
|
|
@ -1234,7 +1234,7 @@ boost::any& Choice::get_value()
|
|||
else
|
||||
m_value = atof(m_opt.enum_values[ret_enum].c_str());
|
||||
}
|
||||
else
|
||||
else
|
||||
// modifies ret_string!
|
||||
get_value_by_opt_type(ret_str);
|
||||
|
||||
|
|
@ -1252,8 +1252,8 @@ void Choice::msw_rescale()
|
|||
#ifdef __WXOSX__
|
||||
const wxString selection = field->GetValue();// field->GetString(index);
|
||||
|
||||
/* To correct scaling (set new controll size) of a wxBitmapCombobox
|
||||
* we need to refill control with new bitmaps. So, in our case :
|
||||
/* To correct scaling (set new controll size) of a wxBitmapCombobox
|
||||
* we need to refill control with new bitmaps. So, in our case :
|
||||
* 1. clear control
|
||||
* 2. add content
|
||||
* 3. add scaled "empty" bitmap to the at least one item
|
||||
|
|
@ -1261,7 +1261,7 @@ void Choice::msw_rescale()
|
|||
field->Clear();
|
||||
wxSize size(wxDefaultSize);
|
||||
size.SetWidth((m_opt.width > 0 ? m_opt.width : def_width_wider()) * m_em_unit);
|
||||
|
||||
|
||||
// Set rescaled min height to correct layout
|
||||
field->SetMinSize(wxSize(-1, int(1.5f*field->GetFont().GetPixelSize().y + 0.5f)));
|
||||
// Set rescaled size
|
||||
|
|
@ -1373,7 +1373,7 @@ void ColourPicker::msw_rescale()
|
|||
|
||||
wxColourPickerCtrl* field = dynamic_cast<wxColourPickerCtrl*>(window);
|
||||
auto size = wxSize(def_width() * m_em_unit, wxDefaultCoord);
|
||||
if (m_opt.height >= 0)
|
||||
if (m_opt.height >= 0)
|
||||
size.SetHeight(m_opt.height * m_em_unit);
|
||||
else if (parent_is_custom_ctrl && opt_height > 0)
|
||||
size.SetHeight(lround(opt_height * m_em_unit));
|
||||
|
|
@ -1509,7 +1509,7 @@ boost::any& PointCtrl::get_value()
|
|||
else
|
||||
if (m_opt.min > x || x > m_opt.max ||
|
||||
m_opt.min > y || y > m_opt.max)
|
||||
{
|
||||
{
|
||||
if (m_opt.min > x) x = m_opt.min;
|
||||
if (x > m_opt.max) x = m_opt.max;
|
||||
if (m_opt.min > y) y = m_opt.min;
|
||||
|
|
@ -1575,7 +1575,7 @@ void SliderCtrl::BUILD()
|
|||
m_slider->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||
wxSize field_size(40, -1);
|
||||
|
||||
m_textctrl = new wxTextCtrl(m_parent, wxID_ANY, wxString::Format("%d", m_slider->GetValue()/m_scale),
|
||||
m_textctrl = new wxTextCtrl(m_parent, wxID_ANY, wxString::Format("%d", m_slider->GetValue()/m_scale),
|
||||
wxDefaultPosition, field_size);
|
||||
m_textctrl->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
||||
m_textctrl->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||
|
|
@ -1625,5 +1625,3 @@ boost::any& SliderCtrl::get_value()
|
|||
|
||||
} // GUI
|
||||
} // Slic3r
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ void disable_screensaver()
|
|||
#if __APPLE__
|
||||
CFStringRef reasonForActivity = CFSTR("Slic3r");
|
||||
[[maybe_unused]]IOReturn success = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep,
|
||||
kIOPMAssertionLevelOn, reasonForActivity, &assertionID);
|
||||
kIOPMAssertionLevelOn, reasonForActivity, &assertionID);
|
||||
// ignore result: success == kIOReturnSuccess
|
||||
#elif _WIN32
|
||||
SetThreadExecutionState(ES_DISPLAY_REQUIRED | ES_CONTINUOUS);
|
||||
|
|
@ -71,7 +71,7 @@ void break_to_debugger()
|
|||
|
||||
const std::string& shortkey_ctrl_prefix()
|
||||
{
|
||||
static const std::string str =
|
||||
static const std::string str =
|
||||
#ifdef __APPLE__
|
||||
"⌘"
|
||||
#else
|
||||
|
|
@ -83,7 +83,7 @@ const std::string& shortkey_ctrl_prefix()
|
|||
|
||||
const std::string& shortkey_alt_prefix()
|
||||
{
|
||||
static const std::string str =
|
||||
static const std::string str =
|
||||
#ifdef __APPLE__
|
||||
"⌥"
|
||||
#else
|
||||
|
|
@ -132,13 +132,13 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt
|
|||
ConfigOptionFloats* vec_new = new ConfigOptionFloats{ boost::any_cast<double>(value) };
|
||||
config.option<ConfigOptionFloats>(opt_key)->set_at(vec_new, opt_index, opt_index);
|
||||
break;
|
||||
}
|
||||
}
|
||||
case coString:
|
||||
config.set_key_value(opt_key, new ConfigOptionString(boost::any_cast<std::string>(value)));
|
||||
break;
|
||||
case coStrings:{
|
||||
if (opt_key == "compatible_prints" || opt_key == "compatible_printers") {
|
||||
config.option<ConfigOptionStrings>(opt_key)->values =
|
||||
config.option<ConfigOptionStrings>(opt_key)->values =
|
||||
boost::any_cast<std::vector<std::string>>(value);
|
||||
}
|
||||
else if (config.def()->get(opt_key)->gui_flags.compare("serialized") == 0) {
|
||||
|
|
@ -179,15 +179,15 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt
|
|||
if (opt_key == "top_fill_pattern" ||
|
||||
opt_key == "bottom_fill_pattern" ||
|
||||
opt_key == "fill_pattern")
|
||||
config.set_key_value(opt_key, new ConfigOptionEnum<InfillPattern>(boost::any_cast<InfillPattern>(value)));
|
||||
config.set_key_value(opt_key, new ConfigOptionEnum<InfillPattern>(boost::any_cast<InfillPattern>(value)));
|
||||
else if (opt_key.compare("ironing_type") == 0)
|
||||
config.set_key_value(opt_key, new ConfigOptionEnum<IroningType>(boost::any_cast<IroningType>(value)));
|
||||
else if (opt_key.compare("fuzzy_skin") == 0)
|
||||
config.set_key_value(opt_key, new ConfigOptionEnum<FuzzySkinType>(boost::any_cast<FuzzySkinType>(value)));
|
||||
else if (opt_key.compare("gcode_flavor") == 0)
|
||||
config.set_key_value(opt_key, new ConfigOptionEnum<GCodeFlavor>(boost::any_cast<GCodeFlavor>(value)));
|
||||
config.set_key_value(opt_key, new ConfigOptionEnum<GCodeFlavor>(boost::any_cast<GCodeFlavor>(value)));
|
||||
else if (opt_key.compare("machine_limits_usage") == 0)
|
||||
config.set_key_value(opt_key, new ConfigOptionEnum<MachineLimitsUsage>(boost::any_cast<MachineLimitsUsage>(value)));
|
||||
config.set_key_value(opt_key, new ConfigOptionEnum<MachineLimitsUsage>(boost::any_cast<MachineLimitsUsage>(value)));
|
||||
else if (opt_key.compare("support_material_pattern") == 0)
|
||||
config.set_key_value(opt_key, new ConfigOptionEnum<SupportMaterialPattern>(boost::any_cast<SupportMaterialPattern>(value)));
|
||||
else if (opt_key.compare("seam_position") == 0)
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ const t_field& OptionsGroup::build_field(const t_config_option_key& id, const Co
|
|||
m_fields.emplace(id, Choice::Create<Choice>(this->ctrl_parent(), opt, id));
|
||||
} else if (opt.gui_type == "color") {
|
||||
m_fields.emplace(id, ColourPicker::Create<ColourPicker>(this->ctrl_parent(), opt, id));
|
||||
} else if (opt.gui_type == "f_enum_open" ||
|
||||
} else if (opt.gui_type == "f_enum_open" ||
|
||||
opt.gui_type == "i_enum_open" ||
|
||||
opt.gui_type == "i_enum_closed") {
|
||||
m_fields.emplace(id, Choice::Create<Choice>(this->ctrl_parent(), opt, id));
|
||||
|
|
@ -41,7 +41,7 @@ const t_field& OptionsGroup::build_field(const t_config_option_key& id, const Co
|
|||
m_fields.emplace(id, StaticText::Create<StaticText>(this->ctrl_parent(), opt, id));
|
||||
} else if (opt.gui_type == "one_string") {
|
||||
m_fields.emplace(id, TextCtrl::Create<TextCtrl>(this->ctrl_parent(), opt, id));
|
||||
} else {
|
||||
} else {
|
||||
switch (opt.type) {
|
||||
case coFloatOrPercent:
|
||||
case coFloat:
|
||||
|
|
@ -74,19 +74,19 @@ const t_field& OptionsGroup::build_field(const t_config_option_key& id, const Co
|
|||
// Grab a reference to fields for convenience
|
||||
const t_field& field = m_fields[id];
|
||||
field->m_on_change = [this](const std::string& opt_id, const boost::any& value) {
|
||||
//! This function will be called from Field.
|
||||
//! This function will be called from Field.
|
||||
//! Call OptionGroup._on_change(...)
|
||||
if (!m_disabled)
|
||||
if (!m_disabled)
|
||||
this->on_change_OG(opt_id, value);
|
||||
};
|
||||
field->m_on_kill_focus = [this](const std::string& opt_id) {
|
||||
//! This function will be called from Field.
|
||||
if (!m_disabled)
|
||||
//! This function will be called from Field.
|
||||
if (!m_disabled)
|
||||
this->on_kill_focus(opt_id);
|
||||
};
|
||||
field->m_on_set_focus = [this](const std::string& opt_id) {
|
||||
//! This function will be called from Field.
|
||||
if (!m_disabled)
|
||||
//! This function will be called from Field.
|
||||
if (!m_disabled)
|
||||
this->on_set_focus(opt_id);
|
||||
};
|
||||
field->m_parent = parent();
|
||||
|
|
@ -99,7 +99,7 @@ const t_field& OptionsGroup::build_field(const t_config_option_key& id, const Co
|
|||
if (!this->m_disabled)
|
||||
this->back_to_sys_value(opt_id);
|
||||
};
|
||||
|
||||
|
||||
// assign function objects for callbacks, etc.
|
||||
return field;
|
||||
}
|
||||
|
|
@ -178,7 +178,7 @@ void OptionsGroup::append_line(const Line& line)
|
|||
return;
|
||||
|
||||
auto option_set = line.get_options();
|
||||
for (auto opt : option_set)
|
||||
for (auto opt : option_set)
|
||||
m_options.emplace(opt.opt_id, opt);
|
||||
|
||||
// add mode value for current line to m_options_mode
|
||||
|
|
@ -232,7 +232,7 @@ void OptionsGroup::activate_line(Line& line)
|
|||
// if we have a single option with no label, no sidetext just add it directly to sizer
|
||||
if (option_set.size() == 1 && label_width == 0 && option_set.front().opt.full_width &&
|
||||
option_set.front().opt.label.empty() &&
|
||||
option_set.front().opt.sidetext.size() == 0 && option_set.front().side_widget == nullptr &&
|
||||
option_set.front().opt.sidetext.size() == 0 && option_set.front().side_widget == nullptr &&
|
||||
line.get_extra_widgets().size() == 0) {
|
||||
|
||||
const auto& option = option_set.front();
|
||||
|
|
@ -334,7 +334,7 @@ void OptionsGroup::activate_line(Line& line)
|
|||
wxString str_label = (option.label == L_CONTEXT("Top", "Layers") || option.label == L_CONTEXT("Bottom", "Layers")) ?
|
||||
_CTX(option.label, "Layers") :
|
||||
_(option.label);
|
||||
label = new wxStaticText(this->ctrl_parent(), wxID_ANY, str_label + ": ", wxDefaultPosition, //wxDefaultSize);
|
||||
label = new wxStaticText(this->ctrl_parent(), wxID_ANY, str_label + ": ", wxDefaultPosition, //wxDefaultSize);
|
||||
wxSize(sublabel_width != -1 ? sublabel_width * wxGetApp().em_unit() : -1, -1), wxALIGN_RIGHT);
|
||||
label->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||
label->SetFont(wxGetApp().normal_font());
|
||||
|
|
@ -379,7 +379,7 @@ void OptionsGroup::activate_line(Line& line)
|
|||
}
|
||||
|
||||
// add extra sizers if any
|
||||
for (auto extra_widget : line.get_extra_widgets())
|
||||
for (auto extra_widget : line.get_extra_widgets())
|
||||
{
|
||||
if (line.get_extra_widgets().size() == 1 && !staticbox)
|
||||
{
|
||||
|
|
@ -504,7 +504,7 @@ void OptionsGroup::clear_fields_except_of(const std::vector<std::string> left_fi
|
|||
while (it != m_fields.end()) {
|
||||
if (std::find(left_fields.begin(), left_fields.end(), it->first) == left_fields.end())
|
||||
it = m_fields.erase(it);
|
||||
else
|
||||
else
|
||||
it++;
|
||||
}
|
||||
}
|
||||
|
|
@ -530,7 +530,7 @@ Option ConfigOptionsGroup::get_option(const std::string& opt_key, int opt_index
|
|||
std::pair<std::string, int> pair(opt_key, opt_index);
|
||||
m_opt_map.emplace(opt_id, pair);
|
||||
|
||||
if (m_use_custom_ctrl) // fill group and category values just for options from Settings Tab
|
||||
if (m_use_custom_ctrl) // fill group and category values just for options from Settings Tab
|
||||
wxGetApp().sidebar().get_searcher().add_key(opt_id, title, this->config_category());
|
||||
|
||||
return Option(*m_config->def()->get(opt_key), opt_id);
|
||||
|
|
@ -545,7 +545,7 @@ void ConfigOptionsGroup::on_change_OG(const t_config_option_key& opt_id, const b
|
|||
{
|
||||
OptionsGroup::on_change_OG(opt_id, value);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
auto itOption = it->second;
|
||||
const std::string &opt_key = itOption.first;
|
||||
|
|
@ -554,7 +554,7 @@ void ConfigOptionsGroup::on_change_OG(const t_config_option_key& opt_id, const b
|
|||
this->change_opt_value(opt_key, value, opt_index == -1 ? 0 : opt_index);
|
||||
}
|
||||
|
||||
OptionsGroup::on_change_OG(opt_id, value);
|
||||
OptionsGroup::on_change_OG(opt_id, value);
|
||||
}
|
||||
|
||||
void ConfigOptionsGroup::back_to_initial_value(const std::string& opt_key)
|
||||
|
|
@ -582,7 +582,7 @@ void ConfigOptionsGroup::back_to_config_value(const DynamicPrintConfig& config,
|
|||
}
|
||||
else if (m_opt_map.find(opt_key) == m_opt_map.end() ||
|
||||
// This option don't have corresponded field
|
||||
opt_key == "bed_shape" || opt_key == "filament_ramming_parameters" ||
|
||||
opt_key == "bed_shape" || opt_key == "filament_ramming_parameters" ||
|
||||
opt_key == "compatible_printers" || opt_key == "compatible_prints" ) {
|
||||
value = get_config_value(config, opt_key);
|
||||
this->change_opt_value(opt_key, value);
|
||||
|
|
@ -765,7 +765,7 @@ boost::any ConfigOptionsGroup::config_value(const std::string& opt_key, int opt_
|
|||
boost::any ConfigOptionsGroup::get_config_value(const DynamicPrintConfig& config, const std::string& opt_key, int opt_index /*= -1*/)
|
||||
{
|
||||
size_t idx = opt_index == -1 ? 0 : opt_index;
|
||||
|
||||
|
||||
boost::any ret;
|
||||
wxString text_value = wxString("");
|
||||
const ConfigOptionDef* opt = config.def()->get(opt_key);
|
||||
|
|
@ -898,7 +898,7 @@ boost::any ConfigOptionsGroup::get_config_value(const DynamicPrintConfig& config
|
|||
}
|
||||
else if (opt_key == "brim_type") {
|
||||
ret = static_cast<int>(config.option<ConfigOptionEnum<BrimType>>(opt_key)->value);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case coPoints:
|
||||
|
|
@ -955,7 +955,7 @@ void ConfigOptionsGroup::change_opt_value(const t_config_option_key& opt_key, co
|
|||
m_modelconfig->touch();
|
||||
}
|
||||
|
||||
ogStaticText::ogStaticText(wxWindow* parent, const wxString& text) :
|
||||
ogStaticText::ogStaticText(wxWindow* parent, const wxString& text) :
|
||||
wxStaticText(parent, wxID_ANY, text, wxDefaultPosition, wxDefaultSize)
|
||||
{
|
||||
if (!text.IsEmpty()) {
|
||||
|
|
|
|||
|
|
@ -1501,7 +1501,8 @@ void TabPrint::build()
|
|||
optgroup->append_single_option_line("raft_layers", category_path + "raft-layers");
|
||||
optgroup->append_single_option_line("raft_first_layer_density", category_path + "raft-first-layer-density");
|
||||
optgroup->append_single_option_line("raft_first_layer_expansion", category_path + "raft-first-layer-expansion");
|
||||
// # optgroup->append_single_option_line(get_option_("raft_contact_distance");
|
||||
optgroup->append_single_option_line("raft_contact_distance");
|
||||
optgroup->append_single_option_line("raft_expansion");
|
||||
|
||||
optgroup = page->new_optgroup(L("Options for support material and raft"));
|
||||
optgroup->append_single_option_line("support_material_contact_distance", category_path + "contact-z-distance");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue