KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_setup_buses.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) 2018 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Jon Evans <[email protected]>
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#ifndef PANEL_SETUP_BUSES_H
23#define PANEL_SETUP_BUSES_H
24
25#include <map>
27#include <bus_alias.h>
28
29class SCH_EDIT_FRAME;
30class BUS_ALIAS;
31
33{
34public:
35 PANEL_SETUP_BUSES( wxWindow* aWindow, SCH_EDIT_FRAME* aFrame );
36
38
39 bool TransferDataFromWindow() override;
40 bool TransferDataToWindow() override;
41
42 void ImportSettingsFrom( const std::map<wxString, std::vector<wxString>>& aAliases );
43
44protected:
45 void OnAddAlias( wxCommandEvent& aEvent ) override;
46 void OnDeleteAlias( wxCommandEvent& aEvent ) override;
47 void OnAddMember( wxCommandEvent& aEvent ) override;
48 void OnRemoveMember( wxCommandEvent& aEvent ) override;
49 void OnAliasesGridCellChanging( wxGridEvent& event );
50 void OnMemberGridCellChanging( wxGridEvent& event );
51 void OnMemberGridCellChanged( wxGridEvent& event );
52 void OnSizeGrid( wxSizeEvent& event ) override;
53 void OnUpdateUI( wxUpdateUIEvent& event ) override;
54
55 void loadAliases();
56
57 void reloadMembersGridOnIdle( wxIdleEvent& aEvent );
58
60
67 void updateAliasMembers( int aAliasIndex );
68
69private:
72
73 std::vector< std::shared_ptr<BUS_ALIAS> > m_aliases;
77
78 wxString m_errorMsg;
81};
82
83
84#endif // PANEL_SETUP_BUSES_H
PANEL_SETUP_BUSES_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 OnAliasesGridCellChanging(wxGridEvent &event)
std::vector< std::shared_ptr< BUS_ALIAS > > m_aliases
void reloadMembersGridOnIdle(wxIdleEvent &aEvent)
void OnDeleteAlias(wxCommandEvent &aEvent) override
void OnUpdateUI(wxUpdateUIEvent &event) override
SCH_EDIT_FRAME * m_frame
void OnSizeGrid(wxSizeEvent &event) override
PANEL_SETUP_BUSES(wxWindow *aWindow, SCH_EDIT_FRAME *aFrame)
bool TransferDataToWindow() override
void OnMemberGridCellChanged(wxGridEvent &event)
void updateAliasMembers(int aAliasIndex)
Keep the BUS_ALIAS member list synchronized with the values displayed in the grid.
wxString m_membersLabelTemplate
void OnRemoveMember(wxCommandEvent &aEvent) override
void OnMemberGridCellChanging(wxGridEvent &event)
bool TransferDataFromWindow() override
void OnAddMember(wxCommandEvent &aEvent) override
void ImportSettingsFrom(const std::map< wxString, std::vector< wxString > > &aAliases)
void OnAddAlias(wxCommandEvent &aEvent) override
Schematic editor (Eeschema) main window.