summaryrefslogtreecommitdiff
path: root/src/tools
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/tools
parent750ad2a59ff2b3487859b6c290d06c0129cb6aa0 (diff)
Remove old Connect() wxWidgets API and use Bind().
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/dcpomatic.cc4
-rw-r--r--src/tools/dcpomatic_batch.cc24
-rw-r--r--src/tools/dcpomatic_server.cc12
3 files changed, 20 insertions, 20 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 ();
}