Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuSanka <yusanka@gmail.com>2019-02-25 12:14:49 +0300
committerYuSanka <yusanka@gmail.com>2019-02-25 12:15:44 +0300
commit2ff95054437cd2e4f3d1ace2f81af1fd601c5c5c (patch)
treed626cb10ae92e0f9a79b9937b0645d6538e0b7ac /src/slic3r/GUI/Field.cpp
parentb4a61a3acb0544e56b90476dafd87acc42dce382 (diff)
Fixed wrong updating of the editable ComboBox under OSX
Diffstat (limited to 'src/slic3r/GUI/Field.cpp')
-rw-r--r--src/slic3r/GUI/Field.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp
index d514615f2..0d65e0ef5 100644
--- a/src/slic3r/GUI/Field.cpp
+++ b/src/slic3r/GUI/Field.cpp
@@ -631,8 +631,13 @@ void Choice::set_value(const boost::any& value, bool change_event)
break;
++idx;
}
- idx == m_opt.enum_values.size() ?
- dynamic_cast<wxComboBox*>(window)->SetValue(text_value) :
+ if (idx == m_opt.enum_values.size()) {
+ // For editable Combobox under OSX is needed to set selection to -1 explicitly,
+ // otherwise selection doesn't be changed
+ dynamic_cast<wxComboBox*>(window)->SetSelection(-1);
+ dynamic_cast<wxComboBox*>(window)->SetValue(text_value);
+ }
+ else
dynamic_cast<wxComboBox*>(window)->SetSelection(idx);
break;
}