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

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

Inheritance diagram for Slic3r::GUI::TabPresetComboBox:
Collaboration diagram for Slic3r::GUI::TabPresetComboBox:

Public Types

enum  LabelItemType : std::size_t {
  LABEL_ITEM_PHYSICAL_PRINTER = 0xffffff01 , LABEL_ITEM_PRINTER_MODELS , LABEL_ITEM_DISABLED , LABEL_ITEM_MARKER ,
  LABEL_ITEM_PHYSICAL_PRINTERS , LABEL_ITEM_WIZARD_PRINTERS , LABEL_ITEM_WIZARD_FILAMENTS , LABEL_ITEM_WIZARD_MATERIALS ,
  LABEL_ITEM_WIZARD_ADD_PRINTERS , LABEL_ITEM_MAX
}
enum  FilamentAMSType : unsigned int { ORIGINAL , FROM_AMS }

Public Member Functions

 TabPresetComboBox (wxWindow *parent, Preset::Type preset_type)
 ~TabPresetComboBox ()
void set_show_incompatible_presets (bool show_incompatible_presets)
wxString get_preset_name (const Preset &preset) override
void update () override
void update_dirty ()
void msw_rescale () override
void OnSelect (wxCommandEvent &evt) override
void set_enable_all (bool enable=true)
PresetCollection * presets () const
Preset::Type type () const
void set_label_marker (int item, LabelItemType label_item_type=LABEL_ITEM_MARKER)
bool set_printer_technology (PrinterTechnology pt)
void set_selection_changed_function (std::function< void(int)> sel_changed)
bool is_selected_physical_printer ()
bool is_selected_printer_model ()
bool selection_is_changed_according_to_physical_printers ()
void update (std::string select_preset)
void update_from_bundle ()
void add_connected_printers (std::string selected, bool alias_name=false)
int selected_connected_printer () const
bool add_ams_filaments (std::string selected, bool alias_name=false)
int selected_ams_filament () const
void set_filament_idx (const int extr_idx)
int get_filament_idx () const
std::string get_selected_dev_id () const
void clear_selected_dev_id ()
wxString get_tooltip (const Preset &preset)
wxString get_preset_item_name (unsigned int index)
Preset::Type get_type ()
void show_all (bool show_all)
virtual void sys_color_changed ()
DropDown & GetDropDown ()
void SetKeepDropArrow (bool keep)
virtual bool SetFont (wxFont const &font) override
int Append (const wxString &item, const wxBitmap &bitmap=wxNullBitmap, int item_style=0)
int Append (const wxString &item, const wxBitmap &bitmap, void *clientData, int item_style=0)
int Append (const wxString &item, const wxBitmap &bitmap, const wxString &group, void *clientData=nullptr, int item_style=0)
int Append (const wxString &item, const wxBitmap &bitmap, const wxString &group_key, const wxString &group_label, void *clientData=nullptr, int item_style=0)
int SetItems (const std::vector< DropDown::Item > &the_items)
void set_replace_text (wxString text, wxString image_name)
unsigned int GetCount () const override
int GetSelection () const override
void SetSelection (int n) override
void SelectAndNotify (int n)
virtual void Rescale () override
wxString GetValue () const
void SetValue (const wxString &value)
void SetLabel (const wxString &label) override
wxString GetLabel () const override
int GetFlag (unsigned int n)
void SetFlag (unsigned int n, int value)
void SetTextLabel (const wxString &label)
wxString GetTextLabel () const
wxString GetString (unsigned int n) const override
void SetString (unsigned int n, wxString const &value) override
wxString GetItemTooltip (unsigned int n) const
void SetItemTooltip (unsigned int n, wxString const &value)
wxString GetItemAlias (unsigned int n) const
void SetItemAlias (unsigned int n, wxString const &value)
wxBitmap GetItemBitmap (unsigned int n)
void SetItemBitmap (unsigned int n, wxBitmap const &bitmap)
void SetItemActionBitmap (unsigned int n, wxBitmap const &bitmap)
bool is_drop_down ()
void DeleteOneItem (unsigned int pos)
void ForceDropdownOpen ()
void CloseDropdown ()

Static Public Member Functions

static wxColor different_color (wxColor const &color)

Protected Types

typedef std::size_t Marker

Protected Member Functions

void invalidate_selection ()
void validate_selection (bool predicate=false)
void update_selection ()
int update_ams_color ()
wxBitmap * get_bmp (std::string bitmap_key, bool wide_icons, const std::string &main_icon_name, bool is_compatible=true, bool is_system=false, bool is_single_bar=false, const std::string &filament_rgb="", const std::string &extruder_rgb="", const std::string &material_rgb="")
wxBitmap * get_bmp (std::string bitmap_key, const std::string &main_icon_name, const std::string &next_icon_name, bool is_enabled=true, bool is_compatible=true, bool is_system=false)
wxBitmap * get_bmp (Preset const &preset)
virtual int DoInsertItems (const wxArrayStringsAdapter &items, unsigned int pos, void **clientData, wxClientDataType type) override
virtual void DoClear () override
void DoDeleteOneItem (unsigned int pos) override
void * DoGetItemClientData (unsigned int n) const override
void DoSetItemClientData (unsigned int n, void *data) override
void OnEdit () override
void sendComboBoxEvent ()

Static Protected Member Functions

static BitmapCache & bitmap_cache ()
static const char * separator_head ()
static const char * separator_tail ()
static wxString separator (const std::string &label)

Protected Attributes

std::function< void(int)> on_selection_changed { nullptr }
Preset::Type m_type
std::string m_main_bitmap_name
PresetBundle * m_preset_bundle {nullptr}
PresetCollection * m_collection {nullptr}
ScalableBitmap m_bitmapCompatible
ScalableBitmap m_bitmapIncompatible
int m_last_selected
int m_em_unit
int m_filament_idx = -1
int m_first_ams_filament = 0
int m_last_ams_filament = 0
int icon_height
int norm_icon_width
int thin_icon_width
int wide_icon_width
int space_icon_width
int thin_space_icon_width
int wide_space_icon_width
int m_first_printer_idx = 0
int m_last_printer_idx = 0
std::string m_selected_dev_id
PrinterTechnology printer_technology {ptAny}

Private Types

typedef DropDown::Item Item

Private Member Functions

void fill_width_height ()
void mouseDown (wxMouseEvent &event)
void mouseWheelMoved (wxMouseEvent &event)
void keyDown (wxKeyEvent &event)
void onMove (wxMoveEvent &event)

Private Attributes

bool show_incompatible {false}
bool m_enable_all {false}
bool m_show_all { false }
std::vector< Item > items
DropDown drop
bool drop_down = false
bool text_off = false
bool is_replace_text_to_image = false
bool m_keep_drop_arrow = false
wxString replace_text
wxString image_for_text

Detailed Description

Member Typedef Documentation

◆ Item

typedef DropDown::Item ComboBox::Item
privateinherited

◆ Marker

typedef std::size_t Slic3r::GUI::PresetComboBox::Marker
protectedinherited

Member Enumeration Documentation

◆ FilamentAMSType

enum Slic3r::GUI::PresetComboBox::FilamentAMSType : unsigned int
inherited
Enumerator
ORIGINAL 
FROM_AMS 
65 :unsigned int {
66 ORIGINAL ,
68 };
@ ORIGINAL
Definition PresetComboBoxes.hpp:66
@ FROM_AMS
Definition PresetComboBoxes.hpp:67

◆ LabelItemType

enum Slic3r::GUI::PresetComboBox::LabelItemType : std::size_t
inherited
Enumerator
LABEL_ITEM_PHYSICAL_PRINTER 
LABEL_ITEM_PRINTER_MODELS 
LABEL_ITEM_DISABLED 
LABEL_ITEM_MARKER 
LABEL_ITEM_PHYSICAL_PRINTERS 
LABEL_ITEM_WIZARD_PRINTERS 
LABEL_ITEM_WIZARD_FILAMENTS 
LABEL_ITEM_WIZARD_MATERIALS 
LABEL_ITEM_WIZARD_ADD_PRINTERS 
LABEL_ITEM_MAX 
51 : std::size_t {
52 LABEL_ITEM_PHYSICAL_PRINTER = 0xffffff01,
61
63 };
@ LABEL_ITEM_WIZARD_PRINTERS
Definition PresetComboBoxes.hpp:57
@ LABEL_ITEM_PHYSICAL_PRINTER
Definition PresetComboBoxes.hpp:52
@ LABEL_ITEM_WIZARD_ADD_PRINTERS
Definition PresetComboBoxes.hpp:60
@ LABEL_ITEM_MAX
Definition PresetComboBoxes.hpp:62
@ LABEL_ITEM_PHYSICAL_PRINTERS
Definition PresetComboBoxes.hpp:56
@ LABEL_ITEM_WIZARD_FILAMENTS
Definition PresetComboBoxes.hpp:58
@ LABEL_ITEM_WIZARD_MATERIALS
Definition PresetComboBoxes.hpp:59
@ LABEL_ITEM_PRINTER_MODELS
Definition PresetComboBoxes.hpp:53
@ LABEL_ITEM_DISABLED
Definition PresetComboBoxes.hpp:54
@ LABEL_ITEM_MARKER
Definition PresetComboBoxes.hpp:55

Constructor & Destructor Documentation

◆ TabPresetComboBox()

Slic3r::GUI::TabPresetComboBox::TabPresetComboBox ( wxWindow * parent,
Preset::Type preset_type )
1663 :
1664 // BBS: new layout
1665 PresetComboBox(parent, preset_type, wxSize(20 * wxGetApp().em_unit(), 30 * wxGetApp().em_unit() / 10))
1666{
1667 GetDropDown().SetUseContentWidth(true,true);
1668}
DropDown & GetDropDown()
Definition ComboBox.hpp:43
void SetUseContentWidth(bool use, bool limit_max_content_width=false)
Definition DropDown.cpp:165
PresetComboBox(wxWindow *parent, Preset::Type preset_type, const wxSize &size=wxDefaultSize, PresetBundle *preset_bundle=nullptr)
Definition PresetComboBoxes.cpp:123
int em_unit(wxWindow *win)
Definition wxExtensions.cpp:424

References Slic3r::GUI::PresetComboBox::PresetComboBox(), TabPresetComboBox(), em_unit(), ComboBox::GetDropDown(), and DropDown::SetUseContentWidth().

Referenced by TabPresetComboBox().

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

◆ ~TabPresetComboBox()

Slic3r::GUI::TabPresetComboBox::~TabPresetComboBox ( )
inline
241{}

Member Function Documentation

◆ add_ams_filaments()

