KiCad PCB EDA Suite
panel_hotkeys_editor.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2004-2020 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 #ifndef PANEL_HOTKEYS_EDITOR_H
25 #define PANEL_HOTKEYS_EDITOR_H
26 
27 #include <hotkeys_basic.h>
28 #include <hotkey_store.h>
29 
32 
33 #include "wx/panel.h"
34 
35 
36 class wxPanel;
37 class wxSizer;
38 class TOOL_MANAGER;
39 
40 
42 {
43 public:
44  PANEL_HOTKEYS_EDITOR( EDA_BASE_FRAME* aFrame, wxWindow* aWindow, bool aReadOnly );
45 
46  void AddHotKeys( TOOL_MANAGER* aToolMgr );
47 
48  bool TransferDataToWindow() override;
49  bool TransferDataFromWindow() override;
50 
51  void ResetPanel() override;
52 
53  wxString GetResetTooltip() override
54  {
55  return _( "Reset all hotkeys to the built-in KiCad defaults" );
56  }
57 
58 private:
64  void installButtons( wxSizer* aSizer );
65 
71  void OnFilterSearch( wxCommandEvent& aEvent );
72 
77  void ImportHotKeys();
78 
79 protected:
81  bool m_readOnly;
82 
83  std::vector<TOOL_MANAGER*> m_toolManagers;
86 };
87 
88 
89 #endif // PANEL_HOTKEYS_EDITOR_H
void OnFilterSearch(wxCommandEvent &aEvent)
Handle a change in the hotkey filter text.
void ImportHotKeys()
Put up a dialog allowing the user to select a hotkeys file and then overlays those hotkeys onto the c...
void ResetPanel() override
Reset the contents of this panel.
A class that contains a set of hotkeys, arranged into "sections" and provides some book-keeping funct...
Definition: hotkey_store.h:62
void AddHotKeys(TOOL_MANAGER *aToolMgr)
std::vector< TOOL_MANAGER * > m_toolManagers
EDA_BASE_FRAME * m_frame
Master controller class:
Definition: tool_manager.h:52
void installButtons(wxSizer *aSizer)
Install the button panel (global reset/default, import/export)
bool TransferDataFromWindow() override
bool TransferDataToWindow() override
#define _(s)
Definition: 3d_actions.cpp:33
The base frame for deriving all KiCad main window classes.
PANEL_HOTKEYS_EDITOR(EDA_BASE_FRAME *aFrame, wxWindow *aWindow, bool aReadOnly)
WIDGET_HOTKEY_LIST * m_hotkeyListCtrl
wxString GetResetTooltip() override
Get the tooltip the reset button should display when showing this panel.
A wxPanel that is designed to be reset in a standard manor.