1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-21 06:01:13 +02:00

Rewrite many calls to Connect() with Bind()...

... it's the more modern way, and does better type checking, without the
dubious casts of pointers-to-member-functions.
This commit is contained in:
Paul Licameli
2018-02-12 16:45:54 -05:00
parent bf5228267a
commit 2f3604bdea
12 changed files with 88 additions and 132 deletions

View File

@@ -166,42 +166,28 @@ void AudacityLogger::Show(bool show)
frame->Layout();
// Hook into the frame events
frame->Connect(wxEVT_CLOSE_WINDOW,
frame->Bind(wxEVT_CLOSE_WINDOW,
wxCloseEventHandler(AudacityLogger::OnCloseWindow),
NULL,
this);
frame->Connect(LoggerID_Save,
wxEVT_COMMAND_MENU_SELECTED,
wxCommandEventHandler(AudacityLogger::OnSave),
NULL,
this);
frame->Connect(LoggerID_Clear,
wxEVT_COMMAND_MENU_SELECTED,
wxCommandEventHandler(AudacityLogger::OnClear),
NULL,
this);
frame->Connect(LoggerID_Close,
wxEVT_COMMAND_MENU_SELECTED,
wxCommandEventHandler(AudacityLogger::OnClose),
NULL,
this);
frame->Connect(LoggerID_Save,
wxEVT_COMMAND_BUTTON_CLICKED,
wxCommandEventHandler(AudacityLogger::OnSave),
NULL,
this);
frame->Connect(LoggerID_Clear,
wxEVT_COMMAND_BUTTON_CLICKED,
wxCommandEventHandler(AudacityLogger::OnClear),
NULL,
this);
frame->Connect(LoggerID_Close,
wxEVT_COMMAND_BUTTON_CLICKED,
wxCommandEventHandler(AudacityLogger::OnClose),
NULL,
this);
frame->Bind( wxEVT_COMMAND_MENU_SELECTED,
&AudacityLogger::OnSave,
this, LoggerID_Save);
frame->Bind( wxEVT_COMMAND_MENU_SELECTED,
&AudacityLogger::OnClear,
this, LoggerID_Clear);
frame->Bind( wxEVT_COMMAND_MENU_SELECTED,
&AudacityLogger::OnClose,
this, LoggerID_Close);
frame->Bind( wxEVT_COMMAND_BUTTON_CLICKED,
&AudacityLogger::OnSave,
this, LoggerID_Save);
frame->Bind( wxEVT_COMMAND_BUTTON_CLICKED,
&AudacityLogger::OnClear,
this, LoggerID_Clear);
frame->Bind( wxEVT_COMMAND_BUTTON_CLICKED,
&AudacityLogger::OnClose,
this, LoggerID_Close);
mFrame = std::move( frame );