Remove old Connect() wxWidgets API and use Bind().
authorCarl Hetherington <cth@carlh.net>
Fri, 26 Jul 2013 10:14:41 +0000 (11:14 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 26 Jul 2013 10:14:41 +0000 (11:14 +0100)
23 files changed:
src/tools/dcpomatic.cc
src/tools/dcpomatic_batch.cc
src/tools/dcpomatic_server.cc
src/wx/audio_dialog.cc
src/wx/audio_dialog.h
src/wx/audio_mapping_view.cc
src/wx/audio_plot.cc
src/wx/audio_plot.h
src/wx/config_dialog.cc
src/wx/config_dialog.h
src/wx/dir_picker_ctrl.cc
src/wx/dir_picker_ctrl.h
src/wx/film_viewer.cc
src/wx/film_viewer.h
src/wx/filter_view.cc
src/wx/filter_view.h
src/wx/server_dialog.cc
src/wx/server_dialog.h
src/wx/timecode.cc
src/wx/timecode.h
src/wx/timeline.cc
src/wx/timeline.h
src/wx/wx_util.cc

index 623df3dc6448d6ff77f4c64551d33f5077e01b99..44f7073516d58b877a201e6c0323cc7bc60a7e06 100644 (file)
@@ -502,7 +502,7 @@ class App : public wxApp
                f->Show ();
 
                ui_signaller = new wxUISignaller (this);
-               this->Connect (-1, wxEVT_IDLE, wxIdleEventHandler (App::idle));
+               this->Bind (wxEVT_IDLE, boost::bind (&App::idle, this));
 
                return true;
        }
@@ -536,7 +536,7 @@ class App : public wxApp
                return true;
        }
 
-       void idle (wxIdleEvent &)
+       void idle ()
        {
                ui_signaller->ui_idle ();
        }
index b4ab054fda92c9c01b287cac72ad115bdebed65a..23d5a4819685ae41c088647bd88b719a790ff934 100644 (file)
@@ -62,9 +62,9 @@ public:
                setup_menu (bar);
                SetMenuBar (bar);
 
-               Connect (ID_file_add_film, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::file_add_film));
-               Connect (ID_file_quit, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::file_quit));
-               Connect (ID_help_about, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::help_about));
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::file_add_film, this), ID_file_add_film);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::file_quit, this),     ID_file_quit);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::help_about, this),    ID_help_about);
 
                wxPanel* panel = new wxPanel (this);
                wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
@@ -78,14 +78,14 @@ public:
 
                wxSizer* buttons = new wxBoxSizer (wxHORIZONTAL);
                wxButton* add = new wxButton (panel, wxID_ANY, _("Add Film..."));
-               add->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (Frame::add_film));
+               add->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&Frame::add_film, this));
                buttons->Add (add, 1, wxALL, 6);
 
                sizer->Add (buttons, 0, wxALL, 6);
 
                panel->SetSizer (sizer);
 
-               Connect (wxID_ANY, wxEVT_CLOSE_WINDOW, wxCloseEventHandler (Frame::close));
+               Bind (wxEVT_CLOSE_WINDOW, boost::bind (&Frame::close, this, _1));
        }
 
 private:
@@ -117,19 +117,19 @@ private:
                ev.Skip ();
        }
 
-       void file_add_film (wxCommandEvent& ev)
+       void file_add_film ()
        {
-               add_film (ev);
+               add_film ();
        }
        
-       void file_quit (wxCommandEvent &)
+       void file_quit ()
        {
                if (should_close ()) {
                        Close (true);
                }
        }
 
-       void help_about (wxCommandEvent &)
+       void help_about ()
        {
                wxAboutDialogInfo info;
                info.SetName (_("DCP-o-matic Batch Converter"));
@@ -161,7 +161,7 @@ private:
                wxAboutBox (info);
        }
 
-       void add_film (wxCommandEvent &)
+       void add_film ()
        {
                wxDirDialog* c = new wxDirDialog (this, _("Select film to open"), wxStandardPaths::Get().GetDocumentsDir(), wxDEFAULT_DIALOG_STYLE | wxDD_DIR_MUST_EXIST);
                int r;
@@ -226,12 +226,12 @@ class App : public wxApp
                f->Show ();
 
                ui_signaller = new wxUISignaller (this);
-               this->Connect (-1, wxEVT_IDLE, wxIdleEventHandler (App::idle));
+               this->Bind (wxEVT_IDLE, boost::bind (&App::idle, this));
 
                return true;
        }
 
-       void idle (wxIdleEvent &)
+       void idle ()
        {
                ui_signaller->ui_idle ();
        }
index 1bfc23ff9fb166f7565d335d47140d46ffd9db10..78354c46889999c8c28ca1234fe6d598a0529f2b 100644 (file)
@@ -73,12 +73,12 @@ public:
                SetSizer (_sizer);
                _sizer->Layout ();
 
-               Connect (ID_timer, wxEVT_TIMER, wxTimerEventHandler (StatusDialog::update));
+               Bind (wxEVT_TIMER, boost::bind (&StatusDialog::update, this), ID_timer);
                _timer.Start (1000);
        }
 
 private:
