KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_setup_netclasses.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) 2019-2023 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
25#ifndef PANEL_SETUP_NETCLASSES_H
26#define PANEL_SETUP_NETCLASSES_H
27
28#include <widgets/unit_binder.h>
31
32class NET_SETTINGS;
33
34
36{
37public:
38 PANEL_SETUP_NETCLASSES( wxWindow* aParentWindow, EDA_DRAW_FRAME* aFrame,
39 std::shared_ptr<NET_SETTINGS> aSettings,
40 const std::set<wxString>& aNetNames, bool isEEschema );
41 ~PANEL_SETUP_NETCLASSES( ) override;
42
43 bool TransferDataToWindow() override;
44 bool TransferDataFromWindow() override;
45
46 bool Validate() override;
47
48 void ImportSettingsFrom( const std::shared_ptr<NET_SETTINGS>& aNetSettings );
49
50private:
51 void OnAddNetclassClick( wxCommandEvent& event ) override;
52 void OnRemoveNetclassClick( wxCommandEvent& event ) override;
53 void OnSizeNetclassGrid( wxSizeEvent& event ) override;
54 void OnSizeAssignmentGrid( wxSizeEvent& event ) override;
55 void OnAddAssignmentClick( wxCommandEvent& event ) override;
56 void OnRemoveAssignmentClick( wxCommandEvent& event ) override;
57 void OnUpdateUI( wxUpdateUIEvent &event ) override;
58 void OnNetclassGridCellChanging( wxGridEvent& event );
59 void OnNetclassGridMouseEvent( wxMouseEvent& event );
60
61 void onUnitsChanged( wxCommandEvent& aEvent );
62
63 bool validateNetclassName( int aRow, const wxString& aName, bool focusFirst = true );
64
66
67 void AdjustNetclassGridColumns( int aWidth );
68 void AdjustAssignmentGridColumns( int aWidth );
69
70private:
73 std::shared_ptr<NET_SETTINGS> m_netSettings;
74 std::set<wxString> m_netNames;
75
76 std::unique_ptr<UNITS_PROVIDER> m_schUnitsProvider;
77 std::unique_ptr<UNITS_PROVIDER> m_pcbUnitsProvider;
78
80 bool m_netclassesDirty; // The netclass drop-down menus need rebuilding
81 int m_hoveredCol; // Column being hovered over, for tooltips
82 wxString m_lastPattern;
83
85};
86
87#endif //PANEL_SETUP_NETCLASSES_H
The base class for create windows for drawing purpose.
NET_SETTINGS stores various net-related settings in a project context.
Definition: net_settings.h:34
Class PANEL_SETUP_NETCLASSES_BASE.
void OnUpdateUI(wxUpdateUIEvent &event) override
void OnSizeAssignmentGrid(wxSizeEvent &event) override
void OnRemoveNetclassClick(wxCommandEvent &event) override
void OnRemoveAssignmentClick(wxCommandEvent &event) override
void ImportSettingsFrom(const std::shared_ptr< NET_SETTINGS > &aNetSettings)
void onUnitsChanged(wxCommandEvent &aEvent)
void OnNetclassGridCellChanging(wxGridEvent &event)
bool validateNetclassName(int aRow, const wxString &aName, bool focusFirst=true)
std::unique_ptr< UNITS_PROVIDER > m_pcbUnitsProvider
void OnNetclassGridMouseEvent(wxMouseEvent &event)
void OnAddAssignmentClick(wxCommandEvent &event) override
void AdjustAssignmentGridColumns(int aWidth)
std::set< wxString > m_netNames
void OnAddNetclassClick(wxCommandEvent &event) override
std::unique_ptr< UNITS_PROVIDER > m_schUnitsProvider
void OnSizeNetclassGrid(wxSizeEvent &event) override
void AdjustNetclassGridColumns(int aWidth)
std::shared_ptr< NET_SETTINGS > m_netSettings