Audacity  2.2.2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
KeyConfigPrefs Class Referencefinal

A PrefsPanel for keybindings. More...

#include <KeyConfigPrefs.h>

Inheritance diagram for KeyConfigPrefs:
PrefsPanel wxPanelWrapper wxTabTraversalWrapper< wxPanel >

Public Member Functions

 KeyConfigPrefs (wxWindow *parent, const wxString &name)
 
 ~KeyConfigPrefs ()
 
bool Commit () override
 
void Cancel () override
 
wxString HelpPageName () override
 
- Public Member Functions inherited from PrefsPanel
 PrefsPanel (wxWindow *parent, const wxString &title)
 
virtual ~PrefsPanel ()
 
virtual void Preview ()
 
virtual bool ShowsPreviewButton ()
 
- Public Member Functions inherited from wxPanelWrapper
 wxPanelWrapper ()
 
 wxPanelWrapper (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const wxString &name=_("Panel"))
 
bool Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const wxString &name=_("Panel"))
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxPanel >
 wxTabTraversalWrapper (Args &&...args)
 
 ~wxTabTraversalWrapper ()
 

Private Member Functions

void Populate ()
 
void PopulateOrExchange (ShuttleGui &S)
 
void RefreshBindings (bool bSort)
 
void FilterKeys (wxArrayString &arr)
 
wxString NameFromKey (const wxString &key)
 
void SetKeyForSelected (const wxString &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)
 

Private Attributes

KeyViewmView
 
wxTextCtrl * mKey
 
wxButton * mSet
 
wxButton * mClear
 
wxTextCtrl * mFilter
 
wxStaticText * mFilterLabel
 
wxTimer mFilterTimer
 
bool mFilterPending
 
ViewByType mViewType
 
wxRadioButton * mViewByTree
 
wxRadioButton * mViewByName
 
wxRadioButton * mViewByKey
 
CommandManagermManager
 
int mCommandSelected
 
wxArrayString mNames
 
wxArrayString mDefaultKeys
 
wxArrayString mStandardDefaultKeys
 
wxArrayString mKeys
 
wxArrayString mNewKeys
 

Detailed Description

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 35 of file KeyConfigPrefs.h.

Constructor & Destructor Documentation

KeyConfigPrefs::KeyConfigPrefs ( wxWindow *  parent,
const wxString &  name 
)

Definition at line 75 of file KeyConfigPrefs.cpp.

References name.

77 : PrefsPanel(parent, _("Keyboard")),
78  mView(NULL),
79  mKey(NULL),
80  mFilter(NULL),
82  mFilterPending(false)
83 {
84  Populate();
85  if (!name.empty()) {
86  auto index = mView->GetIndexByName(name);
87  mView->SelectNode(index);
88  }
89 }
#define FilterTimerID
PrefsPanel(wxWindow *parent, const wxString &title)
Definition: PrefsPanel.h:46
void SelectNode(int index)
Definition: KeyView.cpp:999
wxTextCtrl * mKey
wxTextCtrl * mFilter
KeyView * mView
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom"))), OnMoveTrack) void TrackMenuTable::OnSetName(wxCommandEvent &)
int GetIndexByName(const wxString &name) const
Definition: KeyView.cpp:148
const wxChar * name
Definition: Distortion.cpp:94
wxTimer mFilterTimer
KeyConfigPrefs::~KeyConfigPrefs ( )

Definition at line 91 of file KeyConfigPrefs.cpp.

References mFilter, mKey, OnFilterChar(), OnFilterKeyDown(), OnHotkeyChar(), OnHotkeyKeyDown(), and OnHotkeyKillFocus().

92 {
93  if (mKey)
94  {
95  mKey->Disconnect(wxEVT_KEY_DOWN,
96  wxKeyEventHandler(KeyConfigPrefs::OnHotkeyKeyDown),
97  NULL,
98  this);
99  mKey->Disconnect(wxEVT_CHAR,
100  wxKeyEventHandler(KeyConfigPrefs::OnHotkeyChar),
101  NULL,
102  this);
103  mKey->Disconnect(wxEVT_KILL_FOCUS,
104  wxFocusEventHandler(KeyConfigPrefs::OnHotkeyKillFocus),
105  NULL,
106  this);
107  }
108 
109  if (mFilter)
110  {
111  mKey->Disconnect(wxEVT_KEY_DOWN,
112  wxKeyEventHandler(KeyConfigPrefs::OnFilterKeyDown),
113  NULL,
114  this);
115  mKey->Disconnect(wxEVT_CHAR,
116  wxKeyEventHandler(KeyConfigPrefs::OnFilterChar),
117  NULL,
118  this);
119  }
120 }
wxTextCtrl * mKey
void OnFilterKeyDown(wxKeyEvent &e)
wxTextCtrl * mFilter
void OnFilterChar(wxKeyEvent &e)
void OnHotkeyKeyDown(wxKeyEvent &e)
void OnHotkeyKillFocus(wxFocusEvent &e)
void OnHotkeyChar(wxKeyEvent &e)

Member Function Documentation

void KeyConfigPrefs::Cancel ( )
overridevirtual

Reimplemented from PrefsPanel.

Definition at line 735 of file KeyConfigPrefs.cpp.

References mKeys, mManager, mNames, and CommandManager::SetKeyFromIndex().

736 {
737  // Restore original key values
738  for (size_t i = 0; i < mNames.GetCount(); i++) {
740  }
741 
742  return;
743 }
CommandManager * mManager
void SetKeyFromIndex(int i, const wxString &key)
wxArrayString mKeys
wxArrayString mNames
bool KeyConfigPrefs::Commit ( )
overridevirtual

Implements PrefsPanel.

Definition at line 698 of file KeyConfigPrefs.cpp.

