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>2018-12-21 12:58:00 +0300
committerYuSanka <yusanka@gmail.com>2018-12-21 12:59:21 +0300
commitfb7895768729521cdcb0562a2b39be814f8cf584 (patch)
treeeee88f9382ec6fa4e131a6c70ac19602c424227f /src/slic3r/GUI/Field.cpp
parent964209f89bccab7996e1c4b0e8a126f8b290132d (diff)
Fixed updating of settings after selection of the preset with "modified" suffix
+ Added EVT_SPINCTRL binding
Diffstat (limited to 'src/slic3r/GUI/Field.cpp')
-rw-r--r--src/slic3r/GUI/Field.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp
index 1bc4c7305..9855806be 100644
--- a/src/slic3r/GUI/Field.cpp
+++ b/src/slic3r/GUI/Field.cpp
@@ -400,10 +400,11 @@ void SpinCtrl::BUILD() {
auto temp = new wxSpinCtrl(m_parent, wxID_ANY, text_value, wxDefaultPosition, size,
0, min_val, max_val, default_value);
-// temp->Bind(wxEVT_SPINCTRL, ([this](wxCommandEvent e) { tmp_value = undef_spin_val; on_change_field(); }), temp->GetId());
-
+#ifndef __WXOSX__
// #ys_FIXME_KILL_FOCUS
- // wxEVT_KILL_FOCUS doesn't handled on OSX now
+ // wxEVT_KILL_FOCUS doesn't handled on OSX now (wxWidgets 3.1.1)
+ // So, we will update values on KILL_FOCUS & SPINCTRL events under MSW and GTK
+ // and on TEXT event under OSX
temp->Bind(wxEVT_KILL_FOCUS, ([this](wxEvent& e)
{
if (tmp_value < 0)
@@ -414,6 +415,9 @@ void SpinCtrl::BUILD() {
}
}), temp->GetId());
+ temp->Bind(wxEVT_SPINCTRL, ([this](wxCommandEvent e) { on_change_field(); }), temp->GetId());
+#endif
+
temp->Bind(wxEVT_TEXT, ([this](wxCommandEvent e)
{
// # On OSX / Cocoa, wxSpinCtrl::GetValue() doesn't return the new value
@@ -425,9 +429,7 @@ void SpinCtrl::BUILD() {
if (is_matched(value, "^\\d+$"))
tmp_value = std::stoi(value);
else tmp_value = -9999;
-// on_change_field();
#ifdef __WXOSX__
- // #ys_FIXME_KILL_FOCUS so call on_change_field() inside wxEVT_TEXT
if (tmp_value < 0) {
if (m_on_kill_focus != nullptr)
m_on_kill_focus(m_opt_id);