From e7d33e18a72db78488b35ce9540d9a6e158bfecf Mon Sep 17 00:00:00 2001 From: James Crook Date: Tue, 15 Aug 2017 23:09:31 +0100 Subject: [PATCH] Bug 1664 - Two shortcut pairs do not work in focused Karaoke window --- src/Lyrics.cpp | 4 ++-- src/Lyrics.h | 2 +- src/Menus.cpp | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Lyrics.cpp b/src/Lyrics.cpp index 3f51fa081..bddb92c3f 100644 --- a/src/Lyrics.cpp +++ b/src/Lyrics.cpp @@ -78,12 +78,12 @@ BEGIN_EVENT_TABLE(Lyrics, wxPanelWrapper) // EVT_COMMAND_LEFT_CLICK(kHighlightTextCtrlID, Lyrics::OnHighlightTextCtrl) END_EVENT_TABLE() -IMPLEMENT_CLASS(Lyrics, wxPanelWrapper) +IMPLEMENT_CLASS(Lyrics, wxPanel) Lyrics::Lyrics(wxWindow* parent, wxWindowID id, const wxPoint& pos /*= wxDefaultPosition*/, const wxSize& size /*= wxDefaultSize*/): - wxPanelWrapper(parent, id, pos, size), + wxPanel(parent, id, pos, size, wxWANTS_CHARS), mWidth(size.x), mHeight(size.y) { mKaraokeHeight = mHeight; diff --git a/src/Lyrics.h b/src/Lyrics.h index 8bed9e58a..b2424dd60 100644 --- a/src/Lyrics.h +++ b/src/Lyrics.h @@ -58,7 +58,7 @@ private: DECLARE_EVENT_TABLE() }; -class Lyrics final : public wxPanelWrapper +class Lyrics final : public wxPanel { DECLARE_DYNAMIC_CLASS(Lyrics) diff --git a/src/Menus.cpp b/src/Menus.cpp index 1195a54ca..db744c72b 100644 --- a/src/Menus.cpp +++ b/src/Menus.cpp @@ -1921,7 +1921,11 @@ CommandFlag AudacityProject::GetFocusedFrame() if (w == mTrackPanel) { return TrackPanelHasFocus; } - + // LIE if Lyrics window has focus. + // we want to act as if TrackPanel has focus. + if (w== mLyricsWindow) { + return TrackPanelHasFocus; + } if (w == mToolManager->GetBotDock()) { return BotDockHasFocus; }