References eIsSavingToPrefs, GetActiveProject(), gPrefs, KeyStringNormalize(), mNames, mNewKeys, mStandardDefaultKeys, name, and PopulateOrExchange().

699 {
700  // On the Mac, preferences may be changed without any active
701  // projects. This means that the CommandManager isn't availabe
702  // either. So we can't attempt to save preferences, otherwise
703  // NULL ptr dereferences will happen in ShuttleGui because the
704  // radio buttons are never created. (See Populate() above.)
705  if (!GetActiveProject()) {
706  return true;
707  }
708 
709  ShuttleGui S(this, eIsSavingToPrefs);
711 
712  for (size_t i = 0; i < mNames.GetCount(); i++) {
713  wxString dkey = KeyStringNormalize(mStandardDefaultKeys[i]);
714  wxString name = wxT("/NewKeys/") + mNames[i];
715  wxString key = KeyStringNormalize(mNewKeys[i]);
716 
717  if (gPrefs->HasEntry(name)) {
718  if (key != KeyStringNormalize(gPrefs->Read(name, key))) {
719  gPrefs->Write(name, key);
720  }
721  if (key == dkey) {
722  gPrefs->DeleteEntry(name);
723  }
724  }
725  else {
726  if (key != dkey) {
727  gPrefs->Write(name, key);
728  }
729  }
730  }
731 
732  return gPrefs->Flush();
733 }
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:366
wxFileConfig * gPrefs
Definition: Prefs.cpp:72
wxString KeyStringNormalize(const wxString &key)
Definition: Keyboard.cpp:16
wxArrayString mNewKeys
wxArrayString mNames
void PopulateOrExchange(ShuttleGui &S)
const wxChar * name
Definition: Distortion.cpp:94
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:302
wxArrayString mStandardDefaultKeys
void KeyConfigPrefs::FilterKeys ( wxArrayString &  arr)
private

Definition at line 401 of file KeyConfigPrefs.cpp.

Referenced by OnImportDefaults(), and RefreshBindings().

402 {
403  wxSortedArrayString MaxListOnly;
404 
405  // These short cuts are for the max list only....
406  //MaxListOnly.Add( "Ctrl+I" );
407  MaxListOnly.Add( "Ctrl+Alt+I" );
408  MaxListOnly.Add( "Ctrl+J" );
409  MaxListOnly.Add( "Ctrl+Alt+J" );
410  MaxListOnly.Add( "Ctrl+Alt+V" );
411  MaxListOnly.Add( "Alt+X" );
412  MaxListOnly.Add( "Alt+K" );
413  MaxListOnly.Add( "Shift+Alt+X" );
414  MaxListOnly.Add( "Shift+Alt+K" );
415  MaxListOnly.Add( "Alt+L" );
416  MaxListOnly.Add( "Shift+Alt+C" );
417  MaxListOnly.Add( "Alt+I" );
418  MaxListOnly.Add( "Alt+J" );
419  MaxListOnly.Add( "Shift+Alt+J" );
420  MaxListOnly.Add( "Ctrl+Shift+A" );
421  MaxListOnly.Add( "Q" );
422  //MaxListOnly.Add( "Shift+J" );
423  //MaxListOnly.Add( "Shift+K" );
424  //MaxListOnly.Add( "Shift+Home" );
425  //MaxListOnly.Add( "Shift+End" );
426  MaxListOnly.Add( "Ctrl+[" );
427  MaxListOnly.Add( "Ctrl+]" );
428  MaxListOnly.Add( "1" );
429  MaxListOnly.Add( "Shift+F5" );
430  MaxListOnly.Add( "Shift+F6" );
431  MaxListOnly.Add( "Shift+F7" );
432  MaxListOnly.Add( "Shift+F8" );
433  MaxListOnly.Add( "Ctrl+Shift+F5" );
434  MaxListOnly.Add( "Ctrl+Shift+F7" );
435  MaxListOnly.Add( "Ctrl+Shift+N" );
436  MaxListOnly.Add( "Ctrl+Shift+M" );
437  MaxListOnly.Add( "Ctrl+Home" );
438  MaxListOnly.Add( "Ctrl+End" );
439  MaxListOnly.Add( "Shift+C" );
440  MaxListOnly.Add( "Alt+Shift+Up" );
441  MaxListOnly.Add( "Alt+Shift+Down" );
442  MaxListOnly.Add( "Shift+P" );
443  MaxListOnly.Add( "Alt+Shift+Left" );
444  MaxListOnly.Add( "Alt+Shift+Right" );
445  MaxListOnly.Add( "Ctrl+Shift+T" );
446  //MaxListOnly.Add( "Command+M" );
447  //MaxListOnly.Add( "Option+Command+M" );
448  MaxListOnly.Add( "Shift+H" );
449  MaxListOnly.Add( "Shift+O" );
450  MaxListOnly.Add( "Shift+I" );
451  MaxListOnly.Add( "Shift+N" );
452  MaxListOnly.Add( "D" );
453  MaxListOnly.Add( "A" );
454  MaxListOnly.Add( "Alt+Shift+F6" );
455  MaxListOnly.Add( "Alt+F6" );
456 
457  MaxListOnly.Sort();
458  // Remove items that are in MaxList.
459  for (size_t i = 0; i < arr.GetCount(); i++) {
460  if( MaxListOnly.Index( arr[i] ) != wxNOT_FOUND )
461  arr[i]= wxT("");
462  }
463 }
wxString KeyConfigPrefs::HelpPageName ( )
overridevirtual

Reimplemented from PrefsPanel.

Definition at line 745 of file KeyConfigPrefs.cpp.

746 {
747  return "Keyboard_Preferences";
748 }
wxString KeyConfigPrefs::NameFromKey ( const wxString &  key)
private

Definition at line 579 of file KeyConfigPrefs.cpp.

References KeyView::GetNameByKey(), and mView.

580 {
581  return mView->GetNameByKey(key);
582 }
wxString GetNameByKey(const wxString &key) const
Definition: KeyView.cpp:184
KeyView * mView
void KeyConfigPrefs::OnClear ( wxCommandEvent &  e)
private

Definition at line 648 of file KeyConfigPrefs.cpp.

References mCommandSelected, mKey, and SetKeyForSelected().

649 {
650  mKey->Clear();
651 
652  if (mCommandSelected != wxNOT_FOUND) {
653  SetKeyForSelected(wxEmptyString);
654  }
655 }
void SetKeyForSelected(const wxString &key)
wxTextCtrl * mKey
void KeyConfigPrefs::OnDefaults ( wxCommandEvent &  e)
private

Definition at line 391 of file KeyConfigPrefs.cpp.

References _(), and OnImportDefaults().

392 {
393  wxMenu Menu;
394  Menu.Append( 1, _("Standard") );
395  Menu.Append( 2, _("Full") );
396  Menu.Bind( wxEVT_COMMAND_MENU_SELECTED, &KeyConfigPrefs::OnImportDefaults, this );
397  // Pop it up where the mouse is.
398  PopupMenu(&Menu);//, wxPoint(0, 0));
399 }
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom"))), OnMoveTrack) void TrackMenuTable::OnSetName(wxCommandEvent &)
void OnImportDefaults(wxCommandEvent &e)
void KeyConfigPrefs::OnExport ( wxCommandEvent &  e)
private

Definition at line 363 of file KeyConfigPrefs.cpp.

References _(), FileNames::Export, GuardedCall(), mManager, FileNames::SelectFile(), and CommandManager::WriteXML().

364 {
365  wxString file = wxT("Audacity-keys.xml");
366 
368  _("Export Keyboard Shortcuts As:"),
369  wxEmptyString,
370  file,
371  wxT("xml"),
372  _("XML files (*.xml)|*.xml|All files|*"),
373  wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
374  this);
375 
376  if (!file) {
377  return;
378  }
379 
380  GuardedCall( [&] {
381  XMLFileWriter prefFile{ file, _("Error Exporting Keyboard Shortcuts") };
382  mManager->WriteXML(prefFile);
383  prefFile.Commit();
384  } );
385 }
CommandManager * mManager
void WriteXML(XMLWriter &xmlFile) const
Wrapper to output XML data to files.
Definition: XMLWriter.h:74
R GuardedCall(const F1 &body, const F2 &handler=F2::Default(), const F3 &delayedHandler={})
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom"))), OnMoveTrack) void TrackMenuTable::OnSetName(wxCommandEvent &)
static wxString SelectFile(Operation op, const wxString &message, const wxString &default_path, const wxString &default_filename, const wxString &default_extension, const wxString &wildcard, int flags, wxWindow *parent)
Definition: FileNames.cpp:405
void KeyConfigPrefs::OnFilterChar ( wxKeyEvent &  e)
private

Definition at line 569 of file KeyConfigPrefs.cpp.

References mViewType, and ViewByKey.

Referenced by PopulateOrExchange(), and ~KeyConfigPrefs().

570 {
571  if (mViewType != ViewByKey)
572  {
573  e.Skip();
574  }
575 }
ViewByType mViewType
void KeyConfigPrefs::OnFilterKeyDown ( wxKeyEvent &  e)
private

Definition at line 527 of file KeyConfigPrefs.cpp.

References KeyEventToKeyString(), KeyStringDisplay(), mFilterPending, mFilterTimer, mView, mViewType, KeyView::SetFilter(), and ViewByKey.

Referenced by PopulateOrExchange(), and ~KeyConfigPrefs().

528 {
529  wxTextCtrl *t = (wxTextCtrl *)e.GetEventObject();
530  int keycode = e.GetKeyCode();
531 
532  // Make sure we can navigate away from the hotkey textctrl.
533  // On Linux and OSX, it an get stuck, but it doesn't hurt
534  // to do it for Windows as well.
535  if (keycode == WXK_TAB) {
536  wxNavigationKeyEvent nevent;
537  nevent.SetWindowChange(e.ControlDown());
538  nevent.SetDirection(!e.ShiftDown());
539  nevent.SetEventObject(t);
540  nevent.SetCurrentFocus(t);
541  t->GetParent()->GetEventHandler()->ProcessEvent(nevent);
542 
543  return;
544  }
545 
546  if (mViewType == ViewByKey) {
547  wxString key = KeyStringDisplay(KeyEventToKeyString(e));
548  t->SetValue(key);
549 
550  if (key != wxEmptyString) {
551  mView->SetFilter(t->GetValue());
552  }
553  }
554  else
555  {
556  if (keycode == WXK_RETURN) {
557  mFilterPending = false;
558  mView->SetFilter(t->GetValue());
559  }
560  else {
561  mFilterPending = true;
562  mFilterTimer.Start(500, wxTIMER_ONE_SHOT);
563 
564  e.Skip();
565  }
566  }
567 }
ViewByType mViewType
void SetFilter(const wxString &filter)
Definition: KeyView.cpp:376
wxString KeyStringDisplay(const wxString &key, bool usesSpecialChars)
Definition: Keyboard.cpp:53
KeyView * mView
wxString KeyEventToKeyString(const wxKeyEvent &event)
Definition: Keyboard.cpp:78
wxTimer mFilterTimer
void KeyConfigPrefs::OnFilterTimer ( wxTimerEvent &  e)
private

Definition at line 517 of file KeyConfigPrefs.cpp.

References mFilter, mFilterPending, mView, and KeyView::SetFilter().

