Merge branch 'main' into dev/bbl-network-upd

This commit is contained in:
Noisyfox
2025-06-14 09:52:33 +08:00
committed by GitHub
436 changed files with 10786 additions and 3304 deletions

View File

@@ -2550,11 +2550,9 @@ ModelVolumeType type_from_string(const std::string &s)
stream << " <" << METADATA_TAG << " name=\"Copyright\">" << "</" << METADATA_TAG << ">\n";
stream << " <" << METADATA_TAG << " name=\"LicenseTerms\">" << "</" << METADATA_TAG << ">\n";
stream << " <" << METADATA_TAG << " name=\"Rating\">" << "</" << METADATA_TAG << ">\n";
std::string date = Slic3r::Utils::utc_timestamp(Slic3r::Utils::get_current_time_utc());
// keep only the date part of the string
date = date.substr(0, 10);
stream << " <" << METADATA_TAG << " name=\"CreationDate\">" << date << "</" << METADATA_TAG << ">\n";
stream << " <" << METADATA_TAG << " name=\"ModificationDate\">" << date << "</" << METADATA_TAG << ">\n";
// Orca: PRIVACY: do not store creation & modification date in 3mf
stream << " <" << METADATA_TAG << " name=\"CreationDate\">" << "</" << METADATA_TAG << ">\n";
stream << " <" << METADATA_TAG << " name=\"ModificationDate\">" << "</" << METADATA_TAG << ">\n";
stream << " <" << METADATA_TAG << " name=\"Application\">" << SLIC3R_APP_KEY << "-" << SLIC3R_VERSION << "</" << METADATA_TAG << ">\n";
stream << " <" << RESOURCES_TAG << ">\n";
std::string buf = stream.str();

View File

@@ -6511,7 +6511,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
metadata_item_map[BBL_MODEL_NAME_TAG] = xml_escape(name);
metadata_item_map[BBL_ORIGIN_TAG] = xml_escape(origin);
metadata_item_map[BBL_DESIGNER_TAG] = xml_escape(user_name);
metadata_item_map[BBL_DESIGNER_USER_ID_TAG] = user_id;
metadata_item_map[BBL_DESIGNER_USER_ID_TAG] = ""; // Orca: PRIVACY: do not store BBL user id in 3mf
metadata_item_map[BBL_DESIGNER_COVER_FILE_TAG] = xml_escape(design_cover);
metadata_item_map[BBL_DESCRIPTION_TAG] = xml_escape(description);
metadata_item_map[BBL_COPYRIGHT_NORMATIVE_TAG] = xml_escape(copyright);
@@ -6523,11 +6523,9 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
metadata_item_map[BBL_REGION_TAG] = region_code;
}
std::string date = Slic3r::Utils::utc_timestamp(Slic3r::Utils::get_current_time_utc());
// keep only the date part of the string
date = date.substr(0, 10);
metadata_item_map[BBL_CREATION_DATE_TAG] = date;
metadata_item_map[BBL_MODIFICATION_TAG] = date;
// Orca: PRIVACY: do not store creation & modification date in 3mf
metadata_item_map[BBL_CREATION_DATE_TAG] = "";
metadata_item_map[BBL_MODIFICATION_TAG] = "";
//SoftFever: write BambuStudio tag to keep it compatible
metadata_item_map[BBL_APPLICATION_TAG] = (boost::format("%1%-%2%") % "BambuStudio" % SoftFever_VERSION).str();
}

View File

@@ -4122,6 +4122,10 @@ LayerResult GCode::process_layer(
// Extrude the skirt, brim, support, perimeters, infill ordered by the extruders.
for (unsigned int extruder_id : layer_tools.extruders)
{
if (print.config().skirt_type == stCombined && !print.skirt().empty())
gcode += generate_skirt(print, print.skirt(), Point(0, 0), layer.object()->config().skirt_start_angle, layer_tools, layer,
extruder_id);
std::string gcode_toolchange;
if (has_wipe_tower) {
if (!m_wipe_tower->is_empty_wipe_tower_gcode(*this, extruder_id, extruder_id == layer_tools.extruders.back())) {
@@ -4155,10 +4159,6 @@ LayerResult GCode::process_layer(
// let analyzer tag generator aware of a role type change
if (layer_tools.has_wipe_tower && m_wipe_tower)
m_last_processor_extrusion_role = erWipeTower;
if (print.config().skirt_type == stCombined && !print.skirt().empty())
gcode += generate_skirt(print, print.skirt(), Point(0, 0), layer.object()->config().skirt_start_angle, layer_tools, layer,
extruder_id);
auto objects_by_extruder_it = by_extruder.find(extruder_id);
if (objects_by_extruder_it == by_extruder.end())

View File

@@ -33,7 +33,6 @@
<array>
<string>orcasliceropen</string>
<string>orcaslicer</string>
<string>bambustudioopen</string>
</array>
</dict>
</array>

View File

@@ -14,6 +14,8 @@ set(SLIC3R_GUI_SOURCES
GUI/Widgets/Button.hpp
GUI/Widgets/CheckBox.cpp
GUI/Widgets/CheckBox.hpp
GUI/Widgets/DialogButtons.cpp
GUI/Widgets/DialogButtons.hpp
GUI/Widgets/RadioBox.hpp
GUI/Widgets/RadioBox.cpp
GUI/Widgets/ProgressDialog.hpp
@@ -36,6 +38,8 @@ set(SLIC3R_GUI_SOURCES
GUI/Widgets/Scrollbar.hpp
GUI/Widgets/ScrolledWindow.cpp
GUI/Widgets/ScrolledWindow.hpp
GUI/Widgets/LabeledStaticBox.cpp
GUI/Widgets/LabeledStaticBox.hpp
GUI/Widgets/StaticBox.cpp
GUI/Widgets/StaticBox.hpp
GUI/Widgets/ImageSwitchButton.cpp
@@ -70,6 +74,8 @@ set(SLIC3R_GUI_SOURCES
GUI/Widgets/StepCtrl.hpp
GUI/Widgets/ProgressBar.cpp
GUI/Widgets/ProgressBar.hpp
GUI/Widgets/RadioGroup.cpp
GUI/Widgets/RadioGroup.hpp
GUI/Widgets/SideTools.cpp
GUI/Widgets/SideTools.hpp
GUI/Widgets/WebView.cpp

View File

@@ -619,12 +619,6 @@ void Bed3D::update_model_offset()
shift(2) = -0.03;
Vec3d* model_offset_ptr = const_cast<Vec3d*>(&m_model_offset);
*model_offset_ptr = shift;
//BBS: TODO: hack for current stl for BBL printer
if (std::string::npos != m_model_filename.find("bbl-3dp-"))
{
(*model_offset_ptr)(0) -= m_bed_shape[2].x() / 2.0f;
(*model_offset_ptr)(1) -= m_bed_shape[2].y() / 2.0f;
}
(*model_offset_ptr)(2) = -0.41 + GROUND_Z;
// update extended bounding box
@@ -677,7 +671,7 @@ void Bed3D::render_model(const Transform3d& view_matrix, const Transform3d& proj
m_model.set_color(m_is_dark ? DEFAULT_MODEL_COLOR_DARK : DEFAULT_MODEL_COLOR);
update_model_offset();
// BBS: remove the bed picking logic
//register_raycasters_for_picking(m_model.model.get_geometry(), Geometry::assemble_transform(m_model_offset));
}

View File

@@ -840,7 +840,7 @@ void AuxiliaryPanel::init_tabpanel()
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
auto back_btn = new Button(this, _L("return"), "assemble_return", wxBORDER_NONE | wxBU_LEFT | wxBU_EXACTFIT);
auto back_btn = new Button(this, _L("Return"), "assemble_return", wxBORDER_NONE | wxBU_LEFT | wxBU_EXACTFIT);
back_btn->SetSize(wxSize(FromDIP(220), FromDIP(18)));
back_btn->SetBackgroundColor(btn_bg_green);
back_btn->SetTextColor(StateColor (std::pair<wxColour, int>(wxColour("#FDFFFD"), StateColor::Normal))); // ORCA fixes color change on text. icon stays white color but text changes to black without this

View File

@@ -12,6 +12,9 @@
#include "libslic3r/Model.hpp"
#include "libslic3r/Polygon.hpp"
#include "Widgets/LabeledStaticBox.hpp"
#include "Widgets/DialogButtons.hpp"
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem.hpp>
@@ -143,7 +146,10 @@ void BedShapeDialog::build_dialog(const Pointfs& default_pt, const ConfigOptionS
auto main_sizer = new wxBoxSizer(wxVERTICAL);
main_sizer->Add(m_panel, 1, wxEXPAND);
main_sizer->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxALIGN_CENTER_HORIZONTAL | wxBOTTOM, 10);
auto dlg_btns = new DialogButtons(this, {"OK", "Cancel"});
main_sizer->Add(dlg_btns, 0, wxEXPAND);
wxGetApp().UpdateDlgDarkUI(this);
@@ -184,9 +190,9 @@ void BedShapePanel::build_panel(const Pointfs& default_pt, const std::string& cu
m_custom_texture = custom_texture.empty() ? NONE : custom_texture;
m_custom_model = custom_model.empty() ? NONE : custom_model;
auto sbsizer = new wxStaticBoxSizer(wxVERTICAL, this, _L("Shape"));
sbsizer->GetStaticBox()->SetFont(wxGetApp().bold_font());
wxGetApp().UpdateDarkUI(sbsizer->GetStaticBox());
// ORCA match style of wxStaticBox between platforms
LabeledStaticBox* stb = new LabeledStaticBox(this, _L("Shape"));
auto sbsizer = new wxStaticBoxSizer(stb, wxVERTICAL);
// shape options
m_shape_options_book = new wxSimplebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize);

View File

@@ -124,8 +124,8 @@ static const std::unordered_map<std::string, std::vector<std::string>> printer_m
{"Orca Arena Printer",{"Orca Arena X1 Carbon"}},
{"Peopoly", {"Peopoly Magneto X"}},
{"Positron 3D", {"The Positron"}},
{"Prusa", {"MK4IS", "MINIIS", "MK3S", "MINI", "MK3.5",
"Prusa XL", "Prusa XL 5T", "MK4S", "MK4S HF"}},
{"Prusa", {"Prusa CORE One", "Prusa CORE One HF", "MK4IS", "MK4S", "MK4S HF",
"Prusa XL", "Prusa XL 5T", "MK3.5", "MK3S", "MINI", "MINIIS"}},
{"Qidi", {"Qidi X-Plus 4", "Qidi Q1 Pro", "Qidi X-Max 3", "Qidi X-Plus 3", "Qidi X-Smart 3",
"Qidi X-Plus", "Qidi X-Max", "Qidi X-CF Pro"}},
{"Raise3D", {"Raise3D Pro3", "Raise3D Pro3 Plus"}},
@@ -684,7 +684,7 @@ CreateFilamentPresetDialog::CreateFilamentPresetDialog(wxWindow *parent)
m_scrolled_sizer->Add(0, 0, 0, wxTOP, FromDIP(5));
m_scrolled_preset_panel->SetSizerAndFit(m_scrolled_sizer);
m_main_sizer->Add(m_scrolled_preset_panel, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(10));
m_main_sizer->Add(create_button_item(), 0, wxEXPAND | wxALL, FromDIP(10));
m_main_sizer->Add(create_dialog_buttons(), 0, wxEXPAND);
get_all_visible_printer_name();
select_curr_radiobox(m_create_type_btns, 0);
@@ -709,14 +709,6 @@ CreateFilamentPresetDialog::~CreateFilamentPresetDialog()
}
void CreateFilamentPresetDialog::on_dpi_changed(const wxRect &suggested_rect) {
m_button_create->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_create->SetMaxSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_create->SetCornerRadius(FromDIP(12));
m_button_cancel->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetMaxSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetCornerRadius(FromDIP(12));
Layout();
}
@@ -1018,25 +1010,13 @@ wxBoxSizer *CreateFilamentPresetDialog::create_filament_preset_for_printer_item(
return vertical_sizer;
}
wxBoxSizer *CreateFilamentPresetDialog::create_button_item()
wxWindow *CreateFilamentPresetDialog::create_dialog_buttons()
{
wxBoxSizer *bSizer_button = new wxBoxSizer(wxHORIZONTAL);
bSizer_button->Add(0, 0, 1, wxEXPAND, 0);
auto dlg_btns = new DialogButtons(this, {"OK", "Cancel"});
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_create = new Button(this, _L("Create"));
m_button_create->SetBackgroundColor(btn_bg_green);
m_button_create->SetBorderColor(*wxWHITE);
m_button_create->SetTextColor(wxColour(0xFFFFFE));
m_button_create->SetFont(Label::Body_12);
m_button_create->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_create->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_create->SetCornerRadius(FromDIP(12));
bSizer_button->Add(m_button_create, 0, wxRIGHT, FromDIP(10));
m_button_create->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
auto btn_ok = dlg_btns->GetOK();
btn_ok->SetLabel(_L("Create"));
btn_ok->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
//get vendor name
wxString vendor_str = m_filament_vendor_combobox->GetLabel();
std::string vendor_name;
@@ -1194,23 +1174,11 @@ wxBoxSizer *CreateFilamentPresetDialog::create_button_item()
EndModal(wxID_OK);
});
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_cancel = new Button(this, _L("Cancel"));
m_button_cancel->SetBackgroundColor(btn_bg_white);
m_button_cancel->SetBorderColor(wxColour(38, 46, 48));
m_button_cancel->SetFont(Label::Body_12);
m_button_cancel->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetCornerRadius(FromDIP(12));
bSizer_button->Add(m_button_cancel, 0, wxRIGHT, FromDIP(10));
m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
dlg_btns->GetCANCEL()->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
EndModal(wxID_CANCEL);
});
});
return bSizer_button;
return dlg_btns;
}
wxArrayString CreateFilamentPresetDialog::get_filament_preset_choices()
@@ -1598,7 +1566,7 @@ CreatePrinterPresetDialog::CreatePrinterPresetDialog(wxWindow *parent)
page_sizer->Add(m_page1, 1, wxEXPAND, 0);
page_sizer->Add(m_page2, 1, wxEXPAND, 0);
m_main_sizer->Add(page_sizer, 0, wxEXPAND | wxRIGHT, FromDIP(10));
m_main_sizer->Add(page_sizer, 0, wxEXPAND | wxRIGHT | wxLEFT, FromDIP(5)); // ORCA use equal border for both sides
select_curr_radiobox(m_create_type_btns, 0);
select_curr_radiobox(m_create_presets_btns, 0);
@@ -1627,21 +1595,6 @@ CreatePrinterPresetDialog::~CreatePrinterPresetDialog()
}
void CreatePrinterPresetDialog::on_dpi_changed(const wxRect &suggested_rect) {
m_button_OK->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_OK->SetMaxSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_OK->SetCornerRadius(FromDIP(12));
m_button_create->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_create->SetMaxSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_create->SetCornerRadius(FromDIP(12));
m_button_page1_cancel->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_page1_cancel->SetMaxSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_page1_cancel->SetCornerRadius(FromDIP(12));
m_button_page2_cancel->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_page2_cancel->SetMaxSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_page2_cancel->SetCornerRadius(FromDIP(12));
m_button_page2_back->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_page2_back->SetMaxSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_page2_back->SetCornerRadius(FromDIP(12));
Layout();
}
@@ -1702,7 +1655,7 @@ void CreatePrinterPresetDialog::create_printer_page1(wxWindow *parent)
m_printer_info_sizer->Add(create_max_print_height_item(m_printer_info_panel), 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, FromDIP(5));
m_printer_info_panel->SetSizer(m_printer_info_sizer);
m_page1_sizer->Add(m_printer_info_panel, 0, wxEXPAND, 0);
m_page1_sizer->Add(create_page1_btns_item(parent), 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, FromDIP(5));
m_page1_sizer->Add(create_page1_dialog_buttons(parent), 0, wxEXPAND);
parent->SetSizerAndFit(m_page1_sizer);
Layout();
@@ -2067,45 +2020,19 @@ wxBoxSizer *CreatePrinterPresetDialog::create_max_print_height_item(wxWindow *pa
return horizontal_sizer;
}
wxBoxSizer *CreatePrinterPresetDialog::create_page1_btns_item(wxWindow *parent)
wxWindow *CreatePrinterPresetDialog::create_page1_dialog_buttons(wxWindow *parent)
{
wxBoxSizer *bSizer_button = new wxBoxSizer(wxHORIZONTAL);
bSizer_button->Add(0, 0, 1, wxEXPAND, 0);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_OK = new Button(parent, _L("OK"));
m_button_OK->SetBackgroundColor(btn_bg_green);
m_button_OK->SetBorderColor(*wxWHITE);
m_button_OK->SetTextColor(wxColour(0xFFFFFE));
m_button_OK->SetFont(Label::Body_12);
m_button_OK->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_OK->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_OK->SetCornerRadius(FromDIP(12));
bSizer_button->Add(m_button_OK, 0, wxRIGHT, FromDIP(10));
m_button_OK->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
auto dlg_btns = new DialogButtons(parent, {"OK", "Cancel"});
dlg_btns->GetOK()->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
if (!validate_input_valid()) return;
data_init();
show_page2();
});
});
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
dlg_btns->GetCANCEL()->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { EndModal(wxID_CANCEL); });
m_button_page1_cancel = new Button(parent, _L("Cancel"));
m_button_page1_cancel->SetBackgroundColor(btn_bg_white);
m_button_page1_cancel->SetBorderColor(wxColour(38, 46, 48));
m_button_page1_cancel->SetFont(Label::Body_12);
m_button_page1_cancel->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_page1_cancel->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_page1_cancel->SetCornerRadius(FromDIP(12));
bSizer_button->Add(m_button_page1_cancel, 0, wxRIGHT, FromDIP(10));
m_button_page1_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { EndModal(wxID_CANCEL); });
return bSizer_button;
return dlg_btns;
}
static std::string last_directory = "";
void CreatePrinterPresetDialog::load_texture() {
@@ -2498,7 +2425,7 @@ void CreatePrinterPresetDialog::create_printer_page2(wxWindow *parent)
m_page2_sizer->Add(create_printer_preset_item(parent), 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, FromDIP(5));
m_page2_sizer->Add(create_presets_item(parent), 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, FromDIP(5));
m_page2_sizer->Add(create_presets_template_item(parent), 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, FromDIP(5));
m_page2_sizer->Add(create_page2_btns_item(parent), 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, FromDIP(5));
m_page2_sizer->Add(create_page2_dialog_buttons(parent), 0, wxEXPAND);
parent->SetSizerAndFit(m_page2_sizer);
Layout();
@@ -2648,39 +2575,15 @@ wxBoxSizer *CreatePrinterPresetDialog::create_presets_template_item(wxWindow *pa
return vertical_sizer;
}
wxBoxSizer *CreatePrinterPresetDialog::create_page2_btns_item(wxWindow *parent)
wxWindow *CreatePrinterPresetDialog::create_page2_dialog_buttons(wxWindow *parent)
{
wxBoxSizer *bSizer_button = new wxBoxSizer(wxHORIZONTAL);
bSizer_button->Add(0, 0, 1, wxEXPAND, 0);
auto dlg_btns = new DialogButtons(parent, {"Back", "OK", "Cancel"});
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
dlg_btns->GetBACK()->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { show_page1(); });
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_page2_back = new Button(parent, _L("Back Page 1"));
m_button_page2_back->SetBackgroundColor(btn_bg_white);
m_button_page2_back->SetBorderColor(wxColour(38, 46, 48));
m_button_page2_back->SetFont(Label::Body_12);
m_button_page2_back->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_page2_back->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_page2_back->SetCornerRadius(FromDIP(12));
bSizer_button->Add(m_button_page2_back, 0, wxRIGHT, FromDIP(10));
m_button_page2_back->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { show_page1(); });
m_button_create = new Button(parent, _L("Create"));
m_button_create->SetBackgroundColor(btn_bg_green);
m_button_create->SetBorderColor(*wxWHITE);
m_button_create->SetTextColor(wxColour(0xFFFFFE));
m_button_create->SetFont(Label::Body_12);
m_button_create->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_create->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_create->SetCornerRadius(FromDIP(12));
bSizer_button->Add(m_button_create, 0, wxRIGHT, FromDIP(10));
m_button_create->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
auto btn_ok = dlg_btns->GetOK();
btn_ok->SetLabel(_L("Create"));
btn_ok->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
const wxString curr_selected_printer_type = curr_create_printer_type();
@@ -2925,18 +2828,9 @@ wxBoxSizer *CreatePrinterPresetDialog::create_page2_btns_item(wxWindow *parent)
});
m_button_page2_cancel = new Button(parent, _L("Cancel"));
m_button_page2_cancel->SetBackgroundColor(btn_bg_white);
m_button_page2_cancel->SetBorderColor(wxColour(38, 46, 48));
m_button_page2_cancel->SetFont(Label::Body_12);
m_button_page2_cancel->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_page2_cancel->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_page2_cancel->SetCornerRadius(FromDIP(12));
bSizer_button->Add(m_button_page2_cancel, 0, wxRIGHT, FromDIP(10));
dlg_btns->GetCANCEL()->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { EndModal(wxID_CANCEL); });
m_button_page2_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { EndModal(wxID_CANCEL); });
return bSizer_button;
return dlg_btns;
}
void CreatePrinterPresetDialog::show_page1()
@@ -3374,52 +3268,27 @@ CreatePresetSuccessfulDialog::CreatePresetSuccessfulDialog(wxWindow *parent, con
m_main_sizer->Add(horizontal_sizer, 0, wxALL, FromDIP(5));
wxBoxSizer *btn_sizer = new wxBoxSizer(wxHORIZONTAL);
btn_sizer->Add(0, 0, 1, wxEXPAND, 0);
switch (create_success_type) {
case PRINTER:
m_button_ok = new Button(this, _L("Printer Setting"));
break;
case FILAMENT: m_button_ok = sync_user_preset_need_enabled ? new Button(this, _L("Sync user presets")) : new Button(this, _L("OK"));
break;
}
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
bool is_cancel_needed = PRINTER == create_success_type || sync_user_preset_need_enabled;
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_ok->SetBackgroundColor(btn_bg_green);
m_button_ok->SetBorderColor(wxColour(*wxWHITE));
m_button_ok->SetTextColor(wxColour(*wxWHITE));
m_button_ok->SetFont(Label::Body_12);
m_button_ok->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetCornerRadius(FromDIP(12));
btn_sizer->Add(m_button_ok, 0, wxRIGHT, FromDIP(10));
auto dlg_btns = new DialogButtons(this, is_cancel_needed ? std::vector<wxString>{"OK", "Cancel"} : std::vector<wxString>{"OK"});
m_button_ok->Bind(wxEVT_LEFT_DOWN, [this, sync_user_preset_need_enabled](wxMouseEvent &e) {
if (create_success_type == PRINTER)
dlg_btns->GetOK()->SetLabel(_L("Printer Setting"));
else if (create_success_type == FILAMENT && sync_user_preset_need_enabled)
dlg_btns->GetOK()->SetLabel(_L("Sync user presets"));
dlg_btns->GetOK()->Bind(wxEVT_LEFT_DOWN, [this, sync_user_preset_need_enabled](wxMouseEvent &e) {
if (sync_user_preset_need_enabled) {
wxGetApp().app_config->set("sync_user_preset", "true");
wxGetApp().start_sync_user_preset();
}
EndModal(wxID_OK);
});
});
if (PRINTER == create_success_type || sync_user_preset_need_enabled) {
m_button_cancel = new Button(this, _L("Cancel"));
m_button_cancel->SetBackgroundColor(btn_bg_white);
m_button_cancel->SetBorderColor(wxColour(38, 46, 48));
m_button_cancel->SetTextColor(wxColour(38, 46, 48));
m_button_cancel->SetFont(Label::Body_12);
m_button_cancel->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetCornerRadius(FromDIP(12));
btn_sizer->Add(m_button_cancel, 0, wxRIGHT, FromDIP(10));
m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { EndModal(wxID_CANCEL); });
}
if (is_cancel_needed)
dlg_btns->GetCANCEL()->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { EndModal(wxID_CANCEL); });
m_main_sizer->Add(btn_sizer, 0, wxEXPAND | wxALL, FromDIP(15));
m_main_sizer->Add(0, 0, 0, wxTOP, FromDIP(10));
m_main_sizer->Add(dlg_btns, 0, wxEXPAND);
SetSizer(m_main_sizer);
Layout();
@@ -3430,12 +3299,6 @@ CreatePresetSuccessfulDialog::CreatePresetSuccessfulDialog(wxWindow *parent, con
CreatePresetSuccessfulDialog::~CreatePresetSuccessfulDialog() {}
void CreatePresetSuccessfulDialog::on_dpi_changed(const wxRect &suggested_rect) {
m_button_ok->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetMaxSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetCornerRadius(FromDIP(12));
m_button_cancel->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetMaxSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetCornerRadius(FromDIP(12));
Layout();
}
@@ -3463,7 +3326,7 @@ ExportConfigsDialog::ExportConfigsDialog(wxWindow *parent)
m_main_sizer->Add(create_export_config_item(this), 0, wxEXPAND | wxALL, FromDIP(5));
m_main_sizer->Add(create_select_printer(this), 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, FromDIP(5));
m_main_sizer->Add(create_button_item(this), 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, FromDIP(5));
m_main_sizer->Add(create_dialog_buttons(this), 0, wxEXPAND);
data_init();
@@ -3517,12 +3380,6 @@ ExportConfigsDialog::~ExportConfigsDialog()
}
void ExportConfigsDialog::on_dpi_changed(const wxRect &suggested_rect) {
m_button_ok->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetMaxSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetCornerRadius(FromDIP(12));
m_button_cancel->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetMaxSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetCornerRadius(FromDIP(12));
Layout();
}
@@ -4168,25 +4025,10 @@ ExportConfigsDialog::ExportCase ExportConfigsDialog::archive_process_preset_to_f
return ExportCase::EXPORT_SUCCESS;
}
wxBoxSizer *ExportConfigsDialog::create_button_item(wxWindow* parent)
wxWindow *ExportConfigsDialog::create_dialog_buttons(wxWindow* parent)
{
wxBoxSizer *bSizer_button = new wxBoxSizer(wxHORIZONTAL);
bSizer_button->Add(0, 0, 1, wxEXPAND, 0);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_ok = new Button(this, _L("OK"));
m_button_ok->SetBackgroundColor(btn_bg_green);
m_button_ok->SetBorderColor(*wxWHITE);
m_button_ok->SetTextColor(wxColour(0xFFFFFE));
m_button_ok->SetFont(Label::Body_12);
m_button_ok->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetCornerRadius(FromDIP(12));
bSizer_button->Add(m_button_ok, 0, wxRIGHT, FromDIP(10));
m_button_ok->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
auto dlg_btns = new DialogButtons(parent, {"OK", "Cancel"});
dlg_btns->GetOK()->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
if (!has_check_box_selected()) {
MessageDialog dlg(this, _L("Please select at least one printer or filament."), wxString(SLIC3R_APP_FULL_NAME) + " - " + _L("Info"),
wxYES | wxYES_DEFAULT | wxCENTRE);
@@ -4223,21 +4065,9 @@ wxBoxSizer *ExportConfigsDialog::create_button_item(wxWindow* parent)
EndModal(wxID_OK);
});
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
dlg_btns->GetCANCEL()->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { EndModal(wxID_CANCEL); });
m_button_cancel = new Button(this, _L("Cancel"));
m_button_cancel->SetBackgroundColor(btn_bg_white);
m_button_cancel->SetBorderColor(wxColour(38, 46, 48));
m_button_cancel->SetFont(Label::Body_12);
m_button_cancel->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_cancel->SetCornerRadius(FromDIP(12));
bSizer_button->Add(m_button_cancel, 0, wxRIGHT, FromDIP(10));
m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { EndModal(wxID_CANCEL); });
return bSizer_button;
return dlg_btns;
}
wxBoxSizer *ExportConfigsDialog::create_select_printer(wxWindow *parent)
@@ -4422,7 +4252,7 @@ EditFilamentPresetDialog::EditFilamentPresetDialog(wxWindow *parent, Filamentinf
m_note_text = new wxStaticText(this, wxID_ANY, _L("Note: If the only preset under this filament is deleted, the filament will be deleted after exiting the dialog."));
m_main_sizer->Add(m_note_text, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, FromDIP(10));
m_note_text->Hide();
m_main_sizer->Add(create_button_sizer(), 0, wxEXPAND | wxALL, 0);
m_main_sizer->Add(create_dialog_buttons(), 0, wxEXPAND);
update_preset_tree();
@@ -4434,13 +4264,6 @@ EditFilamentPresetDialog::EditFilamentPresetDialog(wxWindow *parent, Filamentinf
EditFilamentPresetDialog::~EditFilamentPresetDialog() {}
void EditFilamentPresetDialog::on_dpi_changed(const wxRect &suggested_rect) {
/*m_add_filament_btn->Rescale();
m_del_filament_btn->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_del_filament_btn->SetMaxSize(wxSize(FromDIP(58), FromDIP(24)));
m_del_filament_btn->SetCornerRadius(FromDIP(12));
m_ok_btn->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_ok_btn->SetMaxSize(wxSize(FromDIP(58), FromDIP(24)));
m_ok_btn->SetCornerRadius(FromDIP(12));*/
Layout();
}
@@ -4731,39 +4554,11 @@ wxBoxSizer *EditFilamentPresetDialog::create_preset_tree_sizer()
return filament_preset_tree_sizer;
}
wxBoxSizer *EditFilamentPresetDialog::create_button_sizer()
wxWindow *EditFilamentPresetDialog::create_dialog_buttons()
{
wxBoxSizer *bSizer_button = new wxBoxSizer(wxHORIZONTAL);
auto dlg_btns = new DialogButtons(this, {"Delete", "OK"});
m_del_filament_btn = new Button(this, _L("Delete Filament"));
m_del_filament_btn->SetBackgroundColor(*wxRED);
m_del_filament_btn->SetBorderColor(*wxWHITE);
m_del_filament_btn->SetTextColor(wxColour(0xFFFFFE));
m_del_filament_btn->SetFont(Label::Body_12);
m_del_filament_btn->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_del_filament_btn->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_del_filament_btn->SetCornerRadius(FromDIP(12));
bSizer_button->Add(m_del_filament_btn, 0, wxLEFT | wxBOTTOM, FromDIP(10));
bSizer_button->Add(0, 0, 1, wxEXPAND, 0);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_ok_btn = new Button(this, _L("OK"));
m_ok_btn->SetBackgroundColor(btn_bg_green);
m_ok_btn->SetBorderColor(*wxWHITE);
m_ok_btn->SetTextColor(wxColour(0xFFFFFE));
m_ok_btn->SetFont(Label::Body_12);
m_ok_btn->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_ok_btn->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_ok_btn->SetCornerRadius(FromDIP(12));
bSizer_button->Add(m_ok_btn, 0, wxRIGHT | wxBOTTOM, FromDIP(10));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_del_filament_btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent &e) {
dlg_btns->GetButtonFromID(wxID_DELETE)->Bind(wxEVT_BUTTON, ([this](wxCommandEvent &e) {
WarningDialog dlg(this, _L("All the filament presets belong to this filament would be deleted.\n"
"If you are using this filament on your printer, please reset the filament information for that slot."),
_L("Delete filament"), wxYES | wxCANCEL | wxCANCEL_DEFAULT | wxCENTRE);
@@ -4803,10 +4598,9 @@ wxBoxSizer *EditFilamentPresetDialog::create_button_sizer()
e.Skip();
}));
m_ok_btn->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { EndModal(wxID_OK); });
return bSizer_button;
dlg_btns->GetOK()->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { EndModal(wxID_OK); });
return dlg_btns;
}
CreatePresetForPrinterDialog::CreatePresetForPrinterDialog(wxWindow *parent, std::string filament_type, std::string filament_id, std::string filament_vendor, std::string filament_name)
@@ -4837,7 +4631,7 @@ CreatePresetForPrinterDialog::CreatePresetForPrinterDialog(wxWindow *parent, std
main_sizer->Add(create_selected_printer_preset_sizer(), 0, wxALL, FromDIP(10));
main_sizer->Add(create_selected_filament_preset_sizer(), 0, wxALL, FromDIP(10));
main_sizer->Add(create_button_sizer(), 0, wxEXPAND | wxALL, FromDIP(10));
main_sizer->Add(create_dialog_buttons(), 0, wxEXPAND);
this->SetSizer(main_sizer);
this->Layout();
@@ -4848,12 +4642,6 @@ CreatePresetForPrinterDialog::CreatePresetForPrinterDialog(wxWindow *parent, std
CreatePresetForPrinterDialog::~CreatePresetForPrinterDialog() {}
void CreatePresetForPrinterDialog::on_dpi_changed(const wxRect &suggested_rect) {
m_ok_btn->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_ok_btn->SetMaxSize(wxSize(FromDIP(58), FromDIP(24)));
m_ok_btn->SetCornerRadius(FromDIP(12));
m_cancel_btn->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_cancel_btn->SetMaxSize(wxSize(FromDIP(58), FromDIP(24)));
m_cancel_btn->SetCornerRadius(FromDIP(12));
Layout();
}
@@ -4943,38 +4731,10 @@ wxBoxSizer *CreatePresetForPrinterDialog::create_selected_filament_preset_sizer(
return select_filament_preset_sizer;
}
wxBoxSizer *CreatePresetForPrinterDialog::create_button_sizer()
wxWindow *CreatePresetForPrinterDialog::create_dialog_buttons()
{
wxBoxSizer *bSizer_button = new wxBoxSizer(wxHORIZONTAL);
bSizer_button->Add(0, 0, 1, wxEXPAND, 0);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_ok_btn = new Button(this, _L("OK"));
m_ok_btn->SetBackgroundColor(btn_bg_green);
m_ok_btn->SetBorderColor(*wxWHITE);
m_ok_btn->SetTextColor(wxColour(0xFFFFFE));
m_ok_btn->SetFont(Label::Body_12);
m_ok_btn->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_ok_btn->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_ok_btn->SetCornerRadius(FromDIP(12));
bSizer_button->Add(m_ok_btn, 0, wxRIGHT | wxBOTTOM, FromDIP(10));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_cancel_btn = new Button(this, _L("Cancel"));
m_cancel_btn->SetBackgroundColor(btn_bg_white);
m_cancel_btn->SetBorderColor(wxColour(38, 46, 48));
m_cancel_btn->SetFont(Label::Body_12);
m_cancel_btn->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_cancel_btn->SetMinSize(wxSize(FromDIP(58), FromDIP(24)));
m_cancel_btn->SetCornerRadius(FromDIP(12));
bSizer_button->Add(m_cancel_btn, 0, wxRIGHT | wxBOTTOM, FromDIP(10));
m_ok_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) {
auto dlg_btns = new DialogButtons(this, {"OK", "Cancel"});
dlg_btns->GetOK()->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) {
wxString selected_printer_name = m_selected_printer->GetStringSelection();
std::string printer_name = into_u8(selected_printer_name);
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " add preset: get compatible printer name:";
@@ -5015,10 +4775,12 @@ wxBoxSizer *CreatePresetForPrinterDialog::create_button_sizer()
}
EndModal(wxID_OK);
});
m_cancel_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) { EndModal(wxID_CANCEL); });
return bSizer_button;
});
dlg_btns->GetCANCEL()->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) {
EndModal(wxID_CANCEL);
});
return dlg_btns;
}
PresetTree::PresetTree(EditFilamentPresetDialog * dialog)

View File

@@ -10,6 +10,7 @@
#include "Widgets/RadioBox.hpp"
#include "Widgets/CheckBox.hpp"
#include "Widgets/ComboBox.hpp"
#include "Widgets/DialogButtons.hpp"
#include "miniz.h"
#include "ParamsDialog.hpp"
@@ -41,7 +42,7 @@ protected:
wxBoxSizer *create_serial_item();
wxBoxSizer *create_filament_preset_item();
wxBoxSizer *create_filament_preset_for_printer_item();
wxBoxSizer *create_button_item();
wxWindow *create_dialog_buttons();
private:
void clear_filament_preset_map();
@@ -112,13 +113,13 @@ protected:
wxBoxSizer *create_hot_bed_stl_item(wxWindow *parent);
wxBoxSizer *create_hot_bed_svg_item(wxWindow *parent);
wxBoxSizer *create_max_print_height_item(wxWindow *parent);
wxBoxSizer *create_page1_btns_item(wxWindow *parent);
wxWindow *create_page1_dialog_buttons(wxWindow *parent);
//Improt Presets Page2
void create_printer_page2(wxWindow *parent);
wxBoxSizer *create_printer_preset_item(wxWindow *parent);
wxBoxSizer *create_presets_item(wxWindow *parent);
wxBoxSizer *create_presets_template_item(wxWindow *parent);
wxBoxSizer *create_page2_btns_item(wxWindow *parent);
wxWindow *create_page2_dialog_buttons(wxWindow *parent);
void show_page1();
void show_page2();
@@ -168,11 +169,6 @@ private:
Preset * m_printer_preset = nullptr;
wxStaticBitmap * m_step_1 = nullptr;
wxStaticBitmap * m_step_2 = nullptr;
Button * m_button_OK = nullptr;
Button * m_button_create = nullptr;
Button * m_button_page1_cancel = nullptr;
Button * m_button_page2_cancel = nullptr;
Button * m_button_page2_back = nullptr;
Button * m_button_bed_stl = nullptr;
Button * m_button_bed_svg = nullptr;
wxScrolledWindow * m_page1 = nullptr;
@@ -224,9 +220,6 @@ public:
protected:
void on_dpi_changed(const wxRect &suggested_rect) override;
private:
Button *m_button_ok = nullptr;
Button *m_button_cancel = nullptr;
};
class ExportConfigsDialog : public DPIDialog
@@ -267,7 +260,7 @@ private:
std::string initial_file_path(const wxString &path, const std::string &sub_file_path);
std::string initial_file_name(const wxString &path, const std::string file_name);
wxBoxSizer *create_export_config_item(wxWindow *parent);
wxBoxSizer *create_button_item(wxWindow *parent);
wxWindow *create_dialog_buttons(wxWindow *parent);
wxBoxSizer *create_select_printer(wxWindow *parent);
wxBoxSizer *create_radio_item(wxString title, wxWindow *parent, wxString tooltip, std::vector<std::pair<RadioBox *, wxString>> &radiobox_list);
int initial_zip_archive(mz_zip_archive &zip_archive, const std::string &file_path);
@@ -292,8 +285,6 @@ private:
wxScrolledWindow * m_scrolled_preset_window = nullptr;
wxGridSizer * m_preset_sizer = nullptr;
wxPanel * m_presets_window = nullptr;
Button * m_button_ok = nullptr;
Button * m_button_cancel = nullptr;
wxStaticText * m_serial_text = nullptr;
};
@@ -308,7 +299,7 @@ private:
void get_visible_printer_and_compatible_filament_presets();
wxBoxSizer *create_selected_printer_preset_sizer();
wxBoxSizer *create_selected_filament_preset_sizer();
wxBoxSizer *create_button_sizer();
wxWindow *create_dialog_buttons();
private:
std::string m_filament_id;
@@ -318,11 +309,8 @@ private:
std::shared_ptr<PresetBundle> m_preset_bundle;
ComboBox * m_selected_printer = nullptr;
ComboBox * m_selected_filament = nullptr;
Button * m_ok_btn = nullptr;
Button * m_cancel_btn = nullptr;
std::unordered_map<wxString, std::shared_ptr<Preset>> filament_choice_to_filament_preset;
std::unordered_map<std::string, std::vector<std::shared_ptr<Preset>>> m_printer_compatible_filament_presets; // need be used when add presets
};
class EditFilamentPresetDialog;
@@ -370,7 +358,7 @@ private:
wxBoxSizer *create_filament_basic_info();
wxBoxSizer *create_add_filament_btn();
wxBoxSizer *create_preset_tree_sizer();
wxBoxSizer *create_button_sizer();
wxWindow *create_dialog_buttons();
private:
PresetTree * m_preset_tree_creater = nullptr;
@@ -380,8 +368,6 @@ private:
std::string m_filament_type;
std::string m_filament_serial;
Button * m_add_filament_btn = nullptr;
Button * m_del_filament_btn = nullptr;
Button * m_ok_btn = nullptr;
wxBoxSizer * m_preset_tree_sizer = nullptr;
wxPanel * m_preset_tree_panel = nullptr;
wxScrolledWindow * m_preset_tree_window = nullptr;