bool Slic3r::GUI::PresetComboBox::add_ams_filaments ( std::string selected,
bool alias_name = false )
inherited
556{
557 bool selected_in_ams = false;
558 bool is_bbl_vendor_preset = m_preset_bundle->is_bbl_vendor();
559 if (is_bbl_vendor_preset && !m_preset_bundle->filament_ams_list.empty()) {
560 // When a filament track switch is installed and calibrated, every AMS filament is reachable
561 // from both extruders, so present one deduplicated group instead of the Left/Right split.
562 bool fila_switch_ready = wxGetApp().sidebar().is_fila_switch_ready();
563 bool dual_extruder = (m_preset_bundle->filament_ams_list.begin()->first & 0x10000) == 0;
564 if (fila_switch_ready)
565 set_label_marker(Append(_L("AMS filaments"), wxNullBitmap, DD_ITEM_STYLE_SPLIT_ITEM));
566 else
567 set_label_marker(Append(dual_extruder ? _L("Left filaments") : _L("AMS filament"), wxNullBitmap, DD_ITEM_STYLE_SPLIT_ITEM));
569 auto &filaments = m_collection->get_presets();
570
571 int icon_width = 24;
572 for (auto &entry : m_preset_bundle->filament_ams_list) {
573 auto & tray = entry.second;
574 auto name = tray.opt_string("tray_name", 0u);
575 if (name.size() > 3)
576 icon_width = 32;
577 }
578
579 // Deduplicate by (tray_name, filament_id) so a filament shared by both extruders is
580 // listed once when the switch is ready. Uses Orca's tray naming/lookup, not BBS's.
581 std::set<std::pair<std::string, std::string>> added_filaments;
582
583 for (auto &entry : m_preset_bundle->filament_ams_list) {
584 if (!fila_switch_ready && dual_extruder && (entry.first & 0x10000)) {
585 dual_extruder = false;
586 set_label_marker(Append(_L("Right filaments"), wxNullBitmap, DD_ITEM_STYLE_SPLIT_ITEM));
587 }
588 auto & tray = entry.second;
589 std::string filament_id = tray.opt_string("filament_id", 0u);
590 auto name = tray.opt_string("tray_name", 0u);
591 if (filament_id.empty()) {
592 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": %1% 's filament_id is empty.") % name;
593 continue;
594 }
595 if (fila_switch_ready) {
596 // skip the external spool and collapse duplicates shared across both extruders
597 if (name == "Ext")
598 continue;
599 if (!added_filaments.insert(std::make_pair(name, filament_id)).second)
600 continue;
601 }
602 auto iter = std::find_if(filaments.begin(), filaments.end(),
603 [&filament_id, this](auto &f) { return f.is_compatible && m_collection->get_preset_base(f) == &f && f.filament_id == filament_id; });
604 if (iter == filaments.end()) {
605 auto filament_type = tray.opt_string("filament_type", 0u);
606 if (!filament_type.empty()) {
607 filament_type = "Generic " + filament_type;
608 iter = std::find_if(filaments.begin(), filaments.end(),
609 [&filament_type](auto &f) { return f.is_compatible && f.is_system && boost::algorithm::starts_with(f.name, filament_type); });
610 }
611 }
612 if (iter == filaments.end()) {
613 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(": filament_id %1% not found or system or compatible") % filament_id;
614 continue;
615 }
616 const_cast<Preset&>(*iter).is_visible = true;
617 auto color = tray.opt_string("filament_colour", 0u);
618 auto multi_color = tray.opt<ConfigOptionStrings>("filament_multi_colour")->values;
619 wxBitmap bmp(*get_extruder_color_icon(color, name, icon_width, 16));
620 auto text = get_preset_name(*iter);
621 int item_id = Append(text, bmp.ConvertToImage(), &m_first_ams_filament + entry.first);
623 if (text == selected) {
624 DynamicPrintConfig *cfg = &wxGetApp().preset_bundle->project_config;
625 if (cfg) {
626 auto colors = static_cast<ConfigOptionStrings *>(cfg->option("filament_colour")->clone());
627 if (m_filament_idx < colors->values.size()) {
628 auto cur_color = colors->values[m_filament_idx];
629 if (color == cur_color) {
630 selected_in_ams = true;
631 }
632 }
633 }
634 }
635 //validate_selection(id->value == selected); // can not select
636 }
638 }
639 return selected_in_ams;
640}
#define DD_ITEM_STYLE_SPLIT_ITEM
Definition DropDown.hpp:26
#define _L(s)
Definition OBJ.cpp:34
void SetFlag(unsigned int n, int value)
Definition ComboBox.cpp:203
int Append(const wxString &item, const wxBitmap &bitmap=wxNullBitmap, int item_style=0)
Definition ComboBox.cpp:227
unsigned int GetCount() const override
Definition ComboBox.cpp:311
PresetBundle * m_preset_bundle
Definition PresetComboBoxes.hpp:123
void set_label_marker(int item, LabelItemType label_item_type=LABEL_ITEM_MARKER)
Definition PresetComboBoxes.cpp:201
int m_filament_idx
Definition PresetComboBoxes.hpp:138
virtual wxString get_preset_name(const Preset &preset)
Definition PresetComboBoxes.cpp:431
int m_first_ams_filament
Definition PresetComboBoxes.hpp:139
PresetCollection * m_collection
Definition PresetComboBoxes.hpp:124
int m_last_ams_filament
Definition PresetComboBoxes.hpp:140
CGALMeshPtr clone(const CGALMesh &m)
Definition MeshBoolean.cpp:658
zaa_minimize_perimeter_height filament_type((ConfigOptionBools, filament_soluble))((ConfigOptionStrings
@ Preset
Definition calib.hpp:39
static double f(double x, double z_sin, double z_cos, bool vertical, bool flip)
Definition FillGyroid.cpp:124
wxBitmap * get_extruder_color_icon(std::vector< std::string > colors, bool is_gradient, std::string label, int icon_width, int icon_height, const std::vector< wxColour > *ramp)
Definition wxExtensions.cpp:633

References _L, ComboBox::Append(), DD_ITEM_STYLE_SPLIT_ITEM, Slic3r::f(), Slic3r::filament_type(), FROM_AMS, get_extruder_color_icon(), get_preset_name(), ComboBox::GetCount(), Slic3r::Preset::is_visible, m_collection, m_filament_idx, m_first_ams_filament, m_last_ams_filament, m_preset_bundle, Slic3r::ConfigBase::option(), set_label_marker(), and ComboBox::SetFlag().

Referenced by Slic3r::GUI::PlaterPresetComboBox::update(), and Slic3r::GUI::TabPresetComboBox::update().

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

◆ add_connected_printers()

void Slic3r::GUI::PresetComboBox::add_connected_printers ( std::string selected,
bool alias_name = false )
inherited
521{
522 DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
523 if (!dev)
524 return;
525
526 std::map<std::string, MachineObject *> machine_list =
527 dev->get_my_machine_list(dev->get_current_printer_agent_id());
528 if (machine_list.empty())
529 return;
530
531 set_label_marker(Append(_L("My Printer"), wxNullBitmap, DD_ITEM_STYLE_SPLIT_ITEM));
533 for (auto iter = machine_list.begin(); iter != machine_list.end(); ++iter) {
534 Preset* printer_preset = get_printer_preset(iter->second);
535 if (!printer_preset)
536 continue;
537 printer_preset->is_visible = true;
538 auto printer_model = printer_preset->config.opt_string("printer_model");
539 boost::replace_all(printer_model, "Bambu Lab ", "");
540 auto text = iter->second->get_dev_name() + " (" + printer_model + ")";
541 int item_id = Append(from_u8(text), wxNullBitmap, &m_first_printer_idx + std::distance(machine_list.begin(), iter));
543 }
545}
int m_last_printer_idx
Definition PresetComboBoxes.hpp:153
void validate_selection(bool predicate=false)
Definition PresetComboBoxes.cpp:220
int m_first_printer_idx
Definition PresetComboBoxes.hpp:152
std::string m_selected_dev_id
Definition PresetComboBoxes.hpp:155
wxString from_u8(const std::string &str)
Definition GUI.cpp:544
Preset * get_printer_preset(const MachineObject *obj)
Definition Plater.cpp:19913

References _L, ComboBox::Append(), Slic3r::Preset::config, DD_ITEM_STYLE_SPLIT_ITEM, Slic3r::GUI::from_u8(), Slic3r::DeviceManager::get_current_printer_agent_id(), Slic3r::DeviceManager::get_my_machine_list(), Slic3r::GUI::get_printer_preset(), ComboBox::GetCount(), Slic3r::Preset::is_visible, m_first_printer_idx, m_last_printer_idx, m_selected_dev_id, Slic3r::DynamicConfig::opt_string(), set_label_marker(), and validate_selection().

Here is the call graph for this function:

◆ Append() [1/4]

int ComboBox::Append ( const wxString & item,
const wxBitmap & bitmap,
const wxString & group,
void * clientData = nullptr,
int item_style = 0 )
inherited
247{
248 return Append(text, bitmap, group, group, clientData, style);
249}
#define style
Definition WipeTowerDialog.cpp:101

References Append(), and style.

Here is the call graph for this function:

◆ Append() [2/4]

int ComboBox::Append ( const wxString & item,
const wxBitmap & bitmap,
const wxString & group_key,
const wxString & group_label,
void * clientData = nullptr,
int item_style = 0 )
inherited
257{
258 auto valid_bit_map = bitmap.IsOk() ? bitmap : wxNullBitmap;
259 Item item{text, wxEmptyString, valid_bit_map, valid_bit_map, wxNullBitmap, clientData, group_key, group_label};
260 item.style = style;
261 items.push_back(item);
262 SetClientDataType(wxClientData_Void);
263 drop.Invalidate();
264 return items.size() - 1;
265}
DropDown::Item Item
Definition ComboBox.hpp:22
std::vector< Item > items
Definition ComboBox.hpp:23
DropDown drop
Definition ComboBox.hpp:25

References drop, items, DropDown::Item::style, and style.

◆ Append() [3/4]

int ComboBox::Append ( const wxString & item,
const wxBitmap & bitmap,
void * clientData,
int item_style = 0 )
inherited
239{
240 if (bitmap.IsOk()) {
241 return Append(text, bitmap, wxString{}, clientData, style);
242 }
243 return Append(text, wxNullBitmap, wxString{}, clientData, style);
244}

References Append(), and style.

Here is the call graph for this function:

◆ Append() [4/4]

int ComboBox::Append ( const wxString & item,
const wxBitmap & bitmap = wxNullBitmap,
int item_style = 0 )
inherited

◆ bitmap_cache()

BitmapCache & Slic3r::GUI::PresetComboBox::bitmap_cache ( )
staticprotectedinherited
196{
197 static BitmapCache bmps;
198 return bmps;
199}

Referenced by get_bmp(), get_bmp(), and get_bmp().

Here is the caller graph for this function:

◆ clear_selected_dev_id()

void Slic3r::GUI::PresetComboBox::clear_selected_dev_id ( )
inlineinherited
99{ m_selected_dev_id.clear(); }

References m_selected_dev_id.

◆ CloseDropdown()

void ComboBox::CloseDropdown ( )
inherited
306{
307 if (drop.IsShown())
308 drop.DismissAndNotify();
309}

References drop.

◆ DeleteOneItem()

void ComboBox::DeleteOneItem ( unsigned int pos)
inlineinherited
101{ DoDeleteOneItem(pos); }
void DoDeleteOneItem(unsigned int pos) override
Definition ComboBox.cpp:281

References DoDeleteOneItem().

Here is the call graph for this function:

◆ different_color()

wxColor Slic3r::GUI::PresetComboBox::different_color ( wxColor const & color)
staticinherited
341{
342 if (clr.GetLuminance() < 0.51) return *wxWHITE;
343 return *wxBLACK;
344}

◆ DoClear()

void ComboBox::DoClear ( )
overrideprotectedvirtualinherited
275{
276 SetIcon("drop_down");
277 items.clear();
278 drop.Invalidate(true);
279}

References drop, and items.

◆ DoDeleteOneItem()

void ComboBox::DoDeleteOneItem ( unsigned int pos)
overrideprotectedinherited
282{
283 if (pos >= items.size()) return;
284 items.erase(items.begin() + pos);
285 drop.Invalidate(true);
286}

References drop, and items.

Referenced by DeleteOneItem().

Here is the caller graph for this function:

◆ DoGetItemClientData()

void * ComboBox::DoGetItemClientData ( unsigned int n) const
overrideprotectedinherited
386{ return n < items.size() ? items[n].data : NULL; }

References items.

◆ DoInsertItems()

int ComboBox::DoInsertItems ( const wxArrayStringsAdapter & items,
unsigned int pos,
void ** clientData,
wxClientDataType type )
overrideprotectedvirtualinherited
375{
376 if (pos > this->items.size()) return -1;
377 for (int i = 0; i < items.GetCount(); ++i) {
378 Item item { items[i], wxEmptyString, wxNullBitmap, wxNullBitmap, wxNullBitmap, clientData ? clientData[i] : NULL };
379 this->items.insert(this->items.begin() + pos, item);
380 ++pos;
381 }
382 drop.Invalidate(true);
383 return pos - 1;
384}
Vec3d pos(const Pt &p)
Definition ReprojectPointsOnMesh.hpp:16

References drop, and items.

◆ DoSetItemClientData()

void ComboBox::DoSetItemClientData ( unsigned int n,
void * data )
overrideprotectedinherited
389{
390 if (n < items.size())
391 items[n].data = data;
392}

References items.

◆ fill_width_height()

void Slic3r::GUI::PresetComboBox::fill_width_height ( )
privateinherited
672{
673 // To avoid asserts, each added bitmap to wxBitmapCombobox should be the same size, so
674 // set a bitmap's height to m_bitmapCompatible->GetHeight() and norm_icon_width to m_bitmapCompatible->GetWidth()
675 icon_height = m_bitmapCompatible.GetBmpHeight();
676 norm_icon_width = m_bitmapCompatible.GetBmpWidth();
677
678 /* It's supposed that standard size of an icon is 16px*16px for 100% scaled display.
679 * So set sizes for solid_colored icons used for filament preset
680 * and scale them in respect to em_unit value
681 */
682 const float scale_f = (float)m_em_unit * 0.1f;
683
684 thin_icon_width = lroundf(8 * scale_f); // analogue to 8px;
686
687 space_icon_width = lroundf(2 * scale_f);
688 thin_space_icon_width = lroundf(4 * scale_f);
689 wide_space_icon_width = lroundf(6 * scale_f);
690}
int wide_icon_width
Definition PresetComboBoxes.hpp:146
int norm_icon_width
Definition PresetComboBoxes.hpp:144
ScalableBitmap m_bitmapCompatible
Definition PresetComboBoxes.hpp:130
int icon_height
Definition PresetComboBoxes.hpp:143
int wide_space_icon_width
Definition PresetComboBoxes.hpp:149
int thin_space_icon_width
Definition PresetComboBoxes.hpp:148
int thin_icon_width
Definition PresetComboBoxes.hpp:145
int m_em_unit
Definition PresetComboBoxes.hpp:135
int space_icon_width
Definition PresetComboBoxes.hpp:147

References icon_height, m_bitmapCompatible, m_em_unit, norm_icon_width, space_icon_width, thin_icon_width, thin_space_icon_width, wide_icon_width, and wide_space_icon_width.

Referenced by PresetComboBox(), and msw_rescale().

Here is the caller graph for this function:

◆ ForceDropdownOpen()

void ComboBox::ForceDropdownOpen ( )
inherited
289{
290 if (!IsEnabled() || items.empty())
291 return;
292
293 if (!drop_down) {
294 drop.need_sync = true;
295 drop.messureSize();
296 drop.autoPosition();
297 drop_down = true;
298 drop.Popup(&drop);
299
300 wxCommandEvent e(wxEVT_COMBOBOX_DROPDOWN);
301 GetEventHandler()->ProcessEvent(e);
302 }
303}
bool drop_down
Definition ComboBox.hpp:26
bool IsEnabled()
Definition dark_mode.cpp:32

References drop, drop_down, and items.

Referenced by BitmapChoiceRenderer::CreateEditorCtrl().

Here is the caller graph for this function:

◆ get_bmp() [1/3]

wxBitmap * Slic3r::GUI::PresetComboBox::get_bmp ( Preset const & preset)
protectedinherited
755{
756 static wxBitmap sbmp;
758 Preset const & preset2 = &m_collection->get_selected_preset() == &preset ? m_collection->get_edited_preset() : preset;
759 wxString color = preset2.config.opt_string("default_filament_colour", 0);
760 wxColour clr(color);
761 if (clr.IsOk()) {
762 std::string bitmap_key = "default_filament_colour_" + color.ToStdString();
763 wxBitmap *bmp = bitmap_cache().find(bitmap_key);
764 if (bmp == nullptr) {
765 wxImage img(16, 16);
766 if (clr.Red() > 224 && clr.Blue() > 224 && clr.Green() > 224) {
767 img.SetRGB(wxRect({0, 0}, img.GetSize()), 128, 128, 128);
768 img.SetRGB(wxRect({1, 1}, img.GetSize() - wxSize{2, 2}), clr.Red(), clr.Green(), clr.Blue());
769 } else {
770 img.SetRGB(wxRect({0, 0}, img.GetSize()), clr.Red(), clr.Green(), clr.Blue());
771 }
772 bmp = new wxBitmap(img);
773 bmp = bitmap_cache().insert(bitmap_key, *bmp);
774 }
775 return bmp;
776 }
777 }
778 return &sbmp;
779}
wxBitmap * find(const std::string &name)
Definition BitmapCache.hpp:29
wxBitmap * insert(const std::string &name, size_t width, size_t height)
Definition BitmapCache.cpp:81
Preset::Type m_type
Definition PresetComboBoxes.hpp:120
static BitmapCache & bitmap_cache()
Definition PresetComboBoxes.cpp:195
@ TYPE_FILAMENT
Definition Preset.hpp:248

References bitmap_cache(), Slic3r::Preset::config, Slic3r::GUI::BitmapCache::find(), Slic3r::GUI::BitmapCache::insert(), m_collection, m_type, Slic3r::DynamicConfig::opt_string(), and Slic3r::Preset::TYPE_FILAMENT.

Here is the call graph for this function:

◆ get_bmp() [2/3]

wxBitmap * Slic3r::GUI::PresetComboBox::get_bmp ( std::string bitmap_key,
bool wide_icons,
const std::string & main_icon_name,
bool is_compatible = true,
bool is_system = false,
bool is_single_bar = false,
const std::string & filament_rgb = "",
const std::string & extruder_rgb = "",
const std::string & material_rgb = "" )
protectedinherited
700{
701 // BBS: no icon
702#if 1
703 static wxBitmap bmp;
704 return &bmp;
705#else
706 // If the filament preset is not compatible and there is a "red flag" icon loaded, show it left
707 // to the filament color image.
708 if (wide_icons)
709 bitmap_key += is_compatible ? ",cmpt" : ",ncmpt";
710
711 bitmap_key += is_system ? ",syst" : ",nsyst";
712 bitmap_key += ",h" + std::to_string(icon_height);
713 bool dark_mode = wxGetApp().dark_mode();
714 if (dark_mode)
715 bitmap_key += ",dark";
716 bitmap_key += material_rgb;
717
718 wxBitmap* bmp = bitmap_cache().find(bitmap_key);
719 if (bmp == nullptr) {
720 // Create the bitmap with color bars.
721 std::vector<wxBitmap> bmps;
722 if (wide_icons)
723 // Paint a red flag for incompatible presets.
724 bmps.emplace_back(is_compatible ? bitmap_cache().mkclear(norm_icon_width, icon_height) : m_bitmapIncompatible.bmp());
725
726 if (m_type == Preset::TYPE_FILAMENT && !filament_rgb.empty())
727 {
728 // BBS
729 // Paint a lock at the system presets.
730 bmps.emplace_back(bitmap_cache().mkclear(space_icon_width, icon_height));
731 }
732 else
733 {
734 // BBS
735#if 0
736 // Paint the color bars.
737 bmps.emplace_back(bitmap_cache().mkclear(thin_space_icon_width, icon_height));
739 bmps.emplace_back(create_scaled_bitmap(main_icon_name, this, 16, false, material_rgb));
740 else
741 bmps.emplace_back(create_scaled_bitmap(main_icon_name));
742#endif
743 // Paint a lock at the system presets.
744 bmps.emplace_back(bitmap_cache().mkclear(wide_space_icon_width, icon_height));
745 }
746 bmps.emplace_back(is_system ? create_scaled_bitmap("unlock_normal") : bitmap_cache().mkclear(norm_icon_width, icon_height));
747 bmp = bitmap_cache().insert(bitmap_key, bmps);
748 }
749
750 return bmp;
751#endif
752}
ScalableBitmap m_bitmapIncompatible
Definition PresetComboBoxes.hpp:132
@ TYPE_SLA_MATERIAL
Definition Preset.hpp:249
wxBitmap create_scaled_bitmap(const std::string &bmp_name_in, wxWindow *win, const int px_cnt, const bool grayscale, const std::string &new_color, const bool menu_bitmap, const bool resize, const bool bitmap2, const std::vector< std::string > &array_new_color)
Definition wxExtensions.cpp:448

References bitmap_cache(), create_scaled_bitmap(), Slic3r::GUI::BitmapCache::find(), icon_height, Slic3r::GUI::BitmapCache::insert(), m_bitmapIncompatible, m_type, norm_icon_width, space_icon_width, thin_space_icon_width, Slic3r::Preset::TYPE_FILAMENT, Slic3r::Preset::TYPE_SLA_MATERIAL, and wide_space_icon_width.

Referenced by Slic3r::GUI::CalibrateFilamentComboBox::update(), Slic3r::GUI::PlaterPresetComboBox::update(), update(), Slic3r::GUI::TabPresetComboBox::update(), and Slic3r::GUI::TabPresetComboBox::update_dirty().

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

◆ get_bmp() [3/3]

wxBitmap * Slic3r::GUI::PresetComboBox::get_bmp ( std::string bitmap_key,
const std::string & main_icon_name,
const std::string & next_icon_name,
bool is_enabled = true,
bool is_compatible = true,
bool is_system = false )
protectedinherited
785{
786 // BBS: no icon
787#if 1
788 static wxBitmap bmp;
789 return &bmp;
790#else
791 bitmap_key += !is_enabled ? "_disabled" : "";
792 bitmap_key += is_compatible ? ",cmpt" : ",ncmpt";
793 bitmap_key += is_system ? ",syst" : ",nsyst";
794 bitmap_key += ",h" + std::to_string(icon_height);
795 if (wxGetApp().dark_mode())
796 bitmap_key += ",dark";
797
798 wxBitmap* bmp = bitmap_cache().find(bitmap_key);
799 if (bmp == nullptr) {
800 // Create the bitmap with color bars.
801 std::vector<wxBitmap> bmps;
802 bmps.emplace_back(m_type == Preset::TYPE_PRINTER ? create_scaled_bitmap(main_icon_name, this, 16, !is_enabled) :
803 is_compatible ? m_bitmapCompatible.bmp() : m_bitmapIncompatible.bmp());
804 // Paint a lock at the system presets.
805 bmps.emplace_back(is_system ? create_scaled_bitmap(next_icon_name, this, 16, !is_enabled) : bitmap_cache().mkclear(norm_icon_width, icon_height));
806 bmp = bitmap_cache().insert(bitmap_key, bmps);
807 }
808
809 return bmp;
810#endif
811}
@ TYPE_PRINTER
Definition Preset.hpp:250

References bitmap_cache(), create_scaled_bitmap(), Slic3r::GUI::BitmapCache::find(), icon_height, Slic3r::GUI::BitmapCache::insert(), m_bitmapCompatible, m_bitmapIncompatible, m_type, norm_icon_width, and Slic3r::Preset::TYPE_PRINTER.

Here is the call graph for this function:

◆ get_filament_idx()

int Slic3r::GUI::PresetComboBox::get_filament_idx ( ) const
inlineinherited
96{ return m_filament_idx; }

References m_filament_idx.

Referenced by Slic3r::GUI::Plater::priv::on_select_preset().

Here is the caller graph for this function:

◆ get_preset_item_name()

wxString Slic3r::GUI::PresetComboBox::get_preset_item_name ( unsigned int index)
inherited
392{
394 int idx = selected_connected_printer();
395 if (idx < 0) {
396 m_selected_dev_id.clear();
397 return GetString(index);
398 }
399 else {
400 DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
401 if (!dev) {
402 assert(false);
403 m_selected_dev_id.clear();
404 return GetString(index);
405 }
406
407 std::map<std::string, MachineObject *> machine_list =
408 dev->get_my_machine_list(dev->get_current_printer_agent_id());
409 if (machine_list.empty()) {
410 assert(false);
411 m_selected_dev_id.clear();
412 return GetString(index);
413 }
414
415 auto iter = machine_list.begin();
416 std::advance(iter, idx);
417 if (iter != machine_list.end()) {
418 m_selected_dev_id = iter->first;
419 Preset* machine_preset = get_printer_preset(iter->second);
420 if (machine_preset) {
421 return from_u8(machine_preset->name);
422 }
423 }
424 }
425 }
426
427 m_selected_dev_id.clear();
428 return GetString(index);
429}
wxString GetString(unsigned int n) const override
Definition ComboBox.cpp:320
int selected_connected_printer() const
Definition PresetComboBoxes.cpp:547

