mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-19 09:01:15 +02: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:
@@ -167,13 +167,15 @@ public:
|
||||
public:
|
||||
void ConnectEvent(wxWindow *w)
|
||||
{
|
||||
w->GetEventHandler()->Connect(wxEVT_KILL_FOCUS, wxFocusEventHandler(FocusHandler::OnKillFocus));
|
||||
// Need to use a named function pointer, not a lambda, so that we
|
||||
// can unbind the same later
|
||||
w->GetEventHandler()->Bind(wxEVT_KILL_FOCUS, OnKillFocus);
|
||||
};
|
||||
void DisconnectEvent(wxWindow *w)
|
||||
{
|
||||
w->GetEventHandler()->Disconnect(wxEVT_KILL_FOCUS, wxFocusEventHandler(FocusHandler::OnKillFocus));
|
||||
w->GetEventHandler()->Unbind(wxEVT_KILL_FOCUS, OnKillFocus);
|
||||
};
|
||||
void OnKillFocus(wxFocusEvent & WXUNUSED(event))
|
||||
static void OnKillFocus(wxFocusEvent & WXUNUSED(event))
|
||||
{
|
||||
return;
|
||||
};
|
||||
|
Reference in New Issue
Block a user