summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-07-26 11:14:41 +0100
committerCarl Hetherington <cth@carlh.net>2013-07-26 11:14:41 +0100
commit16a7ea91e973b327735658857cbf996cc740be77 (patch)
treeab67c21cb8cb85274b079268ef7c8d2160e3cae2 /src
parent750ad2a59ff2b3487859b6c290d06c0129cb6aa0 (diff)
Remove old Connect() wxWidgets API and use Bind().
Diffstat (limited to 'src')
-rw-r--r--src/tools/dcpomatic.cc4
-rw-r--r--src/tools/dcpomatic_batch.cc24
-rw-r--r--src/tools/dcpomatic_server.cc12
-rw-r--r--src/wx/audio_dialog.cc8
-rw-r--r--src/wx/audio_dialog.h2
-rw-r--r--src/wx/audio_mapping_view.cc2
-rw-r--r--src/wx/audio_plot.cc4
-rw-r--r--src/wx/audio_plot.h2
-rw-r--r--src/wx/config_dialog.cc85
-rw-r--r--src/wx/config_dialog.h38
-rw-r--r--src/wx/dir_picker_ctrl.cc4
-rw-r--r--src/wx/dir_picker_ctrl.h2
-rw-r--r--src/wx/film_viewer.cc30
-rw-r--r--src/wx/film_viewer.h12
-rw-r--r--src/wx/filter_view.cc4
-rw-r--r--src/wx/filter_view.h2
-rw-r--r--src/wx/server_dialog.cc8
-rw-r--r--src/wx/server_dialog.h4
-rw-r--r--src/wx/timecode.cc14
-rw-r--r--src/wx/timecode.h4
-rw-r--r--src/wx/timeline.cc16
-rw-r--r--src/wx/timeline.h4
-rw-r--r--src/wx/wx_util.cc2
23 files changed, 143 insertions, 144 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index 623df3dc6..44f707351 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -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 ();
}
diff --git a/src/tools/dcpomatic_batch.cc b/src/tools/dcpomatic_batch.cc
index b4ab054fd..23d5a4819 100644
--- a/src/tools/dcpomatic_batch.cc
+++ b/src/tools/dcpomatic_batch.cc
@@ -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 ();
}
diff --git a/src/tools/dcpomatic_server.cc b/src/tools/dcpomatic_server.cc
index 1bfc23ff9..78354c468 100644
--- a/src/tools/dcpomatic_server.cc
+++ b/src/tools/dcpomatic_server.cc
@@ -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 ();
}
diff --git a/src/wx/audio_dialog.cc b/src/wx/audio_dialog.cc
index 26655631e..462eb8d50 100644
--- a/src/wx/audio_dialog.cc
+++ b/src/wx/audio_dialog.cc
@@ -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 ());
}
diff --git a/src/wx/audio_dialog.h b/src/wx/audio_dialog.h
index 62811091a..8623192c4 100644
--- a/src/wx/audio_dialog.h
+++ b/src/wx/audio_dialog.h
@@ -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 ();
diff --git a/src/wx/audio_mapping_view.cc b/src/wx/audio_mapping_view.cc
index f5d0ecae2..3136b8679 100644
--- a/src/wx/audio_mapping_view.cc
+++ b/src/wx/audio_mapping_view.cc
@@ -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
diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc
index 2539a93d9..7ed792351 100644
--- a/src/wx/audio_plot.cc
+++ b/src/wx/audio_plot.cc
@@ -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);
diff --git a/src/wx/audio_plot.h b/src/wx/audio_plot.h
index 5605f94a5..094f8e1b0 100644
--- a/src/wx/audio_plot.h
+++ b/src/wx/audio_plot.h
@@ -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];
diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc
index 7ab23c997..cbcae78f8 100644
--- a/src/wx/config_dialog.cc
+++ b/src/wx/config_dialog.cc
@@ -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);
}
diff --git a/src/wx/config_dialog.h b/src/wx/config_dialog.h
index 8d9c7af52..444b886f4 100644
--- a/src/wx/config_dialog.h
+++ b/src/wx/config_dialog.h
@@ -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 ();
diff --git a/src/wx/dir_picker_ctrl.cc b/src/wx/dir_picker_ctrl.cc
index 962dd50ec..47a546a8d 100644
--- a/src/wx/dir_picker_ctrl.cc
+++ b/src/wx/dir_picker_ctrl.cc
@@ -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) {
diff --git a/src/wx/dir_picker_ctrl.h b/src/wx/dir_picker_ctrl.h
index df7b25f7a..97c0d217a 100644
--- a/src/wx/dir_picker_ctrl.h
+++ b/src/wx/dir_picker_ctrl.h
@@ -28,7 +28,7 @@ public:
void SetPath (wxString);
private:
- void browse_clicked (wxCommandEvent &);
+ void browse_clicked ();
wxWindow* _parent;
wxStaticText* _folder;
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 88b293397..f569f4c54 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -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;
diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h
index af58b5467..7bda9617e 100644
--- a/src/wx/film_viewer.h
+++ b/src/wx/film_viewer.h
@@ -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);
diff --git a/src/wx/filter_view.cc b/src/wx/filter_view.cc
index db6728ba5..757daf3fa 100644
--- a/src/wx/filter_view.cc
+++ b/src/wx/filter_view.cc
@@ -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 ();
}
diff --git a/src/wx/filter_view.h b/src/wx/filter_view.h
index b8d5f644f..7fbef84bf 100644
--- a/src/wx/filter_view.h
+++ b/src/wx/filter_view.h
@@ -41,7 +41,7 @@ public:
boost::signals2::signal<void()> ActiveChanged;
private:
- void filter_toggled (wxCommandEvent &);
+ void filter_toggled ();
std::map<Filter const *, wxCheckBox *> _filters;
};
diff --git a/src/wx/server_dialog.cc b/src/wx/server_dialog.cc
index 33cb392bf..0f41b5b90 100644
--- a/src/wx/server_dialog.cc
+++ b/src/wx/server_dialog.cc
@@ -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 ());
}
diff --git a/src/wx/server_dialog.h b/src/wx/server_dialog.h
index 0912fd60f..f42236771 100644
--- a/src/wx/server_dialog.h
+++ b/src/wx/server_dialog.h
@@ -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;
diff --git a/src/wx/timecode.cc b/src/wx/timecode.cc
index 36a01f90d..f826dd93f 100644
--- a/src/wx/timecode.cc
+++ b/src/wx/timecode.cc
@@ -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);
diff --git a/src/wx/timecode.h b/src/wx/timecode.h
index ca6deb969..bebfa3f5f 100644
--- a/src/wx/timecode.h
+++ b/src/wx/timecode.h
@@ -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;
diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc
index 8b0e4762a..f6e0dabb6 100644
--- a/src/wx/timeline.cc
+++ b/src/wx/timeline.cc
@@ -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 ();
}
diff --git a/src/wx/timeline.h b/src/wx/timeline.h
index 6f5c2ef3b..db33dbbdc 100644
--- a/src/wx/timeline.h
+++ b/src/wx/timeline.h
@@ -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 ();
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc
index d87fe1149..249b8d0e4 100644
--- a/src/wx/wx_util.cc
+++ b/src/wx/wx_util.cc
@@ -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));
}