References Slic3r::GUI::from_u8(), Slic3r::DeviceManager::get_current_printer_agent_id(), Slic3r::DeviceManager::get_my_machine_list(), Slic3r::GUI::get_printer_preset(), ComboBox::GetString(), m_selected_dev_id, m_type, Slic3r::Preset::name, selected_connected_printer(), and Slic3r::Preset::TYPE_PRINTER.

Here is the call graph for this function:

◆ get_preset_name()

wxString Slic3r::GUI::TabPresetComboBox::get_preset_name ( const Preset & preset)
overridevirtual

Reimplemented from Slic3r::GUI::PresetComboBox.

1711{
1712 if (preset.is_from_bundle())
1713 return from_u8(preset.label(false));
1714 else
1715 return from_u8(preset.label(true));
1716}

References Slic3r::GUI::from_u8(), Slic3r::Preset::is_from_bundle(), and Slic3r::Preset::label().

Referenced by update().

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

◆ get_selected_dev_id()

std::string Slic3r::GUI::PresetComboBox::get_selected_dev_id ( ) const
inlineinherited
98{ return m_selected_dev_id; }

References m_selected_dev_id.

◆ get_tooltip()

wxString Slic3r::GUI::PresetComboBox::get_tooltip ( const Preset & preset)
inherited
347{
348 wxString tooltip = from_u8(preset.name);
349
350 // Add filament notes if available for filament presets
352 const DynamicConfig* config = &preset.config;
353 Tab* tab = wxGetApp().get_tab(m_type);
354 if (tab && tab->current_preset_is_dirty() && tab->get_presets()->get_selected_preset().name == preset.name) {
355 config = tab->get_config();
356 }
357
358 if (config->has("filament_notes")) {
359 const ConfigOptionStrings* notes_opt = config->option<ConfigOptionStrings>("filament_notes");
360 if (notes_opt && !notes_opt->values.empty() && !notes_opt->values[0].empty()) {
361 std::string notes = notes_opt->values[0];
362 // Truncate if longer than 200 characters
363 if (notes.length() > 200) {
364 notes = notes.substr(0, 197) + "...";
365 }
366 tooltip += "\n" + from_u8(notes);
367 }
368 }
369 }
370
371 // BBS: FIXME
372#if 0
374 int temperature[4] = { 0,0,0,0 };
375 if (preset.config.has("nozzle_temperature_initial_layer")) //get the nozzle_temperature_initial_layer
376 temperature[0] = preset.config.opt_int("nozzle_temperature_initial_layer", 0);
377 if (preset.config.has("nozzle_temperature")) //get the nozzle temperature
378 temperature[1] = preset.config.opt_int("nozzle_temperature", 0);
379 if (preset.config.has("bed_temperature_initial_layer")) //get the bed_temperature_initial_layer
380 temperature[2] = preset.config.opt_int("bed_temperature_initial_layer", 0);
381 if (preset.config.has("bed_temperature")) //get the bed_temperature
382 temperature[3] = preset.config.opt_int("bed_temperature", 0);
383
384 tooltip += wxString::Format("\nNozzle First Layer:%d, Other Layer:%d\n Bed First Layer:%d, Other Layers:%d",
385 temperature[0], temperature[1], temperature[2], temperature[3]);
386 }
387#endif
388 return tooltip;
389}
zaa_minimize_perimeter_height notes((ConfigOptionString, printer_notes))((ConfigOptionBools

References Slic3r::Preset::config, Slic3r::GUI::Tab::current_preset_is_dirty(), Slic3r::GUI::from_u8(), Slic3r::GUI::Tab::get_config(), Slic3r::GUI::Tab::get_presets(), Slic3r::PresetCollection::get_selected_preset(), Slic3r::ConfigOptionResolver::has(), m_type, Slic3r::Preset::name, Slic3r::notes(), Slic3r::DynamicConfig::opt_int(), Slic3r::ConfigBase::option(), Slic3r::Preset::TYPE_FILAMENT, and Slic3r::ConfigOptionVector< T >::values.

Referenced by Slic3r::GUI::CalibrateFilamentComboBox::update(), and Slic3r::GUI::PlaterPresetComboBox::update().

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

◆ get_type()

Preset::Type Slic3r::GUI::PresetComboBox::get_type ( )
inlineinherited
109{ return m_type; }

References m_type.

Referenced by Slic3r::GUI::DiffPresetDialog::create_presets_sizer(), Slic3r::GUI::Plater::priv::on_select_preset(), and Slic3r::GUI::DiffPresetDialog::update_compatibility().

Here is the caller graph for this function:

◆ GetCount()

◆ GetDropDown()

DropDown & ComboBox::GetDropDown ( )
inlineinherited
43{ return drop; }

References drop.

Referenced by Slic3r::GUI::PlaterPresetComboBox::PlaterPresetComboBox(), Slic3r::GUI::TabPresetComboBox::TabPresetComboBox(), Slic3r::GUI::Choice::BUILD(), Slic3r::GUI::PrinterAgentChoice::BUILD(), BitmapChoiceRenderer::CreateEditorCtrl(), and Slic3r::GUI::use_nozzle_row_font().

Here is the caller graph for this function:

◆ GetFlag()

int ComboBox::GetFlag ( unsigned int n)
inherited
197{
198 if (n >= items.size())
199 return -1;
200 return items[n].flag;
201}

References items.

Referenced by Slic3r::anonymous_namespace{PluginHostPresets.cpp}::bind_filament_target(), Slic3r::GUI::Plater::priv::on_select_preset(), and Slic3r::GUI::PlaterPresetComboBox::update_badge_according_flag().

Here is the caller graph for this function:

◆ GetItemAlias()

wxString ComboBox::GetItemAlias ( unsigned int n) const
inherited
344{
345 if (n >= items.size()) return wxString();
346 return items[n].alias;
347}

References items.

Referenced by Slic3r::anonymous_namespace{PluginHostPresets.cpp}::combo_item_for_preset(), Slic3r::GUI::Plater::priv::on_select_preset(), Slic3r::anonymous_namespace{PluginHostPresets.cpp}::resolve_combo_preset(), and Slic3r::GUI::PresetComboBox::update_ams_color().

Here is the caller graph for this function:

◆ GetItemBitmap()

wxBitmap ComboBox::GetItemBitmap ( unsigned int n)
inherited
355{ return items[n].icon; }

References items.

◆ GetItemTooltip()

wxString ComboBox::GetItemTooltip ( unsigned int n) const
inherited
332{
333 if (n >= items.size()) return wxString();
334 return items[n].tip;
335}

References items.

◆ GetLabel()

wxString ComboBox::GetLabel ( ) const
overrideinherited
189{
190 if (GetTextCtrl()->IsShown() || text_off)
191 return GetTextCtrl()->GetValue();
192 else
193 return TextInput::GetLabel();
194}
bool text_off
Definition ComboBox.hpp:27

References text_off.

Referenced by GetValue().

Here is the caller graph for this function:

◆ GetSelection()

◆ GetString()

◆ GetTextLabel()

wxString ComboBox::GetTextLabel ( ) const
inherited
215{
216 return TextInput::GetLabel();
217}

◆ GetValue()

wxString ComboBox::GetValue ( ) const
inherited
141{
142 return drop.GetSelection() >= 0 ? drop.GetValue() : GetLabel();
143}
wxString GetLabel() const override
Definition ComboBox.cpp:188

References drop, and GetLabel().

Referenced by Slic3r::GUI::PlaterPresetComboBox::PlaterPresetComboBox(), Slic3r::GUI::Choice::BUILD(), Slic3r::GUI::PrinterAgentChoice::BUILD(), Slic3r::GUI::GridCellChoiceEditor::EndEdit(), Slic3r::GUI::GridCellFilamentsEditor::EndEdit(), Slic3r::GUI::IMEXModesCtrl::fix_row_name(), Slic3r::GUI::Choice::get_value(), Slic3r::GUI::IMEXModesCtrl::snapshot_row(), Slic3r::GUI::TabPrint::toggle_options(), Slic3r::GUI::CalibrateFilamentComboBox::update(), and Slic3r::GUI::PresetComboBox::update_ams_color().

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

◆ invalidate_selection()

void Slic3r::GUI::PresetComboBox::invalidate_selection ( )
protectedinherited
216{
217 m_last_selected = INT_MAX; // this value means that no one item is selected
218}
int m_last_selected
Definition PresetComboBoxes.hpp:134

References m_last_selected.

Referenced by Slic3r::GUI::CalibrateFilamentComboBox::update(), Slic3r::GUI::PlaterPresetComboBox::update(), update(), and Slic3r::GUI::TabPresetComboBox::update().

Here is the caller graph for this function:

◆ is_drop_down()

bool ComboBox::is_drop_down ( )
inlineinherited
100{return drop_down;}

References drop_down.

◆ is_selected_physical_printer()

bool Slic3r::GUI::PresetComboBox::is_selected_physical_printer ( )
inherited
814{
815 auto selected_item = this->GetSelection();
816 auto marker = reinterpret_cast<Marker>(this->GetClientData(selected_item));
817 return marker == LABEL_ITEM_PHYSICAL_PRINTER;
818}
int GetSelection() const override
Definition ComboBox.cpp:98
std::size_t Marker
Definition PresetComboBoxes.hpp:117

References ComboBox::GetSelection(), and LABEL_ITEM_PHYSICAL_PRINTER.

Referenced by Slic3r::GUI::Plater::priv::on_select_preset(), and selection_is_changed_according_to_physical_printers().

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

◆ is_selected_printer_model()

bool Slic3r::GUI::PresetComboBox::is_selected_printer_model ( )
inherited
821{
822 auto selected_item = this->GetSelection();
823 auto marker = reinterpret_cast<Marker>(this->GetClientData(selected_item));
824 return marker == LABEL_ITEM_PRINTER_MODELS;
825}

References ComboBox::GetSelection(), and LABEL_ITEM_PRINTER_MODELS.

Referenced by Slic3r::GUI::Plater::priv::on_select_preset().

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

◆ keyDown()

void ComboBox::keyDown ( wxKeyEvent & event)
privateinherited
423{
424 switch (event.GetKeyCode()) {
425 case WXK_RETURN:
426 case WXK_SPACE:
427 if (drop_down) {
428 drop.DismissAndNotify();
429 } else if (!items.empty() && drop.HasDismissLongTime()) {
430 drop.autoPosition();
431 drop_down = true;
432 drop.Popup();
433 wxCommandEvent e(wxEVT_COMBOBOX_DROPDOWN);
434 GetEventHandler()->ProcessEvent(e);
435 }
436 break;
437 case WXK_UP:
438 case WXK_DOWN:
439 case WXK_LEFT:
440 case WXK_RIGHT: {
441 // Step over disabled rows: the mouse cannot select them either.
442 const int step = (event.GetKeyCode() == WXK_UP || event.GetKeyCode() == WXK_LEFT) ? -1 : 1;
443 int n = GetSelection() + step;
444 while (n >= 0 && n < int(items.size()) && (items[n].style & DD_ITEM_STYLE_DISABLED))
445 n += step;
446 if (n < 0 || n >= int(items.size()))
447 break;
448 SetSelection(n);
450 break;
451 }
452 case WXK_TAB:
453 HandleAsNavigationKey(event);
454 break;
455 default:
456 event.Skip();
457 break;
458 }
459}
#define DD_ITEM_STYLE_DISABLED
Definition DropDown.hpp:27
void sendComboBoxEvent()
Definition ComboBox.cpp:485
void SetSelection(int n) override
Definition ComboBox.cpp:102
void step(Coord &crd, const Dir d, const long n=1)
Definition MarchingSquares.hpp:213

References DD_ITEM_STYLE_DISABLED, drop, drop_down, GetSelection(), items, sendComboBoxEvent(), and SetSelection().

Here is the call graph for this function:

◆ mouseDown()

void ComboBox::mouseDown ( wxMouseEvent & event)
privateinherited
395{
396 if (!IsEnabled()) { return; } /*on mac, the event may triggered even disabled*/
397
398 SetFocus();
399 if (drop_down) {
400 drop.Hide();
401 } else if (!items.empty() && drop.HasDismissLongTime()) { // DropDown paints nothing for an empty list
402 drop.autoPosition();
403 drop_down = true;
404 drop.Popup(&drop);
405 wxCommandEvent e(wxEVT_COMBOBOX_DROPDOWN);
406 GetEventHandler()->ProcessEvent(e);
407 }
408}

References drop, drop_down, and items.

◆ mouseWheelMoved()

void ComboBox::mouseWheelMoved ( wxMouseEvent & event)
privateinherited
411{
412 event.Skip();
413 if (drop_down) return;
414 auto delta = event.GetWheelRotation() < 0 ? 1 : -1;
415 unsigned int n = GetSelection() + delta;
416 if (n < GetCount()) {
417 SetSelection((int) n);
419 }
420}

References drop_down, GetCount(), GetSelection(), sendComboBoxEvent(), and SetSelection().

Here is the call graph for this function:

◆ msw_rescale()

void Slic3r::GUI::TabPresetComboBox::msw_rescale ( )
overridevirtual

Reimplemented from Slic3r::GUI::PresetComboBox.

1929{
1931 // BBS: new layout
1932 wxSize sz = wxSize(20 * m_em_unit, 30 * m_em_unit / 10);
1933 SetMinSize(sz);
1934 SetSize(sz);
1935}
virtual void msw_rescale()
Definition PresetComboBoxes.cpp:650

References Slic3r::GUI::PresetComboBox::m_em_unit, and Slic3r::GUI::PresetComboBox::msw_rescale().

Here is the call graph for this function:

◆ OnEdit()

void ComboBox::OnEdit ( )
overrideprotectedinherited
468{
469 auto value = GetTextCtrl()->GetValue();
470 SetValue(value);
471}
void SetValue(const wxString &value)
Definition ComboBox.cpp:145

References SetValue().

Here is the call graph for this function:

◆ onMove()

void ComboBox::onMove ( wxMoveEvent & event)
privateinherited
462{
463 event.Skip();
464 drop.Hide();
465}

References drop.

Referenced by ComboBox().

Here is the caller graph for this function:

◆ OnSelect()

void Slic3r::GUI::TabPresetComboBox::OnSelect ( wxCommandEvent & evt)
overridevirtual

Reimplemented from Slic3r::GUI::PresetComboBox.

1671{
1672 // Under OSX: in case of use of a same names written in different case (like "ENDER" and "Ender")
1673 // m_presets_choice->GetSelection() will return first item, because search in PopupListCtrl is case-insensitive.
1674 // So, use GetSelection() from event parameter
1675 auto selected_item = evt.GetSelection();
1676
1677 auto marker = reinterpret_cast<Marker>(this->GetClientData(selected_item));
1678 if (marker >= LABEL_ITEM_DISABLED && marker < LABEL_ITEM_MAX) {
1680 // BBS: Add/Remove filaments
1682 switch (marker) {
1686 default: break;
1687 }
1688 if (sp != ConfigWizard::SP_WELCOME) {
1689 wxTheApp->CallAfter([sp]() {
1690 run_wizard(sp);
1691 });
1692 }
1693 }
1694 else if (on_selection_changed && (m_last_selected != selected_item || m_collection->current_is_dirty())) {
1695 m_last_selected = selected_item;
1696 // BBS: ams
1698 on_selection_changed(selected_item);
1699 }
1700
1701 evt.StopPropagation();
1702#ifdef __WXMSW__
1703 // From the Win 2004 preset combobox lose a focus after change the preset selection
1704 // and that is why the up/down arrow doesn't work properly
1705 // So, set the focus to the combobox explicitly
1706 this->SetFocus();
1707#endif
1708}
StartPage
Definition ConfigWizard.hpp:31
@ SP_MATERIALS
Definition ConfigWizard.hpp:35
@ SP_PRINTERS
Definition ConfigWizard.hpp:33
@ SP_FILAMENTS
Definition ConfigWizard.hpp:34
@ SP_WELCOME
Definition ConfigWizard.hpp:32
int update_ams_color()
Definition PresetComboBoxes.cpp:274
std::function< void(int)> on_selection_changed
Definition PresetComboBoxes.hpp:118
static void run_wizard(ConfigWizard::StartPage sp)
Definition PresetComboBoxes.cpp:1008

References Slic3r::GUI::PresetComboBox::LABEL_ITEM_DISABLED, Slic3r::GUI::PresetComboBox::LABEL_ITEM_MAX, Slic3r::GUI::PresetComboBox::LABEL_ITEM_WIZARD_FILAMENTS, Slic3r::GUI::PresetComboBox::LABEL_ITEM_WIZARD_MATERIALS, Slic3r::GUI::PresetComboBox::LABEL_ITEM_WIZARD_PRINTERS, Slic3r::GUI::PresetComboBox::m_collection, Slic3r::GUI::PresetComboBox::m_last_selected, Slic3r::GUI::PresetComboBox::on_selection_changed, Slic3r::GUI::run_wizard(), ComboBox::SetSelection(), Slic3r::GUI::ConfigWizard::SP_FILAMENTS, Slic3r::GUI::ConfigWizard::SP_MATERIALS, Slic3r::GUI::ConfigWizard::SP_PRINTERS, Slic3r::GUI::ConfigWizard::SP_WELCOME, and Slic3r::GUI::PresetComboBox::update_ams_color().

Here is the call graph for this function:

◆ presets()

PresetCollection * Slic3r::GUI::TabPresetComboBox::presets ( ) const
inline
254{ return m_collection; }

References Slic3r::GUI::PresetComboBox::m_collection.

Referenced by update().

Here is the caller graph for this function:

◆ Rescale()

void ComboBox::Rescale ( )
overridevirtualinherited
135{
137 drop.Rescale();
138}
virtual void Rescale()
Definition TextInput.cpp:175

References drop, and TextInput::Rescale().

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

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

◆ SelectAndNotify()

void ComboBox::SelectAndNotify ( int n)
inherited
129 {
130 SetSelection(n);
132}

References sendComboBoxEvent(), and SetSelection().

Here is the call graph for this function:

◆ selected_ams_filament()

int Slic3r::GUI::PresetComboBox::selected_ams_filament ( ) const
inherited
643{
645 return reinterpret_cast<int *>(GetClientData(m_last_selected)) - &m_first_ams_filament;
646 }
647 return -1;
648}

References m_first_ams_filament, m_last_ams_filament, and m_last_selected.

Referenced by update_ams_color().

Here is the caller graph for this function:

◆ selected_connected_printer()

int Slic3r::GUI::PresetComboBox::selected_connected_printer ( ) const
inherited
548{
550 return reinterpret_cast<int *>(GetClientData(m_last_selected)) - &m_first_printer_idx;
551 }
552 return -1;
553}

