You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
2.7 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2004-2016 KiCad Developers, see CHANGELOG.TXT for contributors.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version 3
  9. * of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, you may find one here:
  18. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  19. * or you may search the http://www.gnu.org website for the version 2 license,
  20. * or you may write to the Free Software Foundation, Inc.,
  21. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  22. */
  23. /**
  24. * @file dialog_hotkeys_editor.h
  25. */
  26. #ifndef __dialog_hotkeys_editor__
  27. #define __dialog_hotkeys_editor__
  28. #include <hotkeys_basic.h>
  29. #include <../common/dialogs/dialog_hotkeys_editor_base.h>
  30. #include <widgets/widget_hotkey_list.h>
  31. /**
  32. * Class HOTKEYS_EDITOR_DIALOG
  33. * is the child class of HOTKEYS_EDITOR_DIALOG_BASE. This is the class
  34. * used to create a hotkey editor.
  35. */
  36. class HOTKEYS_EDITOR_DIALOG : public HOTKEYS_EDITOR_DIALOG_BASE
  37. {
  38. protected:
  39. struct EDA_HOTKEY_CONFIG* m_hotkeys;
  40. WIDGET_HOTKEY_LIST* m_hotkeyListCtrl;
  41. bool TransferDataToWindow();
  42. bool TransferDataFromWindow();
  43. virtual EDA_BASE_FRAME* GetParent()
  44. {
  45. return static_cast<EDA_BASE_FRAME*>( HOTKEYS_EDITOR_DIALOG_BASE::GetParent() );
  46. }
  47. public:
  48. HOTKEYS_EDITOR_DIALOG( EDA_BASE_FRAME* aParent, EDA_HOTKEY_CONFIG* aHotkeys );
  49. ~HOTKEYS_EDITOR_DIALOG() {};
  50. private:
  51. /**
  52. * Function ResetClicked
  53. * Reinit the hotkeys to the initial state (removes all pending changes)
  54. *
  55. * @param aEvent is the button press event, unused
  56. */
  57. void ResetClicked( wxCommandEvent& aEvent );
  58. /**
  59. * Function DefaultsClicked
  60. * Set the hotkeys to the default values (values after installation)
  61. *
  62. * @param aEvent is the button press event, unused
  63. */
  64. void DefaultsClicked( wxCommandEvent& aEvent );
  65. };
  66. /**
  67. * Function InstallHotkeyFrame
  68. * Create a hotkey editor dialog window with the provided hotkey configuration array
  69. *
  70. * @param aParent is the parent window
  71. * @param aHotkeys is the hotkey configuration array
  72. */
  73. void InstallHotkeyFrame( EDA_BASE_FRAME* aParent, EDA_HOTKEY_CONFIG* aHotkeys );
  74. #endif