1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-19 09:01:15 +02:00

Global keyboard capture handling into new files, better comments...

... and break its compile dependency on CommandManager.h by letting it install
callbacks.

This also removes Objective-C mixed code from CommmandManager.

This also eliminates four inclusions of Project.h!

Capture handler state is also global, not per project, though the
CommandManager's callbacks still do depend on the active project.
This commit is contained in:
Paul Licameli
2019-05-14 13:59:24 -04:00
parent 78a1263163
commit db8c4c5e5a
14 changed files with 501 additions and 433 deletions

View File

@@ -171,7 +171,7 @@ different formats.
#include "audacity/Types.h"
#include "../AllThemeResources.h"
#include "../AColor.h"
#include "../Project.h"
#include "../KeyboardCapture.h"
#include "../TranslatableStringArray.h"
#include <algorithm>
@@ -1707,16 +1707,13 @@ void NumericTextCtrl::OnMouse(wxMouseEvent &event)
void NumericTextCtrl::OnFocus(wxFocusEvent &event)
{
if (event.GetEventType() == wxEVT_KILL_FOCUS) {
AudacityProject::ReleaseKeyboard(this);
}
else {
AudacityProject::CaptureKeyboard(this);
if( mFocusedDigit <=0 )
UpdateAutoFocus();
}
KeyboardCapture::OnFocus( *this, event );
Refresh(false);
if (event.GetEventType() != wxEVT_KILL_FOCUS &&
mFocusedDigit <= 0 )
UpdateAutoFocus();
event.Skip( false ); // PRL: not sure why, but preserving old behavior
}
void NumericTextCtrl::OnCaptureKey(wxCommandEvent &event)