#include "dcpomatic_button.h"
+#include "wx_ptr.h"
#include "wx_util.h"
#include <dcp/warnings.h>
LIBDCP_DISABLE_WARNINGS
void add_clicked ()
{
- S* dialog = new S (this);
+ auto dialog = make_wx<S>(this);
if (dialog->ShowModal() == wxID_OK) {
auto const v = dialog->get ();
_set (all);
}
}
-
- dialog->Destroy ();
}
void edit_clicked ()
std::vector<T> all = _get ();
DCPOMATIC_ASSERT (item >= 0 && item < int (all.size ()));
- S* dialog = new S (this);
+ auto dialog = make_wx<S>(this);
dialog->set (all[item]);
if (dialog->ShowModal() == wxID_OK) {
auto const v = dialog->get ();
all[item] = v.get ();
}
- dialog->Destroy ();
for (size_t i = 0; i < _columns.size(); ++i) {
_list->SetItem (item, i, std_to_wx (_column (all[item], i)));