long fit_window::on_cmd_param_change(FXObject *_txt, FXSelector, void*) { FXTextField *txt = (FXTextField *) _txt; param_info* p = (param_info*) txt->getUserData(); FXString vstr = txt->getText(); double new_val = strtod (vstr.text(), NULL); unsigned k = this->get_parameter_index(p); m_fit->set_parameter_value(k, new_val); if (m_canvas) m_canvas->set_dirty(true); return 1; }
long fit_panel::on_update_param(FXObject *_txt, FXSelector, void*) { FXTextField *txt = (FXTextField *) _txt; param_info* p = (param_info*) txt->getUserData(); if(p->is_dirty) { unsigned k = this->get_parameter_index(p); FXString s = FXStringFormat("%g", m_fit->get_parameter_value(k)); txt->setText(s, false); p->is_dirty = false; return 1; } return 0; }