References m_first_printer_idx, m_last_printer_idx, and m_last_selected.

Referenced by get_preset_item_name().

Here is the caller graph for this function:

◆ selection_is_changed_according_to_physical_printers()

bool Slic3r::GUI::PresetComboBox::selection_is_changed_according_to_physical_printers ( )
inherited
828{
830 return false;
831
832 PhysicalPrinterCollection& physical_printers = m_preset_bundle->physical_printers;
833
834 std::string selected_string = this->GetString(this->GetSelection()).ToUTF8().data();
835
836 std::string old_printer_full_name, old_printer_preset;
837 if (physical_printers.has_selection()) {
838 old_printer_full_name = physical_printers.get_selected_full_printer_name();
839 old_printer_preset = physical_printers.get_selected_printer_preset_name();
840 }
841 else
842 old_printer_preset = m_collection->get_edited_preset().name;
843 // Select related printer preset on the Printer Settings Tab
844 physical_printers.select_printer(selected_string);
845 std::string preset_name = physical_printers.get_selected_printer_preset_name();
846
847 // if new preset wasn't selected, there is no need to call update preset selection
848 if (old_printer_preset == preset_name) {
849 // we need just to update according Plater<->Tab PresetComboBox
850 if (dynamic_cast<PlaterPresetComboBox*>(this)!=nullptr) {
851 wxGetApp().get_tab(m_type)->update_preset_choice();
852 // Synchronize config.ini with the current selections.
853 m_preset_bundle->export_selections(*wxGetApp().app_config);
854 }
855 else if (dynamic_cast<TabPresetComboBox*>(this)!=nullptr)
856 wxGetApp().sidebar().update_presets(m_type);
857
858 this->update();
859 return true;
860 }
861
862 Tab* tab = wxGetApp().get_tab(Preset::TYPE_PRINTER);
863 if (tab)
864 tab->select_preset(preset_name, false, old_printer_full_name);
865 return true;
866}
bool is_selected_physical_printer()
Definition PresetComboBoxes.cpp:813
virtual void update()
Definition PresetComboBoxes.cpp:510

