build: clear 237 warnings - unused lambda captures (#15417)

* build: enable /Zc:lambda for MSVC

MSVC keeps its legacy lambda processor under /std:c++17, which rejects
reading a constexpr constant inside a lambda that does not capture it
(C3493). No other compiler requires that capture, and clang reports it as
an unused one, so the two cannot both be satisfied without the flag.

/Zc:lambda selects the conforming lambda parser that clang and GCC
already use. It is implied by /std:c++20 and /permissive-, so it is only
needed while we are on C++17. clang-cl is conforming already and does not
take the flag.

It requires VS2019 16.8, so build_release_vs.bat now says 16.8+.

* build: clear 237 unused lambda capture warnings

236 captures across 81 files, 142 of them `this`. Removing an unused
capture changes no behavior; clang does not report a capture whose type
has a non-trivial destructor, so nothing held only to extend an object's
lifetime is in this set.

Nine of them are the second half of the warning, "is not required to be
captured for this use", where the capture is a const or constexpr value
the body does read. Those depend on the /Zc:lambda change in the previous
commit. One of them, in FillRectilinear.cpp, had been worked around with
an #ifndef __APPLE__ guard around the capture list, which is now gone.

GUI_ObjectTableSettings.cpp captured its reset button only to read it
inside #ifdef __WXOSX_MAC__. That branch now takes the button from the
event it is already handling.

* build: fail configure on MSVC older than 19.28 instead of dropping /Zc:lambda

cl.exe answers an unrecognized /Zc: sub-option with warning D9002 and keeps
going, so on VS2019 before 16.8 the flag is silently ignored and the build
instead dies with C3493 in FillRectilinear.cpp, nowhere near the cause.

* fix: delete three locals that are now unused

Their only remaining use was the lambda capture this branch removed. The
Clang builds set -Wno-unused-variable, so the build never flagged them.

---------

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
This commit is contained in:
Kris Austin
2026-09-02 07:38:05 -03:00
committed by GitHub
co-authored by Rodrigo Faselli
parent e523acc164
commit 1749c293a6
83 changed files with 226 additions and 217 deletions
+3 -3
View File
@@ -437,7 +437,7 @@ wxBoxSizer* AMSDryCtrWin::create_normal_state_panel(wxPanel* parent)
m_temperature_input = new wxTextCtrl(parent, wxID_ANY, "", wxDefaultPosition, wxSize(FromDIP(80), -1));
m_temperature_input->SetMaxLength(3); // Limit to 3 digits
m_temperature_input->Bind(wxEVT_CHAR, [this](wxKeyEvent& event) {
m_temperature_input->Bind(wxEVT_CHAR, [](wxKeyEvent& event) {
int keycode = event.GetKeyCode();
if (keycode >= '0' && keycode <= '9') {
event.Skip();
@@ -464,7 +464,7 @@ wxBoxSizer* AMSDryCtrWin::create_normal_state_panel(wxPanel* parent)
m_time_input = new wxTextCtrl(parent, wxID_ANY, "", wxDefaultPosition, wxSize(FromDIP(100), -1));
m_time_input->SetMaxLength(3); // Limit to 3 digits
m_time_input->Bind(wxEVT_CHAR, [this](wxKeyEvent& event) {
m_time_input->Bind(wxEVT_CHAR, [](wxKeyEvent& event) {
int keycode = event.GetKeyCode();
if (keycode >= '0' && keycode <= '9') {
event.Skip();
@@ -698,7 +698,7 @@ wxBoxSizer* AMSDryCtrWin::create_guide_info_section(wxPanel* parent)
m_rotate_spool_toggle = new wxCheckBox(parent, wxID_ANY, "");
m_rotate_spool_toggle->SetValue(false);
m_rotate_spool_toggle->Bind(wxEVT_CHECKBOX, [this](wxCommandEvent& event) {
m_rotate_spool_toggle->Bind(wxEVT_CHECKBOX, [](wxCommandEvent& event) {
bool is_checked = event.IsChecked();
// Add toggle behavior logic here
});
+3 -3
View File
@@ -468,7 +468,7 @@ PingCodeBindDialog::~PingCodeBindDialog() {
m_link_privacy_title->SetFont(Label::Head_13);
m_link_privacy_title->SetMaxSize(wxSize(FromDIP(450), -1));
m_link_privacy_title->Wrap(FromDIP(450));
m_link_privacy_title->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
m_link_privacy_title->Bind(wxEVT_LEFT_DOWN, [](auto& e) {
std::string url;
std::string country_code = Slic3r::GUI::wxGetApp().app_config->get_country_code();
@@ -893,7 +893,7 @@ void BindMachineDialog::on_show(wxShowEvent &event)
}
}
})
.on_error([this](std::string body, std::string error, unsigned status) {
.on_error([](std::string body, std::string error, unsigned status) {
//BOOST_LOG_TRIVIAL(info) << "load oss picture failed, oss path: " << oss_path << " status:" << status << " error:" << error;
}).perform();
}
@@ -1099,7 +1099,7 @@ void UnBindMachineDialog::on_show(wxShowEvent &event)
}
}
})
.on_error([this](std::string body, std::string error, unsigned status) {
.on_error([](std::string body, std::string error, unsigned status) {
//BOOST_LOG_TRIVIAL(info) << "load oss picture failed, oss path: " << oss_path << " status:" << status << " error:" << error;
}).perform();
+1 -1
View File
@@ -443,7 +443,7 @@ void HistoryWindow::sync_history_data() {
auto edit_button = new Button(m_history_data_panel, _L("Edit"));
edit_button->SetStyle(ButtonStyle::Confirm, ButtonType::Window);
edit_button->Bind(wxEVT_BUTTON, [this, result, k_value, name_value, edit_button](auto& e) {
edit_button->Bind(wxEVT_BUTTON, [this, result, k_value, name_value](auto& e) {
if (m_ui_op_lock) return;
PACalibResult result_buffer = result;
+1 -1
View File
@@ -201,7 +201,7 @@ wxWindow* CalibrationDialog::create_check_option(wxString title, wxWindow* paren
checkbox->SetToolTip(tooltip);
text->SetToolTip(tooltip);
text->Bind(wxEVT_LEFT_DOWN, [this, check](wxMouseEvent&) { check->SetValue(check->GetValue() ? false : true); });
text->Bind(wxEVT_LEFT_DOWN, [check](wxMouseEvent&) { check->SetValue(check->GetValue() ? false : true); });
m_checkbox_list[param] = check;
m_checkbox_list[param]->SetValue(true);
return checkbox;
+1 -1
View File
@@ -477,7 +477,7 @@ void CalibrationWizard::on_cali_go_home()
if (go_home_dialog == nullptr)
go_home_dialog = new SecondaryCheckDialog(this, wxID_ANY, _L("Confirm"));
go_home_dialog->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this, method](wxCommandEvent &e) {
go_home_dialog->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this](wxCommandEvent &e) {
if (curr_obj) {
curr_obj->command_task_abort();
} else {
+1 -1
View File
@@ -90,7 +90,7 @@ void CalibrationCaliPage::on_subtask_abort(wxCommandEvent& event)
if (abort_dlg == nullptr) {
abort_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Cancel print"));
abort_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this, obj](wxCommandEvent& e) {
abort_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [obj](wxCommandEvent& e) {
if (obj) obj->command_task_abort();
});
}
+1 -1
View File
@@ -762,7 +762,7 @@ void CaliPageActionPanel::bind_button(CaliPageActionType action_type, bool is_bl
if (is_block) {
m_action_btns[i]->Bind(wxEVT_BUTTON,
[this](wxCommandEvent& evt) {
[](wxCommandEvent& evt) {
MessageDialog msg(nullptr, _L("The current firmware version of the printer does not support calibration.\nPlease upgrade the printer firmware."), _L("Calibration not supported"), wxOK | wxICON_WARNING);
msg.ShowModal();
});
+3 -3
View File
@@ -272,7 +272,7 @@ void CaliPASaveAutoPanel::sync_cali_result(const std::vector<PACalibResult>& cal
preset_names = default_naming(preset_names);
std::vector<PACalibResult> sorted_cali_result = cali_result;
std::sort(sorted_cali_result.begin(), sorted_cali_result.end(), [this](const PACalibResult &left, const PACalibResult& right) {
std::sort(sorted_cali_result.begin(), sorted_cali_result.end(), [](const PACalibResult &left, const PACalibResult& right) {
return left.tray_id < right.tray_id;
});
@@ -366,7 +366,7 @@ void CaliPASaveAutoPanel::sync_cali_result(const std::vector<PACalibResult>& cal
}
}
comboBox_tray_name->Bind(wxEVT_COMBOBOX, [this, comboBox_tray_name, k_value, n_value](auto& e) {
comboBox_tray_name->Bind(wxEVT_COMBOBOX, [comboBox_tray_name](auto& e) {
int selection = comboBox_tray_name->GetSelection();
auto history = filtered_results[selection];
});
@@ -744,7 +744,7 @@ void CaliPASaveAutoPanel::sync_cali_result_for_multi_extruder(const std::vector<
}
}
comboBox_tray_name->Bind(wxEVT_COMBOBOX, [this, comboBox_tray_name, k_value, n_value](auto &e) {
comboBox_tray_name->Bind(wxEVT_COMBOBOX, [comboBox_tray_name](auto &e) {
int selection = comboBox_tray_name->GetSelection();
auto history = filtered_results[selection];
});
+1 -1
View File
@@ -140,7 +140,7 @@ CameraPopup::CameraPopup(wxWindow *parent)
vcamera_guide_link->Wrap(-1);
vcamera_guide_link->SetForegroundColour(wxColour(0x1F, 0x8E, 0xEA));
auto text_size = vcamera_guide_link->GetTextExtent(text);
vcamera_guide_link->Bind(wxEVT_LEFT_DOWN, [this, url](wxMouseEvent& e) {wxLaunchDefaultBrowser(url); });
vcamera_guide_link->Bind(wxEVT_LEFT_DOWN, [url](wxMouseEvent& e) {wxLaunchDefaultBrowser(url); });
link_underline = new wxPanel(m_panel, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL);
link_underline->SetBackgroundColour(wxColour(0x1F, 0x8E, 0xEA));
+1 -1
View File
@@ -2752,7 +2752,7 @@ ConfigWizard::ConfigWizard(wxWindow *parent)
});
if (wxLinux_gtk3)
this->Bind(wxEVT_SHOW, [this, vsizer](const wxShowEvent& e) {
this->Bind(wxEVT_SHOW, [](const wxShowEvent& e) {
;
});
+1 -1
View File
@@ -1885,7 +1885,7 @@ wxBoxSizer *CreatePrinterPresetDialog::create_nozzle_diameter_item(wxWindow *par
m_custom_nozzle_diameter_ctrl = new wxTextCtrl(parent, wxID_ANY, "", wxDefaultPosition, NAME_OPTION_COMBOBOX_SIZE);
m_custom_nozzle_diameter_ctrl->SetHint(_L("Input Custom Nozzle Diameter"));
m_custom_nozzle_diameter_ctrl->Bind(wxEVT_CHAR, [this](wxKeyEvent &event) {
m_custom_nozzle_diameter_ctrl->Bind(wxEVT_CHAR, [](wxKeyEvent &event) {
int key = event.GetKeyCode();
if (key != 44 && key != 46 && cannot_input_key.find(key) != cannot_input_key.end()) { // "@" can not be inputed
event.Skip(false);
+1 -1
View File
@@ -1324,7 +1324,7 @@ void SpinCtrl::BUILD() {
bEnterPressed = true;
}), temp->GetId());
temp->GetTextCtrl()->Bind(wxEVT_TEXT, ([this, temp](wxCommandEvent e)
temp->GetTextCtrl()->Bind(wxEVT_TEXT, ([this](wxCommandEvent e)
{
// # On OSX / Cocoa, SpinInput::GetValue() doesn't return the new value
// # when it was changed from the text control, so the on_change callback
+2 -2
View File
@@ -426,11 +426,11 @@ wxScrolledWindow* FilamentPickerDialog::CreateColorGrid()
});
// Hover highlight
btn->Bind(wxEVT_ENTER_WINDOW, [btn](wxMouseEvent& evt) {
btn->Bind(wxEVT_ENTER_WINDOW, [](wxMouseEvent& evt) {
evt.Skip();
});
btn->Bind(wxEVT_LEAVE_WINDOW, [btn](wxMouseEvent& evt) {
btn->Bind(wxEVT_LEAVE_WINDOW, [](wxMouseEvent& evt) {
evt.Skip();
});
+12 -12
View File
@@ -2613,7 +2613,7 @@ void GCodeViewer::render_all_plates_stats(const std::vector<const GCodeProcessor
return ret;
};
auto append_item = [icon_size, &imgui, imperial_units, &window_padding, &draw_list, this](const ColorRGBA& color, const std::vector<std::pair<std::string, float>>& columns_offsets)
auto append_item = [icon_size, &imgui, &window_padding, &draw_list, this](const ColorRGBA& color, const std::vector<std::pair<std::string, float>>& columns_offsets)
{
// render icon
ImVec2 pos = ImVec2(ImGui::GetCursorScreenPos().x + window_padding * 3, ImGui::GetCursorScreenPos().y);
@@ -2648,7 +2648,7 @@ void GCodeViewer::render_all_plates_stats(const std::vector<const GCodeProcessor
}
ImGui::Separator();
};
auto get_used_filament_from_volume = [this, imperial_units, &filament_diameters, &filament_densities](double volume, int extruder_id) {
auto get_used_filament_from_volume = [imperial_units, &filament_diameters, &filament_densities](double volume, int extruder_id) {
double koef = imperial_units ? 1.0 / GizmoObjectManipulation::in_to_mm : 0.001;
std::pair<double, double> ret = { koef * volume / (PI * sqr(0.5 * filament_diameters[extruder_id])),
volume * filament_densities[extruder_id] * 0.001 };
@@ -3233,7 +3233,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
//ImVec2(pos_rect.x + ImGui::GetWindowWidth() + ImGui::GetFrameHeight(),pos_rect.y + ImGui::GetFrameHeight() + window_padding * 2.5),
//ImGui::GetColorU32(ImVec4(0,0,0,0.3)));
auto append_item = [icon_size, &imgui, imperial_units, &window_padding, &draw_list, this](
auto append_item = [icon_size, &imgui, &window_padding, &draw_list, this](
EItemType type,
const ColorRGBA& color,
const std::vector<std::pair<std::string, float>>& columns_offsets,
@@ -3368,7 +3368,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
return ret;
};
auto calculate_offsets = [&imgui, max_width, window_padding, this](const std::vector<std::pair<std::string, std::vector<::string>>>& title_columns, float extra_size = 0.0f) {
auto calculate_offsets = [max_width, this](const std::vector<std::pair<std::string, std::vector<::string>>>& title_columns, float extra_size = 0.0f) {
const ImGuiStyle& style = ImGui::GetStyle();
std::vector<float> offsets;
// ORCA increase spacing for more readable format. Using direct number requires much less code change in here. GetTextLineHeight for additional spacing for icon_size
@@ -3856,7 +3856,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
columns_offsets.push_back({ distance_text, offsets[3] });
if (full_layout && !count_text.empty())
columns_offsets.push_back({ count_text, distance_text.empty() ? offsets[3] : offsets[4] });
append_item(EItemType::Rect, color, columns_offsets, true, offsets.back()/*ORCA checkbox_pos*/, visible, [this, type, visible]() {
append_item(EItemType::Rect, color, columns_offsets, true, offsets.back()/*ORCA checkbox_pos*/, visible, [this, type]() {
m_viewer.toggle_option_visibility(type);
update_moves_slider();
});
@@ -3913,7 +3913,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
columns_offsets.push_back({used_filaments_length[i], offsets[3]});
columns_offsets.push_back({used_filaments_weight[i], offsets[4]});
append_item(EItemType::Rect, libvgcode::convert(m_viewer.get_extrusion_role_color(role)), columns_offsets,
true, offsets.back(), visible, [this, role, visible]() {
true, offsets.back(), visible, [this, role]() {
m_viewer.toggle_extrusion_role_visibility(role);
update_moves_slider();
});
@@ -3932,7 +3932,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
columns_offsets.push_back({ travel_percent, offsets[2] });
columns_offsets.push_back({ travel_distance, offsets[3] }); // Usage column
columns_offsets.push_back({ travel_moves, offsets[4] }); // Usage column
append_item(EItemType::Rect, libvgcode::convert(m_viewer.get_option_color(libvgcode::EOptionType::Travels)), columns_offsets, true, offsets.back()/*ORCA checkbox_pos*/, visible, [this, item, visible]() {
append_item(EItemType::Rect, libvgcode::convert(m_viewer.get_option_color(libvgcode::EOptionType::Travels)), columns_offsets, true, offsets.back()/*ORCA checkbox_pos*/, visible, [this, item]() {
m_viewer.toggle_option_visibility(item);
update_moves_slider();
});
@@ -3951,7 +3951,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
append_headers({ {_u8L("Options"), offsets[0] }, { _u8L("Display"), offsets[1]} });
const bool travel_visible = m_viewer.is_option_visible(libvgcode::EOptionType::Travels);
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0.0f, 3.0f));
append_item(EItemType::None, libvgcode::convert(m_viewer.get_option_color(libvgcode::EOptionType::Travels)), { {_u8L("Travel"), offsets[0] }}, true, predictable_icon_pos/*ORCA checkbox_pos*/, travel_visible, [this, travel_visible]() {
append_item(EItemType::None, libvgcode::convert(m_viewer.get_option_color(libvgcode::EOptionType::Travels)), { {_u8L("Travel"), offsets[0] }}, true, predictable_icon_pos/*ORCA checkbox_pos*/, travel_visible, [this]() {
m_viewer.toggle_option_visibility(libvgcode::EOptionType::Travels);
// refresh(*m_gcode_result, wxGetApp().plater()->get_extruder_colors_from_plater_config(m_gcode_result));
update_moves_slider();
@@ -3968,7 +3968,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
append_headers({ {_u8L("Options"), offsets[0] }, { _u8L("Display"), offsets[1]} });
const bool travel_visible = m_viewer.is_option_visible(libvgcode::EOptionType::Travels);
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0.0f, 3.0f));
append_item(EItemType::None, libvgcode::convert(m_viewer.get_option_color(libvgcode::EOptionType::Travels)), { {_u8L("Travel"), offsets[0] }}, true, predictable_icon_pos/*ORCA checkbox_pos*/, travel_visible, [this, travel_visible]() {
append_item(EItemType::None, libvgcode::convert(m_viewer.get_option_color(libvgcode::EOptionType::Travels)), { {_u8L("Travel"), offsets[0] }}, true, predictable_icon_pos/*ORCA checkbox_pos*/, travel_visible, [this]() {
m_viewer.toggle_option_visibility(libvgcode::EOptionType::Travels);
// refresh(*m_gcode_result, wxGetApp().plater()->get_extruder_colors_from_plater_config(m_gcode_result));
update_moves_slider();
@@ -3985,7 +3985,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
append_headers({ {_u8L("Options"), offsets[0] }, { _u8L("Display"), offsets[1]} });
const bool travel_visible = m_viewer.is_option_visible(libvgcode::EOptionType::Travels);
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0.0f, 3.0f));
append_item(EItemType::None, libvgcode::convert(m_viewer.get_option_color(libvgcode::EOptionType::Travels)), { {_u8L("Travel"), offsets[0] }}, true, predictable_icon_pos/*ORCA checkbox_pos*/, travel_visible, [this, travel_visible]() {
append_item(EItemType::None, libvgcode::convert(m_viewer.get_option_color(libvgcode::EOptionType::Travels)), { {_u8L("Travel"), offsets[0] }}, true, predictable_icon_pos/*ORCA checkbox_pos*/, travel_visible, [this]() {
m_viewer.toggle_option_visibility(libvgcode::EOptionType::Travels);
update_moves_slider();
});
@@ -4001,7 +4001,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
append_headers({ {_u8L("Options"), offsets[0] }, { _u8L("Display"), offsets[1]} });
const bool travel_visible = m_viewer.is_option_visible(libvgcode::EOptionType::Travels);
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0.0f, 3.0f));
append_item(EItemType::None, libvgcode::convert(m_viewer.get_option_color(libvgcode::EOptionType::Travels)), { {_u8L("Travel"), offsets[0] }}, true, predictable_icon_pos/*ORCA checkbox_pos*/, travel_visible, [this, travel_visible]() {
append_item(EItemType::None, libvgcode::convert(m_viewer.get_option_color(libvgcode::EOptionType::Travels)), { {_u8L("Travel"), offsets[0] }}, true, predictable_icon_pos/*ORCA checkbox_pos*/, travel_visible, [this]() {
m_viewer.toggle_option_visibility(libvgcode::EOptionType::Travels);
update_moves_slider();
});
@@ -4121,7 +4121,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
}
float checkbox_pos = std::max(predictable_icon_pos, color_print_offsets[_u8L("Display")]); // ORCA prefer predictable_icon_pos when header not reacing end
append_item(EItemType::Rect, libvgcode::convert(tool_colors[extruder_idx]), columns_offsets, false, checkbox_pos/*ORCA*/, true, [this, extruder_idx]() {});
append_item(EItemType::Rect, libvgcode::convert(tool_colors[extruder_idx]), columns_offsets, false, checkbox_pos/*ORCA*/, true, []() {});
}
i++;
}
+10 -10
View File
@@ -9236,7 +9236,7 @@ void GLCanvas3D::_render_imgui_select_plate_toolbar()
ImVec2 size = ImVec2(button_width, button_height);
ImVec2 end_pos = ImVec2(start_pos.x + size.x, start_pos.y + size.y);
// ORCA show additional information depends on state
auto draw_info_btn = [end_pos, f_scale, margin, window_bg](std::string str, ImVec4 bg_color, ImVec4 fg_color){
auto draw_info_btn = [end_pos, f_scale, margin](std::string str, ImVec4 bg_color, ImVec4 fg_color){
GImGui->FontSize = 15.0f * f_scale;
ImVec2 txt_slice_sz = ImGui::CalcTextSize(str.c_str());
ImVec2 btn_pad = ImVec2(8.f, 1.f) * f_scale;
@@ -9492,7 +9492,7 @@ void GLCanvas3D::_render_canvas_toolbar()
Plater* p = wxGetApp().plater();
AppConfig* cfg = wxGetApp().app_config;
auto create_menu_item = [this, sc](
auto create_menu_item = [sc](
const std::string& name,
bool enable,
bool condition,
@@ -9509,7 +9509,7 @@ void GLCanvas3D::_render_canvas_toolbar()
create_menu_item( _utf8(L("3D Navigator")),
m_canvas_type != ECanvasType::CanvasAssembleView, // not work on assembly
wxGetApp().show_3d_navigator(),
[this]{
[]{
wxGetApp().toggle_show_3d_navigator();
ImGui::CloseCurrentPopup(); // Close popup to show changes on UI
}
@@ -9518,7 +9518,7 @@ void GLCanvas3D::_render_canvas_toolbar()
create_menu_item( _utf8(L("Zoom button")),
true, // work on all
wxGetApp().show_canvas_zoom_button(),
[this]{
[]{
wxGetApp().toggle_canvas_zoom_button();
ImGui::CloseCurrentPopup(); // Close popup to show changes on UI
}
@@ -9529,13 +9529,13 @@ void GLCanvas3D::_render_canvas_toolbar()
create_menu_item( _utf8(L("Overhangs")),
m_canvas_type == ECanvasType::CanvasView3D, // work only on prepare
p->is_view3D_overhang_shown(),
[this, p]{p->show_view3D_overhang(!p->is_view3D_overhang_shown());}
[p]{p->show_view3D_overhang(!p->is_view3D_overhang_shown());}
);
create_menu_item( _utf8(L("Outline")),
m_canvas_type != ECanvasType::CanvasPreview, // not work on preview
wxGetApp().show_outline(),
[this]{wxGetApp().toggle_show_outline();}
[]{wxGetApp().toggle_show_outline();}
);
create_menu_item( _utf8(L("Wireframe")),
@@ -9547,7 +9547,7 @@ void GLCanvas3D::_render_canvas_toolbar()
create_menu_item( _utf8(L("Realistic View")),
m_canvas_type != ECanvasType::CanvasPreview, // not work on preview
cfg->get_bool(SETTING_OPENGL_REALISTIC_MODE),
[this, &cfg]{
[&cfg]{
cfg->set_bool(SETTING_OPENGL_REALISTIC_MODE, !cfg->get_bool(SETTING_OPENGL_REALISTIC_MODE));
cfg->save();
}
@@ -9558,7 +9558,7 @@ void GLCanvas3D::_render_canvas_toolbar()
create_menu_item( _utf8(L("Perspective")),
true, // work on all
cfg->get_bool("use_perspective_camera"),
[this, &cfg]{
[&cfg]{
cfg->set_bool("use_perspective_camera", !(cfg->get_bool("use_perspective_camera")));
wxGetApp().update_ui_from_settings();
}
@@ -9575,7 +9575,7 @@ void GLCanvas3D::_render_canvas_toolbar()
create_menu_item( _utf8(L("Gridlines")),
m_canvas_type != ECanvasType::CanvasAssembleView, // not work on assembly
wxGetApp().show_plate_gridlines(),
[this]{wxGetApp().toggle_show_plate_gridlines();}
[]{wxGetApp().toggle_show_plate_gridlines();}
);
ImGui::Separator();
@@ -9583,7 +9583,7 @@ void GLCanvas3D::_render_canvas_toolbar()
create_menu_item( _utf8(L("Labels")),
m_canvas_type == ECanvasType::CanvasView3D, // work only on prepare
p->are_view3D_labels_shown(),
[this, p]{p->show_view3D_labels(!p->are_view3D_labels_shown());}
[p]{p->show_view3D_labels(!p->are_view3D_labels_shown());}
);
ImGui::PopItemFlag();
+5 -5
View File
@@ -2641,7 +2641,7 @@ std::string GUI_App::get_bbl_client_version()
void GUI_App::on_start_subscribe_again(std::string dev_id)
{
auto start_subscribe_timer = new wxTimer(this, wxID_ANY);
Bind(wxEVT_TIMER, [this, start_subscribe_timer, dev_id](auto& e) {
Bind(wxEVT_TIMER, [start_subscribe_timer, dev_id](auto& e) {
start_subscribe_timer->Stop();
Slic3r::DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
if (!dev) return;
@@ -3231,7 +3231,7 @@ bool GUI_App::on_init_inner()
}
});
Bind(EVT_SHOW_NO_NEW_VERSION, [this](const wxCommandEvent& evt) {
Bind(EVT_SHOW_NO_NEW_VERSION, [](const wxCommandEvent& evt) {
wxString msg = _L("This is the newest version.");
InfoDialog dlg(nullptr, _L("Info"), msg);
dlg.ShowModal();
@@ -5256,7 +5256,7 @@ std::string GUI_App::handle_web_request(std::string cmd)
}
}
else if (command_str.compare("begin_network_plugin_download") == 0) {
CallAfter([this] { wxGetApp().ShowDownNetPluginDlg(); });
CallAfter([] { wxGetApp().ShowDownNetPluginDlg(); });
}
else if (command_str.compare("get_web_shortcut") == 0) {
if (root.get_child_optional("key_event") != boost::none) {
@@ -8297,7 +8297,7 @@ bool GUI_App::show_modal_ip_address_enter_dialog(bool input_sn, wxString title)
dlg.set_machine_obj(obj);
if (!title.empty()) dlg.update_title(title);
dlg.Bind(EVT_ENTER_IP_ADDRESS, [this, obj](wxCommandEvent& e) {
dlg.Bind(EVT_ENTER_IP_ADDRESS, [obj](wxCommandEvent& e) {
auto selection_data_arr = wxSplit(e.GetString().ToStdString(), '|');
if (selection_data_arr.size() == 2) {
@@ -8777,7 +8777,7 @@ bool GUI_App::check_and_keep_current_preset_changes(const wxString& caption, con
if (!no_need_change && dlg.ShowModal() == wxID_CANCEL)
return false;
auto reset_modifications = [this, is_called_from_configwizard]() {
auto reset_modifications = [this]() {
//if (is_called_from_configwizard)
// return; // no need to discared changes. It will be done fromConfigWizard closing
+1 -1
View File
@@ -217,7 +217,7 @@ void AuxiliaryList::on_context_menu(wxDataViewEvent& evt)
}
else {
append_menu_item(menu, wxID_ANY, _L("Open"), wxEmptyString,
[this, node](wxCommandEvent&)
[node](wxCommandEvent&)
{
wxLaunchDefaultApplication(node->path, 0);
});
+7 -7
View File
@@ -1414,7 +1414,7 @@ void MenuFactory::create_default_menu()
append_menu_check_item(&m_default_menu, wxID_ANY, _L("Show Labels"), "",
[](wxCommandEvent&) { plater()->show_view3D_labels(!plater()->are_view3D_labels_shown()); plater()->get_current_canvas3D()->post_event(SimpleEvent(wxEVT_PAINT)); }, &m_default_menu,
[]() { return plater()->is_view3D_shown(); }, [this]() { return plater()->are_view3D_labels_shown(); }, m_parent);
[]() { return plater()->is_view3D_shown(); }, []() { return plater()->are_view3D_labels_shown(); }, m_parent);
}
void MenuFactory::create_common_object_menu(wxMenu* menu)
@@ -2090,7 +2090,7 @@ void MenuFactory::append_menu_item_clone(wxMenu* menu)
static const wxString ctrl = _L("Ctrl+");
#endif
append_menu_item(menu, wxID_ANY, _L("Clone") + "\t" + ctrl + "K", "",
[this](wxCommandEvent&) {
[](wxCommandEvent&) {
plater()->clone_selection();
}, "", nullptr,
[]() {
@@ -2115,7 +2115,7 @@ void MenuFactory::append_menu_item_smooth_mesh(wxMenu *menu)
void MenuFactory::append_menu_item_center(wxMenu* menu)
{
append_menu_item(menu, wxID_ANY, _L("Center") , "",
[this](wxCommandEvent&) {
[](wxCommandEvent&) {
plater()->center_selection();
}, "", nullptr,
[]() {
@@ -2134,7 +2134,7 @@ void MenuFactory::append_menu_item_center(wxMenu* menu)
void MenuFactory::append_menu_item_drop(wxMenu* menu)
{
append_menu_item(menu, wxID_ANY, _L("Drop") , "",
[this](wxCommandEvent&) {
[](wxCommandEvent&) {
plater()->drop_selection();
}, "", nullptr,
[]() {
@@ -2309,7 +2309,7 @@ void MenuFactory::append_menu_item_set_printable(wxMenu* menu)
}
}
wxMenuItem* menu_item_set_printable = append_menu_check_item(menu, wxID_ANY, _L("Printable") + "\t" + "V", "", [this, all_printable](wxCommandEvent&) {
wxMenuItem* menu_item_set_printable = append_menu_check_item(menu, wxID_ANY, _L("Printable") + "\t" + "V", "", [all_printable](wxCommandEvent&) {
Selection& selection = plater()->canvas3D()->get_selection();
selection.set_printable(!all_printable);
}, menu);
@@ -2329,7 +2329,7 @@ void MenuFactory::append_menu_item_set_auto_drop(wxMenu* menu)
wxString menu_tooltip = _L("Automatically snaps the selected object to the build plate.");
wxMenuItem* menu_item_set_auto_drop = append_menu_check_item(
menu, wxID_ANY, menu_text, menu_tooltip,
[this, current_auto_drop](wxCommandEvent&) {
[current_auto_drop](wxCommandEvent&) {
Selection& selection = plater()->canvas3D()->get_selection();
selection.set_auto_drop(!current_auto_drop);
},
@@ -2384,7 +2384,7 @@ void MenuFactory::append_menu_item_plate_name(wxMenu *menu)
auto item = append_menu_item(
menu, wxID_ANY, name, "",
[plate](wxCommandEvent &e) {
[](wxCommandEvent &e) {
int hover_idx =plater()->canvas3D()->GetHoverId();
if (hover_idx == -1) {
int plate_idx=plater()->GetPlateIndexByRightMenuInLeftUI();
+1 -1
View File
@@ -223,7 +223,7 @@ void ObjectLayers::update_layers_list()
// only call sizer->Clear(true) via CallAfter, otherwise crash happens in Linux when press enter in Height Range
// because an element cannot be destroyed while there are pending events for this element.(https://github.com/wxWidgets/Phoenix/issues/1854)
wxGetApp().CallAfter([this, type, objects_ctrl, range]() {
wxGetApp().CallAfter([this, type, range]() {
m_og->ctrl_parent()->Freeze();
// Delete all controls from options group
+4 -4
View File
@@ -2324,7 +2324,7 @@ void ObjectList::load_modifier(const wxArrayString& input_files, ModelObject& mo
bool split_compound = wxGetApp().app_config->get_bool("is_split_compound");
model = Model::read_from_step(
input_file, LoadStrategy::LoadModel, nullptr, nullptr,
[this, &is_user_cancel, &linear, &angle, &split_compound](Slic3r::Step& file, double& linear_value,
[&is_user_cancel, &linear, &angle, &split_compound](Slic3r::Step& file, double& linear_value,
double& angle_value, bool& is_split) -> int {
if (wxGetApp().app_config->get_bool("enable_step_mesh_setting")) {
StepMeshDialog mesh_dlg(nullptr, file, linear, angle);
@@ -3317,7 +3317,7 @@ void ObjectList::boolean()
}
}
TriangleMesh mesh = Plater::combine_mesh_fff(*object, -1, [this](const std::string& msg) {return wxGetApp().notification_manager()->push_plater_error_notification(msg); });
TriangleMesh mesh = Plater::combine_mesh_fff(*object, -1, [](const std::string& msg) {return wxGetApp().notification_manager()->push_plater_error_notification(msg); });
// add mesh to model as a new object, keep the original object's name and config
Model* model = object->get_model();
@@ -6267,7 +6267,7 @@ void GUI::ObjectList::smooth_mesh()
get_selection_indexes(obj_idxs, vol_idxs);
auto object_idx = obj_idxs.front();
ModelObject *obj{nullptr};
auto show_warning_dlg = [this](int cur_face_count,std::string name,bool is_part) {
auto show_warning_dlg = [](int cur_face_count,std::string name,bool is_part) {
int limit_face_count = 1000000;
if (cur_face_count > limit_face_count) {
auto name_str = wxString::FromUTF8(name);
@@ -6280,7 +6280,7 @@ void GUI::ObjectList::smooth_mesh()
}
return false;
};
auto show_smooth_mesh_error_dlg = [this](std::string name) {
auto show_smooth_mesh_error_dlg = [](std::string name) {
auto name_str = wxString::FromUTF8(name);
auto content = wxString::Format(_L("\"%s\" part's mesh contains errors. Please repair it first."), name_str);
WarningDialog dlg(static_cast<wxWindow *>(wxGetApp().mainframe), content, wxEmptyString, wxOK);
+2 -2
View File
@@ -3520,13 +3520,13 @@ void GridCellTextEditor::BeginEdit(int row, int col, wxGrid *grid)
Text()->GetTextCtrl()->SetInsertionPointEnd();
m_control->Bind(wxEVT_TEXT_ENTER, [this, row, col, grid](wxCommandEvent &e) {
m_control->Bind(wxEVT_TEXT_ENTER, [grid](wxCommandEvent &e) {
grid->HideCellEditControl();
grid->SaveEditControlValue();
e.Skip();
});
m_control->Bind(wxEVT_CHAR_HOOK, [this, row, col, grid](wxKeyEvent &e) {
m_control->Bind(wxEVT_CHAR_HOOK, [grid](wxKeyEvent &e) {
if (e.GetKeyCode() == WXK_ESCAPE) {
grid->HideCellEditControl();
grid->SaveEditControlValue();
+10 -7
View File
@@ -184,7 +184,7 @@ bool ObjectTableSettings::update_settings_list(bool is_object, bool is_multiple_
btn->Bind(EVT_LOCK_ENABLE, [this, btn](auto &e) { btn->SetBitmap(m_bmp_reset_focus.bmp()); });
#endif
btn->Bind(wxEVT_BUTTON, [btn, opt_key, this, is_object, object, config, group_category](wxEvent &event) {
btn->Bind(wxEVT_BUTTON, [opt_key, this, is_object, object, config, group_category](wxEvent &event) {
//wxGetApp().plater()->take_snapshot(from_u8((boost::format(_utf8(L("Reset Option %s"))) % opt_key).str()));
config->erase(opt_key);
//btn->Hide();
@@ -204,10 +204,13 @@ bool ObjectTableSettings::update_settings_list(bool is_object, bool is_multiple_
this->m_parent->Thaw();
#ifdef __WXOSX_MAC__
if (!btn->IsEnabled()) {
btn->SetBitmap(m_bmp_reset_disable.bmp());
} else {
btn->SetBitmap(m_bmp_reset_focus.bmp());
// The handler is bound on the button, so the event source is that button.
if (auto *btn = dynamic_cast<ScalableButton *>(event.GetEventObject())) {
if (!btn->IsEnabled()) {
btn->SetBitmap(m_bmp_reset_disable.bmp());
} else {
btn->SetBitmap(m_bmp_reset_focus.bmp());
}
}
#endif
});
@@ -284,13 +287,13 @@ bool ObjectTableSettings::update_settings_list(bool is_object, bool is_multiple_
m_settings_list_sizer->Add(optgroup->sizer, 0, wxEXPAND | wxALL, 0);
m_og_settings.push_back(optgroup);
auto toggle_field = [this, optgroup](const t_config_option_key & opt_key, bool toggle, int opt_index)
auto toggle_field = [optgroup](const t_config_option_key & opt_key, bool toggle, int opt_index)
{
Field* field = optgroup->get_fieldc(opt_key, opt_index);;
if (field)
field->toggle(toggle);
};
auto toggle_line = [this, optgroup](const t_config_option_key &opt_key, bool toggle, int opt_index)
auto toggle_line = [optgroup](const t_config_option_key &opt_key, bool toggle, int opt_index)
{
Line* line = optgroup->get_line(opt_key);
if (line) line->toggle_visible = toggle;
+1 -1
View File
@@ -3596,7 +3596,7 @@ void GLGizmoCut3D::perform_cut(const Selection& selection)
// model_name failing reason
std::vector<std::pair<std::string, std::string>> failed_models;
auto plater = wxGetApp().plater();
auto fix_and_update_progress = [this, plater, keep_painting](ModelObject *model_object, const int vol_idx, const string &model_name, ProgressDialog &progress_dlg,
auto fix_and_update_progress = [keep_painting](ModelObject *model_object, const int vol_idx, const string &model_name, ProgressDialog &progress_dlg,
std::vector<std::string> &succes_models, std::vector<std::pair<std::string, std::string>> &failed_models) {
wxString msg = _L("Repairing model object");
msg += ": " + from_u8(model_name) + "\n";
+1 -1
View File
@@ -223,7 +223,7 @@ void GLGizmoMeshBoolean::on_render_input_window(float x, float y, float bottom_l
const int select_btn_length = 2 * ImGui::GetStyle().FramePadding.x + std::max(ImGui::CalcTextSize(("1 " + _u8L("selected")).c_str()).x, ImGui::CalcTextSize(_u8L("Select").c_str()).x);
auto selectable = [this](const std::string& label, bool selected, const ImVec2& size_arg) {
auto selectable = [](const std::string& label, bool selected, const ImVec2& size_arg) {
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, { 0,0 });
ImGuiWindow* window = ImGui::GetCurrentWindow();
+1 -1
View File
@@ -1456,7 +1456,7 @@ void TriangleSelectorPatch::update_triangles_per_patch()
return touching_triangles;
};
auto calc_fragment_area = [this](const TrianglePatch& patch, float max_limit_area, int stride) {
auto calc_fragment_area = [](const TrianglePatch& patch, float max_limit_area, int stride) {
double total_area = 0.f;
const std::vector<int>& ti = patch.triangle_indices;
/*for (int i = 0; i < ti.size() / 3; i++) {
+1 -1
View File
@@ -1003,7 +1003,7 @@ bool GLGizmosManager::on_key(wxKeyEvent& evt)
// number waits briefly for a second one.
const int digit = keyCode - '0';
const int shortcut_max = int(GLGizmoMmuSegmentation::EXTRUDERS_LIMIT);
auto can_start_two_digit = [shortcut_max](int d) { return d > 0 && d * 10 <= shortcut_max; };
auto can_start_two_digit = [](int d) { return d > 0 && d * 10 <= shortcut_max; };
auto select = [mmu_seg](int number) { return number > 0 && mmu_seg->on_number_key_down(number); };
if (m_timer_set_color.IsRunning() && m_pending_color_shortcut_tens > 0) {
@@ -239,7 +239,7 @@ void GizmoObjectManipulation::update_if_dirty()
};
for (int i = 0; i < 3; ++ i) {
auto update = [this, i](Vec3d &cached, Vec3d &cached_rounded, const Vec3d &new_value) {
auto update = [i](Vec3d &cached, Vec3d &cached_rounded, const Vec3d &new_value) {
//wxString new_text = double_to_string(new_value(i), 2);
double new_rounded = round(new_value(i)*100)/100.0;
//new_text.ToDouble(&new_rounded);
+2 -2
View File
@@ -46,7 +46,7 @@ int get_hms_info_version(std::string& version)
std::string url = (boost::format("https://%1%/GetVersion.php?%2%") % hms_host % query_params).str();
Slic3r::Http http = Slic3r::Http::get(url);
http.timeout_max(10)
.on_complete([&result, &version](std::string body, unsigned status){
.on_complete([&version](std::string body, unsigned status){
try {
json j = json::parse(body);
if (j.contains("ver")) {
@@ -95,7 +95,7 @@ int HMSQuery::download_hms_related(const std::string& hms_type, const std::strin
BOOST_LOG_TRIVIAL(info) << "hms: download url = " << url;
Slic3r::Http http = Slic3r::Http::get(url);
http.on_complete([this, receive_json, hms_type, &to_save_local, &j, & local_version](std::string body, unsigned status) {
http.on_complete([receive_json, hms_type, &to_save_local, &j, & local_version](std::string body, unsigned status) {
try {
j = json::parse(body);
if (j.contains("result")) {
+1 -1
View File
@@ -184,7 +184,7 @@ void FillBedJob::prepare()
ap.poly = m_selected.front().poly;
ap.bed_idx = PartPlateList::MAX_PLATES_COUNT;
ap.itemid = -1;
ap.setter = [this, mi, offset](const ArrangePolygon &p) {
ap.setter = [this, offset](const ArrangePolygon &p) {
ModelObject *mo = m_plater->model().objects[m_object_idx];
ModelObject *obj;
if (m_instances) {
+1 -4
View File
@@ -135,7 +135,6 @@ void PrintJob::process(Ctl &ctl)
{
/* display info */
std::string msg;
wxString error_str;
int curr_percent = 10;
NetworkAgent* m_agent = wxGetApp().getAgent();
AppConfig* config = wxGetApp().app_config;
@@ -402,9 +401,7 @@ void PrintJob::process(Ctl &ctl)
&is_try_lan_mode,
&is_try_lan_mode_failed,
&msg,
&error_str,
&curr_percent,
&error_text,
StagePercentPoint
](int stage, int code, std::string info) {
@@ -491,7 +488,7 @@ void PrintJob::process(Ctl &ctl)
DeviceManager* dev = wxGetApp().getDeviceManager();
MachineObject* obj = dev->get_selected_machine();
auto wait_fn = [this, &ctl, curr_percent, &obj](int state, std::string job_info) {
auto wait_fn = [&ctl, &obj](int state, std::string job_info) {
BOOST_LOG_TRIVIAL(info) << "print_job: get_job_info = " << job_info;
if (!obj->is_support_wait_sending_finish) {
+1 -1
View File
@@ -55,7 +55,7 @@ void RotoptimizeJob::process(Ctl &ctl)
sla::RotOptimizeParams{}
.accuracy(m_accuracy)
.print_config(&m_default_print_cfg)
.statucb([this, &prev_status, &ctl/*, &statustxt*/](int s)
.statucb([&ctl/*, &statustxt*/](int s)
{
return !ctl.was_canceled();
});
+1 -2
View File
@@ -213,7 +213,6 @@ void SendJob::process(Ctl &ctl)
params.password = m_access_code;
params.use_ssl_for_ftp = m_local_use_ssl_for_ftp;
params.use_ssl_for_mqtt = m_local_use_ssl;
wxString error_text;
std::string msg_text;
const int StagePercentPoint[(int)PrintingStageFinished + 1] = {
@@ -227,7 +226,7 @@ void SendJob::process(Ctl &ctl)
};
auto update_fn = [this, &ctl,
&msg, &curr_percent, &error_text, StagePercentPoint](int stage, int code, std::string info) {
&msg, &curr_percent, StagePercentPoint](int stage, int code, std::string info) {
if (stage == SendingPrintJobStage::PrintingStageCreate) {
if (this->connection_type == "lan") {
msg = _u8L("Sending G-code file over LAN");
+14 -14
View File
@@ -746,7 +746,7 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
evt.Skip();
});
Bind(wxEVT_SHOW, [this](wxShowEvent &evt) {
Bind(wxEVT_SHOW, [](wxShowEvent &evt) {
DeviceManager *manger = wxGetApp().getDeviceManager();
if (manger) {
evt.IsShown() ? manger->start_refresher() : manger->stop_refresher();
@@ -2855,7 +2855,7 @@ void MainFrame::init_menubar_as_editor()
[this]() { return can_add_models(); });
append_menu_item(import_menu, wxID_ANY, _L("Import Configs") + dots /*+ "\t" + ctrl + "I"*/, _L("Load configs"),
[this](wxCommandEvent&) { load_config_file(); }, "menu_import", nullptr,
[this](){return true; }, this);
[](){return true; }, this);
append_submenu(fileMenu, import_menu, wxID_ANY, _L("Import"), "");
@@ -2968,7 +2968,7 @@ void MainFrame::init_menubar_as_editor()
_L("Duplicate the current plate"),[this](wxCommandEvent&) {
m_plater->duplicate_plate();
},
"menu_remove", nullptr, [this](){return true;}, this);
"menu_remove", nullptr, [](){return true;}, this);
editMenu->AppendSeparator();
#else
// BBS undo
@@ -3135,13 +3135,13 @@ void MainFrame::init_menubar_as_editor()
//BBS perspective view
wxWindowID camera_id_base = wxWindow::NewControlId(int(wxID_CAMERA_COUNT));
auto perspective_item = append_menu_radio_item(viewMenu, wxID_CAMERA_PERSPECTIVE + camera_id_base, _L("Use Perspective View"), _L("Use Perspective View"),
[this](wxCommandEvent&) {
[](wxCommandEvent&) {
wxGetApp().app_config->set_bool("use_perspective_camera", true);
wxGetApp().update_ui_from_settings();
}, nullptr);
//BBS orthogonal view
auto orthogonal_item = append_menu_radio_item(viewMenu, wxID_CAMERA_ORTHOGONAL + camera_id_base, _L("Use Orthogonal View"), _L("Use Orthogonal View"),
[this](wxCommandEvent&) {
[](wxCommandEvent&) {
wxGetApp().app_config->set_bool("use_perspective_camera", false);
wxGetApp().update_ui_from_settings();
}, nullptr);
@@ -3157,7 +3157,7 @@ void MainFrame::init_menubar_as_editor()
m_plater->get_current_canvas3D()->post_event(SimpleEvent(wxEVT_PAINT));
},
this, [this]() { return is_prepare_or_preview_tab(); },
[this]() { return wxGetApp().app_config->get_bool("auto_perspective"); }, this);
[]() { return wxGetApp().app_config->get_bool("auto_perspective"); }, this);
viewMenu->AppendSeparator();
append_menu_check_item(viewMenu, wxID_ANY, _L("Show &G-code Window") + sep + "C", _L("Show G-code window in Preview scene."),
@@ -3166,7 +3166,7 @@ void MainFrame::init_menubar_as_editor()
m_plater->get_current_canvas3D()->post_event(SimpleEvent(wxEVT_PAINT));
},
this, [this]() { return m_tabpanel->GetSelectedPageName() == TAB_ID_PREVIEW; },
[this]() { return wxGetApp().show_gcode_window(); }, this);
[]() { return wxGetApp().show_gcode_window(); }, this);
append_menu_check_item(
viewMenu, wxID_ANY, _L("Show 3D Navigator"), _L("Show 3D navigator in Prepare and Preview scene."),
@@ -3175,7 +3175,7 @@ void MainFrame::init_menubar_as_editor()
m_plater->get_current_canvas3D()->post_event(SimpleEvent(wxEVT_PAINT));
},
this, [this]() { return is_prepare_or_preview_tab(); },
[this]() { return wxGetApp().show_3d_navigator(); }, this);
[]() { return wxGetApp().show_3d_navigator(); }, this);
append_menu_check_item(viewMenu, wxID_ANY, _L("Show Gridlines"), _L("Show Gridlines on plate"),
[this](wxCommandEvent&) {
@@ -3183,7 +3183,7 @@ void MainFrame::init_menubar_as_editor()
m_plater->get_current_canvas3D()->post_event(SimpleEvent(wxEVT_PAINT));
}, this,
[this]() { return is_prepare_or_preview_tab(); },
[this]() { return wxGetApp().show_plate_gridlines(); }, this);
[]() { return wxGetApp().show_plate_gridlines(); }, this);
append_menu_item(
viewMenu, wxID_ANY, _L("Reset Window Layout"), _L("Reset to default window layout"),
@@ -3212,7 +3212,7 @@ void MainFrame::init_menubar_as_editor()
m_plater->get_current_canvas3D()->post_event(SimpleEvent(wxEVT_PAINT));
},
this, [this]() { return m_tabpanel->GetSelectedPageName() == TAB_ID_PREPARE; },
[this]() { return wxGetApp().show_outline(); }, this);
[]() { return wxGetApp().show_outline(); }, this);
/*viewMenu->AppendSeparator();
append_menu_check_item(viewMenu, wxID_ANY, _L("Show &Wireframe") + "\t" + ctrl + shift + _L("Enter"), _L("Show wireframes in 3D scene."),
@@ -3361,7 +3361,7 @@ void MainFrame::init_menubar_as_editor()
append_menu_item(
m_topbar->GetTopMenu(), wxID_ANY, _L("Preferences") + "\t" + ctrl + "P", "",
[this](wxCommandEvent &) {
[](wxCommandEvent &) {
// Orca: Use GUI_App::open_preferences instead of direct call so windows associations are updated on exit
wxGetApp().open_preferences();
},
@@ -3393,14 +3393,14 @@ void MainFrame::init_menubar_as_editor()
into_u8(_L("Syncing presets from cloud\u2026")));
wxGetApp().restart_sync_user_preset();
}, "", nullptr,
[this]() {
[]() {
return wxGetApp().is_user_login() && !wxGetApp().app_config->get_stealth_mode();
}, this);
top_menu->AppendSeparator();
append_menu_item(
top_menu, wxID_ANY, _L("Plugins") + "\t", "",
[this](wxCommandEvent &) {
[](wxCommandEvent &) {
wxGetApp().open_plugins_dialog();
},
"", nullptr, []() { return true; }, this);
@@ -3501,7 +3501,7 @@ void MainFrame::init_menubar_as_editor()
[this]() {return m_plater->is_view3D_shown();; }, this);
// help
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Calibration Guide"), _L("Calibration Guide"), [this](wxCommandEvent &)
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Calibration Guide"), _L("Calibration Guide"), [](wxCommandEvent &)
{ wxLaunchDefaultBrowser("https://www.orcaslicer.com/wiki/calibration_guide", wxBROWSER_NEW_WINDOW); }, "", nullptr, [this]()
{return m_plater->is_view3D_shown();; }, this);
+1 -1
View File
@@ -217,7 +217,7 @@ std::vector<DeviceItem*> selected_machines(const std::vector<DeviceItem*>& dev_i
SortItem::SortItem()
{
sort_map.emplace(std::make_pair(SortRule::SR_None, [this](const DeviceItem* d1, const DeviceItem* d2) {
sort_map.emplace(std::make_pair(SortRule::SR_None, [](const DeviceItem* d1, const DeviceItem* d2) {
return d1->state_dev_name > d2->state_dev_name;
}));
sort_map.emplace(std::make_pair(SortRule::SR_DEV_NAME, [this](const DeviceItem* d1, const DeviceItem* d2) {
+1 -1
View File
@@ -19,7 +19,7 @@ MultiMachineItem::MultiMachineItem(wxWindow* parent, MachineObject* obj)
Bind(wxEVT_LEAVE_WINDOW, &MultiMachineItem::OnLeaveWindow, this);
Bind(wxEVT_LEFT_DOWN, &MultiMachineItem::OnLeftDown, this);
Bind(wxEVT_MOTION, &MultiMachineItem::OnMove, this);
Bind(EVT_MULTI_DEVICE_VIEW, [this, obj](auto& e) {
Bind(EVT_MULTI_DEVICE_VIEW, [obj](auto& e) {
wxGetApp().mainframe->jump_to_monitor(obj->get_dev_id());
if (wxGetApp().mainframe->m_monitor->get_status_panel()->get_media_play_ctrl()) {
wxGetApp().mainframe->m_monitor->get_status_panel()->get_media_play_ctrl()->jump_to_play();
+1 -1
View File
@@ -80,7 +80,7 @@ void MultiMachinePage::init_tabpanel()
sizer_side_tools->Add(m_side_tools, 1, wxEXPAND, 0);
m_tabpanel = new Tabbook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, sizer_side_tools, wxNB_LEFT | wxTAB_TRAVERSAL | wxNB_NOPAGETHEME);
m_tabpanel->SetBackgroundColour(wxColour("#FEFFFF"));
m_tabpanel->Bind(wxEVT_BOOKCTRL_PAGE_CHANGED, [this](wxBookCtrlEvent& e) {; });
m_tabpanel->Bind(wxEVT_BOOKCTRL_PAGE_CHANGED, [](wxBookCtrlEvent& e) {; });
m_local_task_manager = new LocalTaskManagerPage(m_tabpanel);
m_cloud_task_manager = new CloudTaskManagerPage(m_tabpanel);
+1 -1
View File
@@ -783,7 +783,7 @@ void LocalTaskManagerPage::refresh_user_device(bool clear)
mtitem->m_send_time = task_state_info->get_sent_time();
mtitem->state_local_task = task_state_info->state();
task_state_info->set_state_changed_fn([this, mtitem](TaskState state, int percent) {
task_state_info->set_state_changed_fn([mtitem](TaskState state, int percent) {
mtitem->state_local_task = state;
if (state == TaskState::TS_SEND_COMPLETED) {
+2 -2
View File
@@ -156,14 +156,14 @@ void NetworkPluginDownloadDialog::create_update_available_ui(const std::string&
auto daa_chk = new CheckBox(this);
daa_chk->SetValue(cfg->is_network_update_prompt_disabled());
daa_chk->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent& e){
daa_chk->Bind(wxEVT_TOGGLEBUTTON, [](wxCommandEvent& e){
auto cfg = wxGetApp().app_config;
cfg->set_network_update_prompt_disabled(e.IsChecked());
cfg->save();
});
auto daa_str = new Label(this, _L("Don't Ask Again"));
auto on_toggle = [this, daa_chk]() {
auto on_toggle = [daa_chk]() {
daa_chk->SetValue(!daa_chk->GetValue());
wxCommandEvent evt(wxEVT_TOGGLEBUTTON, daa_chk->GetId());
evt.SetEventObject(daa_chk);
+1 -1
View File
@@ -268,7 +268,7 @@ void NetworkTestDialog::start_test_url(TestJob job, wxString name, wxString url)
int result = -1;
http.timeout_max(10)
.on_complete([this, &result](std::string body, unsigned status) {
.on_complete([&result](std::string body, unsigned status) {
try {
if (status == 200) {
result = 0;
+1 -1
View File
@@ -56,7 +56,7 @@ ButtonsListCtrl::ButtonsListCtrl(wxWindow *parent, wxBoxSizer* side_tools) :
// BBS: disable custom paint
//this->Bind(wxEVT_PAINT, &ButtonsListCtrl::OnPaint, this);
Bind(wxEVT_SYS_COLOUR_CHANGED, [this](auto& e){
Bind(wxEVT_SYS_COLOUR_CHANGED, [](auto& e){
});
}
+1 -1
View File
@@ -158,7 +158,7 @@ wxPoint OG_CustomCtrl::get_pos(const Line& line, Field* field_in/* = nullptr*/)
ctrl_line.height = size.y;
};
auto add_buttons_width = [&h_pos, this] (int blinking_button_width) {
auto add_buttons_width = [&h_pos] (int blinking_button_width) {
#ifndef DISABLE_BLINKING
# ifndef DISABLE_UNDO_SYS
h_pos += 3 * blinking_button_width;
+1 -1
View File
@@ -254,7 +254,7 @@ ObjColorPanel::ObjColorPanel(wxWindow *parent, Slic3r::ObjDialogInOut &in_out, c
m_color_cluster_num_by_user_ebox->Bind(wxEVT_TEXT_ENTER, on_apply_color_cluster_text_modify);
m_color_cluster_num_by_user_ebox->Bind(wxEVT_SPINCTRL, on_apply_color_cluster_text_modify);
m_color_cluster_num_by_user_ebox->Bind(wxEVT_CHAR, [this](wxKeyEvent &e) {
m_color_cluster_num_by_user_ebox->Bind(wxEVT_CHAR, [](wxKeyEvent &e) {
int keycode = e.GetKeyCode();
wxString input_char = wxString::Format("%c", keycode);
long value;
+3 -3
View File
@@ -128,7 +128,7 @@ wxBoxSizer *TipsDialog::create_item_checkbox(wxString title, wxWindow *parent, w
m_show_again = wxGetApp().app_config->has(param);
checkbox->SetValue(m_show_again);
checkbox->Bind(wxEVT_TOGGLEBUTTON, [this, checkbox, param](wxCommandEvent &e) {
checkbox->Bind(wxEVT_TOGGLEBUTTON, [this, param](wxCommandEvent &e) {
m_show_again = m_show_again ? false : true;
e.Skip();
});
@@ -290,11 +290,11 @@ ParamsPanel::ParamsPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, c
m_compare_btn = new ScalableButton(m_top_panel, wxID_ANY, "compare", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true);
m_compare_btn->SetToolTip(_L("Compare presets"));
m_compare_btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent e) { wxGetApp().mainframe->diff_dialog.show(); }));
m_compare_btn->Bind(wxEVT_BUTTON, ([](wxCommandEvent e) { wxGetApp().mainframe->diff_dialog.show(); }));
m_setting_btn = new ScalableButton(m_top_panel, wxID_ANY, "table", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true);
m_setting_btn->SetToolTip(_L("View all object's settings"));
m_setting_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &) { wxGetApp().plater()->PopupObjectTable(-1, -1, {0, 0}); });
m_setting_btn->Bind(wxEVT_BUTTON, [](wxCommandEvent &) { wxGetApp().plater()->PopupObjectTable(-1, -1, {0, 0}); });
m_highlighter.set_timer_owner(this, 0);
this->Bind(wxEVT_TIMER, [this](wxTimerEvent &)
+28 -29
View File
@@ -1340,7 +1340,7 @@ ExtruderGroup::ExtruderGroup(wxWindow * parent, int index, wxString const &title
if (index >= 0) label_flow->SetMinSize({FromDIP(80), -1});
auto combo_flow = new ComboBox(this, wxID_ANY, wxString(""), wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY);
combo_flow->GetDropDown().SetUseContentWidth(true);
combo_flow->Bind(wxEVT_COMBOBOX, [this, index, combo_flow](wxCommandEvent &evt) {
combo_flow->Bind(wxEVT_COMBOBOX, [index, combo_flow](wxCommandEvent &evt) {
auto printer_tab = dynamic_cast<TabPrinter *>(wxGetApp().get_tab(Preset::TYPE_PRINTER));
NozzleVolumeType volume_type = NozzleVolumeType(intptr_t(combo_flow->GetClientData(evt.GetInt())));
printer_tab->set_extruder_volume_type(index, volume_type);
@@ -1400,7 +1400,7 @@ ExtruderGroup::ExtruderGroup(wxWindow * parent, int index, wxString const &title
btn_up = new ScalableButton(this, wxID_ANY, "page_up", "", {FromDIP(14), FromDIP(14)}, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, false, 14);
btn_up->SetBackgroundColour(*wxWHITE);
btn_up->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this, index](auto &evt) {
btn_up->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](auto &evt) {
if (page_cur > 0)
--page_cur;
update_ams();
@@ -1408,7 +1408,7 @@ ExtruderGroup::ExtruderGroup(wxWindow * parent, int index, wxString const &title
btn_up->Hide();
btn_down = new ScalableButton(this, wxID_ANY, "page_down", "", {FromDIP(14), FromDIP(14)}, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, false, 14);
btn_down->SetBackgroundColour(*wxWHITE);
btn_down->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this, index](auto &evt) {
btn_down->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](auto &evt) {
if (page_cur + 1 < page_num)
++page_cur;
update_ams();
@@ -2025,7 +2025,7 @@ bool Sidebar::priv::sync_extruder_list(bool &only_external_material, bool is_man
if (!this->plater)
return false;
this->plater->update_objects_position_when_select_preset([&obj, machine_preset]() {
this->plater->update_objects_position_when_select_preset([machine_preset]() {
Tab *printer_tab = GUI::wxGetApp().get_tab(Preset::Type::TYPE_PRINTER);
printer_tab->select_preset(machine_preset->name);
});
@@ -2170,7 +2170,7 @@ bool Sidebar::priv::sync_extruder_list(bool &only_external_material, bool is_man
void Sidebar::priv::update_sync_status(const MachineObject *obj)
{
StateColor not_synced_colour(std::pair<wxColour, int>(wxColour("#009688"), StateColor::Normal));
auto clear_all_sync_status = [this, &not_synced_colour]() {
auto clear_all_sync_status = [this]() {
panel_printer_preset->ShowBadge(false);
panel_printer_bed->ShowBadge(false);
panel_nozzle_dia->ShowBadge(false); // ORCA add support for nozzle sync
@@ -2474,7 +2474,7 @@ Sidebar::Sidebar(Plater *parent)
p->m_printer_icon = new ScalableButton(p->m_panel_printer_title, wxID_ANY, "printer");
p->m_text_printer_settings = new Label(p->m_panel_printer_title, _L("Printer"), LB_PROPAGATE_MOUSE_EVENT | wxST_ELLIPSIZE_END);
p->m_printer_icon->Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) {
p->m_printer_icon->Bind(wxEVT_BUTTON, [](wxCommandEvent& e) {
//auto wizard_t = new ConfigWizard(wxGetApp().mainframe);
//wizard_t->run(ConfigWizard::RR_USER, ConfigWizard::SP_CUSTOM);
});
@@ -2495,7 +2495,7 @@ Sidebar::Sidebar(Plater *parent)
});
p->m_printer_setting = new ScalableButton(p->m_panel_printer_title, wxID_ANY, "settings");
p->m_printer_setting->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) {
p->m_printer_setting->Bind(wxEVT_BUTTON, [](wxCommandEvent &e) {
// p->editing_filament = -1;
// wxGetApp().params_dialog()->Popup();
// wxGetApp().get_tab(Preset::TYPE_FILAMENT)->restore_last_select_item();
@@ -2610,8 +2610,8 @@ Sidebar::Sidebar(Plater *parent)
p->image_printer->SetBackgroundColour(bg_color);
p->combo_printer->SetBackgroundColour(bg_color); // paints margins instead combo background
};
p->combo_printer->Bind(wxEVT_SET_FOCUS, [this, printer_focus_bg](auto& e) {printer_focus_bg(true ); e.Skip();});
p->combo_printer->Bind(wxEVT_KILL_FOCUS, [this, printer_focus_bg](auto& e) {printer_focus_bg(false); e.Skip();});
p->combo_printer->Bind(wxEVT_SET_FOCUS, [printer_focus_bg](auto& e) {printer_focus_bg(true ); e.Skip();});
p->combo_printer->Bind(wxEVT_KILL_FOCUS, [printer_focus_bg](auto& e) {printer_focus_bg(false); e.Skip();});
/* ORCA This part moved to titlebar
p->btn_connect_printer = new ScalableButton(p->panel_printer_preset, wxID_ANY, "monitor_signal_strong");
@@ -2688,8 +2688,8 @@ Sidebar::Sidebar(Plater *parent)
p->label_nozzle_type->SetBackgroundColour(bg_color);
p->combo_nozzle_dia->SetBackgroundColour(bg_color); // paints margins instead combo background
};
p->combo_nozzle_dia->Bind(wxEVT_SET_FOCUS, [this, nozzle_focus_bg](auto& e) {nozzle_focus_bg(true ); e.Skip();});
p->combo_nozzle_dia->Bind(wxEVT_KILL_FOCUS, [this, nozzle_focus_bg](auto& e) {nozzle_focus_bg(false); e.Skip();});
p->combo_nozzle_dia->Bind(wxEVT_SET_FOCUS, [nozzle_focus_bg](auto& e) {nozzle_focus_bg(true ); e.Skip();});
p->combo_nozzle_dia->Bind(wxEVT_KILL_FOCUS, [nozzle_focus_bg](auto& e) {nozzle_focus_bg(false); e.Skip();});
p->label_nozzle_type = new Label(p->panel_nozzle_dia, "Brass", LB_PROPAGATE_MOUSE_EVENT | wxST_ELLIPSIZE_END | wxALIGN_CENTRE_HORIZONTAL);
p->label_nozzle_type->SetFont(Label::Body_10);
@@ -2763,8 +2763,8 @@ Sidebar::Sidebar(Plater *parent)
p->image_printer_bed->SetBackgroundColour(bg_color);
p->combo_printer_bed->SetBackgroundColour(bg_color); // paints margins instead combo background
};
p->combo_printer_bed->Bind(wxEVT_SET_FOCUS, [this, bed_focus_bg](auto& e) {bed_focus_bg(true ); e.Skip();});
p->combo_printer_bed->Bind(wxEVT_KILL_FOCUS, [this, bed_focus_bg](auto& e) {bed_focus_bg(false); e.Skip();});
p->combo_printer_bed->Bind(wxEVT_SET_FOCUS, [bed_focus_bg](auto& e) {bed_focus_bg(true ); e.Skip();});
p->combo_printer_bed->Bind(wxEVT_KILL_FOCUS, [bed_focus_bg](auto& e) {bed_focus_bg(false); e.Skip();});
// highlight border on hover
auto printer_bed_hovered = std::make_shared<std::unordered_set<wxWindow*>>();
@@ -2978,7 +2978,7 @@ Sidebar::Sidebar(Plater *parent)
ScalableButton* add_btn = new ScalableButton(p->m_panel_filament_title, wxID_ANY, "add_filament");
add_btn->SetToolTip(_L("Add one filament"));
add_btn->Bind(wxEVT_BUTTON, [this, scrolled_sizer](wxCommandEvent& e){
add_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& e){
add_filament();
update_filaments_counter();
});
@@ -2988,7 +2988,7 @@ Sidebar::Sidebar(Plater *parent)
ScalableButton* del_btn = new ScalableButton(p->m_panel_filament_title, wxID_ANY, "delete_filament");
del_btn->SetToolTip(_L("Remove last filament"));
del_btn->Bind(wxEVT_BUTTON, [this, scrolled_sizer](wxCommandEvent &e) {
del_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) {
delete_filament();
update_filaments_counter();
});
@@ -3002,7 +3002,7 @@ Sidebar::Sidebar(Plater *parent)
ams_btn = new ScalableButton(p->m_panel_filament_title, wxID_ANY, "ams_fila_sync", wxEmptyString, wxDefaultSize, wxDefaultPosition,
wxBU_EXACTFIT | wxNO_BORDER, false, 16); // ORCA match icon size with other icons as 16x16
ams_btn->SetToolTip(_L("Synchronize filament list from AMS"));
ams_btn->Bind(wxEVT_BUTTON, [this, scrolled_sizer](wxCommandEvent &e) {
ams_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) {
sync_ams_list();
});
@@ -3682,7 +3682,7 @@ void Sidebar::update_presets(Preset::Type preset_type)
extruder.combo_flow->SetSelection(select);
};
auto update_extruder_diameter = [&diameters, &diameter, &nozzle_diameter](int extruder_index,ExtruderGroup & extruder) {
auto update_extruder_diameter = [&diameters, &nozzle_diameter](int extruder_index,ExtruderGroup & extruder) {
extruder.combo_diameter->Clear();
int select = -1;
// ORCA get the actual nozzle diameter from printer config
@@ -7497,7 +7497,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
// Keep tracking the current sidebar size, by storing it using `best_size`, which will be stored
// in the config and re-applied when the app is opened again.
this->sidebar->Bind(wxEVT_IDLE, [&sidebar, this](wxIdleEvent& e) {
this->sidebar->Bind(wxEVT_IDLE, [&sidebar](wxIdleEvent& e) {
if (sidebar.IsShown() && sidebar.IsDocked() && sidebar.rect.GetWidth() > 0) {
sidebar.BestSize(sidebar.rect.GetWidth(), sidebar.best_size.GetHeight());
}
@@ -7796,8 +7796,8 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
wxGetApp().removable_drive_manager()->init(this->q);
#ifdef _WIN32
//Trigger enumeration of removable media on Win32 notification.
this->q->Bind(EVT_VOLUME_ATTACHED, [this](VolumeAttachedEvent &evt) { wxGetApp().removable_drive_manager()->volumes_changed(); });
this->q->Bind(EVT_VOLUME_DETACHED, [this](VolumeDetachedEvent &evt) { wxGetApp().removable_drive_manager()->volumes_changed(); });
this->q->Bind(EVT_VOLUME_ATTACHED, [](VolumeAttachedEvent &evt) { wxGetApp().removable_drive_manager()->volumes_changed(); });
this->q->Bind(EVT_VOLUME_DETACHED, [](VolumeDetachedEvent &evt) { wxGetApp().removable_drive_manager()->volumes_changed(); });
#endif /* _WIN32 */
}
@@ -8354,7 +8354,6 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
const float LOAD_MODEL_RATIO = 0.9;
for (size_t i = 0; i < input_files.size(); ++i) {
int file_percent = 0;
#ifdef _WIN32
auto path = input_files[i];
@@ -8403,7 +8402,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
q->skip_thumbnail_invalid = true;
model = Slic3r::Model::read_from_archive(path.string(), &config_loaded, &config_substitutions, en_3mf_file_type, strategy, &plate_data, &project_presets,
&file_version,
[this, &dlg, real_filename, &progress_percent, &file_percent, stage_percent, INPUT_FILES_RATIO, total_files, i,
[&dlg, real_filename, &progress_percent, stage_percent, INPUT_FILES_RATIO, total_files, i,
&is_user_cancel](int import_stage, int current, int total, bool &cancel) {
bool cont = true;
float percent_float = (100.0f * (float)i / (float)total_files) + INPUT_FILES_RATIO * ((float)stage_percent[import_stage] + (float)current * (float)(stage_percent[import_stage + 1] - stage_percent[import_stage]) /(float) total) / (float)total_files;
@@ -8986,7 +8985,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
Semver file_version;
//ObjImportColorFn obj_color_fun=nullptr;
auto obj_color_fun = [this, &path](ObjDialogInOut &in_out) {
auto obj_color_fun = [&path](ObjDialogInOut &in_out) {
if (!boost::iends_with(path.string(), ".obj")) { return; }
const std::vector<std::string> extruder_colours = wxGetApp().plater()->get_extruder_colors_from_plater_config();
@@ -9003,7 +9002,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
if (angle <= 0) angle = 0.5;
bool split_compound = wxGetApp().app_config->get_bool("is_split_compound");
model = Slic3r::Model:: read_from_step(path.string(), strategy,
[this, &dlg, real_filename, &progress_percent, &file_percent, step_percent, INPUT_FILES_RATIO, total_files, i](int load_stage, int current, int total, bool &cancel)
[&dlg, real_filename, &progress_percent, step_percent, INPUT_FILES_RATIO, total_files, i](int load_stage, int current, int total, bool &cancel)
{
bool cont = true;
float percent_float = (100.0f * (float)i / (float)total_files) + INPUT_FILES_RATIO * ((float)step_percent[load_stage] + (float)current * (float)(step_percent[load_stage + 1] - step_percent[load_stage]) / (float)total) / (float)total_files;
@@ -9027,7 +9026,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
}
}
},
[this, &path, &is_user_cancel, &linear, &angle, &split_compound](Slic3r::Step& file, double& linear_value, double& angle_value, bool& is_split)-> int {
[&is_user_cancel, &linear, &angle, &split_compound](Slic3r::Step& file, double& linear_value, double& angle_value, bool& is_split)-> int {
if (wxGetApp().app_config->get_bool("enable_step_mesh_setting")) {
StepMeshDialog mesh_dlg(nullptr, file, linear, angle);
if (mesh_dlg.ShowModal() == wxID_OK) {
@@ -9048,7 +9047,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
}else {
model = Slic3r::Model:: read_from_file(
path.string(), nullptr, nullptr, strategy, &plate_data, &project_presets, &is_xxx, &file_version, nullptr,
[this, &dlg, real_filename, &progress_percent, &file_percent, INPUT_FILES_RATIO, total_files, i, &designer_model_id, &designer_country_code](int current, int total, bool &cancel, std::string &mode_id, std::string &code)
[&dlg, real_filename, &progress_percent, INPUT_FILES_RATIO, total_files, i, &designer_model_id, &designer_country_code](int current, int total, bool &cancel, std::string &mode_id, std::string &code)
{
designer_model_id = mode_id;
designer_country_code = code;
@@ -11294,7 +11293,7 @@ void Plater::priv::reload_from_disk()
// load one file at a time
for (size_t i = 0; i < input_paths.size(); ++i) {
const auto& path = input_paths[i].string();
auto obj_color_fun = [this, &path](ObjDialogInOut &in_out) {
auto obj_color_fun = [&path](ObjDialogInOut &in_out) {
if (!boost::iends_with(path, ".obj")) { return; }
const std::vector<std::string> extruder_colours = wxGetApp().plater()->get_extruder_colors_from_plater_config();
ObjColorDialog color_dlg(nullptr, in_out, extruder_colours, Sidebar::should_show_SEMM_buttons());
@@ -15265,7 +15264,7 @@ void Plater::import_model_id(wxString download_info)
p->project.reset();
/* prepare project and profile */
boost::thread import_thread = Slic3r::create_thread([&percent, &cont, &cancel, &retry_count, max_retries, &msg, &target_path, &download_ok, download_url, &filename] {
boost::thread import_thread = Slic3r::create_thread([&percent, &cont, &retry_count, &msg, &target_path, &download_ok, download_url, &filename] {
// Orca: NetworkAgent is not needed and only prevents this from running
// NetworkAgent* m_agent = Slic3r::GUI::wxGetApp().getAgent();
@@ -15372,7 +15371,7 @@ void Plater::import_model_id(wxString download_info)
msg = wxString::Format(_L("Project downloaded %d%%"), percent);
}
})
.on_error([&msg, &cont, &retry_count, max_retries](std::string body, std::string error, unsigned http_status) {
.on_error([&msg, &cont, &retry_count](std::string body, std::string error, unsigned http_status) {
(void)body;
BOOST_LOG_TRIVIAL(error) << format("Error getting: `%1%`: HTTP %2%, %3%",
body,
+3 -3
View File
@@ -519,7 +519,7 @@ wxBoxSizer *PreferencesDialog::create_item_language_combobox(wxString title, wxS
}
}
auto check = [this](bool yes_or_no) {
auto check = [](bool yes_or_no) {
// if (yes_or_no)
// return true;
int act_btns = ActionButtons::SAVE;
@@ -1200,7 +1200,7 @@ wxBoxSizer* PreferencesDialog::create_item_button(wxString title, wxString title
m_button_download->SetStyle(title2 == _L("Clear") ? ButtonStyle::Alert : ButtonStyle::Regular, ButtonType::Parameter);
m_button_download->SetToolTip(tooltip2.IsEmpty() ? tooltip : tooltip2); // use label tooltip if button tooltip empty
m_button_download->Bind(wxEVT_BUTTON, [this, onclick](auto &e) { onclick(); });
m_button_download->Bind(wxEVT_BUTTON, [onclick](auto &e) { onclick(); });
m_sizer->Add(m_button_download, 0, wxALIGN_CENTER_VERTICAL);
@@ -1490,7 +1490,7 @@ void PreferencesDialog::create()
m_sizer_body = new wxBoxSizer(wxVERTICAL);
m_pref_tabs = new TabCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_NO_BUTTONS | wxTR_HIDE_ROOT | wxTR_SINGLE | wxTR_NO_LINES | wxBORDER_NONE | wxWANTS_CHARS | wxTR_FULL_ROW_HIGHLIGHT);
m_pref_tabs->Bind(wxEVT_RIGHT_DOWN, [this](auto &e) {}); // disable right select
m_pref_tabs->Bind(wxEVT_RIGHT_DOWN, [](auto &e) {}); // disable right select
m_pref_tabs->SetFont(Label::Body_14);
create_items();
+2 -2
View File
@@ -1653,7 +1653,7 @@ void TabPresetComboBox::OnSelect(wxCommandEvent &evt)
default: break;
}
if (sp != ConfigWizard::SP_WELCOME) {
wxTheApp->CallAfter([this, sp]() {
wxTheApp->CallAfter([sp]() {
run_wizard(sp);
});
}
@@ -1949,7 +1949,7 @@ GUI::CalibrateFilamentComboBox::CalibrateFilamentComboBox(wxWindow *parent)
{
clr_picker->SetBackgroundColour(StateColor::darkModeColorFor(*wxWHITE));
clr_picker->SetToolTip("");
clr_picker->Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) {});
clr_picker->Bind(wxEVT_BUTTON, [](wxCommandEvent& e) {});
}
GUI::CalibrateFilamentComboBox::~CalibrateFilamentComboBox()
+1 -1
View File
@@ -2062,7 +2062,7 @@ void CrealityPrintHostSendDialog::init()
}
for (auto* c : m_slot_combos) {
c->Bind(wxEVT_COMBOBOX, [this, ext_slot_idx](wxCommandEvent& e) {
c->Bind(wxEVT_COMBOBOX, [this](wxCommandEvent& e) {
int sel = e.GetSelection();
if (sel >= 0 && sel < (int)m_printer_slots.size() &&
m_printer_slots[sel].box_id == 0) {
+2 -2
View File
@@ -164,7 +164,7 @@ void PrinterFileSystem::ListAllFiles()
req["storage"] = m_file_storage;
req["api_version"] = 2;
req["notify"] = "DETAIL";
SendRequest<FileList>(LIST_INFO, req, [this, type = m_file_type](json const& resp, FileList & list, auto) -> int {
SendRequest<FileList>(LIST_INFO, req, [type = m_file_type](json const& resp, FileList & list, auto) -> int {
json files = resp["file_lists"];
for (auto& f : files) {
std::string name = f["name"];
@@ -1230,7 +1230,7 @@ boost::uint32_t PrinterFileSystem::RequestMediaAbility(int api_version)
req["api_version"] = api_version;
return SendRequest<MediaAbilityList>(
REQUEST_MEDIA_ABILITY, req, [this](const json &resp, MediaAbilityList &list, auto) -> int {
REQUEST_MEDIA_ABILITY, req, [](const json &resp, MediaAbilityList &list, auto) -> int {
json abliity_list = resp["storage"];
list = abliity_list.get<MediaAbilityList>();
return 0;
+1 -1
View File
@@ -97,7 +97,7 @@ PrivacyUpdateDialog::PrivacyUpdateDialog(wxWindow* parent, wxWindowID id, const
this->on_hide();
});
Bind(wxEVT_CLOSE_WINDOW, [this](wxCloseEvent& e) {e.Veto(); });
Bind(wxEVT_CLOSE_WINDOW, [](wxCloseEvent& e) {e.Veto(); });
if (btn_style != CONFIRM_AND_CANCEL)
m_button_cancel->Hide();
+1 -1
View File
@@ -1250,7 +1250,7 @@ void ConfirmBeforeSendDialog::update_text(std::vector<ConfirmBeforeSendInfo> tex
else
{
label_item = new Label(m_vebview_release_note, text.text + " " + _L("Please refer to Wiki before use->"), LB_AUTO_WRAP);
label_item->Bind(wxEVT_LEFT_DOWN, [this, text](wxMouseEvent& e) { wxLaunchDefaultBrowser(text.wiki_url);});
label_item->Bind(wxEVT_LEFT_DOWN, [text](wxMouseEvent& e) { wxLaunchDefaultBrowser(text.wiki_url);});
label_item->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) { SetCursor(wxCURSOR_HAND); });
label_item->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) { SetCursor(wxCURSOR_ARROW); });
}
+1 -1
View File
@@ -153,7 +153,7 @@ SavePresetDialog::Item::Item(Preset::Type type, const std::string &suffix, wxBox
detach_label->SetForegroundColour(wxColour("#363636"));
auto on_toggle = [this, detach_checkbox]() {
auto on_toggle = [detach_checkbox]() {
detach_checkbox->SetValue(!detach_checkbox->GetValue());
wxCommandEvent ev(wxEVT_TOGGLEBUTTON, detach_checkbox->GetId());
ev.SetEventObject(detach_checkbox);
+4 -4
View File
@@ -3428,7 +3428,7 @@ void SelectMachineDialog::show_timelapse_storage_dialog(MachineObject* obj)
if (show_cleanup_btn) {
auto* btn_cleanup = new Button(&dlg, _L("Clean Up"));
btn_cleanup->Bind(wxEVT_BUTTON, [&dlg, ID_CLEANUP](wxCommandEvent&) { dlg.EndModal(ID_CLEANUP); });
btn_cleanup->Bind(wxEVT_BUTTON, [&dlg](wxCommandEvent&) { dlg.EndModal(ID_CLEANUP); });
btn_sizer->Add(btn_cleanup, 0, wxEXPAND);
}
@@ -5497,7 +5497,7 @@ void SelectMachineDialog::reset_and_sync_ams_list()
first_enabled_id = extruder;
}
item->Bind(wxEVT_LEFT_UP, [this, item, materials, extruder](wxMouseEvent &e) {});
item->Bind(wxEVT_LEFT_UP, [materials](wxMouseEvent &e) {});
item->Bind(wxEVT_LEFT_DOWN, [this, item, materials, extruder](wxMouseEvent &e) {
if (!item->m_enable) {return;}
if (!m_check_flag || m_print_status == PrintDialogStatus::PrintStatusUnsupportedPrinter) { return; } /*STUDIO-11301*/
@@ -6128,8 +6128,8 @@ void SelectMachineDialog::set_default_from_sdcard()
first_enabled_id = fo.id;
}
item->Bind(wxEVT_LEFT_UP, [this, item, materials](wxMouseEvent& e) {});
item->Bind(wxEVT_LEFT_DOWN, [this, obj_, item, materials, diameters_count, fo](wxMouseEvent& e) {
item->Bind(wxEVT_LEFT_UP, [materials](wxMouseEvent& e) {});
item->Bind(wxEVT_LEFT_DOWN, [this, obj_, item, materials, fo](wxMouseEvent& e) {
if (!item->m_enable) {return;}
if (!m_check_flag || m_print_status == PrintDialogStatus::PrintStatusUnsupportedPrinter) { return; } /*STUDIO-11301*/
+6 -6
View File
@@ -567,7 +567,7 @@ void SelectMachinePopup::update_other_devices()
}
}
op->Bind(EVT_CONNECT_LAN_PRINT, [this, mobj](wxCommandEvent &e) {
op->Bind(EVT_CONNECT_LAN_PRINT, [mobj](wxCommandEvent &e) {
if (mobj) {
if (mobj->is_lan_mode_printer()) {
ConnectPrinterDialog dlg(wxGetApp().mainframe, wxID_ANY, _L("Input access code"));
@@ -579,7 +579,7 @@ void SelectMachinePopup::update_other_devices()
}
});
op->Bind(EVT_BIND_MACHINE, [this, mobj](wxCommandEvent &e) {
op->Bind(EVT_BIND_MACHINE, [mobj](wxCommandEvent &e) {
BindMachineDialog dlg;
dlg.update_machine_info(mobj);
int dlg_result = wxID_CANCEL;
@@ -700,7 +700,7 @@ void SelectMachinePopup::update_user_devices()
op->set_printer_state(PrinterState::LOCK);
}
}
op->Bind(EVT_UNBIND_MACHINE, [this, dev, mobj](wxCommandEvent& e) {
op->Bind(EVT_UNBIND_MACHINE, [dev, mobj](wxCommandEvent& e) {
dev->set_selected_machine("");
if (mobj) {
AppConfig* config = wxGetApp().app_config;
@@ -720,7 +720,7 @@ void SelectMachinePopup::update_user_devices()
}
else {
op->show_printer_bind(true, PrinterBindState::ALLOW_UNBIND);
op->Bind(EVT_UNBIND_MACHINE, [this, mobj, dev](wxCommandEvent& e) {
op->Bind(EVT_UNBIND_MACHINE, [mobj, dev](wxCommandEvent& e) {
// show_unbind_dialog
UnBindMachineDialog dlg;
dlg.update_machine_info(mobj);
@@ -747,7 +747,7 @@ void SelectMachinePopup::update_user_devices()
}
}
op->Bind(EVT_CONNECT_LAN_PRINT, [this, mobj](wxCommandEvent &e) {
op->Bind(EVT_CONNECT_LAN_PRINT, [mobj](wxCommandEvent &e) {
if (mobj) {
if (mobj->is_lan_mode_printer()) {
ConnectPrinterDialog dlg(wxGetApp().mainframe, wxID_ANY, _L("Input access code"));
@@ -759,7 +759,7 @@ void SelectMachinePopup::update_user_devices()
}
});
op->Bind(EVT_EDIT_PRINT_NAME, [this, mobj](wxCommandEvent &e) {
op->Bind(EVT_EDIT_PRINT_NAME, [mobj](wxCommandEvent &e) {
EditDevNameDialog dlg;
dlg.set_machine_obj(mobj);
dlg.ShowModal();
+1 -1
View File
@@ -1468,7 +1468,7 @@ void SendMultiMachinePage::sync_ams_list()
item->set_ams_info(wxColour("#CECECE"), "Ext", 0, std::vector<wxColour>());
m_ams_list_sizer->Add(item, 0, wxALL, FromDIP(4));
item->Bind(wxEVT_LEFT_UP, [this, item, materials, extruder](wxMouseEvent& e) {});
item->Bind(wxEVT_LEFT_UP, [materials](wxMouseEvent& e) {});
item->Bind(wxEVT_LEFT_DOWN, [this, item, materials, extruder](wxMouseEvent& e) {
MaterialHash::iterator iter = m_material_list.begin();
while (iter != m_material_list.end()) {
+2 -2
View File
@@ -287,7 +287,7 @@ void SkipPartCanvas::Render()
glDisable(GL_CULL_FACE);
glEnable(GL_STENCIL_TEST);
auto draw_shape = [this, border_w](const int stencil, const PartState part_type, const ColorRGB& rgb) {
auto draw_shape = [this](const int stencil, const PartState part_type, const ColorRGB& rgb) {
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glStencilFunc(GL_ALWAYS, stencil, 0xFF);
glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
@@ -335,7 +335,7 @@ void SkipPartCanvas::Render()
// stencil3 => skipped
draw_shape(skipped_stencil, psSkipped, ColorRGB{95 / 255.f, 95 / 255.f, 95 / 255.f});
auto draw_mask = [this, view_rect, border_w, w, h](const int stencil, const PartState part_type,
auto draw_mask = [this, view_rect](const int stencil, const PartState part_type,
const ColorRGB& background, const ColorRGB& line, const ColorRGB& bound) {
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glStencilFunc(GL_EQUAL, stencil, 0xFF);
+1 -1
View File
@@ -115,7 +115,7 @@ SliceInfoPopup::SliceInfoPopup(wxWindow *parent, wxBitmap bmp, BBLSliceInfo *inf
f_sizer->Add(f_type, 0, wxEXPAND | wxALL, FromDIP(5));
f_sizer->Add(f_used_g, 0, wxEXPAND | wxALL, FromDIP(5));
grid_sizer->Add(f_sizer, 0, wxEXPAND, 0);
f_type->Bind(wxEVT_LEFT_DOWN, [this](auto &e) {});
f_type->Bind(wxEVT_LEFT_DOWN, [](auto &e) {});
}
}
topSizer->Add(grid_sizer, 0, wxALL, FromDIP(5));
+2 -2
View File
@@ -167,7 +167,7 @@ StepMeshDialog::StepMeshDialog(wxWindow* parent, Slic3r::Step& file, double line
e.Skip();
}));
// textctrl bind slider
linear_input->Bind(wxEVT_TEXT, ([this, linear_slider, linear_input](wxCommandEvent& e) {
linear_input->Bind(wxEVT_TEXT, ([linear_slider, linear_input](wxCommandEvent& e) {
double slider_value_long;
int slider_value;
wxString value = linear_input->GetTextCtrl()->GetValue();
@@ -222,7 +222,7 @@ StepMeshDialog::StepMeshDialog(wxWindow* parent, Slic3r::Step& file, double line
e.Skip();
}));
// textctrl bind slider
angle_input->Bind(wxEVT_TEXT, ([this, angle_slider, angle_input](wxCommandEvent& e) {
angle_input->Bind(wxEVT_TEXT, ([angle_slider, angle_input](wxCommandEvent& e) {
double slider_value_long;
int slider_value;
wxString value = angle_input->GetTextCtrl()->GetValue();
+2 -2
View File
@@ -1113,7 +1113,7 @@ void SyncAmsInfoDialog::init_bind()
e.Skip();
});
Bind(EVT_CONNECT_LAN_MODE_PRINT, [this](wxCommandEvent &e) {
Bind(EVT_CONNECT_LAN_MODE_PRINT, [](wxCommandEvent &e) {
if (e.GetInt() == 0) {
DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
if (!dev) return;
@@ -2644,7 +2644,7 @@ void SyncAmsInfoDialog::reset_and_sync_ams_list()
item_index++;
contronal_index++;
item->Bind(wxEVT_LEFT_UP, [this, item, materials, extruder](wxMouseEvent &e) {});
item->Bind(wxEVT_LEFT_UP, [materials](wxMouseEvent &e) {});
item->Bind(wxEVT_LEFT_DOWN, [this, item, materials, extruder, item_index_str](wxMouseEvent &e) {
MaterialHash::iterator iter = m_materialList.begin();
while (iter != m_materialList.end()) {
+7 -7
View File
@@ -459,7 +459,7 @@ void Tab::create_preset_tab()
// tree
m_tabctrl = new TabCtrl(panel, wxID_ANY, wxDefaultPosition, wxSize(20 * m_em_unit, -1),
wxTR_NO_BUTTONS | wxTR_HIDE_ROOT | wxTR_SINGLE | wxTR_NO_LINES | wxBORDER_NONE | wxWANTS_CHARS | wxTR_FULL_ROW_HIGHLIGHT);
m_tabctrl->Bind(wxEVT_RIGHT_DOWN, [this](auto &e) {}); // disable right select
m_tabctrl->Bind(wxEVT_RIGHT_DOWN, [](auto &e) {}); // disable right select
m_tabctrl->SetFont(Label::Body_14);
//m_left_sizer->Add(m_tabctrl, 1, wxEXPAND);
const int img_sz = int(32 * scale_factor + 0.5f);
@@ -6075,7 +6075,7 @@ void TabPrinter::toggle_options()
auto nozzle_volumes = m_preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
auto extruders = m_config->option<ConfigOptionEnumsGeneric>("extruder_type");
auto get_index_for_extruder =
[this, &extruders, &nozzle_volumes](int extruder_id, int stride = 1) {
[this, &extruders](int extruder_id, int stride = 1) {
return m_config->get_index_for_extruder(extruder_id + 1, "printer_extruder_id",
ExtruderType(extruders->values[extruder_id]), get_actual_nozzle_volume_type(extruder_id), "printer_extruder_variant", stride);
};
@@ -7713,18 +7713,18 @@ wxSizer* Tab::compatible_widget_create(wxWindow* parent, PresetDependencies &dep
this->update_changed_ui();
};
deps.checkbox_title->Bind(wxEVT_LEFT_DOWN,([this, &deps, on_toggle](wxMouseEvent& e) {
deps.checkbox_title->Bind(wxEVT_LEFT_DOWN,([&deps, on_toggle](wxMouseEvent& e) {
if (e.GetEventType() == wxEVT_LEFT_DCLICK) return;
on_toggle(!deps.checkbox->GetValue());
e.Skip();
}));
deps.checkbox_title->Bind(wxEVT_LEFT_DCLICK,([this, &deps, on_toggle](wxMouseEvent& e) {
deps.checkbox_title->Bind(wxEVT_LEFT_DCLICK,([&deps, on_toggle](wxMouseEvent& e) {
on_toggle(!deps.checkbox->GetValue());
e.Skip();
}));
deps.checkbox->Bind(wxEVT_TOGGLEBUTTON, ([this, on_toggle](wxCommandEvent& e) {
deps.checkbox->Bind(wxEVT_TOGGLEBUTTON, ([on_toggle](wxCommandEvent& e) {
on_toggle(e.IsChecked());
e.Skip();
}), deps.checkbox->GetId());
@@ -8306,7 +8306,7 @@ void Tab::switch_excluder(int extruder_id, bool reload)
return;
}
auto get_index_for_extruder =
[this, &extruders, &nozzle_volumes, variant_keys = extruder_variant_keys[m_type >= Preset::TYPE_COUNT ? Preset::TYPE_PRINT : m_type]](int extruder_id, int stride = 1) {
[this, &extruders, variant_keys = extruder_variant_keys[m_type >= Preset::TYPE_COUNT ? Preset::TYPE_PRINT : m_type]](int extruder_id, int stride = 1) {
return m_config->get_index_for_extruder(extruder_id + 1, variant_keys.first,
ExtruderType(extruders->values[extruder_id]), get_actual_nozzle_volume_type(extruder_id), variant_keys.second, stride);
};
@@ -8363,7 +8363,7 @@ void Tab::sync_excluder()
auto nozzle_volumes = m_preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
auto extruders = printer_preset.config.option<ConfigOptionEnumsGeneric>("extruder_type");
auto get_index_for_extruder =
[this, &extruders, &nozzle_volumes, variant_keys = extruder_variant_keys[m_type >= Preset::TYPE_COUNT ? Preset::TYPE_PRINT : m_type]](int extruder_id, NozzleVolumeType nozzle_type) {
[this, &extruders, variant_keys = extruder_variant_keys[m_type >= Preset::TYPE_COUNT ? Preset::TYPE_PRINT : m_type]](int extruder_id, NozzleVolumeType nozzle_type) {
return m_config->get_index_for_extruder(extruder_id + 1, variant_keys.first,
ExtruderType(extruders->values[extruder_id]), nozzle_type, variant_keys.second);
};
+2 -2
View File
@@ -71,7 +71,7 @@ wxFlexGridSizer* TroubleshootDialog::create_item_loaded_profiles()
auto gen_stats = GetProfilesOverview();
gen_stats = ""; // clear mem. not needed after generating m_..._act, m_..._usr variables
auto add_sizer = [this, g_sizer, create_label](PresetCollection* col, wxString label, int in_use, int user) {
auto add_sizer = [g_sizer, create_label](PresetCollection* col, wxString label, int in_use, int user) {
int sys = 0;
for (auto it = col->begin(); it != col->end(); it++) {
if (it->is_system)
@@ -178,7 +178,7 @@ TroubleshootDialog::TroubleshootDialog()
return wxTheClipboard->SetData(new wxTextDataObject(GetSysInfoAll()));
});
sys_less_btn->Bind(wxEVT_BUTTON, [this, sys_panel, sys_less_btn, sys_info_lines, sys_copy_btn](wxCommandEvent &e) {
sys_less_btn->Bind(wxEVT_BUTTON, [this, sys_panel, sys_less_btn, sys_info_lines](wxCommandEvent &e) {
m_sys_panel_mode = !m_sys_panel_mode;
sys_panel->SetText(sys_info_lines(m_sys_panel_mode));
sys_less_btn->SetLabel(m_sys_panel_mode ? _L("Hide") : _L("Show"));
+2 -2
View File
@@ -588,7 +588,7 @@ void GuideFrame::OnScriptMessage(wxWebViewEvent &evt)
else if (strCmd == "user_guide_create_printer") {
this->EndModal(wxID_CANCEL);
this->Close();
GUI::wxGetApp().CallAfter([this] {GUI::wxGetApp().sidebar().create_printer_preset();});
GUI::wxGetApp().CallAfter([] {GUI::wxGetApp().sidebar().create_printer_preset();});
}
else if (strCmd == "user_guide_cancel") {
this->EndModal(wxID_CANCEL);
@@ -871,7 +871,7 @@ bool GuideFrame::apply_config(AppConfig *app_config, PresetBundle *preset_bundle
std::string preferred_model;
std::string preferred_variant;
PrinterTechnology preferred_pt = ptFFF;
auto get_preferred_printer_model = [preset_bundle, enabled_vendors, old_enabled_vendors, preferred_pt](const std::string& bundle_name, std::string& variant) {
auto get_preferred_printer_model = [preset_bundle, enabled_vendors, old_enabled_vendors](const std::string& bundle_name, std::string& variant) {
const auto config = enabled_vendors.find(bundle_name);
if (config == enabled_vendors.end())
return std::string();
+2 -2
View File
@@ -489,7 +489,7 @@ void ZUserLogin::OnScriptMessage(wxWebViewEvent &evt)
std::string jump_url = j["data"]["url"].get<std::string>();
int loopback_port = ensure_loopback_port();
jump_url = rewrite_loopback_url(jump_url, loopback_port);
CallAfter([this, jump_url] {
CallAfter([jump_url] {
wxString url = wxString::FromUTF8(jump_url);
wxLaunchDefaultBrowser(url);
});
@@ -498,7 +498,7 @@ void ZUserLogin::OnScriptMessage(wxWebViewEvent &evt)
else if (strCmd == "new_webpage") {
if (j["data"].contains("url")) {
std::string jump_url = j["data"]["url"].get<std::string>();
CallAfter([this, jump_url] {
CallAfter([jump_url] {
wxString url = wxString::FromUTF8(jump_url);
wxLaunchDefaultBrowser(url);
});