mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-15 14:15:56 +08:00
parent
012595e107
commit
70e1f0ebf9
@ -128,6 +128,8 @@ PresetComboBox::PresetComboBox(wxWindow* parent, Preset::Type preset_type, const
|
|||||||
// So, use GetSelection() from event parameter
|
// So, use GetSelection() from event parameter
|
||||||
auto selected_item = evt.GetSelection();
|
auto selected_item = evt.GetSelection();
|
||||||
|
|
||||||
|
//protected as selected_item is often at a weird value
|
||||||
|
if (selected_item < this->GetCount() && selected_item >= 0) {
|
||||||
auto marker = reinterpret_cast<Marker>(this->GetClientData(selected_item));
|
auto marker = reinterpret_cast<Marker>(this->GetClientData(selected_item));
|
||||||
if (marker >= LABEL_ITEM_DISABLED && marker < LABEL_ITEM_MAX)
|
if (marker >= LABEL_ITEM_DISABLED && marker < LABEL_ITEM_MAX)
|
||||||
this->SetSelection(this->m_last_selected);
|
this->SetSelection(this->m_last_selected);
|
||||||
@ -136,6 +138,7 @@ PresetComboBox::PresetComboBox(wxWindow* parent, Preset::Type preset_type, const
|
|||||||
on_selection_changed(selected_item);
|
on_selection_changed(selected_item);
|
||||||
evt.StopPropagation();
|
evt.StopPropagation();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
evt.Skip();
|
evt.Skip();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -451,6 +454,8 @@ wxBitmap* PresetComboBox::get_bmp( std::string bitmap_key, const std::string& m
|
|||||||
bool PresetComboBox::is_selected_physical_printer()
|
bool PresetComboBox::is_selected_physical_printer()
|
||||||
{
|
{
|
||||||
auto selected_item = this->GetSelection();
|
auto selected_item = this->GetSelection();
|
||||||
|
if (selected_item >= this->GetCount() || selected_item < 0)
|
||||||
|
std::cout << "qfohadfh \n";
|
||||||
auto marker = reinterpret_cast<Marker>(this->GetClientData(selected_item));
|
auto marker = reinterpret_cast<Marker>(this->GetClientData(selected_item));
|
||||||
return marker == LABEL_ITEM_PHYSICAL_PRINTER;
|
return marker == LABEL_ITEM_PHYSICAL_PRINTER;
|
||||||
}
|
}
|
||||||
@ -572,6 +577,8 @@ PlaterPresetComboBox::PlaterPresetComboBox(wxWindow *parent, Preset::Type preset
|
|||||||
Bind(wxEVT_COMBOBOX, [this](wxCommandEvent &evt) {
|
Bind(wxEVT_COMBOBOX, [this](wxCommandEvent &evt) {
|
||||||
auto selected_item = evt.GetSelection();
|
auto selected_item = evt.GetSelection();
|
||||||
|
|
||||||
|
if (selected_item >= this->GetCount() || selected_item < 0)
|
||||||
|
std::cout << "qfoshiofh \n";
|
||||||
auto marker = reinterpret_cast<Marker>(this->GetClientData(selected_item));
|
auto marker = reinterpret_cast<Marker>(this->GetClientData(selected_item));
|
||||||
if (marker >= LABEL_ITEM_MARKER && marker < LABEL_ITEM_MAX) {
|
if (marker >= LABEL_ITEM_MARKER && marker < LABEL_ITEM_MAX) {
|
||||||
this->SetSelection(this->m_last_selected);
|
this->SetSelection(this->m_last_selected);
|
||||||
@ -919,7 +926,8 @@ TabPresetComboBox::TabPresetComboBox(wxWindow* parent, Preset::Type preset_type)
|
|||||||
// m_presets_choice->GetSelection() will return first item, because search in PopupListCtrl is case-insensitive.
|
// m_presets_choice->GetSelection() will return first item, because search in PopupListCtrl is case-insensitive.
|
||||||
// So, use GetSelection() from event parameter
|
// So, use GetSelection() from event parameter
|
||||||
auto selected_item = evt.GetSelection();
|
auto selected_item = evt.GetSelection();
|
||||||
|
if (selected_item >= this->GetCount() || selected_item < 0)
|
||||||
|
std::cout << "qfoazfhasuiofh \n";
|
||||||
auto marker = reinterpret_cast<Marker>(this->GetClientData(selected_item));
|
auto marker = reinterpret_cast<Marker>(this->GetClientData(selected_item));
|
||||||
if (marker >= LABEL_ITEM_DISABLED && marker < LABEL_ITEM_MAX) {
|
if (marker >= LABEL_ITEM_DISABLED && marker < LABEL_ITEM_MAX) {
|
||||||
this->SetSelection(this->m_last_selected);
|
this->SetSelection(this->m_last_selected);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user