1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-26 15:23:48 +01:00

Bug682: fix Tab key navigation in Preferences, particulary Keyboard

This commit is contained in:
Paul Licameli
2016-06-25 19:38:38 -04:00
parent 4739f3e27b
commit 9f6eedf6e4
4 changed files with 19 additions and 1 deletions

View File

@@ -73,6 +73,9 @@ BEGIN_EVENT_TABLE(PrefsDialog, wxDialog)
EVT_BUTTON(wxID_CANCEL, PrefsDialog::OnCancel)
EVT_BUTTON(wxID_APPLY, PrefsDialog::OnApply)
EVT_TREE_KEY_DOWN(wxID_ANY, PrefsDialog::OnTreeKeyDown) // Handles key events when tree has focus
EVT_CHAR_HOOK(PrefsDialog::OnCharHook)
END_EVENT_TABLE()
@@ -373,6 +376,12 @@ void PrefsDialog::OnTreeKeyDown(wxTreeEvent & event)
event.Skip(); // Ensure standard behavior when enter is not pressed
}
void PrefsDialog::OnCharHook(wxKeyEvent &event)
{
// Common behavior, let's define it in just one place
wxPanelWrapper::DoCharHook(event);
}
void PrefsDialog::OnOK(wxCommandEvent & WXUNUSED(event))
{
RecordExpansionState();

View File

@@ -61,6 +61,8 @@ class PrefsDialog /* not final */ : public wxDialog
void OnApply(wxCommandEvent & e);
void OnTreeKeyDown(wxTreeEvent & e); // Used to dismiss the dialog when enter is pressed with focus on tree
void OnCharHook(wxKeyEvent &e);
void SelectPageByName(const wxString &pageName);
// Accessor to help implementations of SavePreferredPage(),