References Slic3r::PhysicalPrinterCollection::get_selected_full_printer_name(), Slic3r::PhysicalPrinterCollection::get_selected_printer_preset_name(), ComboBox::GetSelection(), ComboBox::GetString(), Slic3r::PhysicalPrinterCollection::has_selection(), is_selected_physical_printer(), m_collection, m_preset_bundle, m_type, Slic3r::GUI::Tab::select_preset(), Slic3r::PhysicalPrinterCollection::select_printer(), Slic3r::Preset::TYPE_PRINTER, and update().

Referenced by Slic3r::GUI::Plater::priv::on_select_preset().

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

◆ sendComboBoxEvent()

void ComboBox::sendComboBoxEvent ( )
protectedinherited
486{
487 wxCommandEvent event(wxEVT_COMBOBOX, GetId());
488 event.SetEventObject(this);
489 event.SetInt(drop.GetSelection());
490 event.SetString(drop.GetValue());
491 GetEventHandler()->ProcessEvent(event);
492}

References drop.

Referenced by keyDown(), mouseWheelMoved(), and SelectAndNotify().

Here is the caller graph for this function:

◆ separator()

wxString Slic3r::GUI::PresetComboBox::separator ( const std::string & label)
staticprotectedinherited
693{
694 return wxString::FromUTF8(separator_head()) + _(label) + wxString::FromUTF8(separator_tail());
695}
#define _(s)
Definition 3mf.cpp:306
static const char * separator_head()
Definition PresetComboBoxes.hpp:170
static const char * separator_tail()
Definition PresetComboBoxes.hpp:171

References _, separator_head(), and separator_tail().

Here is the call graph for this function:

◆ separator_head()

const char * Slic3r::GUI::PresetComboBox::separator_head ( )
inlinestaticprotectedinherited
170{ return "--"; }

Referenced by separator().

Here is the caller graph for this function:

◆ separator_tail()

const char * Slic3r::GUI::PresetComboBox::separator_tail ( )
inlinestaticprotectedinherited
171{ return " --"; }

Referenced by separator().

Here is the caller graph for this function:

◆ set_enable_all()

void Slic3r::GUI::TabPresetComboBox::set_enable_all ( bool enable = true)
inline
252{ m_enable_all = enable; }
bool m_enable_all
Definition PresetComboBoxes.hpp:237

References m_enable_all.

◆ set_filament_idx()

void Slic3r::GUI::PresetComboBox::set_filament_idx ( const int extr_idx)
inlineinherited
95{ m_filament_idx = extr_idx; }

References m_filament_idx.

◆ set_label_marker()

void Slic3r::GUI::PresetComboBox::set_label_marker ( int item,
LabelItemType label_item_type = LABEL_ITEM_MARKER )
inherited
202{
203 this->SetClientData(item, (void*)label_item_type);
204}

Referenced by add_ams_filaments(), add_connected_printers(), Slic3r::GUI::CalibrateFilamentComboBox::update(), Slic3r::GUI::PlaterPresetComboBox::update(), update(), and Slic3r::GUI::TabPresetComboBox::update().

Here is the caller graph for this function:

◆ set_printer_technology()

bool Slic3r::GUI::PresetComboBox::set_printer_technology ( PrinterTechnology pt)
inherited
207{
208 if (printer_technology != pt) {
210 return true;
211 }
212 return false;
213}
PrinterTechnology printer_technology
Definition PresetComboBoxes.hpp:157

References printer_technology.

◆ set_replace_text()

void ComboBox::set_replace_text ( wxString text,
wxString image_name )
inherited
314{
315 replace_text = text;
316 image_for_text = image_name;
318}
wxString image_for_text
Definition ComboBox.hpp:31
wxString replace_text
Definition ComboBox.hpp:30
bool is_replace_text_to_image
Definition ComboBox.hpp:28

References image_for_text, is_replace_text_to_image, and replace_text.

Referenced by Slic3r::GUI::PlaterPresetComboBox::update().

Here is the caller graph for this function:

◆ set_selection_changed_function()

void Slic3r::GUI::PresetComboBox::set_selection_changed_function ( std::function< void(int)> sel_changed)
inlineinherited
73{ on_selection_changed = sel_changed; }

References on_selection_changed.

Referenced by Slic3r::GUI::DiffPresetDialog::create_presets_sizer().

Here is the caller graph for this function:

◆ set_show_incompatible_presets()

void Slic3r::GUI::TabPresetComboBox::set_show_incompatible_presets ( bool show_incompatible_presets)
inline
242 {
243 show_incompatible = show_incompatible_presets;
244 }
bool show_incompatible
Definition PresetComboBoxes.hpp:236

References show_incompatible.

◆ SetFlag()

void ComboBox::SetFlag ( unsigned int n,
int value )
inherited
203 {
204 if (n >= items.size()) return;
205 items[n].flag = value;
206 drop.Invalidate();
207}

References drop, and items.

Referenced by Slic3r::GUI::PresetComboBox::add_ams_filaments(), and Slic3r::GUI::PlaterPresetComboBox::update().

Here is the caller graph for this function:

◆ SetFont()

bool ComboBox::SetFont ( wxFont const & font)
overridevirtualinherited
220{
221 if (GetTextCtrl() && GetTextCtrl()->IsShown())
222 return GetTextCtrl()->SetFont(font);
223 else
224 return TextInput::SetFont(font);
225}

Referenced by Slic3r::GUI::PresetComboBox::PresetComboBox(), Slic3r::GUI::GridCellChoiceEditor::Create(), and Slic3r::GUI::use_nozzle_row_font().

Here is the caller graph for this function:

◆ SetItemActionBitmap()

void ComboBox::SetItemActionBitmap ( unsigned int n,
wxBitmap const & bitmap )
inherited
365{
366 if (n >= items.size()) return;
367 items[n].action_icon = bitmap.IsOk() ? bitmap : wxNullBitmap;
368 drop.Invalidate();
369}

References drop, and items.

◆ SetItemAlias()

void ComboBox::SetItemAlias ( unsigned int n,
wxString const & value )
inherited
350{
351 if (n >= items.size()) return;
352 items[n].alias = value;
353}

References items.

Referenced by Slic3r::GUI::PlaterPresetComboBox::update(), and Slic3r::GUI::TabPresetComboBox::update().

Here is the caller graph for this function:

◆ SetItemBitmap()

void ComboBox::SetItemBitmap ( unsigned int n,
wxBitmap const & bitmap )
inherited
358{
359 if (n >= items.size()) return;
360 items[n].icon = bitmap.IsOk() ? bitmap : wxNullBitmap;
361 drop.Invalidate();
362}

References drop, and items.

Referenced by Slic3r::GUI::TabPresetComboBox::update_dirty().