-       void update (wxTimerEvent &)
+       void update ()
        {
                _text->ChangeValue (std_to_wx (memory_log->get ()));
                _sizer->Layout ();
@@ -108,8 +108,8 @@ public:
                SetIcon (icon, std_to_wx ("DCP-o-matic encode server"));
 #endif         
 
-               Connect (ID_status, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (TaskBarIcon::status));
-               Connect (ID_quit, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (TaskBarIcon::quit));
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&TaskBarIcon::status, this), ID_status);
+               Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&TaskBarIcon::quit, this), ID_quit);
        }
        
        wxMenu* CreatePopupMenu ()
@@ -121,13 +121,13 @@ public:
        }
 
 private:
-       void status (wxCommandEvent &)
+       void status ()
        {
                StatusDialog* d = new StatusDialog;
                d->Show ();
        }
 
-       void quit (wxCommandEvent &)
+       void quit ()
        {
                wxTheApp->ExitMainLoop ();
        }
index 26655631e8b3ccded05a17c700282c4033d214f1..462eb8d50d02c65c6201172b7dcc9b2b5e76563c 100644 (file)
@@ -47,7 +47,7 @@ AudioDialog::AudioDialog (wxWindow* parent)
        for (int i = 0; i < MAX_AUDIO_CHANNELS; ++i) {
                _channel_checkbox[i] = new wxCheckBox (this, wxID_ANY, std_to_wx (audio_channel_name (i)));
                side->Add (_channel_checkbox[i], 1, wxEXPAND | wxALL, 3);
-               _channel_checkbox[i]->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (AudioDialog::channel_clicked), 0, this);
+               _channel_checkbox[i]->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&AudioDialog::channel_clicked, this, _1));
        }
 
        {
@@ -63,7 +63,7 @@ AudioDialog::AudioDialog (wxWindow* parent)
        for (int i = 0; i < AudioPoint::COUNT; ++i) {
                _type_checkbox[i] = new wxCheckBox (this, wxID_ANY, types[i]);
                side->Add (_type_checkbox[i], 1, wxEXPAND | wxALL, 3);
-               _type_checkbox[i]->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (AudioDialog::type_clicked), 0, this);
+               _type_checkbox[i]->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&AudioDialog::type_clicked, this, _1));
        }
 
        {
@@ -72,7 +72,7 @@ AudioDialog::AudioDialog (wxWindow* parent)
        }
        
        _smoothing = new wxSlider (this, wxID_ANY, AudioPlot::max_smoothing / 2, 1, AudioPlot::max_smoothing);
-       _smoothing->Connect (wxID_ANY, wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler (AudioDialog::smoothing_changed), 0, this);
+       _smoothing->Bind (wxEVT_SCROLL_THUMBTRACK, boost::bind (&AudioDialog::smoothing_changed, this));
        side->Add (_smoothing, 1, wxEXPAND);
 
        sizer->Add (side, 0, wxALL, 12);
@@ -170,7 +170,7 @@ AudioDialog::type_clicked (wxCommandEvent& ev)
 }
 
 void
-AudioDialog::smoothing_changed (wxScrollEvent &)
+AudioDialog::smoothing_changed ()
 {
        _plot->set_smoothing (_smoothing->GetValue ());
 }
index 62811091a8b9c14ce0c7b8eeb5295c4836cc04b9..8623192c4c25ec2f19aaf6bd08d16b0ebc50d18d 100644 (file)
@@ -37,7 +37,7 @@ private:
        void content_changed (int);
        void channel_clicked (wxCommandEvent &);
        void type_clicked (wxCommandEvent &);
-       void smoothing_changed (wxScrollEvent &);
+       void smoothing_changed ();
        void try_to_load_analysis ();
        void analysis_finished ();
 
index f5d0ecae26e67a54715ecfe093f8bd4fc0b8e1e1..3136b8679a6140902c225239832148a51f08326f 100644 (file)
@@ -98,7 +98,7 @@ AudioMappingView::AudioMappingView (wxWindow* parent)
        _sizer->Add (_grid, 1, wxEXPAND | wxALL);
        SetSizerAndFit (_sizer);
 
-       Connect (wxID_ANY, wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler (AudioMappingView::left_click), 0, this);
+       Bind (wxEVT_GRID_CELL_LEFT_CLICK, boost::bind (&AudioMappingView::left_click, this, _1));
 }
 
 void
index 2539a93d9b4d64f96500598007797107d3247146..7ed792351bb30e49ecbfa33fdb1ad12b72a3e286 100644 (file)
@@ -61,7 +61,7 @@ AudioPlot::AudioPlot (wxWindow* parent)
        _colours.push_back (wxColour (  0,   0, 255));
        _colours.push_back (wxColour (100, 100, 100));
        
-       Connect (wxID_ANY, wxEVT_PAINT, wxPaintEventHandler (AudioPlot::paint), 0, this);
+       Bind (wxEVT_PAINT, boost::bind (&AudioPlot::paint, this));
        
        SetMinSize (wxSize (640, 512));
 }