View File

@@ -20,6 +20,8 @@
#include "MsgDialog.hpp"
#include "Plater.hpp"
#include "Widgets/DialogButtons.hpp"
#include "libslic3r/PlaceholderParser.hpp"
#include "libslic3r/Preset.hpp"
#include "libslic3r/Print.hpp"
@@ -98,10 +100,7 @@ EditGCodeDialog::EditGCodeDialog(wxWindow* parent, const std::string& key, const
m_param_description = new wxStaticText(this, wxID_ANY, wxEmptyString);
//Orca: use custom buttons
auto btn_sizer = create_btn_sizer(wxOK | wxCANCEL);
for(auto btn : m_button_list)
wxGetApp().UpdateDarkUI(btn.second);
auto dlg_btns = new DialogButtons(this, {"OK", "Cancel"});
wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
@@ -109,7 +108,7 @@ EditGCodeDialog::EditGCodeDialog(wxWindow* parent, const std::string& key, const
topSizer->Add(grid_sizer , 1, wxEXPAND | wxLEFT | wxTOP | wxRIGHT, border);
topSizer->Add(m_param_label , 0, wxEXPAND | wxLEFT | wxTOP | wxRIGHT, border);
topSizer->Add(m_param_description , 0, wxEXPAND | wxLEFT | wxTOP | wxRIGHT, border);
topSizer->Add(btn_sizer , 0, wxEXPAND | wxALL, border);
topSizer->Add(dlg_btns , 0, wxEXPAND);
SetSizer(topSizer);
topSizer->SetSizeHints(this);
@@ -417,20 +416,6 @@ void EditGCodeDialog::bind_list_and_button()
void EditGCodeDialog::on_dpi_changed(const wxRect&suggested_rect)
{
const int& em = em_unit();
//Orca: use custom buttons
for (auto button_item : m_button_list)
{
if (button_item.first == wxOK) {
button_item.second->SetMinSize(BTN_SIZE);
button_item.second->SetCornerRadius(FromDIP(12));
}
if (button_item.first == wxCANCEL) {
button_item.second->SetMinSize(BTN_SIZE);
button_item.second->SetCornerRadius(FromDIP(12));
}
}
const wxSize& size = wxSize(45 * em, 35 * em);
SetMinSize(size);
@@ -443,83 +428,6 @@ void EditGCodeDialog::on_sys_color_changed()
m_add_btn->msw_rescale();
}
//Orca
wxBoxSizer* EditGCodeDialog::create_btn_sizer(long flags)
{
auto btn_sizer = new wxBoxSizer(wxHORIZONTAL);
btn_sizer->AddStretchSpacer();
StateColor ok_btn_bg(
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)
);
StateColor ok_btn_bd(
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)
);
StateColor ok_btn_text(
std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Normal)
);
StateColor cancel_btn_bg(
std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal)
);
StateColor cancel_btn_bd_(
std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Normal)
);
StateColor cancel_btn_text(
std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Normal)
);
StateColor calc_btn_bg(
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)
);
StateColor calc_btn_bd(
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)
);
StateColor calc_btn_text(
std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Normal)
);
if (flags & wxOK) {
Button* ok_btn = new Button(this, _L("OK"));
ok_btn->SetMinSize(BTN_SIZE);
ok_btn->SetCornerRadius(FromDIP(12));
ok_btn->SetBackgroundColor(ok_btn_bg);
ok_btn->SetBorderColor(ok_btn_bd);
ok_btn->SetTextColor(ok_btn_text);
ok_btn->SetFocus();
ok_btn->SetId(wxID_OK);
btn_sizer->Add(ok_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, BTN_GAP);
m_button_list[wxOK] = ok_btn;
}
if (flags & wxCANCEL) {
Button* cancel_btn = new Button(this, _L("Cancel"));
cancel_btn->SetMinSize(BTN_SIZE);
cancel_btn->SetCornerRadius(FromDIP(12));
cancel_btn->SetBackgroundColor(cancel_btn_bg);
cancel_btn->SetBorderColor(cancel_btn_bd_);
cancel_btn->SetTextColor(cancel_btn_text);
cancel_btn->SetId(wxID_CANCEL);
btn_sizer->Add(cancel_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, BTN_GAP / 2);
m_button_list[wxCANCEL] = cancel_btn;
}
return btn_sizer;
}
const std::map<ParamType, std::string> ParamsInfo {
// Type BitmapName
{ ParamType::Scalar, "custom-gcode_single" },
@@ -762,6 +670,7 @@ wxDataViewItem ParamsModel::Delete(const wxDataViewItem& item)
ParamsNode* node = static_cast<ParamsNode*>(item.GetID());
if (!node) // happens if item.IsOk()==false
return ret_item;
const bool is_item_enabled = node->IsEnabled();
// first remove the node from the parent's array of children;
// NOTE: m_group_nodes is only a vector of _pointers_
@@ -792,8 +701,12 @@ wxDataViewItem ParamsModel::Delete(const wxDataViewItem& item)
ret_item = parent;
}
// notify control
ItemDeleted(parent, item);
// Orca: notify enabled item only, because disabled items have already been removed from UI,
// so attempt to notify it cases a crash.
if (is_item_enabled) {
// notify control
ItemDeleted(parent, item);
}
return ret_item;
}

View File

@@ -65,8 +65,6 @@ protected:
void on_sys_color_changed() override;
void selection_changed(wxDataViewEvent& evt);
wxBoxSizer* create_btn_sizer(long flags);
};

View File

@@ -8252,7 +8252,7 @@ void GLCanvas3D::_render_return_toolbar() const
ImVec4 tint_col = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
ImVec2 margin = ImVec2(10.0f, 5.0f);
if (ImGui::ImageTextButton(real_size,_utf8(L("return")).c_str(), m_return_toolbar.get_return_texture_id(), button_icon_size, uv0, uv1, -1, bg_col, tint_col, margin)) {
if (ImGui::ImageTextButton(real_size,_utf8(L("Return")).c_str(), m_return_toolbar.get_return_texture_id(), button_icon_size, uv0, uv1, -1, bg_col, tint_col, margin)) {
if (m_canvas != nullptr)
wxPostEvent(m_canvas, SimpleEvent(EVT_GLVIEWTOOLBAR_3D));
const_cast<GLGizmosManager*>(&m_gizmos)->reset_all_states();

View File

@@ -118,7 +118,7 @@ public:
wxEllipsizeMode ellipsizeMode = wxELLIPSIZE_END
) override
{ // ORCA draw custom text to improve consistency between platforms
dc.SetFont(Label::Body_13);
//dc.SetFont(win->GetFont()); Without SetFont it pulls font from window
dc.SetTextForeground(StateColor::darkModeColorFor(wxColour("#262E30"))); // use same color for selected / non-selected
dc.DrawText(text,wxPoint(rect.x, rect.y));
}

View File

@@ -18,6 +18,7 @@
#include <wx/debug.h>
#include <wx/settings.h>
#include <wx/dataview.h>
#include <wx/statbox.h>
#include <chrono>
@@ -496,6 +497,7 @@ int get_dpi_for_window(const wxWindow *window);
#ifdef __WXOSX__
void dataview_remove_insets(wxDataViewCtrl* dv);
void staticbox_remove_margin(wxStaticBox* sb);
#endif
#if defined(__WXOSX__) || defined(__linux__)

View File

@@ -15,6 +15,12 @@ void dataview_remove_insets(wxDataViewCtrl* dv) {
}
}
void staticbox_remove_margin(wxStaticBox* sb) {
NSBox* nativeBox = (NSBox*)sb->GetHandle();
[nativeBox setBoxType:NSBoxCustom];
[nativeBox setBorderWidth:0];
}
bool is_debugger_present()
// Returns true if the current process is being debugged (either
// running under the debugger or has a debugger attached post facto).

View File

