KiCad PCB EDA Suite
panel_setup_netclasses_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version Dec 30 2017)
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 ) : wxPanel( parent, id, pos, size, style )
15 {
16  wxBoxSizer* bpanelNetClassesSizer;
17  bpanelNetClassesSizer = new wxBoxSizer( wxVERTICAL );
18 
19  wxBoxSizer* bMargins;
20  bMargins = new wxBoxSizer( wxVERTICAL );
21 
22  wxStaticBoxSizer* sbSizerUpper;
23  sbSizerUpper = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Net Classes") ), wxVERTICAL );
24 
25  sbSizerUpper->SetMinSize( wxSize( -1,220 ) );
26  m_netclassGrid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_DEFAULT|wxHSCROLL|wxTAB_TRAVERSAL|wxVSCROLL );
27 
28  // Grid
29  m_netclassGrid->CreateGrid( 1, 9 );
30  m_netclassGrid->EnableEditing( true );
31  m_netclassGrid->EnableGridLines( true );
32  m_netclassGrid->EnableDragGridSize( false );
33  m_netclassGrid->SetMargins( 0, 0 );
34 
35  // Columns
36  m_netclassGrid->SetColSize( 0, 120 );
37  m_netclassGrid->SetColSize( 1, 85 );
38  m_netclassGrid->SetColSize( 2, 85 );
39  m_netclassGrid->SetColSize( 3, 85 );
40  m_netclassGrid->SetColSize( 4, 85 );
41  m_netclassGrid->SetColSize( 5, 85 );
42  m_netclassGrid->SetColSize( 6, 85 );
43  m_netclassGrid->SetColSize( 7, 85 );
44  m_netclassGrid->SetColSize( 8, 85 );
45  m_netclassGrid->EnableDragColMove( false );
46  m_netclassGrid->EnableDragColSize( true );
47  m_netclassGrid->SetColLabelSize( 22 );
48  m_netclassGrid->SetColLabelValue( 0, _("Name") );
49  m_netclassGrid->SetColLabelValue( 1, _("Clearance") );
50  m_netclassGrid->SetColLabelValue( 2, _("Track Width") );
51  m_netclassGrid->SetColLabelValue( 3, _("Via Size") );
52  m_netclassGrid->SetColLabelValue( 4, _("Via Drill") );
53  m_netclassGrid->SetColLabelValue( 5, _("uVia Size") );
54  m_netclassGrid->SetColLabelValue( 6, _("uVia Drill") );
55  m_netclassGrid->SetColLabelValue( 7, _("dPair Width") );
56  m_netclassGrid->SetColLabelValue( 8, _("dPair Gap") );
57  m_netclassGrid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
58 
59  // Rows
60  m_netclassGrid->EnableDragRowSize( false );
61  m_netclassGrid->SetRowLabelSize( 0 );
62  m_netclassGrid->SetRowLabelValue( 0, _("Default") );
63  m_netclassGrid->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTRE );
64 
65  // Label Appearance
66 
67  // Cell Defaults
68  m_netclassGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
69  m_netclassGrid->SetToolTip( _("Net Class parameters") );
70 
71  sbSizerUpper->Add( m_netclassGrid, 1, wxEXPAND, 5 );
72 
73  wxBoxSizer* buttonBoxSizer;
74  buttonBoxSizer = new wxBoxSizer( wxHORIZONTAL );
75 
76  m_addButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 );
77  m_addButton->SetMinSize( wxSize( 30,29 ) );
78 
79  buttonBoxSizer->Add( m_addButton, 0, wxRIGHT, 5 );
80 
81 
82  buttonBoxSizer->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
83 
84  m_removeButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 );
85  m_removeButton->SetMinSize( wxSize( 30,29 ) );
86 
87  buttonBoxSizer->Add( m_removeButton, 0, wxRIGHT|wxLEFT, 5 );
88 
89 
90  sbSizerUpper->Add( buttonBoxSizer, 0, wxEXPAND|wxTOP, 2 );
91 
92 
93  bMargins->Add( sbSizerUpper, 4, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
94 
95  wxStaticBoxSizer* sbMembership;
96  sbMembership = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Net Class Memberships") ), wxHORIZONTAL );
97 
98  wxBoxSizer* bLeft;
99  bLeft = new wxBoxSizer( wxVERTICAL );
100 
101  wxStaticBoxSizer* sbFilters;
102  sbFilters = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Filter Nets") ), wxVERTICAL );
103 
104  wxBoxSizer* bSizer9;
105  bSizer9 = new wxBoxSizer( wxHORIZONTAL );
106 
107  m_ncfilterLabel = new wxStaticText( sbFilters->GetStaticBox(), wxID_ANY, _("Net class filter:"), wxDefaultPosition, wxDefaultSize, 0 );
108  m_ncfilterLabel->Wrap( -1 );
109  m_ncfilterLabel->SetMinSize( wxSize( 120,-1 ) );
110 
111  bSizer9->Add( m_ncfilterLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
112 
113  wxArrayString m_netClassFilterChoices;
114  m_netClassFilter = new wxChoice( sbFilters->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_netClassFilterChoices, 0 );
115  m_netClassFilter->SetSelection( 0 );
116  bSizer9->Add( m_netClassFilter, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
117 
118 
119  sbFilters->Add( bSizer9, 0, wxEXPAND, 5 );
120 
121  wxBoxSizer* bSizer10;
122  bSizer10 = new wxBoxSizer( wxHORIZONTAL );
123 
124  m_filterLabel = new wxStaticText( sbFilters->GetStaticBox(), wxID_ANY, _("Net name filter:"), wxDefaultPosition, wxDefaultSize, 0 );
125  m_filterLabel->Wrap( -1 );
126  m_filterLabel->SetMinSize( wxSize( 120,-1 ) );
127 
128  bSizer10->Add( m_filterLabel, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
129 
130  m_netNameFilter = new wxTextCtrl( sbFilters->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
131  bSizer10->Add( m_netNameFilter, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
132 
133 
134  sbFilters->Add( bSizer10, 0, wxEXPAND, 5 );
135 
136  wxBoxSizer* bSizer13;
137  bSizer13 = new wxBoxSizer( wxHORIZONTAL );
138 
139  m_showAllButton = new wxButton( sbFilters->GetStaticBox(), wxID_ANY, _("Show All Nets"), wxDefaultPosition, wxDefaultSize, 0 );
140  bSizer13->Add( m_showAllButton, 1, wxALL, 5 );
141 
142 
143  bSizer13->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
144 
145  m_filterNetsButton = new wxButton( sbFilters->GetStaticBox(), wxID_ANY, _("Apply Filters"), wxDefaultPosition, wxDefaultSize, 0 );
146  bSizer13->Add( m_filterNetsButton, 1, wxALL, 5 );
147 
148 
149  sbFilters->Add( bSizer13, 1, wxEXPAND|wxTOP|wxBOTTOM, 6 );
150 
151 
152  bLeft->Add( sbFilters, 0, wxEXPAND|wxBOTTOM, 5 );
153 
154  wxStaticBoxSizer* sbEdit;
155  sbEdit = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Assign Net Class") ), wxVERTICAL );
156 
157  wxBoxSizer* bSizer11;
158  bSizer11 = new wxBoxSizer( wxHORIZONTAL );
159 
160  m_assignLabel = new wxStaticText( sbEdit->GetStaticBox(), wxID_ANY, _("New net class:"), wxDefaultPosition, wxDefaultSize, 0 );
161  m_assignLabel->Wrap( -1 );
162  m_assignLabel->SetMinSize( wxSize( 120,-1 ) );
163 
164  bSizer11->Add( m_assignLabel, 0, wxALL, 5 );
165 
166  wxArrayString m_assignNetClassChoices;
167  m_assignNetClass = new wxChoice( sbEdit->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_assignNetClassChoices, 0 );
168  m_assignNetClass->SetSelection( 0 );
169  bSizer11->Add( m_assignNetClass, 1, wxALL, 5 );
170 
171 
172  sbEdit->Add( bSizer11, 0, wxEXPAND, 5 );
173 
174  wxBoxSizer* bSizer12;
175  bSizer12 = new wxBoxSizer( wxHORIZONTAL );
176 
177  m_assignAllButton = new wxButton( sbEdit->GetStaticBox(), wxID_ANY, _("Assign To Listed Nets"), wxDefaultPosition, wxDefaultSize, 0 );
178  bSizer12->Add( m_assignAllButton, 1, wxALL, 5 );
179 
180 
181  bSizer12->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
182 
183  m_assignSelectedButton = new wxButton( sbEdit->GetStaticBox(), wxID_ANY, _("Assign To Selected Nets"), wxDefaultPosition, wxDefaultSize, 0 );
184  bSizer12->Add( m_assignSelectedButton, 1, wxALL, 5 );
185 
186 
187  sbEdit->Add( bSizer12, 0, wxEXPAND|wxTOP, 6 );
188 
189 
190  bLeft->Add( sbEdit, 1, wxEXPAND|wxTOP, 8 );
191 
192 
193  sbMembership->Add( bLeft, 1, wxEXPAND|wxRIGHT, 5 );
194 
195  wxBoxSizer* bRight;
196  bRight = new wxBoxSizer( wxVERTICAL );
197 
198  m_membershipGrid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_DEFAULT );
199 
200  // Grid
201  m_membershipGrid->CreateGrid( 0, 2 );
202  m_membershipGrid->EnableEditing( true );
203  m_membershipGrid->EnableGridLines( true );
204  m_membershipGrid->EnableDragGridSize( false );
205  m_membershipGrid->SetMargins( 0, 0 );
206 
207  // Columns
208  m_membershipGrid->EnableDragColMove( false );
209  m_membershipGrid->EnableDragColSize( true );
210  m_membershipGrid->SetColLabelSize( 22 );
211  m_membershipGrid->SetColLabelValue( 0, _("Net") );
212  m_membershipGrid->SetColLabelValue( 1, _("Net Class") );
213  m_membershipGrid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
214 
215  // Rows
216  m_membershipGrid->EnableDragRowSize( true );
217  m_membershipGrid->SetRowLabelSize( 0 );
218  m_membershipGrid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
219 
220  // Label Appearance
221 
222  // Cell Defaults
223  m_membershipGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
224  bRight->Add( m_membershipGrid, 1, wxEXPAND|wxBOTTOM|wxLEFT, 5 );
225 
226 
227  sbMembership->Add( bRight, 1, wxEXPAND|wxLEFT, 5 );
228 
229 
230  bMargins->Add( sbMembership, 5, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
231 
232 
233  bpanelNetClassesSizer->Add( bMargins, 1, wxEXPAND|wxRIGHT, 5 );
234 
235 
236  this->SetSizer( bpanelNetClassesSizer );
237  this->Layout();
238  bpanelNetClassesSizer->Fit( this );
239 
240  // Connect Events
241  this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnUpdateUI ) );
242  m_netclassGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnSizeNetclassGrid ), NULL, this );
243  m_addButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAddNetclassClick ), NULL, this );
244  m_removeButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnRemoveNetclassClick ), NULL, this );
245  m_showAllButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnShowAll ), NULL, this );
246  m_filterNetsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnApplyFilters ), NULL, this );
247  m_assignAllButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAssignAll ), NULL, this );
248  m_assignSelectedButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAssignSelected ), NULL, this );
249  m_membershipGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnSizeMembershipGrid ), NULL, this );
250 }
251 
253 {
254  // Disconnect Events
255  this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnUpdateUI ) );
256  m_netclassGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnSizeNetclassGrid ), NULL, this );
257  m_addButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAddNetclassClick ), NULL, this );
258  m_removeButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnRemoveNetclassClick ), NULL, this );
259  m_showAllButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnShowAll ), NULL, this );
260  m_filterNetsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnApplyFilters ), NULL, this );
261  m_assignAllButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAssignAll ), NULL, this );
262  m_assignSelectedButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAssignSelected ), NULL, this );
263  m_membershipGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnSizeMembershipGrid ), NULL, this );
264 
265 }
virtual void OnShowAll(wxCommandEvent &event)
virtual void OnAddNetclassClick(wxCommandEvent &event)
virtual void OnUpdateUI(wxUpdateUIEvent &event)
virtual void OnRemoveNetclassClick(wxCommandEvent &event)
virtual void OnAssignSelected(wxCommandEvent &event)
virtual void OnSizeMembershipGrid(wxSizeEvent &event)
virtual void OnAssignAll(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)
virtual void OnSizeNetclassGrid(wxSizeEvent &event)
virtual void OnApplyFilters(wxCommandEvent &event)