@@ -104,7 +104,7 @@ AudioPlot::set_message (wxString s)
 }
 
 void
-AudioPlot::paint (wxPaintEvent &)
+AudioPlot::paint ()
 {
        wxPaintDC dc (this);
 
index 5605f94a53486439e9d98a39322b7057e06a7281..094f8e1b0124527e4b27794d53c4f1a3c14e832b 100644 (file)
@@ -38,7 +38,7 @@ public:
        static const int max_smoothing;
 
 private:
-       void paint (wxPaintEvent &);
+       void paint ();
 
        boost::shared_ptr<AudioAnalysis> _analysis;
        bool _channel_visible[MAX_AUDIO_CHANNELS];
index 7ab23c997bb88f3f0a840162c8667dc3b7df9b5c..cbcae78f88fcf69c486b826fd56d38444cb5d4ed 100644 (file)
@@ -159,21 +159,21 @@ ConfigDialog::make_misc_panel ()
 
        setup_language_sensitivity ();
 
-       _set_language->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (ConfigDialog::set_language_changed), 0, this);
-       _language->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (ConfigDialog::language_changed), 0, this);
+       _set_language->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&ConfigDialog::set_language_changed, this));
+       _language->Bind     (wxEVT_COMMAND_CHOICE_SELECTED,  boost::bind (&ConfigDialog::language_changed,     this));
 
        _num_local_encoding_threads->SetRange (1, 128);
        _num_local_encoding_threads->SetValue (config->num_local_encoding_threads ());
-       _num_local_encoding_threads->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (ConfigDialog::num_local_encoding_threads_changed), 0, this);
+       _num_local_encoding_threads->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&ConfigDialog::num_local_encoding_threads_changed, this));
 
        _default_still_length->SetRange (1, 3600);
        _default_still_length->SetValue (config->default_still_length ());
-       _default_still_length->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (ConfigDialog::default_still_length_changed), 0, this);
+       _default_still_length->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&ConfigDialog::default_still_length_changed, this));
 
        _default_directory->SetPath (std_to_wx (config->default_directory_or (wx_to_std (wxStandardPaths::Get().GetDocumentsDir()))));
-       _default_directory->Connect (wxID_ANY, wxEVT_COMMAND_DIRPICKER_CHANGED, wxCommandEventHandler (ConfigDialog::default_directory_changed), 0, this);
+       _default_directory->Bind (wxEVT_COMMAND_DIRPICKER_CHANGED, boost::bind (&ConfigDialog::default_directory_changed, this));
 
-       _default_dci_metadata_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (ConfigDialog::edit_default_dci_metadata_clicked), 0, this);
+       _default_dci_metadata_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ConfigDialog::edit_default_dci_metadata_clicked, this));
 
        vector<Ratio const *> ratio = Ratio::all ();
        int n = 0;
@@ -185,7 +185,7 @@ ConfigDialog::make_misc_panel ()
                ++n;
        }
 
-       _default_container->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (ConfigDialog::default_container_changed), 0, this);
+       _default_container->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&ConfigDialog::default_container_changed, this));
        
        vector<DCPContentType const *> const ct = DCPContentType::all ();
        n = 0;
@@ -197,11 +197,11 @@ ConfigDialog::make_misc_panel ()
                ++n;
        }
 
-       _default_dcp_content_type->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (ConfigDialog::default_dcp_content_type_changed), 0, this);
+       _default_dcp_content_type->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&ConfigDialog::default_dcp_content_type_changed, this));
 
        _default_j2k_bandwidth->SetRange (50, 250);
        _default_j2k_bandwidth->SetValue (config->default_j2k_bandwidth() / 1e6);
-       _default_j2k_bandwidth->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (ConfigDialog::default_j2k_bandwidth_changed), 0, this);
+       _default_j2k_bandwidth->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&ConfigDialog::default_j2k_bandwidth_changed, this));
 }
 
 void
@@ -234,13 +234,13 @@ ConfigDialog::make_tms_panel ()
        Config* config = Config::instance ();
        
        _tms_ip->SetValue (std_to_wx (config->tms_ip ()));
-       _tms_ip->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (ConfigDialog::tms_ip_changed), 0, this);
+       _tms_ip->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&ConfigDialog::tms_ip_changed, this));
        _tms_path->SetValue (std_to_wx (config->tms_path ()));
-       _tms_path->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (ConfigDialog::tms_path_changed), 0, this);
+       _tms_path->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&ConfigDialog::tms_path_changed, this));
        _tms_user->SetValue (std_to_wx (config->tms_user ()));
-       _tms_user->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (ConfigDialog::tms_user_changed), 0, this);
+       _tms_user->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&ConfigDialog::tms_user_changed, this));
        _tms_password->SetValue (std_to_wx (config->tms_password ()));
-       _tms_password->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (ConfigDialog::tms_password_changed), 0, this);
+       _tms_password->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&ConfigDialog::tms_password_changed, this));
 }
 
 void
@@ -265,9 +265,9 @@ ConfigDialog::make_metadata_panel ()
        Config* config = Config::instance ();
 
        _issuer->SetValue (std_to_wx (config->dcp_metadata().issuer));
