![]() |
Audacity 3.2.0
|
A PrefsPanel for keybindings. More...
#include <KeyConfigPrefs.h>
Public Member Functions | |
KeyConfigPrefs (wxWindow *parent, wxWindowID winid, AudacityProject *pProject, const CommandID &name) | |
ComponentInterfaceSymbol | GetSymbol () const override |
TranslatableString | GetDescription () const override |
bool | Commit () override |
void | Cancel () override |
ManualPageID | HelpPageName () override |
If not empty string, the Help button is added below the panel. More... | |
void | PopulateOrExchange (ShuttleGui &S) override |
![]() | |
PrefsPanel (wxWindow *parent, wxWindowID winid, const TranslatableString &title) | |
virtual | ~PrefsPanel () |
virtual void | Preview () |
virtual bool | Commit ()=0 |
virtual PluginPath | GetPath () const override |
virtual VendorSymbol | GetVendor () const override |
virtual wxString | GetVersion () const override |
virtual bool | ShowsPreviewButton () |
virtual void | PopulateOrExchange (ShuttleGui &WXUNUSED(S)) |
virtual ManualPageID | HelpPageName () |
If not empty string, the Help button is added below the panel. More... | |
virtual void | Cancel () |
![]() | |
wxPanelWrapper () | |
wxPanelWrapper (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel")) | |
bool | Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel")) |
void | SetLabel (const TranslatableString &label) |
void | SetName (const TranslatableString &name) |
void | SetToolTip (const TranslatableString &toolTip) |
void | SetName () |
![]() | |
wxTabTraversalWrapper (Args &&... args) | |
wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete | |
wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete | |
wxTabTraversalWrapper & | operator= (const wxTabTraversalWrapper &)=delete |
wxTabTraversalWrapper & | operator= (wxTabTraversalWrapper &&)=delete |
Private Member Functions | |
void | Populate () |
void | RefreshBindings (bool bSort) |
void | RefreshKeyInfo () |
void | ClearAllKeys () |
bool | ContainsIllegalDups (TranslatableString &fMatching, TranslatableString &sMatching) const |
TranslatableString | MergeWithExistingKeys (const std::vector< NormalizedKeyString > &toAdd) |
void | FilterKeys (std::vector< NormalizedKeyString > &arr) |
CommandID | NameFromKey (const NormalizedKeyString &key) |
void | SetKeyForSelected (const NormalizedKeyString &key) |
void | OnShow (wxShowEvent &e) |
void | OnViewBy (wxCommandEvent &e) |
void | OnDefaults (wxCommandEvent &e) |
void | OnImportDefaults (wxCommandEvent &e) |
void | OnImport (wxCommandEvent &e) |
void | OnExport (wxCommandEvent &e) |
void | OnSet (wxCommandEvent &e) |
void | OnClear (wxCommandEvent &e) |
void | OnSelected (wxCommandEvent &e) |
void | OnHotkeyKeyDown (wxKeyEvent &e) |
void | OnHotkeyChar (wxEvent &e) |
void | OnHotkeyKillFocus (wxEvent &e) |
void | OnHotkeyContext (wxEvent &e) |
void | OnFilterTimer (wxTimerEvent &e) |
void | OnFilterKeyDown (wxKeyEvent &e) |
void | OnFilterChar (wxEvent &e) |
Private Attributes | |
KeyView * | mView |
wxTextCtrl * | mKey |
wxButton * | mSet |
wxButton * | mClear |
wxTextCtrl * | mFilter |
wxStaticText * | mFilterLabel |
wxTimer | mFilterTimer |
bool | mFilterPending |
ViewByType | mViewType |
wxRadioButton * | mViewByTree |
wxRadioButton * | mViewByName |
wxRadioButton * | mViewByKey |
AudacityProject * | mProject {} |
CommandManager * | mManager |
int | mCommandSelected |
CommandIDs | mNames |
std::vector< NormalizedKeyString > | mDefaultKeys |
std::vector< NormalizedKeyString > | mStandardDefaultKeys |
std::vector< NormalizedKeyString > | mKeys |
std::vector< NormalizedKeyString > | mNewKeys |
Additional Inherited Members | |
![]() | |
using | Factories = std::vector< PrefsPanel::PrefsNode > |
using | Factory = std::function< PrefsPanel *(wxWindow *parent, wxWindowID winid, AudacityProject *) > |
![]() | |
static Factories & | DefaultFactories () |
A PrefsPanel for keybindings.
The code for displaying keybindings is similar to code in MousePrefs. It would be nice to create a NEW 'Bindings' class which both KeyConfigPrefs and MousePrefs use.
Definition at line 32 of file KeyConfigPrefs.h.
KeyConfigPrefs::KeyConfigPrefs | ( | wxWindow * | parent, |
wxWindowID | winid, | ||
AudacityProject * | pProject, | ||
const CommandID & | name | ||
) |
Definition at line 91 of file KeyConfigPrefs.cpp.
|
overridevirtual |
Reimplemented from PrefsPanel.
Definition at line 930 of file KeyConfigPrefs.cpp.
References mKeys, mManager, mNames, and CommandManager::SetKeyFromIndex().
|
private |
Definition at line 373 of file KeyConfigPrefs.cpp.
References mManager, mNames, NO_SHORTCUT, and CommandManager::SetKeyFromName().
Referenced by OnImport().
|
overridevirtual |
Implements PrefsPanel.
Definition at line 891 of file KeyConfigPrefs.cpp.
References FileConfig::DeleteEntry(), eIsSavingToPrefs, FileConfig::Flush(), gPrefs, FileConfig::HasEntry(), key, mDefaultKeys, mNames, mNewKeys, mProject, mStandardDefaultKeys, name, PopulateOrExchange(), S, and wxT().
|
private |
Definition at line 385 of file KeyConfigPrefs.cpp.
References EMPTY_SHORTCUT, CommandManager::GetPrefixedLabelFromName(), mDefaultKeys, mKeys, mManager, mNames, and NO_SHORTCUT.
Referenced by OnImport().
|
private |
Definition at line 607 of file KeyConfigPrefs.cpp.
References CommandManager::ExcludedList().
Referenced by OnImportDefaults(), and RefreshBindings().
|
overridevirtual |
Implements ComponentInterface.
Definition at line 119 of file KeyConfigPrefs.cpp.
References XO().
|
overridevirtual |
Implements ComponentInterface.
Definition at line 114 of file KeyConfigPrefs.cpp.
References KEY_CONFIG_PREFS_PLUGIN_SYMBOL.
|
overridevirtual |
If not empty string, the Help button is added below the panel.
Default returns empty string.
Reimplemented from PrefsPanel.
Definition at line 124 of file KeyConfigPrefs.cpp.
|
private |
Definition at line 425 of file KeyConfigPrefs.cpp.
References EMPTY_SHORTCUT, Identifier::GET(), CommandManager::GetKeyFromName(), CommandManager::GetPrefixedLabelFromName(), mDefaultKeys, mKeys, mManager, mNames, name, NO_SHORTCUT, CommandManager::SetKeyFromIndex(), and XO().
Referenced by OnImport().
|
private |
Definition at line 737 of file KeyConfigPrefs.cpp.
References KeyView::GetNameByKey(), key, and mView.
|
private |
Definition at line 841 of file KeyConfigPrefs.cpp.
References mCommandSelected, mKey, and SetKeyForSelected().
|
private |
Definition at line 598 of file KeyConfigPrefs.cpp.
References _, MenuTable::Menu(), OnImportDefaults(), and BasicMenu::Handle::Popup().
|
private |
Definition at line 570 of file KeyConfigPrefs.cpp.
References FileNames::AllFiles, GuardedCall(), mManager, SelectFile(), CommandManager::WriteXML(), wxT(), FileNames::XMLFiles, and XO().
|
private |
Definition at line 727 of file KeyConfigPrefs.cpp.
References mViewType, and ViewByKey.
Referenced by PopulateOrExchange().
|
private |
Definition at line 685 of file KeyConfigPrefs.cpp.
References NormalizedKeyString::Display(), key, KeyEventToKeyString(), mFilterPending, mFilterTimer, mView, mViewType, KeyView::SetFilter(), and ViewByKey.
Referenced by PopulateOrExchange().
|
private |
Definition at line 675 of file KeyConfigPrefs.cpp.
References mFilter, mFilterPending, mView, and KeyView::SetFilter().
|
private |
Definition at line 656 of file KeyConfigPrefs.cpp.
Referenced by PopulateOrExchange().
|
private |
Definition at line 670 of file KeyConfigPrefs.cpp.
Referenced by PopulateOrExchange().
|
private |
Definition at line 634 of file KeyConfigPrefs.cpp.
References NormalizedKeyString::Display(), and KeyEventToKeyString().
Referenced by PopulateOrExchange().
|
private |
Definition at line 661 of file KeyConfigPrefs.cpp.
References NormalizedKeyString::Display(), KeyView::GetKey(), mCommandSelected, mKey, and mView.
Referenced by PopulateOrExchange().
|
private |
Definition at line 491 of file KeyConfigPrefs.cpp.
References FileNames::AllFiles, AudacityMessageBox(), ClearAllKeys(), ContainsIllegalDups(), XMLFileReader::GetErrorStr(), CommandManager::GetNumberOfKeysRead(), MergeWithExistingKeys(), mKeys, mManager, mNames, XMLFileReader::Parse(), RefreshBindings(), RefreshKeyInfo(), SelectFile(), CommandManager::SetKeyFromName(), wxT(), FileNames::XMLFiles, and XO().
|
private |
Definition at line 618 of file KeyConfigPrefs.cpp.
References FileConfig::DeleteEntry(), FilterKeys(), FileConfig::Flush(), gPrefs, mDefaultKeys, mManager, mNewKeys, RefreshBindings(), CommandManager::SetKeyFromIndex(), and wxT().
Referenced by OnDefaults().
|
private |
Definition at line 850 of file KeyConfigPrefs.cpp.
References KeyView::CanSetKey(), NormalizedKeyString::Display(), KeyView::GetKey(), KeyView::GetSelected(), mClear, mCommandSelected, mKey, mSet, and mView.
|
private |
Definition at line 764 of file KeyConfigPrefs.cpp.
References AudacityMessageBox(), EMPTY_SHORTCUT, TranslatableString::Format(), CommandManager::GetCategoryFromName(), CommandManager::GetDefaultKeyFromName(), KeyView::GetName(), CommandManager::GetPrefixedLabelFromName(), make_iterator_range(), mCommandSelected, mDefaultKeys, mKey, mManager, mNames, mNewKeys, mView, KeyView::SetKeyByName(), SetKeyForSelected(), CommandManager::SetKeyFromName(), Verbatim(), wxT(), and XO().
|
private |
Definition at line 479 of file KeyConfigPrefs.cpp.
References mView.
|
private |
Definition at line 867 of file KeyConfigPrefs.cpp.
References _, mFilter, mFilterLabel, mView, mViewType, KeyView::SetView(), ViewByKey, ViewByKeyID, ViewByName, ViewByNameID, ViewByTree, and ViewByTreeID.
|
private |
Definition at line 129 of file KeyConfigPrefs.cpp.
References _, eIsCreatingFromPrefs, CommandManager::Get(), mCommandSelected, mFilter, mFilterLabel, mManager, mProject, mView, mViewByKey, mViewByName, mViewByTree, mViewType, PopulateOrExchange(), RefreshBindings(), S, KeyView::SetView(), ViewByKey, ViewByName, ViewByTree, and XO().
|
override |
Normally in classes derived from PrefsPanel this function is used both to populate the panel and to exchange data with it. With KeyConfigPrefs all the exchanges are handled specially, so this is only used in populating the panel.
Definition at line 177 of file KeyConfigPrefs.cpp.
References _, AssignDefaultsButtonID, ClearButtonID, CommandsListID, CurrentComboID, ExportButtonID, FilterID, ImportButtonID, mClear, mFilter, mFilterLabel, mKey, mSet, mView, mViewByKey, mViewByName, mViewByTree, OnFilterChar(), OnFilterKeyDown(), OnHotkeyChar(), OnHotkeyContext(), OnHotkeyKeyDown(), OnHotkeyKillFocus(), S, safenew, SetButtonID, ViewByKeyID, ViewByNameID, ViewByTreeID, wxT(), XO(), and XXO().
Referenced by Commit(), and Populate().
|
private |
Definition at line 327 of file KeyConfigPrefs.cpp.
References FilterKeys(), CommandManager::GetAllCommandData(), mDefaultKeys, mKeys, mManager, mNames, mNewKeys, mStandardDefaultKeys, mView, and KeyView::RefreshBindings().
Referenced by OnImport(), OnImportDefaults(), and Populate().
|
private |
Definition at line 363 of file KeyConfigPrefs.cpp.
References CommandManager::GetKeyFromName(), mKeys, mManager, mNames, and name.
Referenced by OnImport().
|
private |
Definition at line 744 of file KeyConfigPrefs.cpp.
References AudacityMessageBox(), KeyView::CanSetKey(), KeyView::GetName(), key, make_iterator_range(), mCommandSelected, mManager, mNames, mNewKeys, mView, name, KeyView::SetKey(), CommandManager::SetKeyFromName(), and XO().
Referenced by OnClear(), and OnSet().
|
private |
Definition at line 84 of file KeyConfigPrefs.h.
Referenced by OnSelected(), and PopulateOrExchange().
|
private |
Definition at line 99 of file KeyConfigPrefs.h.
Referenced by OnClear(), OnHotkeyKillFocus(), OnSelected(), OnSet(), Populate(), and SetKeyForSelected().
|
private |
Definition at line 102 of file KeyConfigPrefs.h.
Referenced by Commit(), ContainsIllegalDups(), MergeWithExistingKeys(), OnImportDefaults(), OnSet(), and RefreshBindings().
|
private |
Definition at line 86 of file KeyConfigPrefs.h.
Referenced by OnFilterTimer(), OnViewBy(), Populate(), and PopulateOrExchange().
|
private |
Definition at line 87 of file KeyConfigPrefs.h.
Referenced by OnViewBy(), Populate(), and PopulateOrExchange().
|
private |
Definition at line 89 of file KeyConfigPrefs.h.
Referenced by OnFilterKeyDown(), and OnFilterTimer().
|
private |
Definition at line 88 of file KeyConfigPrefs.h.
Referenced by OnFilterKeyDown().
|
private |
Definition at line 82 of file KeyConfigPrefs.h.
Referenced by OnClear(), OnHotkeyKillFocus(), OnSelected(), OnSet(), and PopulateOrExchange().
|
private |
Definition at line 104 of file KeyConfigPrefs.h.
Referenced by Cancel(), ContainsIllegalDups(), MergeWithExistingKeys(), OnImport(), RefreshBindings(), and RefreshKeyInfo().
|
private |
Definition at line 98 of file KeyConfigPrefs.h.
Referenced by Cancel(), ClearAllKeys(), ContainsIllegalDups(), MergeWithExistingKeys(), OnExport(), OnImport(), OnImportDefaults(), OnSet(), Populate(), RefreshBindings(), RefreshKeyInfo(), and SetKeyForSelected().
|
private |
Definition at line 101 of file KeyConfigPrefs.h.
Referenced by Cancel(), ClearAllKeys(), Commit(), ContainsIllegalDups(), MergeWithExistingKeys(), OnImport(), OnSet(), RefreshBindings(), RefreshKeyInfo(), and SetKeyForSelected().
|
private |
Definition at line 105 of file KeyConfigPrefs.h.
Referenced by Commit(), OnImportDefaults(), OnSet(), RefreshBindings(), and SetKeyForSelected().
|
private |
Definition at line 96 of file KeyConfigPrefs.h.
Referenced by Commit(), and Populate().
|
private |
Definition at line 83 of file KeyConfigPrefs.h.
Referenced by OnSelected(), and PopulateOrExchange().
|
private |
Definition at line 103 of file KeyConfigPrefs.h.
Referenced by Commit(), and RefreshBindings().
|
private |
Definition at line 81 of file KeyConfigPrefs.h.
Referenced by NameFromKey(), OnFilterKeyDown(), OnFilterTimer(), OnHotkeyKillFocus(), OnSelected(), OnSet(), OnShow(), OnViewBy(), Populate(), PopulateOrExchange(), RefreshBindings(), and SetKeyForSelected().
|
private |
Definition at line 94 of file KeyConfigPrefs.h.
Referenced by Populate(), and PopulateOrExchange().
|
private |
Definition at line 93 of file KeyConfigPrefs.h.
Referenced by Populate(), and PopulateOrExchange().
|
private |
Definition at line 92 of file KeyConfigPrefs.h.
Referenced by Populate(), and PopulateOrExchange().
|
private |
Definition at line 91 of file KeyConfigPrefs.h.
Referenced by OnFilterChar(), OnFilterKeyDown(), OnViewBy(), and Populate().