Add console to dcpomatic_kdm on Windows. Tweak layout a bit more.
[dcpomatic.git] / src / wx / screens_panel.cc
index ce5f2555e308a8cd6d2e75ade7cf11dc95fbdd8a..2130600e4197b5f7b099fb86be5519f90cfe78fa 100644 (file)
@@ -27,6 +27,7 @@
 
 using std::list;
 using std::pair;
+using std::cout;
 using std::map;
 using std::make_pair;
 using boost::shared_ptr;
@@ -69,7 +70,7 @@ ScreensPanel::ScreensPanel (wxWindow* parent)
 
        sizer->Add (targets, 1, wxEXPAND);
 
-       _targets->Bind       (wxEVT_COMMAND_TREE_SEL_CHANGED, boost::bind (&ScreensPanel::selection_changed, this));
+       _targets->Bind       (wxEVT_COMMAND_TREE_SEL_CHANGED, &ScreensPanel::selection_changed, this);
 
        _add_cinema->Bind    (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ScreensPanel::add_cinema_clicked, this));
        _edit_cinema->Bind   (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ScreensPanel::edit_cinema_clicked, this));
@@ -82,6 +83,11 @@ ScreensPanel::ScreensPanel (wxWindow* parent)
        SetSizer (sizer);
 }
 
+ScreensPanel::~ScreensPanel ()
+{
+       _targets->Unbind (wxEVT_COMMAND_TREE_SEL_CHANGED, &ScreensPanel::selection_changed, this);
+}
+
 list<pair<wxTreeItemId, shared_ptr<Cinema> > >
 ScreensPanel::selected_cinemas () const
 {
@@ -299,7 +305,7 @@ ScreensPanel::screens () const
 }
 
 void
-ScreensPanel::selection_changed ()
+ScreensPanel::selection_changed (wxTreeEvent &)
 {
        setup_sensitivity ();
        ScreensChanged ();