-       _issuer->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (ConfigDialog::issuer_changed), 0, this);
+       _issuer->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&ConfigDialog::issuer_changed, this));
        _creator->SetValue (std_to_wx (config->dcp_metadata().creator));
-       _creator->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (ConfigDialog::creator_changed), 0, this);
+       _creator->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&ConfigDialog::creator_changed, this));
 }
 
 void
@@ -311,18 +311,17 @@ ConfigDialog::make_servers_panel ()
                add_server_to_control (*i);
        }
        
-       _add_server->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (ConfigDialog::add_server_clicked), 0, this);
-       _edit_server->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (ConfigDialog::edit_server_clicked), 0, this);
-       _remove_server->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (ConfigDialog::remove_server_clicked), 0, this);
-
-       _servers->Connect (wxID_ANY, wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler (ConfigDialog::server_selection_changed), 0, this);
-       _servers->Connect (wxID_ANY, wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler (ConfigDialog::server_selection_changed), 0, this);
-       wxListEvent ev;
-       server_selection_changed (ev);
+       _add_server->Bind    (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ConfigDialog::add_server_clicked,    this));
+       _edit_server->Bind   (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ConfigDialog::edit_server_clicked,   this));
+       _remove_server->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ConfigDialog::remove_server_clicked, this));
+
+       _servers->Bind (wxEVT_COMMAND_LIST_ITEM_SELECTED,   boost::bind (&ConfigDialog::server_selection_changed, this));
+       _servers->Bind (wxEVT_COMMAND_LIST_ITEM_DESELECTED, boost::bind (&ConfigDialog::server_selection_changed, this));
+       server_selection_changed ();
 }
 
 void
-ConfigDialog::language_changed (wxCommandEvent &)
+ConfigDialog::language_changed ()
 {
        switch (_language->GetSelection ()) {
        case 0:
@@ -344,37 +343,37 @@ ConfigDialog::language_changed (wxCommandEvent &)
 }
 
 void
-ConfigDialog::tms_ip_changed (wxCommandEvent &)
+ConfigDialog::tms_ip_changed ()
 {
        Config::instance()->set_tms_ip (wx_to_std (_tms_ip->GetValue ()));
 }
 
 void
-ConfigDialog::tms_path_changed (wxCommandEvent &)
+ConfigDialog::tms_path_changed ()
 {
        Config::instance()->set_tms_path (wx_to_std (_tms_path->GetValue ()));
 }
 
 void
-ConfigDialog::tms_user_changed (wxCommandEvent &)
+ConfigDialog::tms_user_changed ()
 {
        Config::instance()->set_tms_user (wx_to_std (_tms_user->GetValue ()));
 }
 
 void
-ConfigDialog::tms_password_changed (wxCommandEvent &)
+ConfigDialog::tms_password_changed ()
 {
        Config::instance()->set_tms_password (wx_to_std (_tms_password->GetValue ()));
 }
 
 void
-ConfigDialog::num_local_encoding_threads_changed (wxCommandEvent &)
+ConfigDialog::num_local_encoding_threads_changed ()
 {
        Config::instance()->set_num_local_encoding_threads (_num_local_encoding_threads->GetValue ());
 }
 
 void
-ConfigDialog::default_directory_changed (wxCommandEvent &)
+ConfigDialog::default_directory_changed ()
 {
        Config::instance()->set_default_directory (wx_to_std (_default_directory->GetPath ()));
 }
@@ -391,7 +390,7 @@ ConfigDialog::add_server_to_control (ServerDescription* s)
 }
 
 void
-ConfigDialog::add_server_clicked (wxCommandEvent &)
+ConfigDialog::add_server_clicked ()
 {
        ServerDialog* d = new ServerDialog (this, 0);
        d->ShowModal ();
@@ -405,7 +404,7 @@ ConfigDialog::add_server_clicked (wxCommandEvent &)
 }
 
 void
