diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/editable_list.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/wx/editable_list.h b/src/wx/editable_list.h index f41899a1e..ffaadc182 100644 --- a/src/wx/editable_list.h +++ b/src/wx/editable_list.h @@ -122,13 +122,13 @@ private: T new_item; S* dialog = new S (this); dialog->set (new_item); - dialog->ShowModal (); - add_to_control (dialog->get ()); - - std::vector<T> all = _get (); - all.push_back (dialog->get ()); - _set (all); + if (dialog->ShowModal() == wxID_OK) { + add_to_control (dialog->get ()); + std::vector<T> all = _get (); + all.push_back (dialog->get ()); + _set (all); + } dialog->Destroy (); } @@ -145,8 +145,9 @@ private: S* dialog = new S (this); dialog->set (all[item]); - dialog->ShowModal (); - all[item] = dialog->get (); + if (dialog->ShowModal() == wxID_OK) { + all[item] = dialog->get (); + } dialog->Destroy (); for (int i = 0; i < _columns; ++i) { |