Here is the caller graph for this function:

◆ SetItems()

int ComboBox::SetItems ( const std::vector< DropDown::Item > & the_items)
inherited
268{
269 items = the_items;
270 drop.Invalidate();
271 return items.size() - 1;
272}

References drop, and items.

◆ SetItemTooltip()

void ComboBox::SetItemTooltip ( unsigned int n,
wxString const & value )
inherited
337 {
338 if (n >= items.size()) return;
339 items[n].tip = value;
340 if (n == drop.GetSelection()) drop.SetToolTip(value);
341}

References drop, and items.

Referenced by Slic3r::GUI::PlaterPresetComboBox::update(), and Slic3r::GUI::TabPresetComboBox::update().

Here is the caller graph for this function:

◆ SetKeepDropArrow()

void ComboBox::SetKeepDropArrow ( bool keep)
inlineinherited
48{ m_keep_drop_arrow = keep; }
bool m_keep_drop_arrow
Definition ComboBox.hpp:29

References m_keep_drop_arrow.

◆ SetLabel()

void ComboBox::SetLabel ( const wxString & label)
overrideinherited
170{
171 if (GetTextCtrl()->IsShown() || text_off)
172 GetTextCtrl()->SetValue(value);
173 else {
175 auto new_value = value;
176 if (new_value.starts_with(replace_text)) {
177 new_value.Replace(replace_text, "", false); // replace first text
179 TextInput::SetLabel(new_value);
180 return;
181 }
182 }
184 TextInput::SetLabel(value);
185 }
186}
void SetLabel(const wxString &label) override
Definition TextInput.cpp:113
void SetIcon_1(const wxString &icon)
Definition TextInput.cpp:143

References image_for_text, is_replace_text_to_image, replace_text, TextInput::SetIcon_1(), TextInput::SetLabel(), and text_off.

Referenced by Slic3r::GUI::create_select_filament_preset_checkbox(), SetSelection(), SetString(), SetValue(), and Slic3r::GUI::LayerNumberTextInput::update_label().

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

◆ SetSelection()

void ComboBox::SetSelection ( int n)
overrideinherited
103{
104 if (n == drop.selection)
105 return;
106 drop.SetSelection(n);
107 SetLabel(drop.GetValue());
108 if (drop.selection >= 0 && drop.iconSize.y > 0 && items[drop.selection].icon_textctrl.IsOk()) {
109 if (m_keep_drop_arrow) {
110 SetIcon("drop_down");
111 SetIcon_1(items[drop.selection].icon_textctrl);
112 } else {
113 SetIcon(items[drop.selection].icon_textctrl);
114 }
115 } else {
116 SetIcon("drop_down");
118 SetIcon_1(wxNullBitmap);
119 }
120
121 if (drop.selection >= 0) {
122 SetStaticTips(items[drop.selection].text_static_tips, wxNullBitmap);
123 } else {
124 SetStaticTips(wxEmptyString, wxNullBitmap);
125 }
126
127}
void SetLabel(const wxString &label) override
Definition ComboBox.cpp:169

References drop, items, m_keep_drop_arrow, and SetLabel().

Referenced by ComboBox(), Slic3r::GUI::DesignPanel::DesignPanel(), Slic3r::GUI::LayerNumberTextInput::LayerNumberTextInput(), Slic3r::GUI::GridCellChoiceEditor::BeginEdit(), Slic3r::GUI::GridCellFilamentsEditor::BeginEdit(), BitmapChoiceRenderer::CreateEditorCtrl(), Slic3r::GUI::DesignPanel::fill_body_choice(), Slic3r::GUI::DesignPanel::fill_revolve_axes(), keyDown(), mouseWheelMoved(), Slic3r::GUI::Sidebar::on_filament_count_change(), Slic3r::GUI::CalibrateFilamentComboBox::OnSelect(), Slic3r::GUI::PlaterPresetComboBox::OnSelect(), Slic3r::GUI::PresetComboBox::OnSelect(), Slic3r::GUI::TabPresetComboBox::OnSelect(), Slic3r::GUI::DesignPanel::populate_body_choices(), Slic3r::GUI::DesignPanel::populate_plane_choices(), Slic3r::GUI::DesignPanel::populate_sheet_body_choices(), Slic3r::GUI::select_nozzle_volume(), Slic3r::GUI::DesignPanel::select_sheet_choice(), SelectAndNotify(), Slic3r::GUI::LayerNumberTextInput::set_layer_number(), Slic3r::GUI::Choice::set_selection(), Slic3r::GUI::Choice::set_value(), Slic3r::GUI::Choice::set_value(), Slic3r::GUI::TabPresetComboBox::update_dirty(), Slic3r::GUI::Sidebar::update_presets(), and Slic3r::GUI::PresetComboBox::update_selection().

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

◆ SetString()

void ComboBox::SetString ( unsigned int n,
wxString const & value )
overrideinherited
324{
325 if (n >= items.size()) return;
326 items[n].text = value;
327 drop.Invalidate();
328 if (n == drop.GetSelection()) SetLabel(value);
329}

References drop, items, and SetLabel().

Referenced by Slic3r::GUI::TabPresetComboBox::update_dirty().

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

◆ SetTextLabel()

void ComboBox::SetTextLabel ( const wxString & label)
inherited
210{
211 TextInput::SetLabel(label);
212}

References TextInput::SetLabel().

Referenced by Slic3r::GUI::Choice::BUILD(), and Slic3r::GUI::PrinterAgentChoice::BUILD().

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

◆ SetValue()

void ComboBox::SetValue ( const wxString & value)
inherited
146{
147 drop.SetValue(value);
148 SetLabel(value);
149 if (drop.selection >= 0 && drop.iconSize.y > 0 && items[drop.selection].icon_textctrl.IsOk()) {
150 if (m_keep_drop_arrow) {
151 SetIcon("drop_down");
152 SetIcon_1(items[drop.selection].icon_textctrl);
153 } else {
154 SetIcon(items[drop.selection].icon_textctrl);
155 }
156 } else {
157 SetIcon("drop_down");
159 SetIcon_1(wxNullBitmap);
160 }
161
162 if (drop.selection >= 0) {
163 SetStaticTips(items[drop.selection].text_static_tips, wxNullBitmap);
164 } else {
165 SetStaticTips(wxEmptyString, wxNullBitmap);
166 }
167}

References drop, items, m_keep_drop_arrow, and SetLabel().

Referenced by Slic3r::GUI::CalibrateFilamentComboBox::load_tray(), OnEdit(), Slic3r::GUI::Choice::set_selection(), Slic3r::GUI::Choice::set_value(), and Slic3r::GUI::Choice::set_value().

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

◆ show_all()

void Slic3r::GUI::PresetComboBox::show_all ( bool show_all)
inherited
505{
507 update();
508}
bool m_show_all
Definition PresetComboBoxes.hpp:46
void show_all(bool show_all)
Definition PresetComboBoxes.cpp:504

References m_show_all, show_all(), and update().

Referenced by show_all().

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

◆ sys_color_changed()

void Slic3r::GUI::PresetComboBox::sys_color_changed ( )
virtualinherited

Reimplemented in Slic3r::GUI::PlaterPresetComboBox.

666{
667 wxGetApp().UpdateDarkUI(this);
668 msw_rescale();
669}

References msw_rescale().

Referenced by Slic3r::GUI::PlaterPresetComboBox::sys_color_changed().

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

◆ type()

Preset::Type Slic3r::GUI::TabPresetComboBox::type ( ) const
inline
255{ return m_type; }

References Slic3r::GUI::PresetComboBox::m_type.

◆ update() [1/2]

void Slic3r::GUI::PresetComboBox::update ( std::string select_preset)
inherited
437{
438 Freeze();
439 Clear();
441
442 const std::deque<Preset>& presets = m_collection->get_presets();
443
444 std::map<wxString, std::pair<wxBitmap*, bool>> nonsys_presets;
445 std::map<wxString, wxBitmap*> incomp_presets;
446
447 wxString selected = "";
448 if (!presets.front().is_visible)
449 set_label_marker(Append(_L("System presets"), wxNullBitmap, DD_ITEM_STYLE_SPLIT_ITEM));
450
451 for (size_t i = presets.front().is_visible ? 0 : m_collection->num_default_presets(); i < presets.size(); ++i)
452 {
453 const Preset& preset = presets[i];
454 if (!m_show_all && (!preset.is_visible || !preset.is_compatible))
455 continue;
456
457 // marker used for disable incompatible printer models for the selected physical printer
458 bool is_enabled = m_type == Preset::TYPE_PRINTER && printer_technology != ptAny ? preset.printer_technology() == printer_technology : true;
459 if (select_preset_name.empty() && is_enabled)
460 select_preset_name = preset.name;
461
462 wxBitmap* bmp = get_bmp(preset);
463 assert(bmp);
464
465 if (!is_enabled)
466 incomp_presets.emplace(get_preset_name(preset), bmp);
467 else if (preset.is_default || preset.is_system)
468 {
469 Append(get_preset_name(preset), *bmp);
470 validate_selection(preset.name == select_preset_name);
471 }
472 else
473 {
474 nonsys_presets.emplace(get_preset_name(preset), std::pair<wxBitmap*, bool>(bmp, is_enabled));
475 if (preset.name == select_preset_name || (select_preset_name.empty() && is_enabled))
476 selected = get_preset_name(preset);
477 }
478 if (i + 1 == m_collection->num_default_presets())
479 set_label_marker(Append(_L("System presets"), wxNullBitmap, DD_ITEM_STYLE_SPLIT_ITEM));
480 }
481 if (!nonsys_presets.empty())
482 {
483 set_label_marker(Append(_L("User presets"), wxNullBitmap, DD_ITEM_STYLE_SPLIT_ITEM));
484 for (std::map<wxString, std::pair<wxBitmap*, bool>>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) {
485 int item_id = Append(it->first, *it->second.first);
486 bool is_enabled = it->second.second;
487 if (!is_enabled)
489 validate_selection(it->first == selected);
490 }
491 }
492 if (!incomp_presets.empty())
493 {
494 set_label_marker(Append(_L("Incompatible presets"), wxNullBitmap, DD_ITEM_STYLE_SPLIT_ITEM));
495 for (std::map<wxString, wxBitmap*>::iterator it = incomp_presets.begin(); it != incomp_presets.end(); ++it) {
496 set_label_marker(Append(it->first, *it->second), LABEL_ITEM_DISABLED);
497 }
498 }
499
501 Thaw();
502}
wxBitmap * get_bmp(std::string bitmap_key, bool wide_icons, const std::string &main_icon_name, bool is_compatible=true, bool is_system=false, bool is_single_bar=false, const std::string &filament_rgb="", const std::string &extruder_rgb="", const std::string &material_rgb="")
Definition PresetComboBoxes.cpp:697
void update_selection()
Definition PresetComboBoxes.cpp:228
void invalidate_selection()
Definition PresetComboBoxes.cpp:215
@ ptAny
Definition Config.hpp:237

References _L, ComboBox::Append(), DD_ITEM_STYLE_SPLIT_ITEM, get_bmp(), get_preset_name(), invalidate_selection(), Slic3r::Preset::is_compatible, Slic3r::Preset::is_default, Slic3r::Preset::is_system, Slic3r::Preset::is_visible, LABEL_ITEM_DISABLED, m_collection, m_show_all, m_type, Slic3r::Preset::name, printer_technology, Slic3r::Preset::printer_technology(), Slic3r::ptAny, set_label_marker(), Slic3r::Preset::TYPE_PRINTER, update_selection(), and validate_selection().

Referenced by Slic3r::GUI::DiffPresetDialog::create_presets_sizer(), and Slic3r::GUI::DiffPresetDialog::update_compatibility().

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

◆ update() [2/2]

void Slic3r::GUI::TabPresetComboBox::update ( )
overridevirtual

Reimplemented from Slic3r::GUI::PresetComboBox.

