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 <[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 _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{
34public:
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
51protected:
52 void OnInitDialog( wxInitDialogEvent& aEvent );
53 void OnSelectBus( wxListEvent& event );
54 void OnSelectSignal( wxListEvent& event );
55
56private:
57 wxString getAliasDisplayText( std::shared_ptr< BUS_ALIAS > aAlias );
58
59protected:
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;
70
74
75private:
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_
wxButton * m_btn_remove_signal
bool TransferDataToWindow() override
void OnSelectBus(wxListEvent &event)
void OnRemoveSignal(wxCommandEvent &aEvent)
wxListView * m_bus_list_view
void OnRenameBus(wxCommandEvent &aEvent)
wxListView * m_signal_list_view
bool TransferDataFromWindow() override
void OnRemoveBus(wxCommandEvent &aEvent)
SCH_EDIT_FRAME * m_parent
void OnAddBus(wxCommandEvent &aEvent)
wxString getAliasDisplayText(std::shared_ptr< BUS_ALIAS > aAlias)
void OnAddSignal(wxCommandEvent &aEvent)
void OnInitDialog(wxInitDialogEvent &aEvent)
void OnRenameSignal(wxCommandEvent &aEvent)
wxButton * m_btn_rename_signal
std::shared_ptr< BUS_ALIAS > m_active_alias
DIALOG_BUS_MANAGER(SCH_EDIT_FRAME *aParent)
wxTextCtrl * m_signal_edit
std::unordered_set< SCH_SCREEN * > m_screens
std::vector< std::shared_ptr< BUS_ALIAS > > m_aliases
void OnSelectSignal(wxListEvent &event)
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:83
Schematic editor (Eeschema) main window.