518 {
519  // The filter timer has expired, so set the filter
520  if (mFilterPending)
521  {
522  // Do not reset mFilterPending here...possible race
523  mView->SetFilter(mFilter->GetValue());
524  }
525 }
wxTextCtrl * mFilter
void SetFilter(const wxString &filter)
Definition: KeyView.cpp:376
KeyView * mView
void KeyConfigPrefs::OnHotkeyChar ( wxKeyEvent &  e)
private

Definition at line 503 of file KeyConfigPrefs.cpp.

Referenced by PopulateOrExchange(), and ~KeyConfigPrefs().

504 {
505  // event.Skip() not performed, so event will not be processed further.
506 }
void KeyConfigPrefs::OnHotkeyKeyDown ( wxKeyEvent &  e)
private

Definition at line 481 of file KeyConfigPrefs.cpp.

References KeyEventToKeyString(), and KeyStringDisplay().

Referenced by PopulateOrExchange(), and ~KeyConfigPrefs().

482 {
483  wxTextCtrl *t = (wxTextCtrl *)e.GetEventObject();
484 
485  // Make sure we can navigate away from the hotkey textctrl.
486  // On Linux and OSX, it can get stuck, but it doesn't hurt
487  // to do it for Windows as well.
488  //
489  // Mac note: Don't waste time trying to figure out why the
490  // focus goes back to the prefs tree. Unless Voiceover is
491  // active, buttons on the Mac do not accept focus and all the
492  // controls between this one and the tree control are buttons.
493  if (e.GetKeyCode() == WXK_TAB) {
494  NavigateIn(e.ShiftDown()
495  ? wxNavigationKeyEvent::IsBackward
496  : wxNavigationKeyEvent::IsForward);
497  return;
498  }
499 
500  t->SetValue(KeyStringDisplay(KeyEventToKeyString(e)));
501 }
wxString KeyStringDisplay(const wxString &key, bool usesSpecialChars)
Definition: Keyboard.cpp:53
wxString KeyEventToKeyString(const wxKeyEvent &event)
Definition: Keyboard.cpp:78
void KeyConfigPrefs::OnHotkeyKillFocus ( wxFocusEvent &  e)
private

Definition at line 508 of file KeyConfigPrefs.cpp.

References KeyView::GetKey(), mCommandSelected, mKey, and mView.

Referenced by PopulateOrExchange(), and ~KeyConfigPrefs().

509 {
510  if (mKey->GetValue().IsEmpty() && mCommandSelected != wxNOT_FOUND) {
511  mKey->AppendText(mView->GetKey(mCommandSelected));
512  }
513 
514  e.Skip();
515 }
wxTextCtrl * mKey
wxString GetKey(int index) const
Definition: KeyView.cpp:224
KeyView * mView
void KeyConfigPrefs::OnImport ( wxCommandEvent &  e)
private

Definition at line 336 of file KeyConfigPrefs.cpp.

References _(), AudacityMessageBox(), XMLFileReader::GetErrorStr(), mManager, FileNames::Open, XMLFileReader::Parse(), RefreshBindings(), and FileNames::SelectFile().

