1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-11 00:45:53 +01: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

@@ -186,13 +186,11 @@ void KeyConfigPrefs::PopulateOrExchange(ShuttleGui & S)
#endif
wxTE_PROCESS_ENTER);
mFilter->SetName(wxStripMenuCodes(mFilterLabel->GetLabel()));
mFilter->Connect(wxEVT_KEY_DOWN,
wxKeyEventHandler(KeyConfigPrefs::OnFilterKeyDown),
NULL,
mFilter->Bind(wxEVT_KEY_DOWN,
&KeyConfigPrefs::OnFilterKeyDown,
this);
mFilter->Connect(wxEVT_CHAR,
wxKeyEventHandler(KeyConfigPrefs::OnFilterChar),
NULL,
mFilter->Bind(wxEVT_CHAR,
&KeyConfigPrefs::OnFilterChar,
this);
}
S.AddWindow(mFilter, wxALIGN_NOT | wxALIGN_LEFT);
@@ -228,17 +226,14 @@ void KeyConfigPrefs::PopulateOrExchange(ShuttleGui & S)
wxTE_PROCESS_ENTER);
mKey->SetName(_("Short cut"));
mKey->Connect(wxEVT_KEY_DOWN,
wxKeyEventHandler(KeyConfigPrefs::OnHotkeyKeyDown),
NULL,
mKey->Bind(wxEVT_KEY_DOWN,
&KeyConfigPrefs::OnHotkeyKeyDown,
this);
mKey->Connect(wxEVT_CHAR,
wxKeyEventHandler(KeyConfigPrefs::OnHotkeyChar),
NULL,
mKey->Bind(wxEVT_CHAR,
&KeyConfigPrefs::OnHotkeyChar,
this);
mKey->Connect(wxEVT_KILL_FOCUS,
wxFocusEventHandler(KeyConfigPrefs::OnHotkeyKillFocus),
NULL,
mKey->Bind(wxEVT_KILL_FOCUS,
&KeyConfigPrefs::OnHotkeyKillFocus,
this);
}
S.AddWindow(mKey);