1722{
1723 Freeze();
1724 Clear();
1726
1727 const std::deque<Preset>& presets = m_collection->get_presets();
1728
1729 std::map<wxString, std::pair<wxBitmap*, bool>> nonsys_presets;
1730 //BBS: add project embedded presets logic
1731 std::map<wxString, std::pair<wxBitmap*, bool>> project_embedded_presets;
1732 //BBS: move system to the end
1733 std::map<wxString, std::pair<wxBitmap*, bool>> system_presets;
1734 // ORCA: add bundle presets
1735 std::map<wxString, std::pair<wxBitmap*, bool>> bundle_presets;
1736 std::map<wxString, wxString> preset_descriptions;
1737 std::map<wxString, std::string> preset_aliases; // ORCA
1738 std::map<wxString, std::string> preset_bundle_ids;
1739 std::map<wxString, std::string> preset_bundle_names;
1740
1741 wxString selected = "";
1742 //BBS: move system to the end
1743 /*if (!presets.front().is_visible)
1744 set_label_marker(Append(separator(L("System presets")), wxNullBitmap));*/
1745 size_t idx_selected = m_collection->get_selected_idx();
1746
1747 if (m_type == Preset::TYPE_PRINTER && m_preset_bundle->physical_printers.has_selection()) {
1748 std::string sel_preset_name = m_preset_bundle->physical_printers.get_selected_printer_preset_name();
1749 Preset* preset = m_collection->find_preset(sel_preset_name);
1750 if (!preset)
1751 m_preset_bundle->physical_printers.unselect_printer();
1752 }
1753
1754 for (size_t i = presets.front().is_visible ? 0 : m_collection->num_default_presets(); i < presets.size(); ++i)
1755 {
1756 const Preset& preset = presets[i];
1757 if (!preset.is_visible || (!show_incompatible && !preset.is_compatible && i != idx_selected))
1758 continue;
1759
1760 // marker used for disable incompatible printer models for the selected physical printer
1761 bool is_enabled = true;
1762
1763 wxBitmap* bmp = get_bmp(preset);
1764 assert(bmp);
1765
1766 const wxString name = from_u8(preset.name);
1767 preset_aliases[name] = get_preset_name(preset).utf8_string();
1768 if (preset.is_system)
1769 preset_descriptions.emplace(name, from_u8(preset.description));
1770
1771 // ORCA: Track bundle names for bundled presets
1772 if (preset.is_from_bundle()) {
1773 m_preset_bundle->bundles.ReadLock();
1774 auto bundle_it = m_preset_bundle->bundles.m_bundles.find(preset.bundle_id);
1775 if (bundle_it != m_preset_bundle->bundles.m_bundles.end()) {
1776 preset_bundle_ids[name] = bundle_it->second.id;
1777 preset_bundle_names[name] = bundle_it->second.name;
1778 }
1779 m_preset_bundle->bundles.ReadUnlock();
1780
1781 }
1782
1783 if (preset.is_default || preset.is_system) {
1784 //BBS: move system to the end
1785 system_presets.emplace(name, std::pair<wxBitmap *, bool>(bmp, is_enabled));
1786 if (i == idx_selected)
1787 selected = name;
1788 //int item_id = Append(get_preset_name(preset), *bmp);
1789 //if (!is_enabled)
1790 // set_label_marker(item_id, LABEL_ITEM_DISABLED);
1791 //validate_selection(i == idx_selected);
1792 }
1793 //BBS: add project embedded preset logic
1794 else if (preset.is_project_embedded)
1795 {
1796 //std::pair<wxBitmap*, bool> pair(bmp, is_enabled);
1797 project_embedded_presets.emplace(name, std::pair<wxBitmap *, bool>(bmp, is_enabled));
1798 if (i == idx_selected)
1799 selected = name;
1800 }
1801 // ORCA: add bundle presets
1802 else if (preset.is_from_bundle())
1803 {
1804 bundle_presets.emplace(name, std::pair<wxBitmap*, bool>(bmp, is_enabled));
1805 if (i == idx_selected)
1806 selected = name;
1807 }
1808 else
1809 {
1810 std::pair<wxBitmap*, bool> pair(bmp, is_enabled);
1811 nonsys_presets.emplace(name, std::pair<wxBitmap *, bool>(bmp, is_enabled));
1812 if (i == idx_selected)
1813 selected = name;
1814 }
1815 //BBS: move system to the end
1816 //if (i + 1 == m_collection->num_default_presets())
1817 // set_label_marker(Append(separator(L("System presets")), wxNullBitmap));
1818 }
1819
1820 if (m_type == Preset::TYPE_FILAMENT && m_preset_bundle->is_bbl_vendor())
1821 add_ams_filaments(into_u8(selected));
1822
1823 //BBS: add project embedded preset logic
1824 if (!project_embedded_presets.empty())
1825 {
1826 set_label_marker(Append(_L("Project-inside presets"), wxNullBitmap, DD_ITEM_STYLE_SPLIT_ITEM));
1827 for (std::map<wxString, std::pair<wxBitmap*, bool>>::iterator it = project_embedded_presets.begin(); it != project_embedded_presets.end(); ++it) {
1828 int item_id = Append(it->first, *it->second.first);
1829 SetItemTooltip(item_id, preset_descriptions[it->first]);
1830 bool is_enabled = it->second.second;
1831 if (!is_enabled)
1833 validate_selection(it->first == selected);
1834 }
1835 }
1836 if (!nonsys_presets.empty())
1837 {
1838 set_label_marker(Append(_L("User presets"), wxNullBitmap, DD_ITEM_STYLE_SPLIT_ITEM));
1839 for (std::map<wxString, std::pair<wxBitmap*, bool>>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) {
1840 int item_id = Append(it->first, *it->second.first);
1841 SetItemAlias(item_id, it->first);
1842 SetItemTooltip(item_id, preset_descriptions[it->first]);
1843 bool is_enabled = it->second.second;
1844 if (!is_enabled)
1846 validate_selection(it->first == selected);
1847 }
1848 }
1849 // ORCA: add bundle presets with sub-dropdown grouping
1850 if (!bundle_presets.empty())
1851 {
1852 set_label_marker(Append(_L("Bundle presets"), wxNullBitmap, DD_ITEM_STYLE_SPLIT_ITEM));
1853 for (std::map<wxString, std::pair<wxBitmap*, bool>>::iterator it = bundle_presets.begin(); it != bundle_presets.end(); ++it) {
1854 // Get bundle name for grouping
1855 wxString bundle_name = _L("Unspecified");
1856 if (preset_bundle_names.count(it->first) > 0 && !preset_bundle_names[it->first].empty()) {
1857 bundle_name = from_u8(preset_bundle_names[it->first]);
1858 }
1859 // Use Append with group parameter for sub-dropdown grouping
1860 int item_id = Append(from_u8(preset_aliases[it->first]), *it->second.first, from_u8(preset_bundle_ids[it->first]), bundle_name);
1861 SetItemAlias(item_id, it->first);
1862 SetItemTooltip(item_id, preset_descriptions[it->first]);
1863 bool is_enabled = it->second.second;
1864 if (!is_enabled)
1866 validate_selection(it->first == selected);
1867 }
1868 }
1869 //BBS: move system to the end
1870 if (!system_presets.empty())
1871 {
1872 set_label_marker(Append(_L("System presets"), wxNullBitmap, DD_ITEM_STYLE_SPLIT_ITEM));
1873 for (std::map<wxString, std::pair<wxBitmap*, bool>>::iterator it = system_presets.begin(); it != system_presets.end(); ++it) {
1874 int item_id = Append(it->first, *it->second.first);
1875 SetItemAlias(item_id, it->first);
1876 SetItemTooltip(item_id, preset_descriptions[it->first]);
1877 bool is_enabled = it->second.second;
1878 if (!is_enabled)
1880 validate_selection(it->first == selected);
1881 }
1882 }
1883
1885 {
1886 //BBS: remove unused pysical printer logic
1887 /*// add Physical printers, if any exists
1888 if (!m_preset_bundle->physical_printers.empty()) {
1889 set_label_marker(Append(separator(L("Physical printers")), wxNullBitmap));
1890 const PhysicalPrinterCollection& ph_printers = m_preset_bundle->physical_printers;
1891
1892 for (PhysicalPrinterCollection::ConstIterator it = ph_printers.begin(); it != ph_printers.end(); ++it) {
1893 for (const std::string& preset_name : it->get_preset_names()) {
1894 Preset* preset = m_collection->find_preset(preset_name);
1895 if (!preset || !preset->is_visible)
1896 continue;
1897 std::string main_icon_name = preset->printer_technology() == ptSLA ? "sla_printer" : m_main_bitmap_name;
1898
1899 wxBitmap* bmp = get_bmp(main_icon_name, main_icon_name, "", true, true, false);
1900 assert(bmp);
1901
1902 set_label_marker(Append(from_u8(it->get_full_name(preset_name) + suffix(preset)), *bmp), LABEL_ITEM_PHYSICAL_PRINTER);
1903 validate_selection(ph_printers.is_selected(it, preset_name));
1904 }
1905 }
1906 }*/
1907
1908 // add "Add/Remove printers" item
1909 //std::string icon_name = "edit_uni";
1910 //wxBitmap* bmp = get_bmp("edit_preset_list, tab,", icon_name, "");
1911 //assert(bmp);
1912
1913 //set_label_marker(Append(separator(L("Add/Remove printers")), *bmp), LABEL_ITEM_WIZARD_PRINTERS);
1914 }
1915
1916 // BBS Add/Remove filaments select
1917 //wxBitmap* bmp = get_bmp("edit_preset_list", false, "edit_uni");
1918 //assert(bmp);
1919 //if (m_type == Preset::TYPE_FILAMENT)
1920 // set_label_marker(Append(separator(L("Add/Remove filaments")), *bmp), LABEL_ITEM_WIZARD_FILAMENTS);
1921 //else if (m_type == Preset::TYPE_SLA_MATERIAL)
1922 // set_label_marker(Append(separator(L("Add/Remove materials")), *bmp), LABEL_ITEM_WIZARD_MATERIALS);
1923
1925 Thaw();
1926}
void SetItemTooltip(unsigned int n, wxString const &value)
Definition ComboBox.cpp:337
void SetItemAlias(unsigned int n, wxString const &value)
Definition ComboBox.cpp:349
bool add_ams_filaments(std::string selected, bool alias_name=false)
Definition PresetComboBoxes.cpp:555
PresetCollection * presets() const
Definition PresetComboBoxes.hpp:254
wxString get_preset_name(const Preset &preset) override
Definition PresetComboBoxes.cpp:1710
std::string into_u8(const wxString &str)
Definition GUI.cpp:549

References _L, Slic3r::GUI::PresetComboBox::add_ams_filaments(), ComboBox::Append(), Slic3r::Preset::bundle_id, DD_ITEM_STYLE_SPLIT_ITEM, Slic3r::Preset::description, Slic3r::GUI::from_u8(), Slic3r::GUI::PresetComboBox::get_bmp(), get_preset_name(), Slic3r::GUI::into_u8(), Slic3r::GUI::PresetComboBox::invalidate_selection(), Slic3r::Preset::is_compatible, Slic3r::Preset::is_default, Slic3r::Preset::is_from_bundle(), Slic3r::Preset::is_project_embedded, Slic3r::Preset::is_system, Slic3r::Preset::is_visible, Slic3r::GUI::PresetComboBox::LABEL_ITEM_DISABLED, Slic3r::GUI::PresetComboBox::m_collection, Slic3r::GUI::PresetComboBox::m_preset_bundle, Slic3r::GUI::PresetComboBox::m_type, Slic3r::Preset::name, presets(), Slic3r::GUI::PresetComboBox::set_label_marker(), ComboBox::SetItemAlias(), ComboBox::SetItemTooltip(), show_incompatible, Slic3r::Preset::TYPE_FILAMENT, Slic3r::Preset::TYPE_PRINTER, Slic3r::GUI::PresetComboBox::update_selection(), and Slic3r::GUI::PresetComboBox::validate_selection().

Referenced by Slic3r::GUI::Sidebar::update_presets().

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

◆ update_ams_color()

