KiCad PCB EDA Suite
panel_setup_netclasses_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version 3.9.0 Aug 10 2021)
3 // http://www.wxformbuilder.org/
4 //
5 // PLEASE DO *NOT* EDIT THIS FILE!
7 
8 #include "widgets/wx_grid.h"
9 
11 
13 
14 PANEL_SETUP_NETCLASSES_BASE::PANEL_SETUP_NETCLASSES_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
15 {
16  wxBoxSizer* bpanelNetClassesSizer;
17  bpanelNetClassesSizer = new wxBoxSizer( wxVERTICAL );
18 
19  wxBoxSizer* bMargins;
20  bMargins = new wxBoxSizer( wxVERTICAL );
21 
22  m_splitter = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH|wxSP_LIVE_UPDATE|wxSP_NO_XP_THEME );
23  m_splitter->SetMinimumPaneSize( 80 );
24 
25  m_netclassesPane = new wxPanel( m_splitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
26  wxBoxSizer* bUpperSizer;
27  bUpperSizer = new wxBoxSizer( wxVERTICAL );
28 
29  m_netclassGrid = new WX_GRID( m_netclassesPane, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_DEFAULT|wxHSCROLL|wxTAB_TRAVERSAL|wxVSCROLL );
30 
31  // Grid
32  m_netclassGrid->CreateGrid( 1, 13 );
33  m_netclassGrid->EnableEditing( true );
34  m_netclassGrid->EnableGridLines( true );
35  m_netclassGrid->EnableDragGridSize( false );
36  m_netclassGrid->SetMargins( 0, 0 );
37 
38  // Columns
39  m_netclassGrid->EnableDragColMove( false );
40  m_netclassGrid->EnableDragColSize( true );
41  m_netclassGrid->SetColLabelValue( 0, _("Net Class") );
42  m_netclassGrid->SetColLabelValue( 1, _("Clearance") );
43  m_netclassGrid->SetColLabelValue( 2, _("Track Width") );
44  m_netclassGrid->SetColLabelValue( 3, _("Via Size") );
45  m_netclassGrid->SetColLabelValue( 4, _("Via Hole") );
46  m_netclassGrid->SetColLabelValue( 5, _("uVia Size") );
47  m_netclassGrid->SetColLabelValue( 6, _("uVia Hole") );
48  m_netclassGrid->SetColLabelValue( 7, _("DP Width") );
49  m_netclassGrid->SetColLabelValue( 8, _("DP Gap") );
50  m_netclassGrid->SetColLabelValue( 9, _("Wire Thickness") );
51  m_netclassGrid->SetColLabelValue( 10, _("Bus Thickness") );
52  m_netclassGrid->SetColLabelValue( 11, _("Color") );
53  m_netclassGrid->SetColLabelValue( 12, _("Line Style") );
55  m_netclassGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
56 
57  // Rows
58  m_netclassGrid->EnableDragRowSize( true );
59  m_netclassGrid->SetRowLabelValue( 0, _("Default") );
60  m_netclassGrid->SetRowLabelSize( 0 );
61  m_netclassGrid->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
62 
63  // Label Appearance
64 
65  // Cell Defaults
66  m_netclassGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
67  bUpperSizer->Add( m_netclassGrid, 1, wxEXPAND|wxLEFT, 2 );
68 
69  wxBoxSizer* buttonBoxSizer;
70  buttonBoxSizer = new wxBoxSizer( wxHORIZONTAL );
71 
72  m_addButton = new wxBitmapButton( m_netclassesPane, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
73  buttonBoxSizer->Add( m_addButton, 0, wxLEFT, 2 );
74 
75 
76  buttonBoxSizer->Add( 5, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
77 
78  m_removeButton = new wxBitmapButton( m_netclassesPane, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
79  buttonBoxSizer->Add( m_removeButton, 0, wxRIGHT|wxLEFT, 5 );
80 
81 
82  buttonBoxSizer->Add( 0, 0, 1, wxEXPAND, 5 );
83 
84  m_colorDefaultHelpText = new wxStaticText( m_netclassesPane, wxID_ANY, _("Set color to transparent to use KiCad default color."), wxDefaultPosition, wxDefaultSize, 0 );
85  m_colorDefaultHelpText->Wrap( -1 );
86  buttonBoxSizer->Add( m_colorDefaultHelpText, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
87 
88 
89  bUpperSizer->Add( buttonBoxSizer, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
90 
91 
92  m_netclassesPane->SetSizer( bUpperSizer );
93  m_netclassesPane->Layout();
94  bUpperSizer->Fit( m_netclassesPane );
95  m_membershipPane = new wxPanel( m_splitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
96  wxBoxSizer* bLowerSizer;
97  bLowerSizer = new wxBoxSizer( wxHORIZONTAL );
98 
99  wxBoxSizer* bLeft;
100  bLeft = new wxBoxSizer( wxVERTICAL );
101 
102  wxStaticBoxSizer* sbFilters;
103  sbFilters = new wxStaticBoxSizer( new wxStaticBox( m_membershipPane, wxID_ANY, _("Filter Nets") ), wxVERTICAL );
104 
105  wxBoxSizer* bSizer9;
106  bSizer9 = new wxBoxSizer( wxHORIZONTAL );
107 
108  m_ncfilterLabel = new wxStaticText( sbFilters->GetStaticBox(), wxID_ANY, _("Net class filter:"), wxDefaultPosition, wxDefaultSize, 0 );
109  m_ncfilterLabel->Wrap( -1 );
110  m_ncfilterLabel->SetMinSize( wxSize( 120,-1 ) );
111 
112  bSizer9->Add( m_ncfilterLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
113 
114  wxArrayString m_netClassFilterChoices;
115  m_netClassFilter = new wxChoice( sbFilters->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_netClassFilterChoices, 0 );
116  m_netClassFilter->SetSelection( 0 );
117  bSizer9->Add( m_netClassFilter, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
118 
119 
120  sbFilters->Add( bSizer9, 0, wxEXPAND, 5 );
121 
122  wxBoxSizer* bSizer101;
123  bSizer101 = new wxBoxSizer( wxHORIZONTAL );
124 
125  m_filterLabel = new wxStaticText( sbFilters->GetStaticBox(), wxID_ANY, _("Net name filter:"), wxDefaultPosition, wxDefaultSize, 0 );
126  m_filterLabel->Wrap( -1 );
127  m_filterLabel->SetMinSize( wxSize( 120,-1 ) );
128 
129  bSizer101->Add( m_filterLabel, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
130 
131  m_netNameFilter = new wxTextCtrl( sbFilters->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
132  bSizer101->Add( m_netNameFilter, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
133 
134 
135  sbFilters->Add( bSizer101, 0, wxEXPAND, 5 );
136 
137  wxBoxSizer* bSizer131;
138  bSizer131 = new wxBoxSizer( wxHORIZONTAL );
139 
140  m_showAllButton = new wxButton( sbFilters->GetStaticBox(), wxID_ANY, _("Show All Nets"), wxDefaultPosition, wxDefaultSize, 0 );
141  bSizer131->Add( m_showAllButton, 1, wxLEFT|wxTOP, 5 );
142 
143 
144  bSizer131->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
145 
146  m_filterNetsButton = new wxButton( sbFilters->GetStaticBox(), wxID_ANY, _("Apply Filters"), wxDefaultPosition, wxDefaultSize, 0 );
147  bSizer131->Add( m_filterNetsButton, 1, wxRIGHT|wxTOP, 5 );
148 
149 
150  sbFilters->Add( bSizer131, 1, wxEXPAND|wxTOP|wxBOTTOM, 6 );
151 
152 
153  bLeft->Add( sbFilters, 0, wxEXPAND|wxBOTTOM, 5 );
154 
155 
156  bLeft->Add( 0, 0, 1, wxEXPAND, 5 );
157 
158  wxStaticBoxSizer* sbEdit;
159  sbEdit = new wxStaticBoxSizer( new wxStaticBox( m_membershipPane, wxID_ANY, _("Assign Net Class") ), wxVERTICAL );
160 
161  wxBoxSizer* bSizer11;
162  bSizer11 = new wxBoxSizer( wxHORIZONTAL );
163 
164  m_assignLabel = new wxStaticText( sbEdit->GetStaticBox(), wxID_ANY, _("New net class:"), wxDefaultPosition, wxDefaultSize, 0 );
165  m_assignLabel->Wrap( -1 );
166  m_assignLabel->SetMinSize( wxSize( 120,-1 ) );
167 
168  bSizer11->Add( m_assignLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT, 5 );
169 
170  wxArrayString m_assignNetClassChoices;
171  m_assignNetClass = new wxChoice( sbEdit->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_assignNetClassChoices, 0 );
172  m_assignNetClass->SetSelection( 0 );
173  bSizer11->Add( m_assignNetClass, 1, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
174 
175 
176  sbEdit->Add( bSizer11, 0, wxEXPAND, 5 );
177 
178  wxBoxSizer* bSizer12;
179  bSizer12 = new wxBoxSizer( wxHORIZONTAL );
180 
181  m_assignAllButton = new wxButton( sbEdit->GetStaticBox(), wxID_ANY, _("Assign To All Listed Nets"), wxDefaultPosition, wxDefaultSize, 0 );
182  bSizer12->Add( m_assignAllButton, 1, wxBOTTOM|wxLEFT|wxTOP, 5 );
183 
184 
185  bSizer12->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
186 
187  m_assignSelectedButton = new wxButton( sbEdit->GetStaticBox(), wxID_ANY, _("Assign To Selected Nets"), wxDefaultPosition, wxDefaultSize, 0 );
188  bSizer12->Add( m_assignSelectedButton, 1, wxBOTTOM|wxRIGHT|wxTOP, 5 );
189 
190 
191  sbEdit->Add( bSizer12, 0, wxEXPAND|wxTOP, 6 );
192 
193 
194  bLeft->Add( sbEdit, 0, wxEXPAND|wxTOP, 8 );
195 
196 
197  bLowerSizer->Add( bLeft, 1, wxEXPAND|wxTOP|wxRIGHT, 5 );
198 
199  wxBoxSizer* bRight;
200  bRight = new wxBoxSizer( wxVERTICAL );
201 
202  m_membershipGrid = new WX_GRID( m_membershipPane, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_DEFAULT );
203 
204  // Grid
205  m_membershipGrid->CreateGrid( 0, 2 );
206  m_membershipGrid->EnableEditing( true );
207  m_membershipGrid->EnableGridLines( true );
208  m_membershipGrid->EnableDragGridSize( false );
209  m_membershipGrid->SetMargins( 0, 0 );
210 
211  // Columns
212  m_membershipGrid->EnableDragColMove( false );
213  m_membershipGrid->EnableDragColSize( true );
214  m_membershipGrid->SetColLabelValue( 0, _("Net") );
215  m_membershipGrid->SetColLabelValue( 1, _("Net Class") );
217  m_membershipGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
218 
219  // Rows
220  m_membershipGrid->EnableDragRowSize( true );
221  m_membershipGrid->SetRowLabelSize( 0 );
222  m_membershipGrid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
223 
224  // Label Appearance
225 
226  // Cell Defaults
227  m_membershipGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
228  bRight->Add( m_membershipGrid, 1, wxEXPAND|wxBOTTOM|wxLEFT, 5 );
229 
230 
231  bLowerSizer->Add( bRight, 1, wxEXPAND|wxTOP|wxLEFT, 5 );
232 
233 
234  m_membershipPane->SetSizer( bLowerSizer );
235  m_membershipPane->Layout();
236  bLowerSizer->Fit( m_membershipPane );
237  m_splitter->SplitHorizontally( m_netclassesPane, m_membershipPane, -1 );
238  bMargins->Add( m_splitter, 1, wxEXPAND|wxRIGHT|wxLEFT, 10 );
239 
240 
241  bpanelNetClassesSizer->Add( bMargins, 1, wxEXPAND|wxTOP, 2 );
242 
243 
244  this->SetSizer( bpanelNetClassesSizer );
245  this->Layout();
246  bpanelNetClassesSizer->Fit( this );
247 
248  // Connect Events
249  this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnUpdateUI ) );
250  m_netclassGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnSizeNetclassGrid ), NULL, this );
251  m_addButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAddNetclassClick ), NULL, this );
252  m_removeButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnRemoveNetclassClick ), NULL, this );
253  m_membershipPane->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_SETUP_NETCLASSES_BASE::onmembershipPanelSize ), NULL, this );
254  m_netNameFilter->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnApplyFilters ), NULL, this );
255  m_showAllButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnShowAll ), NULL, this );
256  m_filterNetsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnApplyFilters ), NULL, this );
257  m_assignAllButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAssignAll ), NULL, this );
258  m_assignSelectedButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAssignSelected ), NULL, this );
259  m_membershipGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnSizeMembershipGrid ), NULL, this );
260 }
261 
263 {
264  // Disconnect Events
265  this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnUpdateUI ) );
266  m_netclassGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnSizeNetclassGrid ), NULL, this );
267  m_addButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAddNetclassClick ), NULL, this );
268  m_removeButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnRemoveNetclassClick ), NULL, this );
269  m_membershipPane->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_SETUP_NETCLASSES_BASE::onmembershipPanelSize ), NULL, this );
270  m_netNameFilter->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnApplyFilters ), NULL, this );
271  m_showAllButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnShowAll ), NULL, this );
272  m_filterNetsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnApplyFilters ), NULL, this );
273  m_assignAllButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAssignAll ), NULL, this );
274  m_assignSelectedButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAssignSelected ), NULL, this );
275  m_membershipGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnSizeMembershipGrid ), NULL, this );
276 
277 }
virtual void OnShowAll(wxCommandEvent &event)
virtual void onmembershipPanelSize(wxSizeEvent &event)
virtual void OnAddNetclassClick(wxCommandEvent &event)
PANEL_SETUP_NETCLASSES_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)
virtual void OnUpdateUI(wxUpdateUIEvent &event)
#define _(s)
virtual void OnRemoveNetclassClick(wxCommandEvent &event)
virtual void OnAssignSelected(wxCommandEvent &event)
const char * name
Definition: DXF_plotter.cpp:56
virtual void OnSizeMembershipGrid(wxSizeEvent &event)
virtual void OnAssignAll(wxCommandEvent &event)
virtual void OnSizeNetclassGrid(wxSizeEvent &event)
virtual void OnApplyFilters(wxCommandEvent &event)
void SetColLabelSize(int aHeight)
Hide wxGrid's SetColLabelSize() method with one which makes sure the size is tall enough for the syst...
Definition: wx_grid.cpp:74