diff options
Diffstat (limited to 'src/slic3r/GUI/Field.hpp')
-rw-r--r-- | src/slic3r/GUI/Field.hpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/slic3r/GUI/Field.hpp b/src/slic3r/GUI/Field.hpp index 4a19b6103..3273f84c9 100644 --- a/src/slic3r/GUI/Field.hpp +++ b/src/slic3r/GUI/Field.hpp @@ -74,7 +74,7 @@ protected: /// Call the attached on_kill_focus method. //! It's important to use wxEvent instead of wxFocusEvent, //! in another case we can't unfocused control at all - void on_kill_focus(wxEvent& event); + void on_kill_focus(); /// Call the attached on_change method. void on_set_focus(wxEvent& event); /// Call the attached on_change method. @@ -226,6 +226,8 @@ protected: // current value boost::any m_value; + + bool bEnterPressed = false; friend class OptionsGroup; }; @@ -252,6 +254,8 @@ public: ~TextCtrl() {} void BUILD(); + // Propagate value from field to the OptionGroupe and Config after kill_focus/ENTER + void propagate_value(); wxWindow* window {nullptr}; virtual void set_value(const std::string& value, bool change_event = false) { @@ -310,6 +314,8 @@ public: wxWindow* window{ nullptr }; void BUILD() override; + /// Propagate value from field to the OptionGroupe and Config after kill_focus/ENTER + void propagate_value() ; void set_value(const std::string& value, bool change_event = false) { m_disable_change_event = !change_event; @@ -319,6 +325,7 @@ public: void set_value(const boost::any& value, bool change_event = false) { m_disable_change_event = !change_event; tmp_value = boost::any_cast<int>(value); + m_value = value; dynamic_cast<wxSpinCtrl*>(window)->SetValue(tmp_value); m_disable_change_event = false; } @@ -393,8 +400,8 @@ public: wxTextCtrl* y_textctrl{ nullptr }; void BUILD() override; - - void OnKillFocus(wxEvent& e, wxTextCtrl* win); + // Propagate value from field to the OptionGroupe and Config after kill_focus/ENTER + void propagate_value(wxTextCtrl* win); void set_value(const Vec2d& value, bool change_event = false); void set_value(const boost::any& value, bool change_event = false); boost::any& get_value() override; |