mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-13 23:45:56 +08:00
Fixed #1543
This commit is contained in:
parent
2f4adc1906
commit
b66f41f43d
@ -474,6 +474,7 @@ void Choice::BUILD() {
|
|||||||
if (temp->GetWindowStyle() != wxCB_READONLY) {
|
if (temp->GetWindowStyle() != wxCB_READONLY) {
|
||||||
temp->Bind(wxEVT_KILL_FOCUS, ([this](wxEvent& e) {
|
temp->Bind(wxEVT_KILL_FOCUS, ([this](wxEvent& e) {
|
||||||
e.Skip();
|
e.Skip();
|
||||||
|
if (m_opt.type == coStrings) return;
|
||||||
double old_val = !m_value.empty() ? boost::any_cast<double>(m_value) : -99999;
|
double old_val = !m_value.empty() ? boost::any_cast<double>(m_value) : -99999;
|
||||||
if (is_defined_input_value<wxComboBox>(window, m_opt.type)) {
|
if (is_defined_input_value<wxComboBox>(window, m_opt.type)) {
|
||||||
if (fabs(old_val - boost::any_cast<double>(get_value())) <= 0.0001)
|
if (fabs(old_val - boost::any_cast<double>(get_value())) <= 0.0001)
|
||||||
@ -692,7 +693,7 @@ boost::any& Choice::get_value()
|
|||||||
}
|
}
|
||||||
else if (m_opt.gui_type == "f_enum_open") {
|
else if (m_opt.gui_type == "f_enum_open") {
|
||||||
const int ret_enum = static_cast<wxComboBox*>(window)->GetSelection();
|
const int ret_enum = static_cast<wxComboBox*>(window)->GetSelection();
|
||||||
if (ret_enum < 0 || m_opt.enum_values.empty())
|
if (ret_enum < 0 || m_opt.enum_values.empty() || m_opt.type == coStrings)
|
||||||
get_value_by_opt_type(ret_str);
|
get_value_by_opt_type(ret_str);
|
||||||
else
|
else
|
||||||
m_value = atof(m_opt.enum_values[ret_enum].c_str());
|
m_value = atof(m_opt.enum_values[ret_enum].c_str());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user