KiCad PCB EDA Suite
panel_setup_netclasses_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version Dec 1 2018)
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  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, 130 );
37  m_netclassGrid->SetColSize( 1, 96 );
38  m_netclassGrid->SetColSize( 2, 96 );
39  m_netclassGrid->SetColSize( 3, 96 );
40  m_netclassGrid->SetColSize( 4, 96 );
41  m_netclassGrid->SetColSize( 5, 96 );
42  m_netclassGrid->SetColSize( 6, 96 );
43  m_netclassGrid->SetColSize( 7, 96 );
44  m_netclassGrid->SetColSize( 8, 96 );
45  m_netclassGrid->EnableDragColMove( false );
46  m_netclassGrid->EnableDragColSize( true );
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_CENTER, wxALIGN_CENTER );
58 
59  // Rows
60  m_netclassGrid->EnableDragRowSize( true );
61  m_netclassGrid->SetRowLabelSize( 0 );
62  m_netclassGrid->SetRowLabelValue( 0, _("Default") );
63  m_netclassGrid->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
64 
65  // Label Appearance
66  m_netclassGrid->SetLabelFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
67 
68  // Cell Defaults
69  m_netclassGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
70  m_netclassGrid->SetToolTip( _("Net Class parameters") );
71 
72  sbSizerUpper->Add( m_netclassGrid, 1, wxEXPAND, 5 );
73 
74  wxBoxSizer* buttonBoxSizer;
75  buttonBoxSizer = new wxBoxSizer( wxHORIZONTAL );
76 
77  m_addButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
78  m_addButton->SetMinSize( wxSize( 30,29 ) );
79 
80  buttonBoxSizer->Add( m_addButton, 0, wxRIGHT, 5 );
81 
82 
83  buttonBoxSizer->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
84 
85  m_removeButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
86  m_removeButton->SetMinSize( wxSize( 30,29 ) );
87 
88  buttonBoxSizer->Add( m_removeButton, 0, wxRIGHT|wxLEFT, 5 );
89 
90 
91  sbSizerUpper->Add( buttonBoxSizer, 0, wxTOP|wxEXPAND, 2 );
92 
93 
94  bMargins->Add( sbSizerUpper, 4, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
95 
96  wxStaticBoxSizer* sbMembership;
97  sbMembership = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Net Class Memberships") ), wxHORIZONTAL );
98 
99  wxBoxSizer* bLeft;
100  bLeft = new wxBoxSizer( wxVERTICAL );
101 
102  wxStaticBoxSizer* sbFilters;
103  sbFilters = new wxStaticBoxSizer( new wxStaticBox( this, 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* bSizer10;
123  bSizer10 = 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  bSizer10->Add( m_filterLabel, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
130 
131  m_netNameFilter = new wxTextCtrl( sbFilters->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
132  bSizer10->Add( m_netNameFilter, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
133 
134 
135  sbFilters->Add( bSizer10, 0, wxEXPAND, 5 );
136 
137  wxBoxSizer* bSizer13;
138  bSizer13 = new wxBoxSizer( wxHORIZONTAL );
139 
140  m_showAllButton = new wxButton( sbFilters->GetStaticBox(), wxID_ANY, _("Show All Nets"), wxDefaultPosition, wxDefaultSize, 0 );
141  bSizer13->Add( m_showAllButton, 1, wxALL, 5 );
142 
143 
144  bSizer13->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
145 
146  m_filterNetsButton = new wxButton( sbFilters->GetStaticBox(), wxID_ANY, _("Apply Filters"), wxDefaultPosition, wxDefaultSize, 0 );
147  bSizer13->Add( m_filterNetsButton, 1, wxALL, 5 );
148 
149 
150  sbFilters->Add( bSizer13, 1, wxEXPAND|wxTOP|wxBOTTOM, 6 );
151 
152 
153  bLeft->Add( sbFilters, 0, wxEXPAND|wxBOTTOM, 5 );
154 
155  wxStaticBoxSizer* sbEdit;
156  sbEdit = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Assign Net Class") ), wxVERTICAL );
157 
158  wxBoxSizer* bSizer11;
159  bSizer11 = new wxBoxSizer( wxHORIZONTAL );
160 
161  m_assignLabel = new wxStaticText( sbEdit->GetStaticBox(), wxID_ANY, _("New net class:"), wxDefaultPosition, wxDefaultSize, 0 );
162  m_assignLabel->Wrap( -1 );
163  m_assignLabel->SetMinSize( wxSize( 120,-1 ) );
164 
165  bSizer11->Add( m_assignLabel, 0, wxALL, 5 );
166 
167  wxArrayString m_assignNetClassChoices;
168  m_assignNetClass = new wxChoice( sbEdit->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_assignNetClassChoices, 0 );
169  m_assignNetClass->SetSelection( 0 );
170  bSizer11->Add( m_assignNetClass, 1, wxALL, 5 );
171 
172 
173  sbEdit->Add( bSizer11, 0, wxEXPAND, 5 );
174 
175  wxBoxSizer* bSizer12;
176  bSizer12 = new wxBoxSizer( wxHORIZONTAL );
177 
178  m_assignAllButton = new wxButton( sbEdit->GetStaticBox(), wxID_ANY, _("Assign To Listed Nets"), wxDefaultPosition, wxDefaultSize, 0 );
179  bSizer12->Add( m_assignAllButton, 1, wxALL, 5 );
180 
181 
182  bSizer12->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
183 
184  m_assignSelectedButton = new wxButton( sbEdit->GetStaticBox(), wxID_ANY, _("Assign To Selected Nets"), wxDefaultPosition, wxDefaultSize, 0 );
185  bSizer12->Add( m_assignSelectedButton, 1, wxALL, 5 );
186 
187 
188  sbEdit->Add( bSizer12, 0, wxEXPAND|wxTOP, 6 );
189 
190 
191  bLeft->Add( sbEdit, 1, wxEXPAND|wxTOP, 8 );
192 
193 
194  sbMembership->Add( bLeft, 1, wxEXPAND|wxRIGHT, 5 );
195 
196  wxBoxSizer* bRight;
197  bRight = new wxBoxSizer( wxVERTICAL );
198 
199  m_membershipGrid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_DEFAULT );
200 
201  // Grid
202  m_membershipGrid->CreateGrid( 0, 2 );
203  m_membershipGrid->EnableEditing( true );
204  m_membershipGrid->EnableGridLines( true );
205  m_membershipGrid->EnableDragGridSize( false );
206  m_membershipGrid->SetMargins( 0, 0 );
207 
208  // Columns
209  m_membershipGrid->EnableDragColMove( false );
210  m_membershipGrid->EnableDragColSize( true );
212  m_membershipGrid->SetColLabelValue( 0, _("Net") );
213  m_membershipGrid->SetColLabelValue( 1, _("Net Class") );
214  m_membershipGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
215 
216  // Rows
217  m_membershipGrid->EnableDragRowSize( true );
218  m_membershipGrid->SetRowLabelSize( 0 );
219  m_membershipGrid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
220 
221  // Label Appearance
222  m_membershipGrid->SetLabelFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
223 
224  // Cell Defaults
225  m_membershipGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
226  bRight->Add( m_membershipGrid, 1, wxEXPAND|wxBOTTOM|wxLEFT, 5 );
227 
228 
229  sbMembership->Add( bRight, 1, wxEXPAND|wxLEFT, 5 );
230 
231 
232  bMargins->Add( sbMembership, 5, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
233 
234 
235  bpanelNetClassesSizer->Add( bMargins, 1, wxEXPAND|wxRIGHT, 5 );
236 
237 
238  this->SetSizer( bpanelNetClassesSizer );
239  this->Layout();
240  bpanelNetClassesSizer->Fit( this );
241 
242  // Connect Events
243  this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnUpdateUI ) );
244  m_netclassGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnSizeNetclassGrid ), NULL, this );
245  m_addButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAddNetclassClick ), NULL, this );
246  m_removeButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnRemoveNetclassClick ), NULL, this );
247  m_showAllButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnShowAll ), NULL, this );
248  m_filterNetsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnApplyFilters ), NULL, this );
249  m_assignAllButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAssignAll ), NULL, this );
250  m_assignSelectedButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAssignSelected ), NULL, this );
251  m_membershipGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnSizeMembershipGrid ), NULL, this );
252 }
253 
255 {
256  // Disconnect Events
257  this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnUpdateUI ) );
258  m_netclassGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnSizeNetclassGrid ), NULL, this );
259  m_addButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAddNetclassClick ), NULL, this );
260  m_removeButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnRemoveNetclassClick ), NULL, this );
261  m_showAllButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnShowAll ), NULL, this );
262  m_filterNetsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnApplyFilters ), NULL, this );
263  m_assignAllButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAssignAll ), NULL, this );
264  m_assignSelectedButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAssignSelected ), NULL, this );
265  m_membershipGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnSizeMembershipGrid ), NULL, this );
266 
267 }
virtual void OnShowAll(wxCommandEvent &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)
virtual void OnRemoveNetclassClick(wxCommandEvent &event)
virtual void OnAssignSelected(wxCommandEvent &event)
const char * name
Definition: DXF_plotter.cpp:61
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:47