1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-21 16:37:12 +01:00

Rewrite more Connect() with Bind(), which were type incorrect...

... though harmlessly so.  They called to nonstatic member functions of classes
with improper this pointers; though the functions did not use this.

Bind events to nonmember funtions instead.  Sometimes just to empty lambdas to
consume the event and ignore it, blocking other handlers.
This commit is contained in:
Paul Licameli
2018-02-12 17:27:51 -05:00
parent 2f3604bdea
commit e6e8e3251c
9 changed files with 54 additions and 57 deletions

View File

@@ -95,11 +95,15 @@ HistoryWindow::HistoryWindow(AudacityProject *parent, UndoManager *manager):
{
// FIXME: Textbox labels have inconsistent capitalization
mTotal = S.Id(ID_TOTAL).AddTextBox(_("&Total space used"), wxT("0"), 10);
mTotal->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(HistoryWindow::OnChar));
mTotal->Bind(wxEVT_KEY_DOWN,
// ignore it
[](wxEvent&){});
S.AddVariableText( {} )->Hide();
mAvail = S.Id(ID_AVAIL).AddTextBox(_("&Undo Levels Available"), wxT("0"), 10);
mAvail->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(HistoryWindow::OnChar));
mAvail->Bind(wxEVT_KEY_DOWN,
// ignore it
[](wxEvent&){});
S.AddVariableText( {} )->Hide();
S.AddPrompt(_("&Levels To Discard"));
@@ -117,7 +121,9 @@ HistoryWindow::HistoryWindow(AudacityProject *parent, UndoManager *manager):
mDiscard = S.Id(ID_DISCARD).AddButton(_("&Discard"));
mClipboard = S.AddTextBox(_("Clipboard space used"), wxT("0"), 10);
mClipboard->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(HistoryWindow::OnChar));
mClipboard->Bind(wxEVT_KEY_DOWN,
// ignore it
[](wxEvent&){});
S.Id(ID_DISCARD_CLIPBOARD).AddButton(_("Discard"));
}
S.EndMultiColumn();
@@ -294,9 +300,3 @@ void HistoryWindow::OnSize(wxSizeEvent & WXUNUSED(event))
if (mList->GetItemCount() > 0)
mList->EnsureVisible(mSelected);
}
void HistoryWindow::OnChar(wxKeyEvent &event)
{
event.Skip(false);
return;
}