int Slic3r::GUI::PresetComboBox::update_ams_color ( )
protectedinherited
275{
276 if (m_filament_idx < 0) return -1;
277 int idx = selected_ams_filament();
278 std::string color;
279 std::string ctype;
280 std::vector<std::string> colors;
281 if (idx < 0) {
282 // ORCA: The combo displays the preset alias while
283 // the stored preset name usually carries a printer suffix. Resolving with the raw display
284 // value via find_preset() fails for such presets, so this returned early and the
285 // filament color swatch (clr_picker) kept showing the previous color. Prefer the
286 // internal preset name stored per item, then fall back to alias resolution.
287 std::string name;
288 if (m_last_selected >= 0) {
289 wxString stored = GetItemAlias(m_last_selected);
290 if (!stored.empty())
291 name = Preset::remove_suffix_modified(stored.ToUTF8().data());
292 }
293 if (name.empty())
294 name = m_collection->get_preset_name_by_alias(Preset::remove_suffix_modified(GetValue().ToUTF8().data()));
295 auto *preset = m_collection->find_preset(name);
296 if (preset)
297 color = preset->config.opt_string("default_filament_colour", 0u);
298 if (color.empty()) return -1;
299 } else {
300 auto &ams_list = wxGetApp().preset_bundle->filament_ams_list;
301 auto iter = ams_list.find(idx);
302 if (iter == ams_list.end()) {
303 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(": ams %1% out of range %2%") % idx % ams_list.size();
304 return -1;
305 }
306 color = iter->second.opt_string("filament_colour", 0u);
307 ctype = iter->second.opt_string("filament_colour_type", 0u);
308 colors = iter->second.opt<ConfigOptionStrings>("filament_multi_colour")->values;
309 }
310 DynamicPrintConfig *cfg = &wxGetApp().preset_bundle->project_config;
311 auto color_head = static_cast<ConfigOptionStrings*>(cfg->option("filament_colour")->clone()); // single color (the first color if multi-color filament)
312 auto color_pack = static_cast<ConfigOptionStrings *>(cfg->option("filament_multi_colour")->clone()); // multi color (all colors in all kinds of filament)
313 auto color_type = static_cast<ConfigOptionStrings*>(cfg->option("filament_colour_type")->clone()); // color type
314
315 color_head->values[m_filament_idx] = color;
316 color_type->values[m_filament_idx] = ctype;
317 std::string color_str = ""; // Translate multi color info to config storage format
318 for (auto &c : colors) {
319 if (c.empty()) continue;
320 color_str += c + " ";
321 }
322 if (color_str.empty()) color_str = color;
323 else color_str.erase(color_str.size() - 1);
324 color_pack->values[m_filament_idx] = color_str;
325
326 // Update color informations in config
327 DynamicPrintConfig new_cfg;
328 new_cfg.set_key_value("filament_colour", color_head);
329 new_cfg.set_key_value("filament_colour_type", color_type);
330 new_cfg.set_key_value("filament_multi_colour", color_pack);
331 cfg->apply(new_cfg);
332 wxGetApp().plater()->on_config_change(new_cfg);
333 //trigger the filament color changed
334 wxCommandEvent *evt = new wxCommandEvent(EVT_FILAMENT_COLOR_CHANGED);
335 evt->SetInt(m_filament_idx);
336 wxQueueEvent(wxGetApp().plater(), evt);
337 return idx;
338}
wxString GetItemAlias(unsigned int n) const
Definition ComboBox.cpp:343
wxString GetValue() const
Definition ComboBox.cpp:140
int selected_ams_filament() const
Definition PresetComboBoxes.cpp:642
static std::string remove_suffix_modified(const std::string &name)
Definition Preset.cpp:516
static Plater * plater()
Definition GUI_Factories.cpp:400

References Slic3r::ConfigBase::apply(), ComboBox::GetItemAlias(), ComboBox::GetValue(), m_collection, m_filament_idx, m_last_selected, Slic3r::ConfigBase::option(), Slic3r::GUI::plater(), Slic3r::Preset::remove_suffix_modified(), selected_ams_filament(), Slic3r::DynamicConfig::set_key_value(), and Slic3r::ConfigOptionVector< T >::values.

Referenced by Slic3r::GUI::PlaterPresetComboBox::OnSelect(), and Slic3r::GUI::TabPresetComboBox::OnSelect().

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

◆ update_dirty()

void Slic3r::GUI::TabPresetComboBox::update_dirty ( )
1938{
1939 // 1) Update the dirty flag of the current preset.
1940 m_collection->update_dirty();
1941
1942 // 2) Update the labels.
1943 wxWindowUpdateLocker noUpdates(this);
1944 for (unsigned int ui_id = 0; ui_id < GetCount(); ++ui_id) {
1945 auto marker = reinterpret_cast<Marker>(this->GetClientData(ui_id));
1946 if (marker >= LABEL_ITEM_MARKER)
1947 continue;
1948
1949 std::string old_label = GetString(ui_id).utf8_str().data();
1950 std::string preset_name = Preset::remove_suffix_modified(old_label);
1951 std::string ph_printer_name;
1952
1953 if (marker == LABEL_ITEM_PHYSICAL_PRINTER) {
1954 ph_printer_name = PhysicalPrinter::get_short_name(preset_name);
1955 preset_name = PhysicalPrinter::get_preset_name(preset_name);
1956 }
1957
1958 Preset* preset = m_collection->find_preset(preset_name, false);
1959 if (preset) {
1960 std::string new_label = preset->label(true);
1961
1962 if (marker == LABEL_ITEM_PHYSICAL_PRINTER)
1963 new_label = ph_printer_name + PhysicalPrinter::separator() + new_label;
1964
1965 if (old_label != new_label) {
1966 SetString(ui_id, from_u8(new_label));
1967 SetItemBitmap(ui_id, *get_bmp(*preset));
1968 if (ui_id == GetSelection()) SetToolTip(wxString::FromUTF8(new_label.c_str())); // BBS
1969 }
1970 }
1971 }
1972#ifdef __APPLE__
1973 // wxWidgets on OSX do not upload the text of the combo box line automatically.
1974 // Force it to update by re-selecting.
1976#endif /* __APPLE __ */
1977}
void SetItemBitmap(unsigned int n, wxBitmap const &bitmap)
Definition ComboBox.cpp:357
void SetString(unsigned int n, wxString const &value) override
Definition ComboBox.cpp:323
static std::string get_short_name(std::string full_name)
Definition Preset.cpp:4699
static std::string separator()
Definition Preset.cpp:4547
static std::string get_preset_name(std::string full_name)
Definition Preset.cpp:4707

References Slic3r::GUI::from_u8(), Slic3r::GUI::PresetComboBox::get_bmp(), Slic3r::PhysicalPrinter::get_preset_name(), Slic3r::PhysicalPrinter::get_short_name(), ComboBox::GetCount(), ComboBox::GetSelection(), ComboBox::GetString(), Slic3r::Preset::label(), Slic3r::GUI::PresetComboBox::LABEL_ITEM_MARKER, Slic3r::GUI::PresetComboBox::LABEL_ITEM_PHYSICAL_PRINTER, Slic3r::GUI::PresetComboBox::m_collection, Slic3r::Preset::remove_suffix_modified(), Slic3r::PhysicalPrinter::separator(), ComboBox::SetItemBitmap(), ComboBox::SetSelection(), and ComboBox::SetString().

Here is the call graph for this function:

◆ update_from_bundle()

void Slic3r::GUI::PresetComboBox::update_from_bundle ( )
inherited
516{
517 this->update(m_collection->get_selected_preset().name);
518}

References m_collection, and update().

Here is the call graph for this function:

◆ update_selection()

void Slic3r::GUI::PresetComboBox::update_selection ( )
protectedinherited
229{
230 /* If selected_preset_item is still equal to INT_MAX, it means that
231 * there is no presets added to the list.
232 * So, select last combobox item ("Add/Remove preset")
233 */
234 //validate_selection();
235 if (m_last_selected == INT_MAX)
236 m_last_selected = 1;
237
239#ifdef __WXMSW__
240 // From the Windows 2004 the tooltip for preset combobox doesn't work after next call of SetTooltip()
241 // (There was an issue, when tooltip doesn't appears after changing of the preset selection)
242 // But this workaround seems to work: We should to kill tooltip and than set new tooltip value
243 SetToolTip(NULL);
244#endif
245 SetToolTip(GetString(m_last_selected));
246
247// A workaround for a set of issues related to text fitting into gtk widgets:
248#if defined(__WXGTK20__) || defined(__WXGTK3__)
249 GtkWidget* widget = m_widget;
250 if (GTK_IS_CONTAINER(widget)) {
251 GList* children = gtk_container_get_children(GTK_CONTAINER(widget));
252 if (children) {
253 widget = GTK_WIDGET(children->data);
254 g_list_free(children);
255 }
256 }
257 if (GTK_IS_ENTRY(widget)) {
258 // Set ellipsization for the entry
259 gtk_entry_set_width_chars(GTK_ENTRY(widget), 20); // Adjust this value as needed
260 gtk_entry_set_max_width_chars(GTK_ENTRY(widget), 20); // Adjust this value as needed
261 // Create a PangoLayout for the entry and set ellipsization
262 PangoLayout* layout = gtk_entry_get_layout(GTK_ENTRY(widget));
263 if (layout) {
264 pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_END);
265 } else {
266 g_warning("Unable to get PangoLayout from GtkEntry");
267 }
268 } else {
269 g_warning("Expected GtkEntry, but got %s", G_OBJECT_TYPE_NAME(widget));
270 }
271#endif
272}

References ComboBox::GetString(), m_last_selected, and ComboBox::SetSelection().

Referenced by update(), and Slic3r::GUI::TabPresetComboBox::update().

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

◆ validate_selection()

void Slic3r::GUI::PresetComboBox::validate_selection ( bool predicate = false)
protectedinherited
221{
222 if (predicate &&
223 // just in case: mark m_last_selected as a first added element
224 m_last_selected == INT_MAX)
226}

References ComboBox::GetCount(), and m_last_selected.

Referenced by add_connected_printers(), Slic3r::GUI::CalibrateFilamentComboBox::update(), Slic3r::GUI::PlaterPresetComboBox::update(), update(), and Slic3r::GUI::TabPresetComboBox::update().

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

Member Data Documentation

◆ drop

◆ drop_down

bool ComboBox::drop_down = false
privateinherited

◆ icon_height

int Slic3r::GUI::PresetComboBox::icon_height
protectedinherited

Referenced by fill_width_height(), get_bmp(), and get_bmp().

◆ image_for_text

wxString ComboBox::image_for_text
privateinherited

Referenced by set_replace_text(), and SetLabel().

◆ is_replace_text_to_image

bool ComboBox::is_replace_text_to_image = false
privateinherited

Referenced by set_replace_text(), and SetLabel().

◆ items

◆ m_bitmapCompatible

ScalableBitmap Slic3r::GUI::PresetComboBox::m_bitmapCompatible
protectedinherited

◆ m_bitmapIncompatible

ScalableBitmap Slic3r::GUI::PresetComboBox::m_bitmapIncompatible
protectedinherited

◆ m_collection

◆ m_em_unit

◆ m_enable_all

bool Slic3r::GUI::TabPresetComboBox::m_enable_all {false}
private
237{false};

Referenced by set_enable_all().

◆ m_filament_idx

◆ m_first_ams_filament

int Slic3r::GUI::PresetComboBox::m_first_ams_filament = 0
protectedinherited

◆ m_first_printer_idx

int Slic3r::GUI::PresetComboBox::m_first_printer_idx = 0
protectedinherited

◆ m_keep_drop_arrow

bool ComboBox::m_keep_drop_arrow = false
privateinherited

◆ m_last_ams_filament

int Slic3r::GUI::PresetComboBox::m_last_ams_filament = 0
protectedinherited

◆ m_last_printer_idx

int Slic3r::GUI::PresetComboBox::m_last_printer_idx = 0
protectedinherited

◆ m_last_selected

◆ m_main_bitmap_name

std::string Slic3r::GUI::PresetComboBox::m_main_bitmap_name
protectedinherited

Referenced by PresetComboBox().

◆ m_preset_bundle

◆ m_selected_dev_id

std::string Slic3r::GUI::PresetComboBox::m_selected_dev_id
protectedinherited

◆ m_show_all

bool Slic3r::GUI::PresetComboBox::m_show_all { false }
privateinherited
46{ false };

Referenced by show_all(), and update().

◆ m_type

◆ norm_icon_width

int Slic3r::GUI::PresetComboBox::norm_icon_width
protectedinherited

Referenced by fill_width_height(), get_bmp(), and get_bmp().

◆ on_selection_changed

std::function<void(int)> Slic3r::GUI::PresetComboBox::on_selection_changed { nullptr }
protectedinherited

◆ printer_technology

PrinterTechnology Slic3r::GUI::PresetComboBox::printer_technology {ptAny}
protectedinherited
157{ptAny};

Referenced by set_printer_technology(), and update().

◆ replace_text

wxString ComboBox::replace_text
privateinherited

Referenced by set_replace_text(), and SetLabel().

◆ show_incompatible

bool Slic3r::GUI::TabPresetComboBox::show_incompatible {false}
private
236{false};

Referenced by set_show_incompatible_presets(), and update().

◆ space_icon_width

int Slic3r::GUI::PresetComboBox::space_icon_width
protectedinherited

Referenced by fill_width_height(), and get_bmp().

◆ text_off

bool ComboBox::text_off = false
privateinherited

Referenced by ComboBox(), GetLabel(), and SetLabel().

◆ thin_icon_width

int Slic3r::GUI::PresetComboBox::thin_icon_width
protectedinherited

Referenced by fill_width_height().

◆ thin_space_icon_width

int Slic3r::GUI::PresetComboBox::thin_space_icon_width
protectedinherited

Referenced by fill_width_height(), and get_bmp().

◆ wide_icon_width

int Slic3r::GUI::PresetComboBox::wide_icon_width
protectedinherited

Referenced by fill_width_height().

◆ wide_space_icon_width

int Slic3r::GUI::PresetComboBox::wide_space_icon_width
protectedinherited

Referenced by fill_width_height(), and get_bmp().


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