KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_toolbar_customization.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 2
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_TOOLBAR_CUSTOMIZATION_H_
25 #define PANEL_TOOLBAR_CUSTOMIZATION_H_
26
28
29#include <tool/action_toolbar.h>
31
32#include <wx/bmpbndl.h>
33
34class wxImageList;
35
37class TOOL_ACTION;
38
40{
41public:
42 PANEL_TOOLBAR_CUSTOMIZATION( wxWindow* aParent, APP_SETTINGS_BASE* aCfg, TOOLBAR_SETTINGS* aTbSettings,
43 std::vector<TOOL_ACTION*> aTools,
44 std::vector<ACTION_TOOLBAR_CONTROL*> aControls );
45
47
48 void ResetPanel() override;
49
50 bool TransferDataFromWindow() override;
51 bool TransferDataToWindow() override;
52
53protected:
54 std::optional<TOOLBAR_CONFIGURATION> parseToolbarTree();
55
57
58 void populateActions();
59
60 void enableCustomControls( bool enable );
61 void enableToolbarControls( bool enable );
62
63 void onGroupPress( wxCommandEvent& aEvent );
64 void onSpacerPress( wxCommandEvent& aEvent );
65 void onSeparatorPress( wxCommandEvent& aEvent );
66
67 // From the base class
68 void onCustomizeTbCb( wxCommandEvent& event ) override;
69 void onToolDelete( wxCommandEvent& event ) override;
70 void onToolMoveUp( wxCommandEvent& event ) override;
71 void onToolMoveDown( wxCommandEvent& event ) override;
72 void onBtnAddAction( wxCommandEvent& event ) override;
73 void onTreeBeginLabelEdit( wxTreeEvent& event ) override;
74 void onTreeEndLabelEdit( wxTreeEvent& event ) override;
75 void onTbChoiceSelect( wxCommandEvent& event ) override;
76
77protected:
78 wxImageList* m_actionImageList;
79 wxVector<wxBitmapBundle> m_actionImageBundleVector;
80 std::map<std::string, int> m_actionImageListMap;
81
82 // Actual settings for the frame
85
86 // The toolbar currently being viewed
88
89 // Shadow copy of the toolbar configurations used to store the changes in the dialog
90 std::map<TOOLBAR_LOC, TOOLBAR_CONFIGURATION> m_toolbars;
91
92 std::map<std::string, TOOL_ACTION*> m_availableTools;
93 std::map<std::string, ACTION_TOOLBAR_CONTROL*> m_availableControls;
94};
95
96 #endif /* PANEL_TOOLBAR_CUSTOMIZATION_H_ */
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:92
Class PANEL_TOOLBAR_CUSTOMIZATION_BASE.
void onSpacerPress(wxCommandEvent &aEvent)
wxVector< wxBitmapBundle > m_actionImageBundleVector
void onTbChoiceSelect(wxCommandEvent &event) override
void onTreeEndLabelEdit(wxTreeEvent &event) override
void onTreeBeginLabelEdit(wxTreeEvent &event) override
void onToolDelete(wxCommandEvent &event) override
std::map< TOOLBAR_LOC, TOOLBAR_CONFIGURATION > m_toolbars
void onGroupPress(wxCommandEvent &aEvent)
void onSeparatorPress(wxCommandEvent &aEvent)
void ResetPanel() override
Reset the contents of this panel.
std::map< std::string, int > m_actionImageListMap
void onBtnAddAction(wxCommandEvent &event) override
std::map< std::string, TOOL_ACTION * > m_availableTools
std::map< std::string, ACTION_TOOLBAR_CONTROL * > m_availableControls
std::optional< TOOLBAR_CONFIGURATION > parseToolbarTree()
void onCustomizeTbCb(wxCommandEvent &event) override
void onToolMoveDown(wxCommandEvent &event) override
void onToolMoveUp(wxCommandEvent &event) override
Represent a single user action.
Definition: tool_action.h:304