From 1e4b48c54833086b9f68f1914fb621b30165a1e2 Mon Sep 17 00:00:00 2001 From: Kris Austin Date: Wed, 26 Aug 2026 05:38:52 -0500 Subject: [PATCH 1/4] build: clear 227 warnings - dead private fields, malformed comments (#15376) build: drop dead private fields, close malformed comments (227 warnings) Clears 227 of the clang-cl warnings tracked in #15374, taking a full Windows build from 1,491 to 1,264. Five of the six changes are in headers, which are re-diagnosed in every translation unit that includes them, so the count is large for a 14-line diff. Tabbook.hpp: delete two private fields, unread since the 2022 import. m_parent also shadowed wxWindowBase::m_parent. GUI_Utils.hpp: the wxEVT_SYS_COLOUR_CHANGED lambda body is empty on Windows, so its `this` capture is unused there. (void) this; leaves the handler bound, which is what stops the event propagating. DevFirmware.h: mark m_owner [[maybe_unused]]. The class is never instantiated, and the file tracks BambuStudio, so this is the smallest divergence. Eight DeviceTab/ files, AMSItem.cpp and SelectMachine.cpp: block comments malformed so that they read as a nested /*. No behavior change. -Wcomment goes to zero, and only the three intended categories move. --- src/slic3r/GUI/DeviceCore/DevFirmware.h | 2 +- src/slic3r/GUI/DeviceTab/uiAMSBestPositionPopup.cpp | 2 +- src/slic3r/GUI/DeviceTab/uiAMSBestPositionPopup.hpp | 2 +- src/slic3r/GUI/DeviceTab/wgtDeviceNozzleRack.cpp | 2 +- src/slic3r/GUI/DeviceTab/wgtDeviceNozzleRack.h | 2 +- src/slic3r/GUI/DeviceTab/wgtDeviceNozzleRackUpdate.cpp | 2 +- src/slic3r/GUI/DeviceTab/wgtDeviceNozzleRackUpdate.h | 2 +- src/slic3r/GUI/DeviceTab/wgtDeviceNozzleSelect.cpp | 2 +- src/slic3r/GUI/DeviceTab/wgtDeviceNozzleSelect.h | 2 +- src/slic3r/GUI/GUI_Utils.hpp | 3 +++ src/slic3r/GUI/SelectMachine.cpp | 2 +- src/slic3r/GUI/Tabbook.hpp | 3 --- src/slic3r/GUI/Widgets/AMSItem.cpp | 3 --- 13 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/slic3r/GUI/DeviceCore/DevFirmware.h b/src/slic3r/GUI/DeviceCore/DevFirmware.h index 9dae603702..5b0ea986a2 100644 --- a/src/slic3r/GUI/DeviceCore/DevFirmware.h +++ b/src/slic3r/GUI/DeviceCore/DevFirmware.h @@ -64,7 +64,7 @@ public: DevFirmware(MachineObject* obj) : m_owner(obj) {} private: - MachineObject* m_owner = nullptr; + [[maybe_unused]] MachineObject* m_owner = nullptr; }; } // namespace Slic3r \ No newline at end of file diff --git a/src/slic3r/GUI/DeviceTab/uiAMSBestPositionPopup.cpp b/src/slic3r/GUI/DeviceTab/uiAMSBestPositionPopup.cpp index 103584602f..a258a2178a 100644 --- a/src/slic3r/GUI/DeviceTab/uiAMSBestPositionPopup.cpp +++ b/src/slic3r/GUI/DeviceTab/uiAMSBestPositionPopup.cpp @@ -2,7 +2,7 @@ /* File: uiAMSBestPositionPopup.hpp * Description: The popup with suggest best ams position * -//**********************************************************/ +************************************************************/ #include "uiAMSBestPositionPopup.hpp" diff --git a/src/slic3r/GUI/DeviceTab/uiAMSBestPositionPopup.hpp b/src/slic3r/GUI/DeviceTab/uiAMSBestPositionPopup.hpp index 427a5c6a73..18dd3c4301 100644 --- a/src/slic3r/GUI/DeviceTab/uiAMSBestPositionPopup.hpp +++ b/src/slic3r/GUI/DeviceTab/uiAMSBestPositionPopup.hpp @@ -2,7 +2,7 @@ /* File: uiAMSBestPositionPopup.hpp * Description: The popup with suggest best ams position * -//**********************************************************/ +************************************************************/ #pragma once #include "slic3r/GUI/Widgets/AMSItem.hpp" diff --git a/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleRack.cpp b/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleRack.cpp index a62277a858..1e40a71150 100644 --- a/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleRack.cpp +++ b/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleRack.cpp @@ -6,7 +6,7 @@ * \n class wgtDeviceNozzleRackNozzleItem; * \n class wgtDeviceNozzleRackToolHead; * \n class wgtDeviceNozzleRackPos; -//**********************************************************/ +************************************************************/ #include "wgtDeviceNozzleRack.h" #include "wgtDeviceNozzleRackUpdate.h" diff --git a/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleRack.h b/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleRack.h index fe12b8bc50..385fa6be48 100644 --- a/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleRack.h +++ b/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleRack.h @@ -6,7 +6,7 @@ * \n class wgtDeviceNozzleRackNozzleItem; * \n class wgtDeviceNozzleRackToolHead; * \n class wgtDeviceNozzleRackPos; -//**********************************************************/ +************************************************************/ #pragma once #include "slic3r/GUI/DeviceCore/DevNozzleRack.h" diff --git a/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleRackUpdate.cpp b/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleRackUpdate.cpp index 2750ad6323..fac14e31d9 100644 --- a/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleRackUpdate.cpp +++ b/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleRackUpdate.cpp @@ -3,7 +3,7 @@ * Description: The panel with rack updating * * \n class wgtDeviceNozzleRackUpdate -//**********************************************************/ +************************************************************/ #include "wgtDeviceNozzleRackUpdate.h" diff --git a/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleRackUpdate.h b/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleRackUpdate.h index 0fa07fd63a..8275638831 100644 --- a/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleRackUpdate.h +++ b/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleRackUpdate.h @@ -3,7 +3,7 @@ * Description: The panel for updating hotends * * \n class wgtDeviceNozzleRackUpdate -//**********************************************************/ +************************************************************/ #pragma once #include "slic3r/GUI/DeviceCore/DevNozzleRack.h" diff --git a/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleSelect.cpp b/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleSelect.cpp index 0d61cfd144..c383815f8c 100644 --- a/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleSelect.cpp +++ b/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleSelect.cpp @@ -3,7 +3,7 @@ * Description: The panel to select nozzle * * \n class wgtDeviceNozzleSelect; -//**********************************************************/ +************************************************************/ #include "wgtDeviceNozzleSelect.h" #include "wgtDeviceNozzleRack.h" diff --git a/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleSelect.h b/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleSelect.h index 3ff866f3a1..729d24a03d 100644 --- a/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleSelect.h +++ b/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleSelect.h @@ -3,7 +3,7 @@ * Description: The panel to select nozzle * * \n class wgtDeviceNozzleSelect; -//**********************************************************/ +************************************************************/ #pragma once diff --git a/src/slic3r/GUI/GUI_Utils.hpp b/src/slic3r/GUI/GUI_Utils.hpp index c93c40b066..85790516ee 100644 --- a/src/slic3r/GUI/GUI_Utils.hpp +++ b/src/slic3r/GUI/GUI_Utils.hpp @@ -155,6 +155,9 @@ public: update_dark_config(); on_sys_color_changed(); event.Skip(); +#else + // Not calling Skip() is what stops the event propagating on Windows. + (void) this; #endif // __WINDOWS__ }); diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index 486be04243..2411967b0d 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -2847,7 +2847,7 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event) }); // STUDIO-9580 - /* use warning color if there are warning and normal messages* / + /* use warning color if there are warning and normal messages*/ /* use indexes if there are several messages*/ /* add header and ending if there are several messages or has none block warnings*/ if (confirm_text.size() > 1 || !is_printing_block) diff --git a/src/slic3r/GUI/Tabbook.hpp b/src/slic3r/GUI/Tabbook.hpp index 87fd215327..b1301a5c23 100644 --- a/src/slic3r/GUI/Tabbook.hpp +++ b/src/slic3r/GUI/Tabbook.hpp @@ -36,7 +36,6 @@ public: TabButton* pageButton; private: - wxWindow* m_parent; wxFlexGridSizer* m_buttons_sizer; wxBoxSizer* m_sizer; ScalableBitmap m_arrow_img; @@ -400,8 +399,6 @@ private: unsigned m_showTimeout, m_hideTimeout; - TabButtonsListCtrl *m_ctrl{nullptr}; - }; //#endif // _WIN32 #endif // slic3r_Tabbook_hpp_ diff --git a/src/slic3r/GUI/Widgets/AMSItem.cpp b/src/slic3r/GUI/Widgets/AMSItem.cpp index b6f335b580..27241450cb 100644 --- a/src/slic3r/GUI/Widgets/AMSItem.cpp +++ b/src/slic3r/GUI/Widgets/AMSItem.cpp @@ -2083,9 +2083,6 @@ void AMSRoad::OnPassRoad(std::vector prord_list) } } -/* - - /************************************************* Description:AMSRoadUpPart **************************************************/ From 9dc9b4247520b8fe016738955ead7b9406dddcc3 Mon Sep 17 00:00:00 2001 From: Ian Bassi Date: Wed, 26 Aug 2026 07:39:23 -0300 Subject: [PATCH 2/4] Pass closure state to fuzzy skin (#15378) Update perimeter traversal to pass each extrusion's closed/open state into `apply_fuzzy_skin`. This lets fuzzy skin logic distinguish contours from closed loops when processing perimeters. Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com> --- src/libslic3r/PerimeterGenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libslic3r/PerimeterGenerator.cpp b/src/libslic3r/PerimeterGenerator.cpp index 659a3a7038..9037118f0c 100644 --- a/src/libslic3r/PerimeterGenerator.cpp +++ b/src/libslic3r/PerimeterGenerator.cpp @@ -408,7 +408,7 @@ static ExtrusionEntityCollection traverse_extrusions(const PerimeterGenerator& p ExtrusionRole role = is_external ? erExternalPerimeter : erPerimeter; const bool is_contour = !extrusion->is_closed || pg_extrusion.is_contour; - apply_fuzzy_skin(extrusion, perimeter_generator, is_contour); + apply_fuzzy_skin(extrusion, perimeter_generator, is_contour, extrusion->is_closed); ExtrusionPaths paths; // detect overhanging/bridging perimeters From 5552ed6cf1383a58321b2196317fe0c69a78b1a6 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Wed, 26 Aug 2026 19:06:33 +0800 Subject: [PATCH 3/4] Keep mixed-color filaments intact when the extruder count changes (#15385) * Keep mixed-color filaments intact when the extruder count changes The extruder-count spinner resized the filament arrays in bulk at the tail, which is where mixed-color slots live, so a new filament landed behind the mix and the sidebar skipped a slot number. It now adds and removes one slot at a time through the same calls the sidebar's +/- buttons use, so a new slot opens ahead of the mixed tail and a removal renumbers object filament ids, painted facets, custom g-code and mixed components rather than clamping them away. Drops the vector overload of set_num_filaments(), which this leaves without callers. --- src/libslic3r/PresetBundle.cpp | 84 ++------ src/libslic3r/PresetBundle.hpp | 7 +- src/slic3r/GUI/GUI_App.cpp | 14 +- src/slic3r/GUI/Plater.cpp | 11 +- src/slic3r/GUI/Tab.cpp | 32 +-- .../libslic3r/test_preset_bundle_loading.cpp | 186 ++++++++++++++++++ 6 files changed, 246 insertions(+), 88 deletions(-) diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp index f92bb354ee..53524887a9 100644 --- a/src/libslic3r/PresetBundle.cpp +++ b/src/libslic3r/PresetBundle.cpp @@ -3190,63 +3190,6 @@ void PresetBundle::export_selections(AppConfig &config) BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": printer %1%, print %2%, filaments[0] %3% ")%printers.get_selected_preset_name() % prints.get_selected_preset_name() %filament_presets[0]; } -// BBS -void PresetBundle::set_num_filaments(unsigned int n, std::vector new_colors) { - int old_filament_count = this->filament_presets.size(); - if (n > old_filament_count && old_filament_count != 0) - filament_presets.resize(n, filament_presets.back()); - else { - filament_presets.resize(n); - } - ConfigOptionStrings* filament_color = project_config.option("filament_colour"); - ConfigOptionStrings *filament_multi_color = project_config.option("filament_multi_colour"); - ConfigOptionStrings* filament_color_type = project_config.option("filament_colour_type"); - ConfigOptionInts* filament_map = project_config.option("filament_map"); - ConfigOptionInts* filament_nozzle_map = project_config.option("filament_nozzle_map"); - ConfigOptionInts* filament_volume_map = project_config.option("filament_volume_map"); - - filament_color->resize(n); - // Sync filament multi colour - filament_multi_color->values.resize(n); - for (size_t i = 0; i < n; i++) { - filament_multi_color->values[i] = filament_color->values[i]; - } - filament_color_type->resize(n); - filament_map->values.resize(n, 1); - filament_nozzle_map->values.resize(n, 0); - filament_volume_map->values.resize(n, static_cast(NozzleVolumeType::nvtStandard)); - ams_multi_color_filment.resize(n); - - // Mixed-color metadata is a parallel per-filament array set, so it has to grow and shrink - // with the filament count exactly like filament_colour above. - if (auto* opt = project_config.option("filament_is_mixed")) - opt->values.resize(n, false); - if (auto* opt = project_config.option("filament_mixed_components")) - opt->values.resize(n, std::string{}); - if (auto* opt = project_config.option("filament_mixed_sublayer_ratios")) - opt->values.resize(n, std::string{}); - if (auto* opt = project_config.option("filament_mixed_gradient")) - opt->values.resize(n, false); - if (auto* opt = project_config.option("filament_mixed_gradient_range")) - opt->values.resize(n, std::string{}); - if (auto* opt = project_config.option("filament_mixed_gradient_curve")) - opt->values.resize(n, std::string{}); - if (auto* opt = project_config.option("filament_mixed_gradient_per_part")) - opt->values.resize(n, false); - - // BBS set new filament color to new_color - if (old_filament_count < n) { - if (!new_colors.empty()) { - for (int i = old_filament_count; i < n; i++) { - filament_color->values[i] = new_colors[i - old_filament_count]; - filament_multi_color->values[i] = new_colors[i - old_filament_count]; - filament_color_type->values[i] = "1"; // default color type - } - } - } - - update_multi_material_filament_presets(); -} void PresetBundle::set_num_filaments(unsigned int n, std::string new_color) { unsigned old_filament_count = this->filament_presets.size(); @@ -3262,6 +3205,11 @@ void PresetBundle::set_num_filaments(unsigned int n, std::string new_color) ConfigOptionInts* filament_nozzle_map = project_config.option("filament_nozzle_map"); ConfigOptionInts* filament_volume_map = project_config.option("filament_volume_map"); + // Which slots are new is a fact about the arrays below, not about filament_presets: + // update_multi_material_filament_presets() tops that list up to the nozzle count on its own, + // so it can already sit at the new size while every array below is still at the old one. + const size_t old_slot_count = filament_color->values.size(); + filament_color->resize(n); // Sync filament multi colour filament_multi_color->values.resize(n); @@ -3292,13 +3240,11 @@ void PresetBundle::set_num_filaments(unsigned int n, std::string new_color) opt->values.resize(n, false); //BBS set new filament color to new_color - if (old_filament_count < n) { - if (!new_color.empty()) { - for (unsigned i = old_filament_count; i < n; i++) { - filament_color->values[i] = new_color; - filament_multi_color->values[i] = new_color; - filament_color_type->values[i] = "1"; // default color type - } + if (!new_color.empty()) { + for (size_t i = old_slot_count; i < n; i++) { + filament_color->values[i] = new_color; + filament_multi_color->values[i] = new_color; + filament_color_type->values[i] = "1"; // default color type } } @@ -3407,6 +3353,16 @@ size_t PresetBundle::num_mixed_filaments() const return opt == nullptr ? 0 : size_t(std::count(opt->values.begin(), opt->values.end(), true)); } +// Counted off the mixed flags, not filament_presets: that list is topped up to the nozzle count on +// its own, so it can sit a slot ahead of the arrays that describe slots. Unlike the sibling +// physical_filament_config_indices(), which bounds by filament_presets, this ignores that top-up. +size_t PresetBundle::num_physical_filaments() const +{ + const auto *opt = project_config.option("filament_is_mixed"); + return opt == nullptr ? filament_presets.size() + : size_t(std::count(opt->values.begin(), opt->values.end(), false)); +} + std::vector PresetBundle::physical_filament_config_indices() const { std::vector indices; diff --git a/src/libslic3r/PresetBundle.hpp b/src/libslic3r/PresetBundle.hpp index c3e7dd4441..6e7e07b26e 100644 --- a/src/libslic3r/PresetBundle.hpp +++ b/src/libslic3r/PresetBundle.hpp @@ -326,8 +326,9 @@ public: // Export selections (current print, current filaments, current printer) into config.ini void export_selections(AppConfig &config); - // BBS - void set_num_filaments(unsigned int n, std::vector new_colors); + // n is the total slot count, and growth appends at the raw tail - which is where the mixed + // slots live. A caller adding physical filaments has to add num_mixed_filaments() on top and + // then move the new slots ahead of the mixed tail, as Sidebar::add_custom_filament does. void set_num_filaments(unsigned int n, std::string new_col = ""); void update_num_filaments(unsigned int to_del_flament_id); @@ -503,6 +504,8 @@ public: // How many slots are mixed. They sit at the tail of the filament list and have no nozzle of // their own, so any resize driven by the printer's extruder count has to add this on top. size_t num_mixed_filaments() const; + // How many slots hold a real filament, i.e. everything ahead of the mixed tail. + size_t num_physical_filaments() const; void on_extruders_count_changed(int extruder_count); diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 738af5e24c..223829f435 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -8906,10 +8906,16 @@ void GUI_App::load_current_presets(bool active_preset_combox/*= false*/, bool ch auto* nozzle_diameter = edited_printer_preset.config.option("nozzle_diameter"); if (nozzle_diameter) { // Mixed-color slots are virtual filaments kept at the tail of the list, so they have no - // nozzle of their own. Sizing to the nozzle count alone would silently drop the mixes of - // a just-loaded project, and update_extruder_count() would then strip the facets painted - // with them. - preset_bundle->set_num_filaments(nozzle_diameter->values.size() + preset_bundle->num_mixed_filaments()); + // nozzle of their own and the count has to allow for them. Only ever grow: this sizes + // the list so the combo boxes have something to bind to, and set_num_filaments() trims + // at the raw tail, so shrinking here would eat the mixes rather than the surplus + // physical slots. A list longer than the nozzle count is a state the app reaches + // legitimately - raising the extruder count and not saving the printer preset leaves + // exactly that on the next start - and losing the project's mixes to it is worse than + // carrying a filament the printer has no nozzle for until the count is next changed. + const size_t target = nozzle_diameter->values.size() + preset_bundle->num_mixed_filaments(); + if (target > preset_bundle->filament_presets.size()) + preset_bundle->set_num_filaments(target); } } this->plater()->set_printer_technology(printer_technology); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 79ebd38716..7d3fc4307f 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -5506,12 +5506,15 @@ void Sidebar::add_custom_filament(wxColour new_col, const std::string& preset_na // Mixed-color slots are kept at the tail of the filament arrays, so a new physical // filament has to be inserted just after the last physical one rather than appended. - // total == every slot (physical + mixed); insert_pos == the physical slot count. - size_t total = wxGetApp().preset_bundle->filament_presets.size(); - size_t insert_pos = p->combos_filament.size(); + // Count off filament_is_mixed, not filament_presets or the combos: the extruder-count spinner + // reaches this before the sidebar has rebuilt, and update_multi_material_filament_presets() + // can have grown filament_presets alone. + auto *bundle = wxGetApp().preset_bundle; + size_t insert_pos = bundle->num_physical_filaments(); + size_t total = insert_pos + bundle->num_mixed_filaments(); int filament_count = (int)(total + 1); std::string new_color = new_col.GetAsString(wxC2S_HTML_SYNTAX).ToStdString(); - wxGetApp().preset_bundle->set_num_filaments(filament_count, new_color); + bundle->set_num_filaments(filament_count, new_color); // Maintain physical-first ordering: rotate the new slot from end to insert_pos. // No mixed slots -> insert_pos == total -> every rotate below is a no-op. diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index dc7ccb7284..ef5ff29af1 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2174,21 +2174,25 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) //Orca: sync filament num if it's a multi tool printer if (opt_key == "extruders_count" && !m_config->opt_bool("single_extruder_multi_material")){ - auto num_extruder = boost::any_cast(value); - int old_filament_size = wxGetApp().preset_bundle->filament_presets.size(); - std::vector new_colors; - for (int i = old_filament_size; i < num_extruder; ++i) { - wxColour new_col = Plater::get_next_color_for_filament(); - std::string new_color = new_col.GetAsString(wxC2S_HTML_SYNTAX).ToStdString(); - new_colors.push_back(new_color); + const size_t num_extruder = boost::any_cast(value); + auto *bundle = wxGetApp().preset_bundle; + Sidebar &sidebar = wxGetApp().plater()->sidebar(); + // A tool changer feeds filament N from nozzle N, so the extruder count sizes the physical + // run only; mixed slots are virtual and keep the tail. Go one slot at a time through the + // sidebar's own +/- calls: they insert ahead of the mixed tail and renumber filament ids, + // painted facets, custom g-code and mixed components, which a bulk resize clamps away. + // Both also refresh the print tab and export the selections, so nothing to do afterwards. + size_t physical = bundle->num_physical_filaments(); + while (physical != num_extruder) { + if (physical < num_extruder) + sidebar.add_custom_filament(Plater::get_next_color_for_filament()); + else + sidebar.delete_filament(physical - 1); // physical > num_extruder >= 1 + const size_t updated = bundle->num_physical_filaments(); + if (updated == physical) + break; // the call declined, e.g. the total slot limit - do not spin + physical = updated; } - // Mixed-color slots are virtual filaments at the tail of the list with no nozzle of their - // own, so they are carried on top of the new extruder count instead of being truncated. - const size_t total_filaments = num_extruder + wxGetApp().preset_bundle->num_mixed_filaments(); - wxGetApp().preset_bundle->set_num_filaments(total_filaments, new_colors); - wxGetApp().plater()->on_filament_count_change(total_filaments); - wxGetApp().get_tab(Preset::TYPE_PRINT)->update(); - wxGetApp().preset_bundle->export_selections(*wxGetApp().app_config); } //Orca: disable purge_in_prime_tower if single_extruder_multi_material is disabled diff --git a/tests/libslic3r/test_preset_bundle_loading.cpp b/tests/libslic3r/test_preset_bundle_loading.cpp index ea05ec0cf5..55c18bfa9e 100644 --- a/tests/libslic3r/test_preset_bundle_loading.cpp +++ b/tests/libslic3r/test_preset_bundle_loading.cpp @@ -704,3 +704,189 @@ TEST_CASE("Sizing the filament list to a multi-tool nozzle count keeps mixed slo CHECK(bundle.num_mixed_filaments() == 0); } } + +// The nozzle-count top-up in update_multi_material_filament_presets() grows filament_presets on +// its own, so a physical count derived from that list reports a slot no per-filament array has +// yet. That is what made the extruder-count handler conclude there was nothing to add and leave +// the new sidebar combo with no colour to draw. +TEST_CASE("The physical filament count is not fooled by a lone filament_presets top-up", "[Preset][Bundle][FilamentMixer]") +{ + PresetBundle bundle; + + SECTION("no mixed slots") { + bundle.set_num_filaments(4u, std::string("#FF0000")); + bundle.printers.get_edited_preset().config.option("nozzle_diameter", true)->values = + { 0.4, 0.4, 0.4, 0.4, 0.4 }; + bundle.update_multi_material_filament_presets(); + + REQUIRE(bundle.filament_presets.size() == 5); // the top-up moved this list on its own + REQUIRE(bundle.project_config.option("filament_colour")->values.size() == 4); + CHECK(bundle.num_physical_filaments() == 4); + } + + SECTION("behind a mixed tail") { + bundle.set_num_filaments(5u, std::string("#FF0000")); + bundle.project_config.option("filament_is_mixed")->values = + { false, false, false, false, true }; + bundle.printers.get_edited_preset().config.option("nozzle_diameter", true)->values = + { 0.4, 0.4, 0.4, 0.4, 0.4, 0.4 }; + bundle.update_multi_material_filament_presets(); + + REQUIRE(bundle.filament_presets.size() == 6); + REQUIRE(bundle.project_config.option("filament_colour")->values.size() == 5); + CHECK(bundle.num_physical_filaments() == 4); + CHECK(bundle.num_mixed_filaments() == 1); + } +} + +// Which slots are new is a fact about the per-filament arrays, not about filament_presets, for the +// same reason. Keyed off the wrong one, a freshly opened slot silently keeps filament 1's colour. +TEST_CASE("New filament colours are placed by array position", "[Preset][Bundle][FilamentMixer]") +{ + PresetBundle bundle; + bundle.set_num_filaments(4u, std::string("#FF0000")); + bundle.printers.get_edited_preset().config.option("nozzle_diameter", true)->values = + { 0.4, 0.4, 0.4, 0.4, 0.4 }; + bundle.update_multi_material_filament_presets(); + REQUIRE(bundle.filament_presets.size() == 5); + REQUIRE(bundle.project_config.option("filament_colour")->values.size() == 4); + + // The call Sidebar::add_custom_filament makes once the extruder count opens a slot. + bundle.set_num_filaments(5u, std::string("#00FF00")); + + const auto &colours = bundle.project_config.option("filament_colour")->values; + REQUIRE(colours.size() == 5); + CHECK(colours[4] == "#00FF00"); // not colours[0], which resize() would have padded with +} + +// The mixed-slot flags are written into the app config on exit and read back on the next start. +// If the read side loses them the slots survive as filaments but stop being mixes, so the project +// comes back with the mix showing as an ordinary physical filament. +TEST_CASE("A saved mix is still a mix after an app restart", "[Preset][Bundle][FilamentMixer]") +{ + AppConfig app_config; + + // Last session: a 4-tool project carrying one mix of filaments 2 and 3 at the tail. + { + PresetBundle bundle; + add_inmemory_preset(bundle.printers, "Test Printer"); + bundle.printers.select_preset_by_name("Test Printer", true); + add_inmemory_preset(bundle.filaments, "Test Filament"); + bundle.filaments.select_preset_by_name("Test Filament", true); + bundle.set_num_filaments(5u, std::string("#FF0000")); + bundle.filament_presets.assign(5, "Test Filament"); + bundle.project_config.option("filament_is_mixed")->values = + { false, false, false, false, true }; + bundle.project_config.option("filament_mixed_components")->values = + { "", "", "", "", "2,3" }; + bundle.export_selections(app_config); + + REQUIRE(app_config.get_printer_setting("Test Printer", "filament_is_mixed") == "0,0,0,0,1"); + } + + // This session. + PresetBundle bundle; + add_inmemory_preset(bundle.printers, "Test Printer"); + add_inmemory_preset(bundle.filaments, "Test Filament"); + bundle.load_selections(app_config); + + CHECK(bundle.filament_presets.size() == 5); + CHECK(bundle.num_mixed_filaments() == 1); + CHECK(bundle.is_mixed_filament(4)); + CHECK(bundle.project_config.option("filament_mixed_components")->values[4] == "2,3"); +} + +// The same restart, on the printer shape that actually shows the bug: a 4-tool changer whose +// saved filament list is one longer than its nozzle count, because the extra slot is the mix. +TEST_CASE("A saved mix survives a restart on a multi-tool printer", "[Preset][Bundle][FilamentMixer]") +{ + auto make_toolchanger = [](PresetBundle &bundle) -> Preset & { + Preset &p = add_inmemory_preset(bundle.printers, "Tool Changer"); + p.config.option("nozzle_diameter", true)->values = { 0.4, 0.4, 0.4, 0.4 }; + p.config.option("single_extruder_multi_material", true)->value = false; + return p; + }; + + AppConfig app_config; + { + PresetBundle bundle; + make_toolchanger(bundle); + bundle.printers.select_preset_by_name("Tool Changer", true); + add_inmemory_preset(bundle.filaments, "Test Filament"); + bundle.filaments.select_preset_by_name("Test Filament", true); + bundle.set_num_filaments(5u, std::string("#FF0000")); + bundle.filament_presets.assign(5, "Test Filament"); + bundle.project_config.option("filament_is_mixed")->values = + { false, false, false, false, true }; + bundle.project_config.option("filament_mixed_components")->values = + { "", "", "", "", "1,2" }; + bundle.export_selections(app_config); + REQUIRE(app_config.get_printer_setting("Tool Changer", "filament_is_mixed") == "0,0,0,0,1"); + } + + PresetBundle bundle; + make_toolchanger(bundle); + add_inmemory_preset(bundle.filaments, "Test Filament"); + bundle.load_selections(app_config); + + CHECK(bundle.filament_presets.size() == 5); + CHECK(bundle.num_mixed_filaments() == 1); + CHECK(bundle.is_mixed_filament(4)); + + SECTION("and through the GUI startup calls that follow it") { + // GUI_App::load_current_presets sizes the list for a non-SEMM printer, growing only. + const size_t target = 4u + bundle.num_mixed_filaments(); + if (target > bundle.filament_presets.size()) + bundle.set_num_filaments(target); + CHECK(bundle.num_mixed_filaments() == 1); + + // TabPrinter::extruders_count_changed. + bundle.on_extruders_count_changed(4); + CHECK(bundle.num_mixed_filaments() == 1); + + // Tab::select_preset re-reads the snapshot when remember_printer_config is on. + bundle.update_selections(app_config); + CHECK(bundle.filament_presets.size() == 5); + CHECK(bundle.num_mixed_filaments() == 1); + CHECK(bundle.is_mixed_filament(4)); + } +} + +// The startup sizing in GUI_App::load_current_presets targets the nozzle count plus the mixes. +// That is a floor, never a ceiling: set_num_filaments() trims at the raw tail, which is exactly +// where the mixes live, so applying the target to a longer list deletes them. A list longer than +// the target is reachable - raising the extruder count without saving the printer preset leaves +// the extra physical slot behind on the next start - so the startup sizing must only ever grow. +TEST_CASE("Sizing down to the nozzle count plus mixes is what eats the mixed tail", "[Preset][Bundle][FilamentMixer]") +{ + // 5 physical + 1 mix, on a printer preset still reporting 4 nozzles. + const size_t nozzle_count = 4; + PresetBundle bundle; + bundle.set_num_filaments(6u, std::string("#FF0000")); + bundle.project_config.option("filament_is_mixed")->values = + { false, false, false, false, false, true }; + bundle.project_config.option("filament_mixed_components")->values = + { "", "", "", "", "", "1,2" }; + REQUIRE(bundle.num_physical_filaments() == 5); + + const size_t target = nozzle_count + bundle.num_mixed_filaments(); + REQUIRE(target < bundle.filament_presets.size()); + + SECTION("applied as written, the mix is gone and every slot reads physical") { + bundle.set_num_filaments(target); + + CHECK(bundle.filament_presets.size() == target); + CHECK(bundle.num_mixed_filaments() == 0); + CHECK(bundle.num_physical_filaments() == target); + } + + SECTION("applied as a floor, the mix is left alone") { + if (target > bundle.filament_presets.size()) + bundle.set_num_filaments(target); + + CHECK(bundle.filament_presets.size() == 6); + CHECK(bundle.num_mixed_filaments() == 1); + CHECK(bundle.is_mixed_filament(5)); + CHECK(bundle.project_config.option("filament_mixed_components")->values[5] == "1,2"); + } +} From 142c63ab0e4a22c9be18d67752f9779d75c98bf5 Mon Sep 17 00:00:00 2001 From: Kris Austin Date: Wed, 26 Aug 2026 17:14:30 -0500 Subject: [PATCH 4/4] build: clear 143 -Woverloaded-virtual warnings in GUI widgets (#15377) --- .../GUI/CalibrationWizardPresetPage.cpp | 2 +- src/slic3r/GUI/Plater.cpp | 4 +-- src/slic3r/GUI/Widgets/AMSControl.cpp | 6 ++-- src/slic3r/GUI/Widgets/AMSItem.cpp | 35 ++++++++----------- src/slic3r/GUI/Widgets/AMSItem.hpp | 14 ++++---- src/slic3r/GUI/Widgets/ScrolledWindow.cpp | 11 ------ src/slic3r/GUI/Widgets/ScrolledWindow.hpp | 1 - 7 files changed, 28 insertions(+), 45 deletions(-) diff --git a/src/slic3r/GUI/CalibrationWizardPresetPage.cpp b/src/slic3r/GUI/CalibrationWizardPresetPage.cpp index db97354ad1..5267715439 100644 --- a/src/slic3r/GUI/CalibrationWizardPresetPage.cpp +++ b/src/slic3r/GUI/CalibrationWizardPresetPage.cpp @@ -1015,7 +1015,7 @@ wxBoxSizer* CalibrationPresetPage::create_ams_items_sizer(MachineObject* obj, wx auto ams_items_sizer = new wxBoxSizer(wxHORIZONTAL); for (auto &info : ams_info) { auto preview_ams_item = new AMSPreview(ams_preview_panel, wxID_ANY, info, info.ams_type); - preview_ams_item->Update(info); + preview_ams_item->UpdateInfo(info); preview_ams_item->Open(); ams_preview_list.push_back(preview_ams_item); std::string ams_id = preview_ams_item->get_ams_id(); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 7d3fc4307f..e1a98cdbf8 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1467,12 +1467,12 @@ void ExtruderGroup::update_ams() size_t left = 4; size_t index = 0; for (size_t i = i4; i < ams_n4 && left > 0; ++i, ++index, left -= 2) { - ams[index]->Update(i < ams_4.size() ? ams_4[i] : info4); + ams[index]->UpdateInfo(i < ams_4.size() ? ams_4[i] : info4); ams[index]->Refresh(); ams[index]->Open(); } for (size_t i = i1; i < ams_n1 && left > 0; ++i, ++index, --left) { - ams[index]->Update(i < ams_1.size() ? ams_1[i] : info1); + ams[index]->UpdateInfo(i < ams_1.size() ? ams_1[i] : info1); ams[index]->Refresh(); ams[index]->Open(); } diff --git a/src/slic3r/GUI/Widgets/AMSControl.cpp b/src/slic3r/GUI/Widgets/AMSControl.cpp index efcca12a05..41f14b6a11 100644 --- a/src/slic3r/GUI/Widgets/AMSControl.cpp +++ b/src/slic3r/GUI/Widgets/AMSControl.cpp @@ -984,7 +984,7 @@ void AMSControl::UpdateAms(const std::string &series_name, if (cans->get_ams_id() == std::to_string(VIRTUAL_TRAY_MAIN_ID) || cans->get_ams_id() == std::to_string(VIRTUAL_TRAY_DEPUTY_ID)) { for (auto ifo : m_ext_info) { if (ifo.ams_id == ams_id) { - cans->Update(ifo); + cans->UpdateInfo(ifo); cans->show_sn_value(m_ams_model == AMSModel::AMS_LITE ? false : true); } } @@ -992,7 +992,7 @@ void AMSControl::UpdateAms(const std::string &series_name, else{ for (auto ifo : m_ams_info) { if (ifo.ams_id == ams_id) { - cans->Update(ifo); + cans->UpdateInfo(ifo); cans->show_sn_value(m_ams_model == AMSModel::AMS_LITE ? false : true); } } @@ -1015,7 +1015,7 @@ void AMSControl::UpdateAms(const std::string &series_name, std::string id = ams_prv.second->get_ams_id(); auto item = m_ams_item_list.find(id); if (item != m_ams_item_list.end()) - { ams_prv.second->Update(item->second->get_ams_info()); + { ams_prv.second->UpdateInfo(item->second->get_ams_info()); } } } diff --git a/src/slic3r/GUI/Widgets/AMSItem.cpp b/src/slic3r/GUI/Widgets/AMSItem.cpp index 27241450cb..f99e5f49fd 100644 --- a/src/slic3r/GUI/Widgets/AMSItem.cpp +++ b/src/slic3r/GUI/Widgets/AMSItem.cpp @@ -325,7 +325,7 @@ AMSrefresh::AMSrefresh(wxWindow *parent, std::string ams_id, wxString can_id, Ca m_can_id = can_id.ToStdString(); create(parent, wxID_ANY, pos, size); - Update(ams_id, info); + UpdateInfo(ams_id, info); } AMSrefresh::AMSrefresh(wxWindow *parent, std::string ams_id, int can_id, Caninfo info, const wxPoint &pos, const wxSize &size) : AMSrefresh() @@ -333,7 +333,7 @@ AMSrefresh::AMSrefresh(wxWindow *parent, std::string ams_id, int can_id, Caninfo m_can_id = wxString::Format("%d", can_id).ToStdString(); create(parent, wxID_ANY, pos, size); - Update(ams_id, info); + UpdateInfo(ams_id, info); } AMSrefresh::~AMSrefresh() @@ -482,7 +482,7 @@ void AMSrefresh::paintEvent(wxPaintEvent &evt) dc.DrawText(m_refresh_id, pot); } -void AMSrefresh::Update(std::string ams_id, Caninfo info) +void AMSrefresh::UpdateInfo(std::string ams_id, Caninfo info) { if (m_ams_id == ams_id && m_info == info) { @@ -945,7 +945,7 @@ AMSLib::AMSLib(wxWindow *parent, std::string ams_idx, Caninfo info, AMSModelOrig Bind(wxEVT_LEAVE_WINDOW, &AMSLib::on_leave_window, this); Bind(wxEVT_LEFT_DOWN, &AMSLib::on_left_down, this); - Update(info, ams_idx, false); + UpdateInfo(info, ams_idx, false); } AMSLib::~AMSLib() @@ -1730,7 +1730,7 @@ void AMSLib::on_pass_road(bool pass) } } -void AMSLib::Update(Caninfo info, std::string ams_idx, bool refresh) +void AMSLib::UpdateInfo(Caninfo info, std::string ams_idx, bool refresh) { DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager(); if (!dev) return; @@ -1868,7 +1868,7 @@ AMSRoad::AMSRoad(wxWindow *parent, wxWindowID id, Caninfo info, int canindex, in void AMSRoad::create(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size) { wxWindow::Create(parent, id, pos, size); } -void AMSRoad::Update(AMSinfo amsinfo, Caninfo info, int canindex, int maxcan) +void AMSRoad::UpdateInfo(AMSinfo amsinfo, Caninfo info, int canindex, int maxcan) { m_amsinfo = amsinfo; m_info = info; @@ -2121,7 +2121,7 @@ void AMSRoadUpPart::create(wxWindow* parent, wxWindowID id, const wxPoint& pos, Refresh(); } -void AMSRoadUpPart::Update(AMSinfo amsinfo) +void AMSRoadUpPart::UpdateInfo(AMSinfo amsinfo) { if (m_amsinfo != amsinfo) { @@ -2613,7 +2613,7 @@ void AMSPreview::Close() Hide(); } -void AMSPreview::Update(AMSinfo amsinfo) +void AMSPreview::UpdateInfo(AMSinfo amsinfo) { if (m_amsinfo == amsinfo) { @@ -2951,7 +2951,7 @@ AMSHumidity::AMSHumidity(wxWindow* parent, wxWindowID id, AMSinfo info, const wx } }); - Update(info); + UpdateInfo(info); } void AMSHumidity::create(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size) { @@ -2960,7 +2960,7 @@ void AMSHumidity::create(wxWindow* parent, wxWindowID id, const wxPoint& pos, co } -void AMSHumidity::Update(AMSinfo amsinfo) +void AMSHumidity::UpdateInfo(AMSinfo amsinfo) { if (m_amsinfo != amsinfo) { @@ -3377,7 +3377,7 @@ void AmsItem::AddLiteCan(Caninfo caninfo, int canindex, wxGridSizer* sizer) //m_can_road_list[caninfo.can_id] = m_panel_road; } -void AmsItem::Update(AMSinfo info) +void AmsItem::UpdateInfo(AMSinfo info) { if (m_info == info) { @@ -3389,7 +3389,7 @@ void AmsItem::Update(AMSinfo info) if (m_humidity) { - m_humidity->Update(m_info); + m_humidity->UpdateInfo(m_info); } for (int i = 0; i < m_can_count; i++) { @@ -3398,7 +3398,7 @@ void AmsItem::Update(AMSinfo info) auto refresh = it->second; if (refresh != nullptr){ - refresh->Update(info.ams_id, info.cans[i]); + refresh->UpdateInfo(info.ams_id, info.cans[i]); refresh->Show(); } } @@ -3407,7 +3407,7 @@ void AmsItem::Update(AMSinfo info) AMSLib* lib = m_can_lib_list[std::to_string(i)]; if (lib != nullptr){ if (i < m_can_count){ - lib->Update(info.cans[i], info.ams_id); + lib->UpdateInfo(info.cans[i], info.ams_id); lib->Show(); } else{ @@ -3416,12 +3416,7 @@ void AmsItem::Update(AMSinfo info) } } if (m_panel_road != nullptr){ - m_panel_road->Update(m_info); - } - - if (true || m_ams_model == AMSModel::GENERIC_AMS) { - /*m_panel_road->Update(m_info, info.cans[0]); - m_panel_road->Show();*/ + m_panel_road->UpdateInfo(m_info); } Layout(); diff --git a/src/slic3r/GUI/Widgets/AMSItem.hpp b/src/slic3r/GUI/Widgets/AMSItem.hpp index bed57e7d39..d7dc26a741 100644 --- a/src/slic3r/GUI/Widgets/AMSItem.hpp +++ b/src/slic3r/GUI/Widgets/AMSItem.hpp @@ -312,7 +312,7 @@ public: ~AMSrefresh(); public: - void Update(std::string ams_id, Caninfo info); + void UpdateInfo(std::string ams_id, Caninfo info); std::string GetCanId() const { return m_info.can_id; }; @@ -492,7 +492,7 @@ public: AMSModel m_ams_model; AMSModelOriginType m_ext_type = { AMSModelOriginType::GENERIC_EXT }; - void Update(Caninfo info, std::string ams_idx, bool refresh = true); + void UpdateInfo(Caninfo info, std::string ams_idx, bool refresh = true); void UnableSelected() { m_unable_selected = true; }; void EableSelected() { m_unable_selected = false; }; void OnSelected(); @@ -581,7 +581,7 @@ public: double m_radius = {4}; wxColour m_road_def_color; wxColour m_road_color; - void Update(AMSinfo amsinfo, Caninfo info, int canindex, int maxcan); + void UpdateInfo(AMSinfo amsinfo, Caninfo info, int canindex, int maxcan); std::vector ams_humidity_img; @@ -614,7 +614,7 @@ public: void create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize); public: - void Update(AMSinfo amsinfo); + void UpdateInfo(AMSinfo amsinfo); void OnVamsLoading(bool load, wxColour col = AMS_CONTROL_GRAY500); void SetPassRoadColour(wxColour col); @@ -715,7 +715,7 @@ public: void Open(); void Close(); - void Update(AMSinfo amsinfo); + void UpdateInfo(AMSinfo amsinfo); void create(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size); void OnEnterWindow(wxMouseEvent &evt); void OnLeaveWindow(wxMouseEvent &evt); @@ -768,7 +768,7 @@ public: int m_canindex = { 0 }; bool m_selected = { false }; double m_radius = { 12 }; - void Update(AMSinfo amsinfo); + void UpdateInfo(AMSinfo amsinfo); std::vector ams_humidity_imgs; std::vector ams_humidity_dark_imgs; @@ -801,7 +801,7 @@ public: AmsItem(wxWindow *parent, AMSinfo info, AMSModel model, AMSPanelPos pos); ~AmsItem(); - void Update(AMSinfo info); + void UpdateInfo(AMSinfo info); void create(wxWindow *parent); void AddCan(Caninfo caninfo, int canindex, int maxcan, wxBoxSizer* sizer); void AddLiteCan(Caninfo caninfo, int canindex, wxGridSizer* sizer); diff --git a/src/slic3r/GUI/Widgets/ScrolledWindow.cpp b/src/slic3r/GUI/Widgets/ScrolledWindow.cpp index d570b9f764..6aa6f5b600 100644 --- a/src/slic3r/GUI/Widgets/ScrolledWindow.cpp +++ b/src/slic3r/GUI/Widgets/ScrolledWindow.cpp @@ -110,17 +110,6 @@ void ScrolledWindow::SetTipColor(wxColour color) if (m_bottomScrollbar) m_bottomScrollbar->SetTipColor(color); } -void ScrolledWindow::Refresh() -{ - // m_rightScrollbar->SetViewStart(0); - // m_rightScrollbar->Refresh(); - // m_rightScrollbar->Update(); - // m_userPanel->Refresh(); - // m_bottomScrollbar->SetViewStart(0); - // m_rightScrollbar->Refresh(); - // m_bottomScrollbar->Refresh(); -} - void ScrolledWindow::SetBackgroundColour(wxColour color) { wxWindow::SetBackgroundColour(color); diff --git a/src/slic3r/GUI/Widgets/ScrolledWindow.hpp b/src/slic3r/GUI/Widgets/ScrolledWindow.hpp index 56d54aade3..38409a19d4 100644 --- a/src/slic3r/GUI/Widgets/ScrolledWindow.hpp +++ b/src/slic3r/GUI/Widgets/ScrolledWindow.hpp @@ -15,7 +15,6 @@ public: ScrolledWindow(wxWindow *parent, wxWindowID id, wxPoint position, wxSize size, long style, int marginWidth = 0, int scrollbarWidth = 4, int tipLength = 0); void OnMouseWheel(wxMouseEvent &event); void SetTipColor(wxColour color); - void Refresh(); void SetBackgroundColour(wxColour color); void SetMarginColor(wxColour color);