mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
Added template for the handle of the TextCtrl's focus event
This commit is contained in:
parent
d7bc1410ee
commit
e1cea03cda
6 changed files with 36 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue