Audacity  2.2.0
KeyConfigPrefs.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  KeyConfigPrefs.h
6 
7  Brian Gunlogson
8  Dominic Mazzoni
9 
10 **********************************************************************/
11 
12 #ifndef __AUDACITY_KEY_CONFIG_PREFS__
13 #define __AUDACITY_KEY_CONFIG_PREFS__
14 
15 #include "../Experimental.h"
16 
17 class ShuttleGui;
18 
19 #include <wx/defs.h>
20 #include <wx/imaglist.h>
21 #include <wx/listctrl.h>
22 #include <wx/radiobut.h>
23 #include <wx/srchctrl.h>
24 #include <wx/string.h>
25 #include <wx/textctrl.h>
26 #include <wx/timer.h>
27 
28 #include "../commands/CommandManager.h"
29 #include "../widgets/KeyView.h"
30 
31 #include "PrefsPanel.h"
32 
33 class wxStaticText;
34 
35 class KeyConfigPrefs final : public PrefsPanel
36 {
37 public:
38  KeyConfigPrefs(wxWindow * parent);
40  bool Commit() override;
41  void Cancel() override;
42  wxString HelpPageName() override;
43 
44 private:
45  void Populate();
47  void RefreshBindings(bool bSort);
48  void FilterKeys( wxArrayString & arr );
49  wxString NameFromKey(const wxString & key);
50  void SetKeyForSelected(const wxString & key);
51 
52  void OnViewBy(wxCommandEvent & e);
53  void OnDefaults(wxCommandEvent & e);
54  void OnImportDefaults(wxCommandEvent & e);
55  void OnImport(wxCommandEvent & e);
56  void OnExport(wxCommandEvent & e);
57  void OnSet(wxCommandEvent & e);
58  void OnClear(wxCommandEvent & e);
59  void OnSelected(wxCommandEvent & e);
60 
61  void OnHotkeyKeyDown(wxKeyEvent & e);
62  void OnHotkeyChar(wxKeyEvent & e);
63  void OnHotkeyKillFocus(wxFocusEvent & e);
64 
65  void OnFilterTimer(wxTimerEvent & e);
66  void OnFilterKeyDown(wxKeyEvent & e);
67  void OnFilterChar(wxKeyEvent & e);
68 
70  wxTextCtrl *mKey;
71  wxButton *mSet;
72  wxButton *mClear;
73 
74  wxTextCtrl *mFilter;
75  wxStaticText *mFilterLabel;
76  wxTimer mFilterTimer;
78 
80  wxRadioButton *mViewByTree;
81  wxRadioButton *mViewByName;
82  wxRadioButton *mViewByKey;
83 
86 
87  wxArrayString mNames;
88  wxArrayString mDefaultKeys; // The full set.
89  wxArrayString mStandardDefaultKeys; // The reduced set.
90  wxArrayString mKeys;
91  wxArrayString mNewKeys; // Used for work in progress.
92 
93  DECLARE_EVENT_TABLE()
94 };
95 
96 
98 {
99 public:
100  PrefsPanel *Create(wxWindow *parent) override;
101 };
102 #endif
CommandManager * mManager
Definition: KeyConfigPrefs.h:84
wxRadioButton * mViewByKey
Definition: KeyConfigPrefs.h:82
ViewByType
Definition: KeyView.h:56
PrefsPanel * Create(wxWindow *parent) override
Definition: KeyConfigPrefs.cpp:743
ViewByType mViewType
Definition: KeyConfigPrefs.h:79
void OnDefaults(wxCommandEvent &e)
Definition: KeyConfigPrefs.cpp:386
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:369
wxString HelpPageName() override
Definition: KeyConfigPrefs.cpp:738
void OnViewBy(wxCommandEvent &e)
Definition: KeyConfigPrefs.cpp:667
wxArrayString mDefaultKeys
Definition: KeyConfigPrefs.h:88
void Populate()
Definition: KeyConfigPrefs.cpp:117
void OnSelected(wxCommandEvent &e)
Definition: KeyConfigPrefs.cpp:650
void OnFilterTimer(wxTimerEvent &e)
Definition: KeyConfigPrefs.cpp:512
void OnImport(wxCommandEvent &e)
Definition: KeyConfigPrefs.cpp:331
KeyConfigPrefs(wxWindow *parent)
Definition: KeyConfigPrefs.cpp:75
void SetKeyForSelected(const wxString &key)
Definition: KeyConfigPrefs.cpp:581
bool mFilterPending
Definition: KeyConfigPrefs.h:77
wxStaticText * mFilterLabel
Definition: KeyConfigPrefs.h:75
wxArrayString mKeys
Definition: KeyConfigPrefs.h:90
~KeyConfigPrefs()
Definition: KeyConfigPrefs.cpp:86
wxTextCtrl * mKey
Definition: KeyConfigPrefs.h:70
void OnClear(wxCommandEvent &e)
Definition: KeyConfigPrefs.cpp:641
void OnFilterKeyDown(wxKeyEvent &e)
Definition: KeyConfigPrefs.cpp:522
bool Commit() override
Definition: KeyConfigPrefs.cpp:691
wxRadioButton * mViewByTree
Definition: KeyConfigPrefs.h:80
A PrefsPanel for keybindings.
Definition: KeyConfigPrefs.h:35
wxTextCtrl * mFilter
Definition: KeyConfigPrefs.h:74
void Cancel() override
Definition: KeyConfigPrefs.cpp:728
CommandManager implements a system for organizing all user-callable commands.
Definition: CommandManager.h:94
wxButton * mClear
Definition: KeyConfigPrefs.h:72
wxButton * mSet
Definition: KeyConfigPrefs.h:71
int mCommandSelected
Definition: KeyConfigPrefs.h:85
wxRadioButton * mViewByName
Definition: KeyConfigPrefs.h:81
wxArrayString mNewKeys
Definition: KeyConfigPrefs.h:91
void RefreshBindings(bool bSort)
Definition: KeyConfigPrefs.cpp:297
wxArrayString mNames
Definition: KeyConfigPrefs.h:87
KeyView * mView
Definition: KeyConfigPrefs.h:69
Used within the PrefsDialog, classes derived from this class include AudioIOPrefs, BatchPrefs, DirectoriesPrefs, FileFormatPrefs, GUIPrefs, KeyConfigPrefs, MousePrefs, QualityPrefs, SpectrumPrefs and ThemePrefs.
Definition: PrefsPanel.h:43
void OnFilterChar(wxKeyEvent &e)
Definition: KeyConfigPrefs.cpp:564
void PopulateOrExchange(ShuttleGui &S)
Definition: KeyConfigPrefs.cpp:166
wxArrayString mStandardDefaultKeys
Definition: KeyConfigPrefs.h:89
Definition: PrefsPanel.h:70
void OnImportDefaults(wxCommandEvent &e)
Definition: KeyConfigPrefs.cpp:460
Definition: KeyConfigPrefs.h:97
void OnHotkeyKeyDown(wxKeyEvent &e)
Definition: KeyConfigPrefs.cpp:476
wxString NameFromKey(const wxString &key)
Definition: KeyConfigPrefs.cpp:574
void OnHotkeyKillFocus(wxFocusEvent &e)
Definition: KeyConfigPrefs.cpp:503
void FilterKeys(wxArrayString &arr)
Definition: KeyConfigPrefs.cpp:396
void OnSet(wxCommandEvent &e)
Definition: KeyConfigPrefs.cpp:598
Provides multiple views of keyboard shortcuts.
Definition: KeyView.h:71
void OnExport(wxCommandEvent &e)
Definition: KeyConfigPrefs.cpp:358
void OnHotkeyChar(wxKeyEvent &e)
Definition: KeyConfigPrefs.cpp:498
wxTimer mFilterTimer
Definition: KeyConfigPrefs.h:76