X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Feditable_list.h;h=e82c4f91cdf77b44d9c35eb5bb786f6e3ae00b06;hb=54141c7a9504e289d41af997067ca6b78a1d4b0a;hp=f90d219f81a9a0f7defc398f287efa478edd2ab8;hpb=a5d004b0773f633401528392fc28e66d70e13ac8;p=dcpomatic.git diff --git a/src/wx/editable_list.h b/src/wx/editable_list.h index f90d219f8..e82c4f91c 100644 --- a/src/wx/editable_list.h +++ b/src/wx/editable_list.h @@ -18,16 +18,21 @@ */ + #ifndef DCPOMATIC_EDITABLE_LIST_H #define DCPOMATIC_EDITABLE_LIST_H -#include "wx_util.h" + #include "dcpomatic_button.h" -#include +#include "wx_util.h" +#include +LIBDCP_DISABLE_WARNINGS #include -#include +#include +LIBDCP_ENABLE_WARNINGS #include + class EditableListColumn { public: @@ -60,9 +65,9 @@ public: EditableList ( wxWindow* parent, std::vector columns, - boost::function ()> get, - boost::function)> set, - boost::function column, + std::function ()> get, + std::function)> set, + std::function column, bool can_edit = true, bool title = true ) @@ -205,7 +210,8 @@ private: S* dialog = new S (this); if (dialog->ShowModal() == wxID_OK) { - boost::optional const v = dialog->get (); + auto const v = dialog->get (); + static_assert(std::is_same::type, boost::optional>::value, "get() must return boost::optional"); if (v) { add_to_control (v.get ()); std::vector all = _get (); @@ -230,7 +236,8 @@ private: S* dialog = new S (this); dialog->set (all[item]); if (dialog->ShowModal() == wxID_OK) { - boost::optional const v = dialog->get (); + auto const v = dialog->get (); + static_assert(std::is_same::type, boost::optional>::value, "get() must return boost::optional"); if (!v) { return; } @@ -289,10 +296,10 @@ private: ev.Skip (); } - boost::function ()> _get; - boost::function )> _set; + std::function ()> _get; + std::function )> _set; std::vector _columns; - boost::function _column; + std::function _column; wxButton* _add; wxButton* _edit;