KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_kicad_launcher.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 modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * 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 KICAD_PANEL_KICAD_LAUNCHER_H
21#define KICAD_PANEL_KICAD_LAUNCHER_H
22
24
25#include <unordered_map>
26
27class TOOL_MANAGER;
28class TOOL_ACTION;
30
32{
33public:
34 PANEL_KICAD_LAUNCHER( wxWindow* aParent );
35
37
38 void CreateLaunchers();
39
40private:
41 void onThemeChanged( wxSysColourChangedEvent& aEvent );
42 void onLauncherButtonClick( wxCommandEvent& aEvent );
43
45
46 // Action lookup keyed by button id rather than stashed as button client data, so the
47 // handler for the button's asynchronous click event never has to dereference the event
48 // object, which CreateLaunchers() may have already destroyed by the time the event arrives.
49 std::unordered_map<int, const TOOL_ACTION*> m_actionForId;
50
51 // Source of never-reused button ids so a stale click cannot alias a rebuilt button's id.
52 int m_nextLauncherId = wxID_HIGHEST + 1;
53};
54
55
56#endif // KICAD_PANEL_KICAD_LAUNCHER_H
The main KiCad project manager frame.
PANEL_KICAD_LAUNCHER_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
void onThemeChanged(wxSysColourChangedEvent &aEvent)
void onLauncherButtonClick(wxCommandEvent &aEvent)
std::unordered_map< int, const TOOL_ACTION * > m_actionForId
PANEL_KICAD_LAUNCHER(wxWindow *aParent)
KICAD_MANAGER_FRAME * m_frame
Represent a single user action.
Master controller class: