/********************************************************************** Audacity: A Digital Audio Editor KeyConfigPrefs.h Brian Gunlogson Dominic Mazzoni **********************************************************************/ #ifndef __AUDACITY_KEY_CONFIG_PREFS__ #define __AUDACITY_KEY_CONFIG_PREFS__ class CommandManager; class ShuttleGui; #include #include // member variable #include "PrefsPanel.h" class wxRadioButton; class wxStaticText; class wxTextCtrl; class KeyView; struct NormalizedKeyString; enum ViewByType : int; #define KEY_CONFIG_PREFS_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Key Config") } class KeyConfigPrefs final : public PrefsPanel { public: KeyConfigPrefs(wxWindow * parent, wxWindowID winid, const CommandID &name); ComponentInterfaceSymbol GetSymbol() override; wxString GetDescription() override; bool Commit() override; void Cancel() override; wxString HelpPageName() override; void PopulateOrExchange(ShuttleGui & S) override; private: void Populate(); void RefreshBindings(bool bSort); void FilterKeys( std::vector & arr ); CommandID NameFromKey(const NormalizedKeyString & key); void SetKeyForSelected(const NormalizedKeyString & key); 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(wxKeyEvent & e); void OnHotkeyKillFocus(wxFocusEvent & e); void OnFilterTimer(wxTimerEvent & e); void OnFilterKeyDown(wxKeyEvent & e); void OnFilterChar(wxKeyEvent & e); KeyView *mView; wxTextCtrl *mKey; wxButton *mSet; wxButton *mClear; wxTextCtrl *mFilter; wxStaticText *mFilterLabel; wxTimer mFilterTimer; bool mFilterPending; ViewByType mViewType; wxRadioButton *mViewByTree; wxRadioButton *mViewByName; wxRadioButton *mViewByKey; CommandManager *mManager; int mCommandSelected; CommandIDs mNames; std::vector mDefaultKeys; // The full set. std::vector mStandardDefaultKeys; // The reduced set. std::vector mKeys; std::vector mNewKeys; // Used for work in progress. DECLARE_EVENT_TABLE() }; /// A PrefsPanel::Factory that creates one KeyConfigPrefs panel. /// This factory can be parametrized by name, which specifies a command to be /// focused initially extern PrefsPanel::Factory KeyConfigPrefsFactory( const CommandID &name = {} ); #endif