diff options
author | YuSanka <yusanka@gmail.com> | 2018-12-11 15:57:50 +0300 |
---|---|---|
committer | YuSanka <yusanka@gmail.com> | 2018-12-11 16:05:56 +0300 |
commit | e1cea03cda35418603c948f982e300b2ec9c7d1a (patch) | |
tree | 71ed86c95601153786222167cf0ed3cb8a5fc79b /src/slic3r/GUI/OptionsGroup.cpp | |
parent | d7bc1410eea26c7b44f4657964a57b50d64894e5 (diff) |
Added template for the handle of the TextCtrl's focus event
Diffstat (limited to 'src/slic3r/GUI/OptionsGroup.cpp')
-rw-r--r-- | src/slic3r/GUI/OptionsGroup.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/slic3r/GUI/OptionsGroup.cpp b/src/slic3r/GUI/OptionsGroup.cpp index 512bcb4ac..4701ae20b 100644 --- a/src/slic3r/GUI/OptionsGroup.cpp +++ b/src/slic3r/GUI/OptionsGroup.cpp @@ -78,6 +78,11 @@ const t_field& OptionsGroup::build_field(const t_config_option_key& id, const Co if (!m_disabled) this->on_kill_focus(opt_id); }; + field->m_on_set_focus = [this](const std::string& opt_id) { + //! This function will be called from Field. + if (!m_disabled) + this->on_set_focus(opt_id); + }; field->m_parent = parent(); //! Label to change background color, when option is modified @@ -277,6 +282,12 @@ Line OptionsGroup::create_single_option_line(const Option& option) const { return retval; } +void OptionsGroup::on_set_focus(const std::string& opt_key) +{ + if (m_set_focus != nullptr) + m_set_focus(opt_key); +} + void OptionsGroup::on_change_OG(const t_config_option_key& opt_id, const boost::any& value) { if (m_on_change != nullptr) m_on_change(opt_id, value); |