337 {
338  wxString file = wxT("Audacity-keys.xml");
339 
341  _("Select an XML file containing Audacity keyboard shortcuts..."),
342  wxEmptyString,
343  file,
344  wxT(""),
345  _("XML files (*.xml)|*.xml|All files|*"),
346  wxRESIZE_BORDER,
347  this);
348 
349  if (!file) {
350  return;
351  }
352 
353  XMLFileReader reader;
354  if (!reader.Parse(mManager, file)) {
356  _("Error Importing Keyboard Shortcuts"),
357  wxOK | wxCENTRE, this);
358  }
359 
360  RefreshBindings(true);
361 }
CommandManager * mManager
int AudacityMessageBox(const wxString &message, const wxString &caption=AudacityMessageBoxCaptionStr(), long style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Definition: ErrorDialog.h:92
bool Parse(XMLTagHandler *baseHandler, const wxString &fname)
Reads a file and passes the results through an XMLTagHandler.
Definition: XMLFileReader.h:18
void RefreshBindings(bool bSort)
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom"))), OnMoveTrack) void TrackMenuTable::OnSetName(wxCommandEvent &)
static wxString SelectFile(Operation op, const wxString &message, const wxString &default_path, const wxString &default_filename, const wxString &default_extension, const wxString &wildcard, int flags, wxWindow *parent)
Definition: FileNames.cpp:405
wxString GetErrorStr()
void KeyConfigPrefs::OnImportDefaults ( wxCommandEvent &  e)
private

Definition at line 465 of file KeyConfigPrefs.cpp.

References FilterKeys(), gPrefs, mDefaultKeys, mManager, mNewKeys, RefreshBindings(), and CommandManager::SetKeyFromIndex().

Referenced by OnDefaults().

466 {
467  gPrefs->DeleteEntry(wxT("/GUI/Shortcuts/FullDefaults"));
468  gPrefs->Flush();
469 
471  if( event.GetId() == 1 )
472  FilterKeys( mNewKeys );
473 
474  for (size_t i = 0; i < mNewKeys.GetCount(); i++) {
476  }
477 
478  RefreshBindings(true);
479 }
CommandManager * mManager
void SetKeyFromIndex(int i, const wxString &key)
wxArrayString mDefaultKeys
wxFileConfig * gPrefs
Definition: Prefs.cpp:72
wxArrayString mNewKeys
void RefreshBindings(bool bSort)
void FilterKeys(wxArrayString &arr)
void KeyConfigPrefs::OnSelected ( wxCommandEvent &  e)
private

Definition at line 657 of file KeyConfigPrefs.cpp.

References KeyView::CanSetKey(), KeyView::GetKey(), KeyView::GetSelected(), mClear, mCommandSelected, mKey, mSet, and mView.

658 {
660  mKey->Clear();
661 
662  if (mCommandSelected != wxNOT_FOUND) {
663  bool canset = mView->CanSetKey(mCommandSelected);
664  if (canset) {
665  mKey->AppendText(mView->GetKey(mCommandSelected));
666  }
667 
668  mKey->Enable(canset);
669  mSet->Enable(canset);
670  mClear->Enable(canset);
671  }
672 }
int GetSelected() const
Definition: KeyView.cpp:87
bool CanSetKey(int index) const
Definition: KeyView.cpp:240
wxTextCtrl * mKey
wxButton * mClear
wxButton * mSet
wxString GetKey(int index) const
Definition: KeyView.cpp:224
KeyView * mView
void KeyConfigPrefs::OnSet ( wxCommandEvent &  e)
private

Definition at line 603 of file KeyConfigPrefs.cpp.

References _(), AudacityMessageBox(), CommandManager::GetCategoryFromName(), KeyView::GetName(), KeyView::GetNameByKey(), CommandManager::GetPrefixedLabelFromName(), mCommandSelected, mKey, mManager, mNames, mNewKeys, mView, KeyView::SetKeyByName(), SetKeyForSelected(), and CommandManager::SetKeyFromName().

604 {
605  if (mCommandSelected == wxNOT_FOUND) {
606  AudacityMessageBox(_("You must select a binding before assigning a shortcut"),
607  _("Error"), wxICON_WARNING | wxCENTRE, this);
608  return;
609  }
610 
611  wxString key = mKey->GetValue();
612  wxString oldname = mView->GetNameByKey(key);
613  wxString newname = mView->GetName(mCommandSelected);
614 
615  // Just ignore it if they are the same
616  if (oldname == newname) {
617  return;
618  }
619 
620  // Prevent same hotkey combination being used twice.
621  if (!oldname.empty()) {
622  auto oldlabel = wxString::Format( _("%s - %s"),
623  mManager->GetCategoryFromName(oldname),
625  auto newlabel = wxString::Format( _("%s - %s"),
626  mManager->GetCategoryFromName(newname),
628  if (AudacityMessageBox(
629  wxString::Format(
630  _("The keyboard shortcut '%s' is already assigned to:\n\n\t'%s'\n\nClick OK to assign the shortcut to\n\n\t'%s'\n\ninstead. Otherwise, click Cancel."),
631  key,
632  oldlabel,
633  newlabel),
634  _("Error"), wxOK | wxCANCEL | wxICON_STOP | wxCENTRE, this) == wxCANCEL)
635  {
636  return;
637  }
638 
639  mView->SetKeyByName(oldname, wxEmptyString);
640  mManager->SetKeyFromName(oldname, wxEmptyString);
641  mNewKeys[mNames.Index(oldname)].Empty();
642 
643  }
644 
645  SetKeyForSelected(key);
646 }
CommandManager * mManager
wxString GetNameByKey(const wxString &key) const
Definition: KeyView.cpp:184
wxString GetName() const
Definition: KeyView.cpp:96
int AudacityMessageBox(const wxString &message, const wxString &caption=AudacityMessageBoxCaptionStr(), long style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Definition: ErrorDialog.h:92
void SetKeyForSelected(const wxString &key)
wxTextCtrl * mKey
wxString GetPrefixedLabelFromName(const wxString &name)
wxString GetCategoryFromName(const wxString &name)
void SetKeyFromName(const wxString &name, const wxString &key)
wxArrayString mNewKeys
wxArrayString mNames
KeyView * mView
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom"))), OnMoveTrack) void TrackMenuTable::OnSetName(wxCommandEvent &)
bool SetKeyByName(const wxString &name, const wxString &key)
Definition: KeyView.cpp:298
void KeyConfigPrefs::OnViewBy ( wxCommandEvent &  e)
private

Definition at line 674 of file KeyConfigPrefs.cpp.

References _(), mFilter, mFilterLabel, mView, mViewType, KeyView::SetView(), ViewByKey, ViewByKeyID, ViewByName, ViewByNameID, ViewByTree, and ViewByTreeID.

675 {
676  switch (e.GetId())
677  {
678  case ViewByTreeID:
680  mFilterLabel->SetLabel(_("Searc&h:"));
681  break;
682 
683  case ViewByNameID:
685  mFilterLabel->SetLabel(_("Searc&h:"));
686  break;
687 
688  case ViewByKeyID:
690  mFilterLabel->SetLabel(_("&Hotkey:"));
691  break;
692  }
693 
695  mFilter->SetName(wxStripMenuCodes(mFilterLabel->GetLabel()));
696 }
ViewByType mViewType
#define ViewByTreeID
wxStaticText * mFilterLabel
#define ViewByKeyID
void SetView(ViewByType type)
Definition: KeyView.cpp:316
wxTextCtrl * mFilter
KeyView * mView
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom"))), OnMoveTrack) void TrackMenuTable::OnSetName(wxCommandEvent &)
#define ViewByNameID
void KeyConfigPrefs::Populate ( )
private

Definition at line 122 of file KeyConfigPrefs.cpp.

References _(), ShuttleGuiBase::AddTitle(), eIsCreatingFromPrefs, ShuttleGuiBase::EndStatic(), ShuttleGuiBase::EndVerticalLay(), GetActiveProject(), AudacityProject::GetCommandManager(), mCommandSelected, mFilter, mFilterLabel, mManager, mView, mViewByKey, mViewByName, mViewByTree, mViewType, PopulateOrExchange(), RefreshBindings(), KeyView::SetView(), ShuttleGuiBase::StartStatic(), ShuttleGuiBase::StartVerticalLay(), ViewByKey, ViewByName, and ViewByTree.

123 {
125  AudacityProject *project = GetActiveProject();
126 
127  if (!project) {
128  S.StartVerticalLay(true);
129  {
130  S.StartStatic( {}, true);
131  {
132  S.AddTitle(_("Keyboard preferences currently unavailable."));
133  S.AddTitle(_("Open a new project to modify keyboard shortcuts."));
134  }
135  S.EndStatic();
136  }
137  S.EndVerticalLay();
138 
139  return;
140  }
141 
143 
144  mCommandSelected = wxNOT_FOUND;
145 
146  mManager = project->GetCommandManager();
147 
148  // For speed, don't sort here. We're just creating.
149  // Instead sort when we do SetView later in this function.
150  RefreshBindings(false);
151 
152  if (mViewByTree->GetValue()) {
154  }
155  else if (mViewByName->GetValue()) {
157  }
158  else if (mViewByKey->GetValue()) {
160  mFilterLabel->SetLabel(_("&Hotkey:"));
161  mFilter->SetName(wxStripMenuCodes(mFilterLabel->GetLabel()));
162  }
163 
165 }
CommandManager * mManager
wxRadioButton * mViewByKey
ViewByType mViewType
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:366
CommandManager * GetCommandManager()
Definition: Project.h:331
wxStaticText * mFilterLabel
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:161
void SetView(ViewByType type)
Definition: KeyView.cpp:316
wxRadioButton * mViewByTree
wxTextCtrl * mFilter
wxRadioButton * mViewByName
void RefreshBindings(bool bSort)
KeyView * mView
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom"))), OnMoveTrack) void TrackMenuTable::OnSetName(wxCommandEvent &)
void PopulateOrExchange(ShuttleGui &S)
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:302
void KeyConfigPrefs::PopulateOrExchange ( ShuttleGui S)
private

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 171 of file KeyConfigPrefs.cpp.

References _(), ShuttleGuiBase::AddButton(), ShuttleGuiBase::AddFixedText(), ShuttleGui::AddSpace(), ShuttleGuiBase::AddTitle(), ShuttleGuiBase::AddVariableText(), ShuttleGuiBase::AddWindow(), AssignDefaultsButtonID, ClearButtonID, CommandsListID, CurrentComboID, ShuttleGuiBase::EndHorizontalLay(), ShuttleGuiBase::EndRadioButtonGroup(), ShuttleGuiBase::EndStatic(), ShuttleGuiBase::EndThreeColumn(), ExportButtonID, FilterID, ShuttleGui::Id(), ImportButtonID, mClear, mFilter, mFilterLabel, mKey, mSet, mView, mViewByKey, mViewByName, mViewByTree, OnFilterChar(), OnFilterKeyDown(), OnHotkeyChar(), OnHotkeyKeyDown(), OnHotkeyKillFocus(), ShuttleGui::Prop(), safenew, ShuttleGuiBase::SetBorder(), SetButtonID, ShuttleGuiBase::SetStretchyCol(), ShuttleGuiBase::StartHorizontalLay(), ShuttleGuiBase::StartMultiColumn(), ShuttleGuiBase::StartRadioButtonGroup(), ShuttleGuiBase::StartStatic(), ShuttleGuiBase::StartThreeColumn(), ShuttleGuiBase::TieRadioButton(), ViewByKeyID, ViewByNameID, and ViewByTreeID.

Referenced by Commit(), and Populate().

172 {
173  S.SetBorder(2);
174 
175  S.StartStatic(_("Key Bindings"), 1);
176  {
177  S.StartMultiColumn(3, wxEXPAND);
178  {
179  S.SetStretchyCol(1);
180 
181  S.StartHorizontalLay(wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 0);
182  {
183  S.AddTitle(_("View by:"));
184  S.StartRadioButtonGroup(wxT("/Prefs/KeyConfig/ViewBy"), wxT("tree"));
185  {
186  mViewByTree = S.Id(ViewByTreeID).TieRadioButton(_("&Tree"), wxT("tree"));
187  mViewByTree->SetName(_("View by tree"));
188  mViewByName = S.Id(ViewByNameID).TieRadioButton(_("&Name"), wxT("name"));
189  mViewByName->SetName(_("View by name"));
190  mViewByKey = S.Id(ViewByKeyID).TieRadioButton(_("&Key"), wxT("key"));
191  mViewByKey->SetName(_("View by key"));
192  }
194  }
195  S.EndHorizontalLay();
196 
197  S.StartHorizontalLay(wxALIGN_CENTER|wxALIGN_CENTER_VERTICAL, 0);
198  {
199  // just a spacer
200  }
201  S.EndHorizontalLay();
202 
203  S.StartHorizontalLay(wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 0);
204  {
205  mFilterLabel = S.AddVariableText(_("Searc&h:"));
206 
207  if (!mFilter) {
208  mFilter = safenew wxTextCtrl(this,
209  FilterID,
210  wxT(""),
211  wxDefaultPosition,
212 #if defined(__WXMAC__)
213  wxSize(300, -1),
214 #else
215  wxSize(210, -1),
216 #endif
217  wxTE_PROCESS_ENTER);
218  mFilter->SetName(wxStripMenuCodes(mFilterLabel->GetLabel()));
219  mFilter->Connect(wxEVT_KEY_DOWN,
220  wxKeyEventHandler(KeyConfigPrefs::OnFilterKeyDown),
221  NULL,
222  this);
223  mFilter->Connect(wxEVT_CHAR,
224  wxKeyEventHandler(KeyConfigPrefs::OnFilterChar),
225  NULL,
226  this);
227  }
228  S.AddWindow(mFilter, wxALIGN_NOT | wxALIGN_LEFT);
229  }
230  S.EndHorizontalLay();
231  }
232  S.EndThreeColumn();
233  S.AddSpace(-1, 2);
234 
235  S.StartHorizontalLay(wxEXPAND, 1);
236  {
237  if (!mView) {
239  mView->SetName(_("Bindings"));
240  }
241  S.Prop(true);
242  S.AddWindow(mView, wxEXPAND);
243  }
244  S.EndHorizontalLay();
245 
246  S.StartThreeColumn();
247  {
248  if (!mKey) {
249  mKey = safenew wxTextCtrl(this,
251  wxT(""),
252  wxDefaultPosition,
253 #if defined(__WXMAC__)
254  wxSize(300, -1),
255 #else
256  wxSize(210, -1),
257 #endif
258  wxTE_PROCESS_ENTER);
259 
260  mKey->SetName(_("Short cut"));
261  mKey->Connect(wxEVT_KEY_DOWN,
262  wxKeyEventHandler(KeyConfigPrefs::OnHotkeyKeyDown),
263  NULL,
264  this);
265  mKey->Connect(wxEVT_CHAR,
266  wxKeyEventHandler(KeyConfigPrefs::OnHotkeyChar),
267  NULL,
268  this);
269  mKey->Connect(wxEVT_KILL_FOCUS,
270  wxFocusEventHandler(KeyConfigPrefs::OnHotkeyKillFocus),
271  NULL,
272  this);
273  }
274  S.AddWindow(mKey);
275 
276  /* i18n-hint: (verb)*/
277  mSet = S.Id(SetButtonID).AddButton(_("&Set"));
278  mClear = S.Id(ClearButtonID).AddButton(_("Cl&ear"));
279  }
280  S.EndThreeColumn();
281 
282 #if defined(__WXMAC__)
283  S.AddFixedText(_("Note: Pressing Cmd+Q will quit. All other keys are valid."));
284 #endif
285 
286  S.StartThreeColumn();
287  {
288  S.Id(ImportButtonID).AddButton(_("&Import..."));
289  S.Id(ExportButtonID).AddButton(_("&Export..."));
290  S.Id(AssignDefaultsButtonID).AddButton(_("&Defaults"));
291  }
292  S.EndThreeColumn();
293  }
294  S.EndStatic();
295 
296 
297  // Need to layout so that the KeyView is properly sized before populating.
298  // Otherwise, the initial selection is not scrolled into view.
299  Layout();
300 }
wxRadioButton * mViewByKey
void EndThreeColumn()
Definition: ShuttleGui.h:128
void EndRadioButtonGroup()
wxWindow * AddWindow(wxWindow *pWindow, int Flags=wxALIGN_CENTRE|wxALL)
Definition: ShuttleGui.cpp:257
#define ViewByTreeID
wxStaticText * mFilterLabel
#define safenew
Definition: Audacity.h:223
void EndHorizontalLay()
Definition: ShuttleGui.cpp:975
wxTextCtrl * mKey
#define ImportButtonID
#define AssignDefaultsButtonID
#define CurrentComboID
void OnFilterKeyDown(wxKeyEvent &e)
#define ViewByKeyID
wxRadioButton * mViewByTree
void StartHorizontalLay(int PositionFlags=wxALIGN_CENTRE, int iProp=1)
Definition: ShuttleGui.cpp:966
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:998
wxTextCtrl * mFilter
ShuttleGui & Id(int id)
void AddFixedText(const wxString &Str, bool bCenter=false)
Definition: ShuttleGui.cpp:356
wxButton * mClear
wxButton * mSet
void AddTitle(const wxString &Prompt)
Centred text string.
Definition: ShuttleGui.cpp:243
wxRadioButton * mViewByName
#define ClearButtonID
wxRadioButton * TieRadioButton(const wxString &Prompt, WrappedType &WrappedRef)
void StartThreeColumn()
Definition: ShuttleGui.h:127
#define ExportButtonID
KeyView * mView
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom"))), OnMoveTrack) void TrackMenuTable::OnSetName(wxCommandEvent &)
void OnFilterChar(wxKeyEvent &e)
#define FilterID
#define ViewByNameID
#define CommandsListID
wxStaticText * AddVariableText(const wxString &Str, bool bCenter=false, int PositionFlags=0)
Definition: ShuttleGui.cpp:373
wxStaticBox * StartStatic(const wxString &Str, int iProp=0)
Definition: ShuttleGui.cpp:701
ShuttleGui & Prop(int iProp)
Definition: ShuttleGui.h:374
void OnHotkeyKeyDown(wxKeyEvent &e)
wxSizerItem * AddSpace(int width, int height)
void OnHotkeyKillFocus(wxFocusEvent &e)
#define SetButtonID
void SetBorder(int Border)
Definition: ShuttleGui.h:251
void StartRadioButtonGroup(const wxString &SettingName)
Provides multiple views of keyboard shortcuts.
Definition: KeyView.h:71
wxButton * AddButton(const wxString &Text, int PositionFlags=wxALIGN_CENTRE)
Definition: ShuttleGui.cpp:301
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:192
void OnHotkeyChar(wxKeyEvent &e)
void KeyConfigPrefs::RefreshBindings ( bool  bSort)
private

Definition at line 302 of file KeyConfigPrefs.cpp.

References FilterKeys(), CommandManager::GetAllCommandData(), mDefaultKeys, mKeys, mManager, mNames, mNewKeys, mStandardDefaultKeys, mView, and KeyView::RefreshBindings().

Referenced by OnImport(), OnImportDefaults(), and Populate().

303 {
304  wxArrayString Labels;
305  wxArrayString Categories;
306  wxArrayString Prefixes;
307 
308  mNames.Clear();
309  mKeys.Clear();
310  mDefaultKeys.Clear();
311  mStandardDefaultKeys.Clear();
313  mNames,
314  mKeys,
315  mDefaultKeys,
316  Labels,
317  Categories,
318  Prefixes,
319  true); // True to include effects (list items), false otherwise.
320 
323 
325  Categories,
326  Prefixes,
327  Labels,
328  mKeys,
329  bSort);
330  //Not needed as NEW nodes are already shown expanded.
331  //mView->ExpandAll();
332 
333  mNewKeys = mKeys;
334 }
CommandManager * mManager
wxArrayString mDefaultKeys
void GetAllCommandData(wxArrayString &names, wxArrayString &keys, wxArrayString &default_keys, wxArrayString &labels, wxArrayString &categories, wxArrayString &prefixes, bool includeMultis)
wxArrayString mKeys
void RefreshBindings(const wxArrayString &names, const wxArrayString &categories, const wxArrayString &prefixes, const wxArrayString &labels, const wxArrayString &keys, bool bSort)
Definition: KeyView.cpp:533
wxArrayString mNewKeys
wxArrayString mNames
KeyView * mView
wxArrayString mStandardDefaultKeys
void FilterKeys(wxArrayString &arr)
void KeyConfigPrefs::SetKeyForSelected ( const wxString &  key)
private

Definition at line 586 of file KeyConfigPrefs.cpp.

References _(), AudacityMessageBox(), KeyView::CanSetKey(), KeyView::GetName(), mCommandSelected, mManager, mNames, mNewKeys, mView, name, KeyView::SetKey(), and CommandManager::SetKeyFromName().

Referenced by OnClear(), and OnSet().

587 {
588  wxString name = mView->GetName(mCommandSelected);
589 
591  {
592  AudacityMessageBox(_("You may not assign a key to this entry"),
593  _("Error"), wxICON_ERROR | wxCENTRE, this);
594  return;
595  }
596 
598  mManager->SetKeyFromName(name, key);
599  mNewKeys[mNames.Index(name)] = key;
600 }
CommandManager * mManager
wxString GetName() const
Definition: KeyView.cpp:96
int AudacityMessageBox(const wxString &message, const wxString &caption=AudacityMessageBoxCaptionStr(), long style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Definition: ErrorDialog.h:92
bool CanSetKey(int index) const
Definition: KeyView.cpp:240
void SetKeyFromName(const wxString &name, const wxString &key)
wxArrayString mNewKeys
wxArrayString mNames
KeyView * mView
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom"))), OnMoveTrack) void TrackMenuTable::OnSetName(wxCommandEvent &)
const wxChar * name
Definition: Distortion.cpp:94
bool SetKey(int index, const wxString &key)
Definition: KeyView.cpp:257

Member Data Documentation

wxButton* KeyConfigPrefs::mClear
private

Definition at line 72 of file KeyConfigPrefs.h.

Referenced by OnSelected(), and PopulateOrExchange().

int KeyConfigPrefs::mCommandSelected
private
wxArrayString KeyConfigPrefs::mDefaultKeys
private

Definition at line 88 of file KeyConfigPrefs.h.

Referenced by OnImportDefaults(), and RefreshBindings().

wxTextCtrl* KeyConfigPrefs::mFilter
private
wxStaticText* KeyConfigPrefs::mFilterLabel
private

Definition at line 75 of file KeyConfigPrefs.h.

Referenced by OnViewBy(), Populate(), and PopulateOrExchange().

bool KeyConfigPrefs::mFilterPending
private

Definition at line 77 of file KeyConfigPrefs.h.

Referenced by OnFilterKeyDown(), and OnFilterTimer().

wxTimer KeyConfigPrefs::mFilterTimer
private

Definition at line 76 of file KeyConfigPrefs.h.

Referenced by OnFilterKeyDown().

wxTextCtrl* KeyConfigPrefs::mKey
private
wxArrayString KeyConfigPrefs::mKeys
private

Definition at line 90 of file KeyConfigPrefs.h.

Referenced by Cancel(), and RefreshBindings().

CommandManager* KeyConfigPrefs::mManager
private
wxArrayString KeyConfigPrefs::mNames
private

Definition at line 87 of file KeyConfigPrefs.h.

Referenced by Cancel(), Commit(), OnSet(), RefreshBindings(), and SetKeyForSelected().

wxArrayString KeyConfigPrefs::mNewKeys
private

Definition at line 91 of file KeyConfigPrefs.h.

Referenced by Commit(), OnImportDefaults(), OnSet(), RefreshBindings(), and SetKeyForSelected().

wxButton* KeyConfigPrefs::mSet
private

Definition at line 71 of file KeyConfigPrefs.h.

Referenced by OnSelected(), and PopulateOrExchange().

wxArrayString KeyConfigPrefs::mStandardDefaultKeys
private

Definition at line 89 of file KeyConfigPrefs.h.

Referenced by Commit(), and RefreshBindings().

KeyView* KeyConfigPrefs::mView
private
wxRadioButton* KeyConfigPrefs::mViewByKey
private

Definition at line 82 of file KeyConfigPrefs.h.

Referenced by Populate(), and PopulateOrExchange().

wxRadioButton* KeyConfigPrefs::mViewByName
private

Definition at line 81 of file KeyConfigPrefs.h.

Referenced by Populate(), and PopulateOrExchange().

wxRadioButton* KeyConfigPrefs::mViewByTree
private

Definition at line 80 of file KeyConfigPrefs.h.

Referenced by Populate(), and PopulateOrExchange().

ViewByType KeyConfigPrefs::mViewType
private

Definition at line 79 of file KeyConfigPrefs.h.

Referenced by OnFilterChar(), OnFilterKeyDown(), OnViewBy(), and Populate().


The documentation for this class was generated from the following files: