KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 The KiCad Developers, see AUTHORS.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, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef PANEL_HOTKEYS_EDITOR_H
21#define PANEL_HOTKEYS_EDITOR_H
22
23#include <hotkeys_basic.h>
24#include <hotkey_store.h>
25
28
29#include "wx/panel.h"
30
31
32class wxPanel;
33class wxSizer;
34class TOOL_MANAGER;
35class wxSearchCtrl;
36
37
39{
40public:
41 PANEL_HOTKEYS_EDITOR( EDA_BASE_FRAME* aFrame, wxWindow* aWindow, bool readOnly );
43
44 std::vector<TOOL_ACTION*>& ActionsList() { return m_actions; }
45
46 bool TransferDataToWindow() override;
47 bool TransferDataFromWindow() override;
48
49 void ResetPanel() override;
50
51 wxString GetResetTooltip() const override
52 {
53 return _( "Reset all hotkeys to the built-in KiCad defaults" );
54 }
55
56 wxSizer* GetBottomSizer() { return m_bottomSizer; }
57
58private:
64 void installButtons( wxSizer* aSizer );
65
71 void OnFilterSearch( wxCommandEvent& aEvent );
72
77 void ImportHotKeys();
78
85 void dumpHotkeys();
86
87 wxSearchCtrl* m_filterSearch;
88
89protected:
91 wxSizer* m_bottomSizer;
92 std::vector<TOOL_ACTION*> m_actions;
95};
96
97
98#endif // PANEL_HOTKEYS_EDITOR_H
The base frame for deriving all KiCad main window classes.
A class that contains a set of hotkeys, arranged into "sections" and provides some book-keeping funct...
wxString GetResetTooltip() const override
Get the tooltip the reset button should display when showing this panel.
PANEL_HOTKEYS_EDITOR(EDA_BASE_FRAME *aFrame, wxWindow *aWindow, bool readOnly)
void OnFilterSearch(wxCommandEvent &aEvent)
Handle a change in the hotkey filter text.
void ResetPanel() override
Reset the contents of this panel.
std::vector< TOOL_ACTION * > m_actions
void installButtons(wxSizer *aSizer)
Install the button panel (global reset/default, import/export)
WIDGET_HOTKEY_LIST * m_hotkeyListCtrl
std::vector< TOOL_ACTION * > & ActionsList()
bool TransferDataToWindow() override
void ImportHotKeys()
Put up a dialog allowing the user to select a hotkeys file and then overlays those hotkeys onto the c...
void dumpHotkeys()
Dump all actions and their hotkeys to a text file for inclusion in documentation.
bool TransferDataFromWindow() override
RESETTABLE_PANEL(wxWindow *aParent, wxWindowID aId=wxID_ANY, const wxPoint &aPos=wxDefaultPosition, const wxSize &aSize=wxSize(-1,-1), long aStyle=wxTAB_TRAVERSAL, const wxString &aName=wxEmptyString)
Master controller class:
#define _(s)