KiCad PCB EDA Suite
dialog_bus_manager.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 (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
6  * @author Jon Evans <jon@craftyjon.com>
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 _DIALOG_BUS_MANAGER_H_
23 #define _DIALOG_BUS_MANAGER_H_
24 
25 #include "dialog_shim.h"
26 
27 #include <sch_edit_frame.h>
28 #include <wx/listctrl.h>
29 
30 #include <bus_alias.h>
31 
33 {
34 public:
36 
38 
39  bool TransferDataFromWindow() override;
40 
41  bool TransferDataToWindow() override;
42 
43  void OnAddBus( wxCommandEvent& aEvent );
44  void OnRenameBus( wxCommandEvent& aEvent );
45  void OnRemoveBus( wxCommandEvent& aEvent );
46 
47  void OnAddSignal( wxCommandEvent& aEvent );
48  void OnRenameSignal( wxCommandEvent& aEvent );
49  void OnRemoveSignal( wxCommandEvent& aEvent );
50 
51 protected:
52  void OnInitDialog( wxInitDialogEvent& aEvent );
53  void OnSelectBus( wxListEvent& event );
54  void OnSelectSignal( wxListEvent& event );
55 
56 private:
57  wxString getAliasDisplayText( std::shared_ptr< BUS_ALIAS > aAlias );
58 
59 protected:
61 
62  wxListView* m_bus_list_view;
63  wxListView* m_signal_list_view;
64  wxTextCtrl* m_bus_edit;
65  wxTextCtrl* m_signal_edit;
66 
67  wxButton* m_btn_add_bus;
68  wxButton* m_btn_rename_bus;
69  wxButton* m_btn_remove_bus;
70 
71  wxButton* m_btn_add_signal;
74 
75 private:
76  std::vector< std::shared_ptr< BUS_ALIAS > > m_aliases;
77  std::unordered_set<SCH_SCREEN*> m_screens;
78  std::shared_ptr< BUS_ALIAS > m_active_alias;
79 };
80 
81 
82 #endif
83 
84 // _DIALOG_BUS_MANAGER_H_
bool TransferDataFromWindow() override
wxListView * m_bus_list_view
wxListView * m_signal_list_view
void OnAddSignal(wxCommandEvent &aEvent)
void OnAddBus(wxCommandEvent &aEvent)
void OnRenameSignal(wxCommandEvent &aEvent)
wxButton * m_btn_rename_signal
Schematic editor (Eeschema) main window.
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:82
void OnInitDialog(wxInitDialogEvent &aEvent)
void OnSelectBus(wxListEvent &event)
void OnRemoveSignal(wxCommandEvent &aEvent)
SCH_EDIT_FRAME * m_parent
std::unordered_set< SCH_SCREEN * > m_screens
void OnRenameBus(wxCommandEvent &aEvent)
wxButton * m_btn_remove_signal
std::vector< std::shared_ptr< BUS_ALIAS > > m_aliases
bool TransferDataToWindow() override
wxTextCtrl * m_signal_edit
std::shared_ptr< BUS_ALIAS > m_active_alias
wxString getAliasDisplayText(std::shared_ptr< BUS_ALIAS > aAlias)
void OnRemoveBus(wxCommandEvent &aEvent)
void OnSelectSignal(wxListEvent &event)
DIALOG_BUS_MANAGER(SCH_EDIT_FRAME *aParent)