-ConfigDialog::edit_server_clicked (wxCommandEvent &)
+ConfigDialog::edit_server_clicked ()
 {
        int i = _servers->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
        if (i == -1) {
@@ -429,7 +428,7 @@ ConfigDialog::edit_server_clicked (wxCommandEvent &)
 }
 
 void
-ConfigDialog::remove_server_clicked (wxCommandEvent &)
+ConfigDialog::remove_server_clicked ()
 {
        int i = _servers->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
        if (i >= 0) {
@@ -442,7 +441,7 @@ ConfigDialog::remove_server_clicked (wxCommandEvent &)
 }
 
 void
-ConfigDialog::server_selection_changed (wxListEvent &)
+ConfigDialog::server_selection_changed ()
 {
        int const i = _servers->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
        _edit_server->Enable (i >= 0);
@@ -450,7 +449,7 @@ ConfigDialog::server_selection_changed (wxListEvent &)
 }
 
 void
-ConfigDialog::edit_default_dci_metadata_clicked (wxCommandEvent &)
+ConfigDialog::edit_default_dci_metadata_clicked ()
 {
        DCIMetadataDialog* d = new DCIMetadataDialog (this, Config::instance()->default_dci_metadata ());
        d->ShowModal ();
@@ -459,11 +458,11 @@ ConfigDialog::edit_default_dci_metadata_clicked (wxCommandEvent &)
 }
 
 void
-ConfigDialog::set_language_changed (wxCommandEvent& ev)
+ConfigDialog::set_language_changed ()
 {
        setup_language_sensitivity ();
        if (_set_language->GetValue ()) {
-               language_changed (ev);
+               language_changed ();
        } else {
                Config::instance()->unset_language ();
        }
@@ -476,27 +475,27 @@ ConfigDialog::setup_language_sensitivity ()
 }
 
 void
-ConfigDialog::default_still_length_changed (wxCommandEvent &)
+ConfigDialog::default_still_length_changed ()
 {
        Config::instance()->set_default_still_length (_default_still_length->GetValue ());
 }
 
 void
-ConfigDialog::default_container_changed (wxCommandEvent &)
+ConfigDialog::default_container_changed ()
 {
        vector<Ratio const *> ratio = Ratio::all ();
        Config::instance()->set_default_container (ratio[_default_container->GetSelection()]);
 }
 
 void
-ConfigDialog::default_dcp_content_type_changed (wxCommandEvent &)
+ConfigDialog::default_dcp_content_type_changed ()
 {
        vector<DCPContentType const *> ct = DCPContentType::all ();
        Config::instance()->set_default_dcp_content_type (ct[_default_dcp_content_type->GetSelection()]);
 }
 
 void
-ConfigDialog::issuer_changed (wxCommandEvent &)
+ConfigDialog::issuer_changed ()
 {
        libdcp::XMLMetadata m = Config::instance()->dcp_metadata ();
        m.issuer = wx_to_std (_issuer->GetValue ());
@@ -504,7 +503,7 @@ ConfigDialog::issuer_changed (wxCommandEvent &)
 }
 
 void
-ConfigDialog::creator_changed (wxCommandEvent &)
+ConfigDialog::creator_changed ()
 {
        libdcp::XMLMetadata m = Config::instance()->dcp_metadata ();
        m.creator = wx_to_std (_creator->GetValue ());
@@ -512,7 +511,7 @@ ConfigDialog::creator_changed (wxCommandEvent &)
 }
 
 void
-ConfigDialog::default_j2k_bandwidth_changed (wxCommandEvent &)
+ConfigDialog::default_j2k_bandwidth_changed ()
 {
        Config::instance()->set_default_j2k_bandwidth (_default_j2k_bandwidth->GetValue() * 1e6);
 }
index 8d9c7af52db2ddf9734e7d959d0f65386c092af4..444b886f475a49b822ecde38402ee53501821bb6 100644 (file)
@@ -41,25 +41,25 @@ public:
        ConfigDialog (wxWindow *);
 
 private:
-       void set_language_changed (wxCommandEvent &);
-       void language_changed (wxCommandEvent &);
-       void tms_ip_changed (wxCommandEvent &);
-       void tms_path_changed (wxCommandEvent &);
-       void tms_user_changed (wxCommandEvent &);
-       void tms_password_changed (wxCommandEvent &);
-       void num_local_encoding_threads_changed (wxCommandEvent &);
-       void default_still_length_changed (wxCommandEvent &);
-       void default_directory_changed (wxCommandEvent &);
-       void edit_default_dci_metadata_clicked (wxCommandEvent &);
-       void add_server_clicked (wxCommandEvent &);
-       void edit_server_clicked (wxCommandEvent &);
-       void remove_server_clicked (wxCommandEvent &);
-       void server_selection_changed (wxListEvent &);
-       void default_container_changed (wxCommandEvent &);
-       void default_dcp_content_type_changed (wxCommandEvent &);
-       void issuer_changed (wxCommandEvent &);
-       void creator_changed (wxCommandEvent &);
-       void default_j2k_bandwidth_changed (wxCommandEvent &);
+       void set_language_changed ();
+       void language_changed ();
+       void tms_ip_changed ();
+       void tms_path_changed ();
+       void tms_user_changed ();
+       void tms_password_changed ();
+       void num_local_encoding_threads_changed ();
+       void default_still_length_changed ();
+       void default_directory_changed ();
+       void edit_default_dci_metadata_clicked ();
+       void add_server_clicked ();
+       void edit_server_clicked ();
+       void remove_server_clicked ();
+       void server_selection_changed ();
+       void default_container_changed ();
+       void default_dcp_content_type_changed ();
+       void issuer_changed ();
+       void creator_changed ();
+       void default_j2k_bandwidth_changed ();
 
        void add_server_to_control (ServerDescription *);
        void setup_language_sensitivity ();
index 962dd50ece04b58c72df5d233ec08efdca90da95..47a546a8d8782223a5d519067c95fed7605fa13e 100644 (file)
@@ -40,7 +40,7 @@ DirPickerCtrl::DirPickerCtrl (wxWindow* parent)
 
        SetSizerAndFit (_sizer);
 
-       _browse->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (DirPickerCtrl::browse_clicked), 0, this);
+       _browse->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DirPickerCtrl::browse_clicked, this));
 }
 
 void
@@ -65,7 +65,7 @@ DirPickerCtrl::GetPath () const
 }
 
 void
-DirPickerCtrl::browse_clicked (wxCommandEvent &)
+DirPickerCtrl::browse_clicked ()
 {
        wxDirDialog* d = new wxDirDialog (this);
        if (d->ShowModal () == wxID_OK) {
index df7b25f7a435d2be01f52041db49d3d7b15fced2..97c0d217a15541318bcb8a0bae5498a965dad93f 100644 (file)
@@ -28,7 +28,7 @@ public:
        void SetPath (wxString);
 
 private:
-       void browse_clicked (wxCommandEvent &);
+       void browse_clicked ();
        
        wxWindow* _parent;
        wxStaticText* _folder;
index 88b2933973853190c31bbbb6dada978da72f1eff..f569f4c54ae097a43c893cccff62f09689cfaeca 100644 (file)
@@ -93,15 +93,15 @@ FilmViewer::FilmViewer (shared_ptr<Film> f, wxWindow* p)
        _back_button->SetMinSize (wxSize (32, -1));
        _forward_button->SetMinSize (wxSize (32, -1));
 
-       _panel->Connect (wxID_ANY, wxEVT_PAINT, wxPaintEventHandler (FilmViewer::paint_panel), 0, this);
-       _panel->Connect (wxID_ANY, wxEVT_SIZE, wxSizeEventHandler (FilmViewer::panel_sized), 0, this);
-       _slider->Connect (wxID_ANY, wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler (FilmViewer::slider_moved), 0, this);
-       _slider->Connect (wxID_ANY, wxEVT_SCROLL_PAGEUP, wxScrollEventHandler (FilmViewer::slider_moved), 0, this);
-       _slider->Connect (wxID_ANY, wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler (FilmViewer::slider_moved), 0, this);
-       _play_button->Connect (wxID_ANY, wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler (FilmViewer::play_clicked), 0, this);
-       _timer.Connect (wxID_ANY, wxEVT_TIMER, wxTimerEventHandler (FilmViewer::timer), 0, this);
-       _back_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmViewer::back_clicked), 0, this);
-       _forward_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmViewer::forward_clicked), 0, this);
+       _panel->Bind          (wxEVT_PAINT,                        boost::bind (&FilmViewer::paint_panel,     this));
+       _panel->Bind          (wxEVT_SIZE,                         boost::bind (&FilmViewer::panel_sized,     this, _1));
+       _slider->Bind         (wxEVT_SCROLL_THUMBTRACK,            boost::bind (&FilmViewer::slider_moved,    this));
+       _slider->Bind         (wxEVT_SCROLL_PAGEUP,                boost::bind (&FilmViewer::slider_moved,    this));
+       _slider->Bind         (wxEVT_SCROLL_PAGEDOWN,              boost::bind (&FilmViewer::slider_moved,    this));
+       _play_button->Bind    (wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, boost::bind (&FilmViewer::play_clicked,    this));
+       _timer.Bind           (wxEVT_TIMER,                        boost::bind (&FilmViewer::timer,           this));
+       _back_button->Bind    (wxEVT_COMMAND_BUTTON_CLICKED,       boost::bind (&FilmViewer::back_clicked,    this));
+       _forward_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED,       boost::bind (&FilmViewer::forward_clicked, this));
 
        set_film (f);
 
@@ -159,7 +159,7 @@ FilmViewer::fetch_current_frame_again ()
 }
 
 void
-FilmViewer::timer (wxTimerEvent &)
+FilmViewer::timer ()
 {
        if (!_player) {
                return;
@@ -179,7 +179,7 @@ FilmViewer::timer (wxTimerEvent &)
 
 
 void
-FilmViewer::paint_panel (wxPaintEvent &)
+FilmViewer::paint_panel ()
 {
        wxPaintDC dc (_panel);
 
@@ -213,7 +213,7 @@ FilmViewer::paint_panel (wxPaintEvent &)
 
 
 void
-FilmViewer::slider_moved (wxScrollEvent &)
+FilmViewer::slider_moved ()
 {
        if (_film && _player) {
                _player->seek (_slider->GetValue() * _film->length() / 4096, false);
@@ -260,7 +260,7 @@ FilmViewer::calculate_sizes ()
 }
 
 void
-FilmViewer::play_clicked (wxCommandEvent &)
+FilmViewer::play_clicked ()
 {
        check_play_state ();
 }
@@ -373,7 +373,7 @@ FilmViewer::active_jobs_changed (bool a)
 }
 
 void
-FilmViewer::back_clicked (wxCommandEvent &)
+FilmViewer::back_clicked ()
 {
        if (!_player) {
                return;
@@ -388,7 +388,7 @@ FilmViewer::back_clicked (wxCommandEvent &)
 }
 
 void
-FilmViewer::forward_clicked (wxCommandEvent &)
+FilmViewer::forward_clicked ()
 {
        if (!_player) {
                return;
index af58b5467cb5b2ad633b91432dcab05b9fbb8b0a..7bda9617e9bea0aa92beae1e9d540f0f2f807610 100644 (file)
@@ -53,19 +53,19 @@ public:
        void set_film (boost::shared_ptr<Film>);
 
 private:
-       void paint_panel (wxPaintEvent &);
+       void paint_panel ();
        void panel_sized (wxSizeEvent &);
-       void slider_moved (wxScrollEvent &);
-       void play_clicked (wxCommandEvent &);
-       void timer (wxTimerEvent &);
+       void slider_moved ();
+       void play_clicked ();
+       void timer ();
        void process_video (boost::shared_ptr<const Image>, Eyes, Time);
        void calculate_sizes ();
        void check_play_state ();
        void fetch_current_frame_again ();
        void fetch_next_frame ();
        void active_jobs_changed (bool);
-       void back_clicked (wxCommandEvent &);
-       void forward_clicked (wxCommandEvent &);
+       void back_clicked ();
+       void forward_clicked ();
        void player_changed (bool);
        void set_position_text (Time);
 
index db6728ba58cd45a2ac05ed47148242ae72a89ab7..757daf3fa7131a4c3881211afa3b44372c77efd1 100644 (file)
@@ -64,7 +64,7 @@ FilterView::FilterView (wxWindow* parent, vector<Filter const *> const & active)
                        bool const a = find (active.begin(), active.end(), *j) != active.end ();
                        b->SetValue (a);
                        _filters[*j] = b;
-                       b->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilterView::filter_toggled), 0, this);
+                       b->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&FilterView::filter_toggled, this));
                        sizer->Add (b);
                }
 
@@ -73,7 +73,7 @@ FilterView::FilterView (wxWindow* parent, vector<Filter const *> const & active)
 }
 
 void
-FilterView::filter_toggled (wxCommandEvent &)
+FilterView::filter_toggled ()
 {
        ActiveChanged ();
 }
index b8d5f644f126c9a16a749a016c5117c244b2f504..7fbef84bf62e5de3747239bce12cfffbbcbe6869 100644 (file)
@@ -41,7 +41,7 @@ public:
        boost::signals2::signal<void()> ActiveChanged;
 
 private:
-       void filter_toggled (wxCommandEvent &);
+       void filter_toggled ();
 
        std::map<Filter const *, wxCheckBox *> _filters;
 };
index 33cb392bfe52886f2878ebfd33ad001022483f58..0f41b5b90f751b57793622885e5e4752899e7911 100644 (file)
@@ -41,9 +41,9 @@ ServerDialog::ServerDialog (wxWindow* parent, ServerDescription* server)
        _threads = new wxSpinCtrl (this, wxID_ANY);
        table->Add (_threads, 1, wxEXPAND);
 
-       _host->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (ServerDialog::host_changed), 0, this);
+       _host->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&ServerDialog::host_changed, this));
        _threads->SetRange (0, 256);
-       _threads->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (ServerDialog::threads_changed), 0, this);
+       _threads->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&ServerDialog::threads_changed, this));
 
        _host->SetValue (std_to_wx (_server->host_name ()));
        _threads->SetValue (_server->threads ());
@@ -62,13 +62,13 @@ ServerDialog::ServerDialog (wxWindow* parent, ServerDescription* server)
 }
 
 void
-ServerDialog::host_changed (wxCommandEvent &)
+ServerDialog::host_changed ()
 {
        _server->set_host_name (wx_to_std (_host->GetValue ()));
 }
 
 void
-ServerDialog::threads_changed (wxCommandEvent &)
+ServerDialog::threads_changed ()
 {
        _server->set_threads (_threads->GetValue ());
 }
index 0912fd60f19291a866b57cc5456320d9f7e24e00..f42236771efbb6e3a7f7c5d34c0865b2f6f4ac12 100644 (file)
@@ -30,8 +30,8 @@ public:
        ServerDescription* server () const;
 
 private:
-       void host_changed (wxCommandEvent &);
-       void threads_changed (wxCommandEvent &);
+       void host_changed ();
+       void threads_changed ();
 
        ServerDescription* _server;
        wxTextCtrl* _host;
index 36a01f90d01eacda6c01c707abc8e6c4750d7e87..f826dd93fe99751487c583f70dd609a75fff77a6 100644 (file)
@@ -62,11 +62,11 @@ Timecode::Timecode (wxWindow* parent)
        _set_button = new wxButton (this, wxID_ANY, _("Set"));
        sizer->Add (_set_button, 0, wxLEFT | wxRIGHT, 8);
 
-       _hours->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (Timecode::changed), 0, this);
-       _minutes->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (Timecode::changed), 0, this);
-       _seconds->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (Timecode::changed), 0, this);
-       _frames->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (Timecode::changed), 0, this);
-       _set_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (Timecode::set_clicked), 0, this);
+       _hours->Bind      (wxEVT_COMMAND_TEXT_UPDATED,   boost::bind (&Timecode::changed, this));
+       _minutes->Bind    (wxEVT_COMMAND_TEXT_UPDATED,   boost::bind (&Timecode::changed, this));
+       _seconds->Bind    (wxEVT_COMMAND_TEXT_UPDATED,   boost::bind (&Timecode::changed, this));
+       _frames->Bind     (wxEVT_COMMAND_TEXT_UPDATED,   boost::bind (&Timecode::changed, this));
+       _set_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&Timecode::set_clicked, this));
 
        _set_button->Enable (false);
        
