Build fixes for Boost >= 1.73
[dcpomatic.git] / src / wx / templates_dialog.cc
index eb0d491e072a5b0f87029ca9ff0760bc9587744c..53eb2e4220ab804d4a51b0e3958d6c3af776de39 100644 (file)
 #include "templates_dialog.h"
 #include "wx_util.h"
 #include "rename_template_dialog.h"
+#include "dcpomatic_button.h"
 #include "lib/config.h"
 #include <wx/wx.h>
 #include <boost/foreach.hpp>
 
 using std::string;
 using boost::bind;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
 
 TemplatesDialog::TemplatesDialog (wxWindow* parent)
        : wxDialog (parent, wxID_ANY, _("Templates"))
@@ -47,9 +51,9 @@ TemplatesDialog::TemplatesDialog (wxWindow* parent)
 
        {
                wxSizer* s = new wxBoxSizer (wxVERTICAL);
-               _rename = new wxButton (this, wxID_ANY, _("Rename..."));
+               _rename = new Button (this, _("Rename..."));
                s->Add (_rename, 0, wxTOP | wxBOTTOM, 2);
-               _remove = new wxButton (this, wxID_ANY, _("Remove"));
+               _remove = new Button (this, _("Remove"));
                s->Add (_remove, 0, wxTOP | wxBOTTOM, 2);
                hs->Add (s, 0, wxLEFT, DCPOMATIC_SIZER_X_GAP);
        }
@@ -61,11 +65,11 @@ TemplatesDialog::TemplatesDialog (wxWindow* parent)
                _sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
        }
 
-       _rename->Bind (wxEVT_COMMAND_BUTTON_CLICKED, bind (&TemplatesDialog::rename_clicked, this));
-       _remove->Bind (wxEVT_COMMAND_BUTTON_CLICKED, bind (&TemplatesDialog::remove_clicked, this));
+       _rename->Bind (wxEVT_BUTTON, bind (&TemplatesDialog::rename_clicked, this));
+       _remove->Bind (wxEVT_BUTTON, bind (&TemplatesDialog::remove_clicked, this));
 
-       _list->Bind (wxEVT_COMMAND_LIST_ITEM_SELECTED, bind (&TemplatesDialog::selection_changed, this));
-       _list->Bind (wxEVT_COMMAND_LIST_ITEM_DESELECTED, bind (&TemplatesDialog::selection_changed, this));
+       _list->Bind (wxEVT_LIST_ITEM_SELECTED, bind (&TemplatesDialog::selection_changed, this));
+       _list->Bind (wxEVT_LIST_ITEM_DESELECTED, bind (&TemplatesDialog::selection_changed, this));
        _list->Bind (wxEVT_SIZE, bind (&TemplatesDialog::resized, this, _1));
        _config_connection = Config::instance()->Changed.connect (bind (&TemplatesDialog::refresh, this));