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