@@ -107,13 +107,13 @@ Timecode::get (int fps) const
 }
 
 void
-Timecode::changed (wxCommandEvent &)
+Timecode::changed ()
 {
        _set_button->Enable (true);
 }
 
 void
-Timecode::set_clicked (wxCommandEvent &)
+Timecode::set_clicked ()
 {
        Changed ();
        _set_button->Enable (false);
index ca6deb9692a033085f0e5f5bba26663385f6aca2..bebfa3f5f8d2f00c3cdea476a5b7e6fde8f9b9ae 100644 (file)
@@ -32,8 +32,8 @@ public:
        boost::signals2::signal<void ()> Changed;
 
 private:
-       void changed (wxCommandEvent &);
-       void set_clicked (wxCommandEvent &);
+       void changed ();
+       void set_clicked ();
        
        wxTextCtrl* _hours;
        wxTextCtrl* _minutes;
index 8b0e4762a6ac9f6b888bb9190b23c9da686cb4ef..f6e0dabb6a8d7f79aa401de97a8e047e5415a5ff 100644 (file)
@@ -335,12 +335,12 @@ Timeline::Timeline (wxWindow* parent, FilmEditor* ed, shared_ptr<Film> film)
        SetDoubleBuffered (true);
 #endif 
 
-       Connect (wxID_ANY, wxEVT_PAINT, wxPaintEventHandler (Timeline::paint), 0, this);
-       Connect (wxID_ANY, wxEVT_LEFT_DOWN, wxMouseEventHandler (Timeline::left_down), 0, this);
-       Connect (wxID_ANY, wxEVT_LEFT_UP, wxMouseEventHandler (Timeline::left_up), 0, this);
-       Connect (wxID_ANY, wxEVT_RIGHT_DOWN, wxMouseEventHandler (Timeline::right_down), 0, this);
-       Connect (wxID_ANY, wxEVT_MOTION, wxMouseEventHandler (Timeline::mouse_moved), 0, this);
-       Connect (wxID_ANY, wxEVT_SIZE, wxSizeEventHandler (Timeline::resized), 0, this);
+       Bind (wxEVT_PAINT,      boost::bind (&Timeline::paint,       this));
+       Bind (wxEVT_LEFT_DOWN,  boost::bind (&Timeline::left_down,   this, _1));
+       Bind (wxEVT_LEFT_UP,    boost::bind (&Timeline::left_up,     this, _1));
+       Bind (wxEVT_RIGHT_DOWN, boost::bind (&Timeline::right_down,  this, _1));
+       Bind (wxEVT_MOTION,     boost::bind (&Timeline::mouse_moved, this, _1));
+       Bind (wxEVT_SIZE,       boost::bind (&Timeline::resized,     this));
 
        playlist_changed ();
 
@@ -350,7 +350,7 @@ Timeline::Timeline (wxWindow* parent, FilmEditor* ed, shared_ptr<Film> film)
 }
 
 void
-Timeline::paint (wxPaintEvent &)
+Timeline::paint ()
 {
        wxPaintDC dc (this);
 
@@ -605,7 +605,7 @@ Timeline::film () const
 }
 
 void
-Timeline::resized (wxSizeEvent &)
+Timeline::resized ()
 {
        setup_pixels_per_time_unit ();
 }
index 6f5c2ef3b925a286d410d7799f5e1c736638da2e..db33dbbdc70e161003eaf9df40ebbaf46c64eefa 100644 (file)
@@ -65,13 +65,13 @@ public:
        void setup_pixels_per_time_unit ();
 
 private:
-       void paint (wxPaintEvent &);
+       void paint ();
        void left_down (wxMouseEvent &);
        void left_up (wxMouseEvent &);
        void right_down (wxMouseEvent &);
        void mouse_moved (wxMouseEvent &);
        void playlist_changed ();
-       void resized (wxSizeEvent &);
+       void resized ();
        void assign_tracks ();
        void set_start_from_event (wxMouseEvent &);
        void clear_selection ();
index d87fe1149a245aa594ef9cfe01e8fe84174ad96a..249b8d0e4b727101f75cce957ada930eb41e67f1 100644 (file)
@@ -126,7 +126,7 @@ int const ThreadedStaticText::_update_event_id = 10000;
 ThreadedStaticText::ThreadedStaticText (wxWindow* parent, wxString initial, function<string ()> fn)
        : wxStaticText (parent, wxID_ANY, initial)
 {
-       Connect (_update_event_id, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (ThreadedStaticText::thread_finished), 0, this);
+       Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&ThreadedStaticText::thread_finished, this, _1), _update_event_id);
        _thread = new thread (bind (&ThreadedStaticText::run, this, fn));
 }