@@ -7,6 +7,7 @@
#include "MsgDialog.hpp"
#include "format.hpp"
#include "Widgets/StaticLine.hpp"
#include "Widgets/LabeledStaticBox.hpp"
#include <utility>
#include <wx/bookctrl.h>
@@ -470,14 +471,11 @@ bool OptionsGroup::activate(std::function<void()> throw_if_canceled/* = [](){}*/
try {
if (staticbox) {
wxStaticBox * stb = new wxStaticBox(m_parent, wxID_ANY, _(title));
if (!wxOSX) stb->SetBackgroundStyle(wxBG_STYLE_PAINT);
stb->SetBackgroundColour(m_parent->GetBackgroundColour());
stb->SetFont(wxOSX ? wxGetApp().normal_font() : wxGetApp().bold_font());
wxGetApp().UpdateDarkUI(stb);
// BBS: new layout
sizer = new wxStaticBoxSizer(stb, wxVERTICAL);
// ORCA match style of wxStaticBox between platforms
LabeledStaticBox * stb = new LabeledStaticBox(m_parent, _(title));
//wxGetApp().UpdateDarkUI(stb);
this->stb = stb;
sizer = new wxStaticBoxSizer(stb, wxVERTICAL);
}
else {
// BBS: new layout

View File

@@ -19,6 +19,8 @@
#include "libslic3r/PrintConfig.hpp"
#include "libslic3r/PresetBundle.hpp"
#include "Widgets/DialogButtons.hpp"
#include "GUI.hpp"
#include "GUI_App.hpp"
#include "MainFrame.hpp"
@@ -94,20 +96,17 @@ PhysicalPrinterDialog::PhysicalPrinterDialog(wxWindow* parent) :
m_optgroup = new ConfigOptionsGroup(this, _L("Print Host upload"), m_config);
build_printhost_settings(m_optgroup);
wxStdDialogButtonSizer* btns = this->CreateStdDialogButtonSizer(wxOK | wxCANCEL);
btnOK = static_cast<wxButton*>(this->FindWindowById(wxID_OK, this));
wxGetApp().UpdateDarkUI(btnOK);
btnOK->Bind(wxEVT_BUTTON, &PhysicalPrinterDialog::OnOK, this);
auto dlg_btns = new DialogButtons(this, {"OK"});
wxGetApp().UpdateDarkUI(static_cast<wxButton*>(this->FindWindowById(wxID_CANCEL, this)));
(static_cast<wxButton*>(this->FindWindowById(wxID_CANCEL, this)))->Hide();
btnOK = dlg_btns->GetOK();
btnOK->Bind(wxEVT_BUTTON, &PhysicalPrinterDialog::OnOK, this);
wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
// topSizer->Add(label_top , 0, wxEXPAND | wxLEFT | wxTOP | wxRIGHT, BORDER_W);
topSizer->Add(input_sizer , 0, wxEXPAND | wxALL, BORDER_W);
topSizer->Add(m_optgroup->sizer , 1, wxEXPAND | wxLEFT | wxTOP | wxRIGHT, BORDER_W);
topSizer->Add(btns , 0, wxEXPAND | wxALL, BORDER_W);
topSizer->Add(dlg_btns, 0, wxEXPAND);
Bind(wxEVT_CLOSE_WINDOW, [this](auto& e) {this->EndModal(wxID_NO);});
@@ -736,8 +735,6 @@ void PhysicalPrinterDialog::on_dpi_changed(const wxRect& suggested_rect)
m_optgroup->msw_rescale();
msw_buttons_rescale(this, em, { wxID_OK, wxID_CANCEL });
const wxSize& size = wxSize(45 * em, 35 * em);
SetMinSize(size);

View File

@@ -38,7 +38,7 @@ class PhysicalPrinterDialog : public DPIDialog
RoundedRectangle* m_input_area {nullptr};
wxStaticText* m_valid_label {nullptr};
wxTextCtrl* m_input_ctrl {nullptr};
wxButton* btnOK {nullptr};
Button* btnOK {nullptr};
void build_printhost_settings(ConfigOptionsGroup* optgroup);
void OnOK(wxEvent& event);

View File

@@ -2056,17 +2056,17 @@ void TabPrint::build()
optgroup->append_single_option_line("seam_position", "quality_settings_seam");
optgroup->append_single_option_line("staggered_inner_seams", "quality_settings_seam");
optgroup->append_single_option_line("seam_gap","quality_settings_seam");
optgroup->append_single_option_line("seam_slope_type", "seam#scarf-joint-seam");
optgroup->append_single_option_line("seam_slope_conditional", "seam#scarf-joint-seam");
optgroup->append_single_option_line("scarf_angle_threshold", "seam#scarf-joint-seam");
optgroup->append_single_option_line("scarf_overhang_threshold", "seam#scarf-joint-seam");
optgroup->append_single_option_line("scarf_joint_speed", "seam#scarf-joint-seam");
optgroup->append_single_option_line("seam_slope_start_height", "seam#scarf-joint-seam");
optgroup->append_single_option_line("seam_slope_entire_loop", "seam#scarf-joint-seam");
optgroup->append_single_option_line("seam_slope_min_length", "seam#scarf-joint-seam");
optgroup->append_single_option_line("seam_slope_steps", "seam#scarf-joint-seam");
optgroup->append_single_option_line("scarf_joint_flow_ratio", "seam#scarf-joint-seam");
optgroup->append_single_option_line("seam_slope_inner_walls", "seam#scarf-joint-seam");
optgroup->append_single_option_line("seam_slope_type", "quality_settings_seam#scarf-joint-seam");
optgroup->append_single_option_line("seam_slope_conditional", "quality_settings_seam#scarf-joint-seam");
optgroup->append_single_option_line("scarf_angle_threshold", "quality_settings_seam#scarf-joint-seam");
optgroup->append_single_option_line("scarf_overhang_threshold", "quality_settings_seam#scarf-joint-seam");
optgroup->append_single_option_line("scarf_joint_speed", "quality_settings_seam#scarf-joint-seam");
optgroup->append_single_option_line("seam_slope_start_height", "quality_settings_seam#scarf-joint-seam");
optgroup->append_single_option_line("seam_slope_entire_loop", "quality_settings_seam#scarf-joint-seam");
optgroup->append_single_option_line("seam_slope_min_length", "quality_settings_seam#scarf-joint-seam");
optgroup->append_single_option_line("seam_slope_steps", "quality_settings_seam#scarf-joint-seam");
optgroup->append_single_option_line("scarf_joint_flow_ratio", "quality_settings_seam#scarf-joint-seam");
optgroup->append_single_option_line("seam_slope_inner_walls", "quality_settings_seam#scarf-joint-seam");
optgroup->append_single_option_line("role_based_wipe_speed","quality_settings_seam");
optgroup->append_single_option_line("wipe_speed", "quality_settings_seam");
optgroup->append_single_option_line("wipe_on_loops","quality_settings_seam");

View File

@@ -552,6 +552,8 @@ void WebViewPanel::OnNavigationRequest(wxWebViewEvent& evt)
#ifdef _WIN32
if (file.StartsWith('/'))
file = file.Mid(1);
else
file = "//" + file; // When file from network location
#endif
wxGetApp().plater()->load_files(wxArrayString{1, &file});
evt.Veto();

View File

@@ -0,0 +1,247 @@
#include "DialogButtons.hpp"
#include "slic3r/GUI/I18N.hpp"
namespace Slic3r { namespace GUI {
// ORCA standardize dialog buttons
DialogButtons::DialogButtons(wxWindow* parent, std::vector<wxString> non_translated_labels, const wxString& primary_btn_translated_label)
: wxWindow(parent, wxID_ANY)
{
m_parent = parent;
m_sizer = new wxBoxSizer(wxHORIZONTAL);
m_primary = primary_btn_translated_label;
m_alert = wxEmptyString;
SetBackgroundColour(StateColor::darkModeColorFor(wxColour("#FFFFFF")));
// Add all to array
for (wxString label : non_translated_labels) {
Button* btn = new Button(this, _L(label));
wxString l = label;
l.LowerCase();
auto f = m_standardIDs.find(l);
if (f != m_standardIDs.end())
btn->SetId(f->second);
m_buttons.push_back(btn);
}
m_parent->Bind(wxEVT_DPI_CHANGED, &DialogButtons::on_dpi_changed, this);
SetSizer(m_sizer);
UpdateButtons();
}
DialogButtons::~DialogButtons() {
m_parent->Unbind(wxEVT_DPI_CHANGED, &DialogButtons::on_dpi_changed, this);
}
void DialogButtons::on_dpi_changed(wxDPIChangedEvent& event) {
UpdateButtons();
event.Skip();
}
Button* DialogButtons::GetButtonFromID(wxStandardID id) {
for (Button* btn : m_buttons)
if (btn->GetId() == id)
return btn;
return nullptr;
}
Button* DialogButtons::GetButtonFromLabel(wxString translated_label) {
for (Button* btn : m_buttons)
if (btn->GetLabel() == translated_label)
return btn;
return nullptr;
}
Button* DialogButtons::PickFromList(std::set<wxStandardID> ID_list) {
// Picks first button from given list
Button* b;
for (auto itr : ID_list) {
b = GetButtonFromID(itr);
if (b != nullptr)
return b;
}
return nullptr;
}
// shorthands for common buttons
Button* DialogButtons::GetOK() {return GetButtonFromID(wxID_OK) ;}
Button* DialogButtons::GetYES() {return GetButtonFromID(wxID_YES) ;}
Button* DialogButtons::GetAPPLY() {return GetButtonFromID(wxID_APPLY) ;}
Button* DialogButtons::GetCONFIRM(){return GetButtonFromID(wxID_APPLY) ;}
Button* DialogButtons::GetNO() {return GetButtonFromID(wxID_NO) ;}
Button* DialogButtons::GetCANCEL() {return GetButtonFromID(wxID_CANCEL) ;}
Button* DialogButtons::GetBACK() {return GetButtonFromID(wxID_BACKWARD);}
Button* DialogButtons::GetFORWARD(){return GetButtonFromID(wxID_FORWARD) ;}
void DialogButtons::SetPrimaryButton(wxString translated_label) {
// use _L("Create") translated text for custom buttons
// use non existing button name to disable primary styled button
Button* btn;
if(translated_label.IsEmpty()){ // prefer standard primary buttons if label empty
if(m_buttons.size() == 1)
btn = m_buttons.front();
else
btn = PickFromList(m_primaryIDs);
}else
btn = GetButtonFromLabel(translated_label);
if(btn == nullptr) return;
m_primary = translated_label;
btn->SetFocus();
// we won't need color definations after button style management
StateColor clr_bg = StateColor(
std::pair(wxColour("#009688"), (int)StateColor::NotHovered),
std::pair(wxColour("#DFDFDF"), (int)StateColor::Disabled),
std::pair(wxColour("#009688"), (int)StateColor::Pressed),
std::pair(wxColour("#26A69A"), (int)StateColor::Hovered),
std::pair(wxColour("#009688"), (int)StateColor::Normal),
std::pair(wxColour("#009688"), (int)StateColor::Enabled)
);
btn->SetBackgroundColor(clr_bg);
StateColor clr_br = StateColor(
std::pair(wxColour("#009688"), (int)StateColor::NotFocused),
std::pair(wxColour("#26A69A"), (int)StateColor::Focused)
);
btn->SetBorderColor(clr_br);
StateColor clr_tx = StateColor(
std::pair(wxColour("#6B6A6A"), (int)StateColor::Disabled),
std::pair(wxColour("#FEFEFE"), (int)StateColor::Hovered),
std::pair(wxColour("#FEFEFE"), (int)StateColor::Normal)
);
btn->SetTextColor(clr_tx);
}
void DialogButtons::SetAlertButton(wxString translated_label) {
// use _L("Create") translated text for custom buttons
// use non existing button name to disable alert styled button
if(m_buttons.size() == 1)
return;
Button* btn;
if(translated_label.IsEmpty()){ // prefer standard alert buttons if label empty
btn = PickFromList(m_alertIDs);
}else
btn = GetButtonFromLabel(translated_label);
if(btn == nullptr) return;
m_alert = translated_label;
// we won't need color definations after button style management
StateColor clr_bg = StateColor(
std::pair(wxColour("#DFDFDF"), (int)StateColor::NotHovered),
std::pair(wxColour("#DFDFDF"), (int)StateColor::Disabled),
std::pair(wxColour("#DFDFDF"), (int)StateColor::Pressed),
std::pair(wxColour("#CD1F00"), (int)StateColor::Hovered),
std::pair(wxColour("#DFDFDF"), (int)StateColor::Normal),
std::pair(wxColour("#DFDFDF"), (int)StateColor::Enabled)
);
btn->SetBackgroundColor(clr_bg);
StateColor clr_br = StateColor(
std::pair(wxColour("#DFDFDF"), (int)StateColor::NotFocused),
std::pair(wxColour("#26A69A"), (int)StateColor::Focused)
);
btn->SetBorderColor(clr_br);
StateColor clr_tx = StateColor(
std::pair(wxColour("#CD1F00"), (int)StateColor::NotHovered),
std::pair(wxColour("#6B6A6A"), (int)StateColor::Disabled),
std::pair(wxColour("#CD1F00"), (int)StateColor::Pressed),
std::pair(wxColour("#FFFFFD"), (int)StateColor::Hovered),
std::pair(wxColour("#CD1F00"), (int)StateColor::Focused),
std::pair(wxColour("#CD1F00"), (int)StateColor::Normal)
);
btn->SetTextColor(clr_tx);
}
void DialogButtons::UpdateButtons() {
m_sizer->Clear();
SetBackgroundColour(StateColor::darkModeColorFor(wxColour("#FFFFFF")));
// we won't need color definations after button style management
StateColor clr_bg = StateColor(
std::pair(wxColour("#DFDFDF"), (int)StateColor::NotHovered),
std::pair(wxColour("#DFDFDF"), (int)StateColor::Disabled),
std::pair(wxColour("#DFDFDF"), (int)StateColor::Pressed),
std::pair(wxColour("#D4D4D4"), (int)StateColor::Hovered),
std::pair(wxColour("#DFDFDF"), (int)StateColor::Normal),
std::pair(wxColour("#DFDFDF"), (int)StateColor::Enabled)
);
StateColor clr_br = StateColor(
std::pair(wxColour("#DFDFDF"), (int)StateColor::NotFocused),
std::pair(wxColour("#26A69A"), (int)StateColor::Focused)
);
StateColor clr_tx = StateColor(
std::pair(wxColour("#6B6A6A"), (int)StateColor::Disabled),
std::pair(wxColour("#262E30"), (int)StateColor::Hovered),
std::pair(wxColour("#262E30"), (int)StateColor::Normal)
);
// Apply standard style to all
for (Button* btn : m_buttons) {
btn->SetFont(Label::Body_14);
btn->SetMinSize(wxSize(FromDIP(100),FromDIP(32)));
btn->SetPaddingSize(wxSize(FromDIP(12), FromDIP(8)));
btn->SetCornerRadius(FromDIP(4));
btn->SetBorderWidth(FromDIP(1));
btn->SetBackgroundColor(clr_bg);
btn->SetBorderColor(clr_br);
btn->SetTextColor(clr_tx);
btn->Bind(wxEVT_KEY_DOWN, &DialogButtons::on_keydown, this);
}
int btn_gap = FromDIP(10);
auto list = m_left_align_IDs;
auto on_left = [list](int id){
return list.find(wxStandardID(id)) != list.end();
};
for (Button* btn : m_buttons) // Left aligned
if(on_left(btn->GetId()))
m_sizer->Add(btn, 0, wxLEFT | wxTOP | wxBOTTOM | wxALIGN_CENTER_VERTICAL, btn_gap);
m_sizer->AddStretchSpacer();
for (Button* btn : m_buttons) // Right aligned
if(!on_left(btn->GetId()))
m_sizer->Add(btn, 0, wxRIGHT | wxTOP | wxBOTTOM | wxALIGN_CENTER_VERTICAL, btn_gap);
SetPrimaryButton(m_primary);
SetAlertButton(m_alert);
Layout();
Fit();
}
int DialogButtons::FromDIP(int d) {
return m_parent->FromDIP(d);
}
// This might be helpful for future use
// Append Button
// Prepend Button
void DialogButtons::on_keydown(wxKeyEvent& e) {
wxObject* current = e.GetEventObject();
int key = e.GetKeyCode();
int cnt = m_buttons.size();
if(cnt > 1){
int i = -1;
for (Button* btn : m_buttons){
i++;
if(btn->HasFocus())
break;
}
// possible issue if button hidden
if (key == WXK_LEFT) {m_buttons[i - 1 < 0 ? (cnt - 1) : i - 1]->SetFocus();}
else if (key == WXK_RIGHT) {m_buttons[i + 1 > (cnt - 1) ? 0 : i + 1]->SetFocus();}
}
e.Skip();
}
}} // namespace Slic3r::GUI

View File

@@ -0,0 +1,125 @@
#ifndef slic3r_GUI_DialogButtons_hpp_
#define slic3r_GUI_DialogButtons_hpp_
#include "wx/wx.h"
#include "wx/sizer.h"
#include "map"
#include "set"
#include "Button.hpp"
#include "Label.hpp"
#include "slic3r/GUI/GUI_App.hpp"
namespace Slic3r { namespace GUI {
class DialogButtons : public wxWindow{
public:
DialogButtons(wxWindow* parent, std::vector<wxString> non_translated_labels, const wxString& primary_btn_label = "");
wxBoxSizer* GetSizer() const { return m_sizer; }
Button* GetButtonFromID(wxStandardID id);
Button* GetButtonFromLabel(wxString label);
Button* GetOK();
Button* GetYES();
Button* GetAPPLY();
Button* GetCONFIRM();
Button* GetNO();
Button* GetCANCEL();
Button* GetBACK();
Button* GetFORWARD();
void SetPrimaryButton(wxString label);
void SetAlertButton(wxString label);
void UpdateButtons();
~DialogButtons();
private:
wxWindow* m_parent;
wxBoxSizer* m_sizer;
std::vector<Button*> m_buttons;
wxString m_primary;
wxString m_alert;
// missing ones Transfer / Update / Create
const std::map<wxString, wxStandardID> m_standardIDs = {
// Choice
{"ok" , wxID_OK},
{"yes" , wxID_YES},
{"apply" , wxID_APPLY},
{"confirm" , wxID_APPLY}, // no id for confirm, reusing wxID_APPLY
{"no" , wxID_NO},
{"cancel" , wxID_CANCEL},
// Action
{"open" , wxID_PRINT},
{"open" , wxID_OPEN},
{"add" , wxID_ADD},
{"copy" , wxID_COPY},
{"new" , wxID_NEW},
{"save" , wxID_SAVE},
{"save as" , wxID_SAVEAS},
{"refresh" , wxID_REFRESH},
{"retry" , wxID_RETRY},
{"ignore" , wxID_IGNORE},
{"help" , wxID_HELP},
{"clone" , wxID_DUPLICATE},
{"duplicate" , wxID_DUPLICATE},
{"select all" , wxID_SELECTALL},
{"replace" , wxID_REPLACE},
{"replace all", wxID_REPLACE_ALL},
// Navigation
{"back" , wxID_BACKWARD},
{"next" , wxID_FORWARD},
// Alert / Negative
{"remove" , wxID_REMOVE},
{"delete" , wxID_DELETE},
{"abort" , wxID_ABORT},
{"stop" , wxID_STOP},
{"reset" , wxID_RESET},
{"clear" , wxID_CLEAR},
{"exit" , wxID_EXIT},
{"quit" , wxID_EXIT}
};
std::set<wxStandardID> m_primaryIDs {
wxID_OK,
wxID_YES,
wxID_APPLY,
wxID_SAVE,
wxID_PRINT
};
std::set<wxStandardID> m_alertIDs {
wxID_REMOVE,
wxID_DELETE,
wxID_ABORT,
wxID_STOP,
wxID_RESET,
wxID_CLEAR,
wxID_EXIT
};
std::set<wxStandardID> m_left_align_IDs {
wxID_DELETE,
wxID_BACKWARD,
wxID_FORWARD
};
Button* PickFromList(std::set<wxStandardID> ID_list);
int FromDIP(int d);
void on_dpi_changed(wxDPIChangedEvent& event);
void on_keydown(wxKeyEvent& event);
};
}} // namespace Slic3r::GUI
#endif // !slic3r_GUI_DialogButtons_hpp_

View File

@@ -0,0 +1,181 @@
#include "LabeledStaticBox.hpp"
#include "libslic3r/Utils.hpp"
#include "../GUI.hpp"
#include "../GUI_Utils.hpp"
#include "Label.hpp"
/*
Fix label overflowing to inner frame
Fix use elypsis if text too long
setmin size
*/
LabeledStaticBox::LabeledStaticBox()
: state_handler(this)
{
m_radius = 3;
m_border_width = 1;
m_font = Label::Head_14;
text_color = StateColor(
std::make_pair(0x363636, (int) StateColor::Normal),
std::make_pair(0x6B6B6B, (int) StateColor::Disabled)
);
background_color = StateColor(
std::make_pair(0xFFFFFF, (int) StateColor::Normal),
std::make_pair(0xF0F0F1, (int) StateColor::Disabled)
);
border_color = StateColor(
std::make_pair(0xDBDBDB, (int) StateColor::Normal),
std::make_pair(0xDBDBDB, (int) StateColor::Disabled)
);
}
LabeledStaticBox::LabeledStaticBox(
wxWindow* parent,
const wxString& label,
const wxPoint& pos,
const wxSize& size,
long style
)
: LabeledStaticBox()
{
Create(parent, label, pos, size, style);
}
bool LabeledStaticBox::Create(
wxWindow* parent,
const wxString& label,
const wxPoint& pos,
const wxSize& size,
long style
)
{
if (style & wxBORDER_NONE)
m_border_width = 0;
wxStaticBox::Create(parent, wxID_ANY, label, pos, size, style);
#ifdef __WXOSX__
Slic3r::GUI::staticbox_remove_margin(this);
#endif
m_label = label;
m_scale = FromDIP(100) / 100.f;
m_pos = this->GetPosition();
int tW,tH,descent,externalLeading;
GetTextExtent("Yy", &tW, &tH, &descent, &externalLeading, &m_font);
m_label_height = tH - externalLeading;
GetTextExtent(m_label, &tW, &tH, &descent, &externalLeading, &m_font);
m_label_width = tW;
Bind(wxEVT_PAINT,([this](wxPaintEvent e) {
wxPaintDC dc(this);
PickDC(dc);
}));
state_handler.attach({&text_color, &background_color, &border_color});
state_handler.update_binds();
#ifndef __WXOSX__
SetBackgroundStyle(wxBG_STYLE_PAINT);
#endif
SetBackgroundColour(background_color.colorForStates(state_handler.states()));
SetForegroundColour( text_color.colorForStates(state_handler.states()));
SetBorderColor( border_color.colorForStates(state_handler.states()));
SetCanFocus(false);
return true;
}
void LabeledStaticBox::SetCornerRadius(int radius)
{
this->m_radius = radius;
Refresh();
}
void LabeledStaticBox::SetBorderWidth(int width)
{
this->m_border_width = width;
Refresh();
}
void LabeledStaticBox::SetBorderColor(StateColor const &color)
{
border_color = color;
state_handler.update_binds();
Refresh();
}
void LabeledStaticBox::SetFont(wxFont set_font)
{
m_font = set_font;
Refresh();
}
bool LabeledStaticBox::Enable(bool enable)
{
bool result = this->wxStaticBox::Enable(enable);
if (result) {
wxCommandEvent e(EVT_ENABLE_CHANGED);
e.SetEventObject(this);
GetEventHandler()->ProcessEvent(e);
this->SetForegroundColour( text_color.colorForStates(state_handler.states()));
this->SetBorderColor( border_color.colorForStates(state_handler.states()));
}
return result;
}
void LabeledStaticBox::PickDC(wxDC& dc)
{
#ifdef __WXMSW__
wxSize size = GetSize();
if (size.x <= 0 || size.y <= 0)
return;
wxMemoryDC memdc(&dc);
if (!memdc.IsOk()) {
DrawBorderAndLabel(dc);
return;
}
wxBitmap bmp(size.x, size.y);
memdc.SelectObject(bmp);
memdc.SetBackground(wxBrush(GetBackgroundColour()));
memdc.Clear();
{
wxGCDC dc2(memdc);
DrawBorderAndLabel(dc2);
}
memdc.SelectObject(wxNullBitmap);
dc.DrawBitmap(bmp, 0, 0);
#else
DrawBorderAndLabel(dc);
#endif
}
void LabeledStaticBox::DrawBorderAndLabel(wxDC& dc)
{
// fill full background
dc.SetBackground(wxBrush(background_color.colorForStates(0)));
dc.Clear();
wxSize wSz = GetSize();
dc.SetBrush(*wxTRANSPARENT_BRUSH);
dc.SetPen(wxPen(border_color.colorForStates(state_handler.states()), m_border_width, wxSOLID));
dc.DrawRoundedRectangle( // Border
std::max(0, m_pos.x),
std::max(0, m_pos.y) + m_label_height * .5,
wSz.GetWidth(),
wSz.GetHeight() - m_label_height * .5,
m_radius * m_scale
);
if (!m_label.IsEmpty()) {
dc.SetFont(m_font);
dc.SetPen(*wxTRANSPARENT_PEN);
dc.SetBrush(wxBrush(background_color.colorForStates(0)));
dc.DrawRectangle(wxRect(7 * m_scale,0 , m_label_width + 7 * m_scale, m_label_height)); // text background
// NEEDFIX if text lenght > client size
dc.SetTextForeground(text_color.colorForStates(state_handler.states()));
dc.DrawText(m_label, wxPoint(10 * m_scale, 0));
}
}

View File

@@ -0,0 +1,68 @@
#ifndef slic3r_GUI_LabeledStaticBox_hpp_
#define slic3r_GUI_LabeledStaticBox_hpp_
#include <wx/window.h>
#include <wx/dc.h>
#include <wx/dcgraph.h>
#include <wx/dcclient.h>
#include <wx/dcbuffer.h>
#include <wx/settings.h>
#include <wx/statbox.h>
#include <wx/pen.h>
#include "libslic3r/Utils.hpp"
#include "slic3r/GUI/wxExtensions.hpp"
#include "slic3r/GUI/Widgets/StateHandler.hpp"
class LabeledStaticBox : public wxStaticBox
{
public:
LabeledStaticBox();
LabeledStaticBox(
wxWindow* parent,
const wxString& label = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0
);
bool Create(
wxWindow* parent,
const wxString& label = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0
);
void SetCornerRadius(int radius);
void SetBorderWidth(int width);
void SetBorderColor(StateColor const &color);
void SetFont(wxFont set_font);
bool Enable(bool enable) override;
private:
void PickDC(wxDC& dc);
virtual void DrawBorderAndLabel(wxDC& dc);
protected:
StateHandler state_handler;
StateColor text_color;
StateColor border_color;
StateColor background_color;
int m_border_width;
int m_radius;
wxFont m_font;
wxString m_label;
int m_label_height;
int m_label_width;
float m_scale;
wxPoint m_pos;
};
#endif // !slic3r_GUI_LabeledStaticBox_hpp_

View File

@@ -0,0 +1,149 @@
#include "RadioGroup.hpp"
#include "Label.hpp"
#include "StateColor.hpp"
RadioGroup::RadioGroup(
wxWindow* parent,
const std::vector<wxString>& labels,
long direction,
int row_col_limit
)
: wxPanel(parent, wxID_ANY)
, m_on( this, "radio_on" , 18)
, m_off( this, "radio_off" , 18)
, m_on_hover( this, "radio_on_hover" , 18)
, m_off_hover(this, "radio_off_hover", 18)
, m_disabled( this, "radio_off_hover", 18)
, m_selectedIndex(0)
, m_focused(false)
{
Create(parent, labels, direction, row_col_limit);
}
void RadioGroup::Create(
wxWindow* parent,
const std::vector<wxString>& labels,
long direction, /* wxHORIZONTAL / wxVERTICAL */
int row_col_limit /* sets column/row count depends on direction. creates new row if wxHORIZONTAL used after limit reached */
)
{
m_labels = labels;
auto bg = parent->GetBackgroundColour();
this->SetBackgroundColour(bg);
auto bmp_size = m_on.GetBmpSize();
int item_count = m_labels.size();
int item_limit = row_col_limit < 0 ? 1 : row_col_limit > item_count ? item_count : row_col_limit;
int count = (int(item_count / item_limit) + (item_count % item_limit));
int rows = (direction & wxHORIZONTAL) ? item_limit : count;
int cols = (direction & wxHORIZONTAL) ? count : item_limit;
wxFlexGridSizer* f_sizer = new wxFlexGridSizer(rows, cols, 0, 0);
SetDoubleBuffered(true);
AcceptsFocusFromKeyboard();
Bind(wxEVT_SET_FOCUS ,([this](wxFocusEvent e) {m_focused = true ;Refresh(); e.Skip();}));
Bind(wxEVT_KILL_FOCUS,([this](wxFocusEvent e) {m_focused = false;Refresh(); e.Skip();}));
Bind(wxEVT_PAINT,([this](wxPaintEvent e) {
wxPaintDC dc(this);
dc.Clear();
dc.SetPen(wxPen(StateColor::darkModeColorFor(wxColour("#009688")), 1, wxPENSTYLE_SOLID));
dc.SetBrush(*wxTRANSPARENT_BRUSH);
dc.DrawRectangle(
m_focused ? wxRect(
m_radioButtons[GetSelection()]->GetRect().GetTopLeft() - wxPoint(1, 3),
m_labelButtons[GetSelection()]->GetRect().GetBottomRight() + wxPoint(4, 1)
) : wxRect(0,0,0,0)
);
if (m_focused) // Required to take focus again since Refresh causing lossing focus
SetFocus();
}));
// DPIDialog's uses wxEVT_CHAR_HOOK
Bind(wxEVT_CHAR_HOOK, ([this](wxKeyEvent&e){
int k = e.GetKeyCode();
bool is_next = (k == WXK_DOWN || k == WXK_RIGHT);
bool is_prev = (k == WXK_LEFT || k == WXK_UP);
if(m_focused){
if (is_next) SelectNext();
else if (is_prev) SelectPrevious();
e.Skip(!(is_next || is_prev));
}else{
e.Skip();
}
}));
for (int i = 0; i < item_count; ++i){
auto rb = new wxStaticBitmap(this, wxID_ANY, m_off.bmp(), wxDefaultPosition, wxDefaultSize, wxBU_LEFT | wxNO_BORDER);
m_radioButtons.push_back(rb);
rb->Bind(wxEVT_LEFT_DOWN ,([this, i](wxMouseEvent e) {OnClick(i) ; e.Skip();}));
rb->Bind(wxEVT_ENTER_WINDOW,([this, i](wxMouseEvent e) {SetRadioIcon(i, true) ; e.Skip();}));
rb->Bind(wxEVT_LEAVE_WINDOW,([this, i](wxMouseEvent e) {
// prevent removing hover effect while switching between button and its text
if(wxFindWindowAtPoint(wxGetMousePosition())->GetId() != m_labelButtons[i]->GetId())
SetRadioIcon(i, false);
e.Skip();
}));
auto tx = new wxStaticText(this, wxID_ANY, " " + m_labels[i], wxDefaultPosition, wxDefaultSize);
tx->SetForegroundColour(wxColour("#363636"));
tx->SetFont(Label::Body_14);
m_labelButtons.push_back(tx);
tx->Bind(wxEVT_LEFT_DOWN ,([this, i](wxMouseEvent e) {OnClick(i) ; e.Skip();}));
tx->Bind(wxEVT_ENTER_WINDOW,([this, i](wxMouseEvent e) {SetRadioIcon(i, true) ; e.Skip();}));
tx->Bind(wxEVT_LEAVE_WINDOW,([this, i](wxMouseEvent e) {
// prevent removing hover effect while switching between button and its text
if(wxFindWindowAtPoint(wxGetMousePosition())->GetId() != m_radioButtons[i]->GetId())
SetRadioIcon(i, false);
e.Skip();
}));
wxBoxSizer* radio_sizer = new wxBoxSizer(wxHORIZONTAL);
radio_sizer->Add(rb, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 1);
radio_sizer->Add(tx, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, this->FromDIP(15));
f_sizer->Add(radio_sizer, 0, wxTOP | wxBOTTOM, this->FromDIP(4));
}
SetSelection(m_selectedIndex);
SetSizer(f_sizer);
}
void RadioGroup::OnClick(int i)
{
m_focused = true; // prevents 2 time refresh
SetSelection(i);
}
void RadioGroup::SetSelection(int index)
{
if (index >= 0 && index < static_cast<int>(m_labels.size())){
m_selectedIndex = index;
for (size_t i = 0; i < m_labels.size(); ++i)
SetRadioIcon(i, HasFocus() && i == m_selectedIndex);
wxCommandEvent evt(wxEVT_COMMAND_RADIOBOX_SELECTED, GetId());
evt.SetInt(index);
evt.SetString(m_labels[index]);
GetEventHandler()->ProcessEvent(evt);
Refresh(); // refresh on every change
}
}
int RadioGroup::GetSelection()
{
return m_selectedIndex;
}
void RadioGroup::SelectNext(bool focus)
{
SetSelection(m_selectedIndex + 1 > (m_radioButtons.size() - 1) ? 0 : m_selectedIndex + 1);
}
void RadioGroup::SelectPrevious(bool focus)
{
SetSelection(m_selectedIndex - 1 < 0 ? (m_radioButtons.size() - 1) : m_selectedIndex - 1);
}
void RadioGroup::SetRadioIcon(int i, bool hover)
{
auto icon = m_selectedIndex == i ? (hover ? m_on_hover : m_on) : (hover ? m_off_hover : m_off);
m_radioButtons[i]->SetBitmap(icon.bmp());
}

View File

@@ -0,0 +1,63 @@
#ifndef slic3r_GUI_RADIOGROUP_hpp_
#define slic3r_GUI_RADIOGROUP_hpp_
#include "../wxExtensions.hpp"
#include <wx/wx.h>
#include <wx/dcclient.h>
#include <wx/dcgraph.h>
#include <vector>
#include <string>
class RadioGroup : public wxPanel
{
public:
RadioGroup();
RadioGroup(
wxWindow* parent,
const std::vector<wxString>& labels = {"1", "2", "3"},
long direction = wxHORIZONTAL,
int row_col_limit = -1
);
void Create(
wxWindow* parent,
const std::vector<wxString>& labels = {"1", "2", "3"},
long direction = wxHORIZONTAL,
int row_col_limit = -1
);
int GetSelection();
void SetSelection(int index);
void SelectNext(bool focus = true);
void SelectPrevious(bool focus = true);
private:
std::vector<wxString> m_labels;
std::vector<wxStaticBitmap*> m_radioButtons;
std::vector<wxStaticText*> m_labelButtons;
int m_selectedIndex;
bool m_focused;
ScalableBitmap m_on;
ScalableBitmap m_off;
ScalableBitmap m_on_hover;
ScalableBitmap m_off_hover;
ScalableBitmap m_disabled;
void OnClick(int i);
void UpdateFocus(bool focus);
void SetRadioIcon(int i, bool hover);
void OnKeyDown(wxKeyEvent& e);
};
#endif // !slic3r_GUI_RADIOGROUP_hpp_

File diff suppressed because it is too large Load Diff

View File

@@ -3,13 +3,14 @@
#include "wxExtensions.hpp"
#include "GUI_Utils.hpp"
#include "Widgets/RadioBox.hpp"
#include "Widgets/Button.hpp"
#include "Widgets/RoundedRectangle.hpp"
#include "Widgets/Label.hpp"
#include "Widgets/CheckBox.hpp"
#include "Widgets/ComboBox.hpp"
#include "Widgets/TextInput.hpp"
#include "Widgets/LabeledStaticBox.hpp"
#include "Widgets/RadioGroup.hpp"
#include "GUI_App.hpp"
#include "wx/hyperlink.h"
#include <wx/radiobox.h>
@@ -35,15 +36,14 @@ protected:
Calib_Params m_params;
wxRadioBox* m_rbExtruderType;
wxRadioBox* m_rbMethod;
RadioGroup* m_rbExtruderType;
RadioGroup* m_rbMethod;
TextInput* m_tiStartPA;
TextInput* m_tiEndPA;
TextInput* m_tiPAStep;
CheckBox* m_cbPrintNum;
TextInput* m_tiBMAccels;
TextInput* m_tiBMSpeeds;
Button* m_btnStart;
Plater* m_plater;
};
@@ -61,11 +61,10 @@ protected:
virtual void on_filament_type_changed(wxCommandEvent& event);
Calib_Params m_params;
wxRadioBox* m_rbFilamentType;
RadioGroup* m_rbFilamentType;
TextInput* m_tiStart;
TextInput* m_tiEnd;
TextInput* m_tiStep;
Button* m_btnStart;
Plater* m_plater;
};
@@ -84,7 +83,6 @@ protected:
TextInput* m_tiStart;
TextInput* m_tiEnd;
TextInput* m_tiStep;
Button* m_btnStart;
Plater* m_plater;
};
@@ -101,7 +99,6 @@ protected:
TextInput* m_tiStart;
TextInput* m_tiEnd;
TextInput* m_tiStep;
Button* m_btnStart;
Plater* m_plater;
};
@@ -121,7 +118,6 @@ protected:
TextInput* m_tiStart;
TextInput* m_tiEnd;
TextInput* m_tiStep;
Button* m_btnStart;
Plater* m_plater;
};
@@ -137,13 +133,12 @@ protected:
virtual void on_start(wxCommandEvent& event);
Calib_Params m_params;
wxRadioBox* m_rbModel;
RadioGroup* m_rbModel;
TextInput* m_tiFreqStartX;
TextInput* m_tiFreqEndX;
TextInput* m_tiFreqStartY;
TextInput* m_tiFreqEndY;
TextInput* m_tiDampingFactor;
Button* m_btnStart;
Plater* m_plater;
};
@@ -159,12 +154,11 @@ protected:
virtual void on_start(wxCommandEvent& event);
Calib_Params m_params;
wxRadioBox* m_rbModel;
RadioGroup* m_rbModel;
TextInput* m_tiFreqX;
TextInput* m_tiFreqY;
TextInput* m_tiDampingFactorStart;
TextInput* m_tiDampingFactorEnd;
Button* m_btnStart;
Plater* m_plater;
};
@@ -179,10 +173,9 @@ protected:
virtual void on_start(wxCommandEvent& event);
Calib_Params m_params;
wxRadioBox* m_rbModel;
RadioGroup* m_rbModel;
TextInput* m_tiJDStart;
TextInput* m_tiJDEnd;
Button* m_btnStart;
Plater* m_plater;
};
}} // namespace Slic3r::GUI