diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-11-15 01:08:48 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-11-15 01:08:48 +0000 |
| commit | 94b63f777e0a1625e557f7fd6f19aaf920b18332 (patch) | |
| tree | 95b02573000fd99ef1f602f771bea112828fdbcb /src | |
| parent | 7ae1829778ed26b55fcf6c4c0f2d24ef16229969 (diff) | |
Fix operation of cancel in EditableList's operation dialogue box.
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) { |
