From 28b6d222f2988d3cd7a4c2b2ae9d3e28eb3ee3f8 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Thu, 5 Apr 2018 12:12:35 +0200 Subject: [PATCH] Next try to fix bug with CheckBox selection if cursor is in SpinCtrl. --- xs/src/slic3r/GUI/Field.cpp | 4 ++-- xs/src/slic3r/GUI/Field.hpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/xs/src/slic3r/GUI/Field.cpp b/xs/src/slic3r/GUI/Field.cpp index 70a8b84cf..36ef9098f 100644 --- a/xs/src/slic3r/GUI/Field.cpp +++ b/xs/src/slic3r/GUI/Field.cpp @@ -265,8 +265,8 @@ 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()); - temp->Bind(wxEVT_KILL_FOCUS, ([this](wxEvent& e) { tmp_value = undef_spin_val; on_kill_focus(e); }), temp->GetId()); +// temp->Bind(wxEVT_SPINCTRL, ([this](wxCommandEvent e) { tmp_value = undef_spin_val; on_change_field(); }), temp->GetId()); +// temp->Bind(wxEVT_KILL_FOCUS, ([this](wxEvent& e) { tmp_value = undef_spin_val; on_kill_focus(e); }), temp->GetId()); temp->Bind(wxEVT_TEXT, ([this](wxCommandEvent e) { // # On OSX / Cocoa, wxSpinCtrl::GetValue() doesn't return the new value diff --git a/xs/src/slic3r/GUI/Field.hpp b/xs/src/slic3r/GUI/Field.hpp index e8f055aea..da3e23ccd 100644 --- a/xs/src/slic3r/GUI/Field.hpp +++ b/xs/src/slic3r/GUI/Field.hpp @@ -203,7 +203,8 @@ public: } void set_value(boost::any value, bool change_event = false) { m_disable_change_event = !change_event; - dynamic_cast(window)->SetValue(boost::any_cast(value)); + tmp_value = boost::any_cast(value); + dynamic_cast(window)->SetValue(tmp_value/*boost::any_cast(value)*/); m_disable_change_event = false; } boost::any get_value() override {