KiCad PCB EDA Suite
panel_setup_tracks_and_vias_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_TRACKS_AND_VIAS_BASE::PANEL_SETUP_TRACKS_AND_VIAS_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* bMainSizer;
17  bMainSizer = new wxBoxSizer( wxVERTICAL );
18 
19  m_label = new wxStaticText( this, wxID_ANY, _("Pre-defined track and via dimensions:"), wxDefaultPosition, wxDefaultSize, 0 );
20  m_label->Wrap( -1 );
21  bMainSizer->Add( m_label, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
22 
23  wxBoxSizer* bSizerLower;
24  bSizerLower = new wxBoxSizer( wxHORIZONTAL );
25 
26  wxStaticBoxSizer* sbSizer4;
27  sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Tracks") ), wxVERTICAL );
28 
29  m_trackWidthsGrid = new WX_GRID( sbSizer4->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
30 
31  // Grid
32  m_trackWidthsGrid->CreateGrid( 8, 1 );
33  m_trackWidthsGrid->EnableEditing( true );
34  m_trackWidthsGrid->EnableGridLines( true );
35  m_trackWidthsGrid->EnableDragGridSize( false );
36  m_trackWidthsGrid->SetMargins( 40, 0 );
37 
38  // Columns
39  m_trackWidthsGrid->EnableDragColMove( false );
40  m_trackWidthsGrid->EnableDragColSize( false );
42  m_trackWidthsGrid->SetColLabelValue( 0, _("Width") );
43  m_trackWidthsGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
44 
45  // Rows
46  m_trackWidthsGrid->EnableDragRowSize( false );
47  m_trackWidthsGrid->SetRowLabelSize( 0 );
48  m_trackWidthsGrid->SetRowLabelValue( 0, _("1") );
49  m_trackWidthsGrid->SetRowLabelValue( 1, _("2") );
50  m_trackWidthsGrid->SetRowLabelValue( 2, _("3") );
51  m_trackWidthsGrid->SetRowLabelValue( 3, _("4") );
52  m_trackWidthsGrid->SetRowLabelValue( 4, _("5") );
53  m_trackWidthsGrid->SetRowLabelValue( 5, _("6") );
54  m_trackWidthsGrid->SetRowLabelValue( 6, _("7") );
55  m_trackWidthsGrid->SetRowLabelValue( 7, _("8") );
56  m_trackWidthsGrid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
57 
58  // Label Appearance
59 
60  // Cell Defaults
61  m_trackWidthsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
62  sbSizer4->Add( m_trackWidthsGrid, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
63 
64  wxBoxSizer* bSizer3;
65  bSizer3 = new wxBoxSizer( wxHORIZONTAL );
66 
67  m_trackWidthsAddButton = new wxBitmapButton( sbSizer4->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
68  bSizer3->Add( m_trackWidthsAddButton, 0, wxLEFT|wxRIGHT, 5 );
69 
70 
71  bSizer3->Add( 20, 0, 0, wxEXPAND, 5 );
72 
73  m_trackWidthsRemoveButton = new wxBitmapButton( sbSizer4->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
74  bSizer3->Add( m_trackWidthsRemoveButton, 0, wxLEFT|wxRIGHT, 5 );
75 
76 
77  sbSizer4->Add( bSizer3, 0, wxBOTTOM|wxEXPAND|wxTOP, 2 );
78 
79 
80  bSizerLower->Add( sbSizer4, 0, wxEXPAND|wxRIGHT, 10 );
81 
82  wxStaticBoxSizer* sbSizer5;
83  sbSizer5 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Vias") ), wxVERTICAL );
84 
85  m_viaSizesGrid = new WX_GRID( sbSizer5->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
86 
87  // Grid
88  m_viaSizesGrid->CreateGrid( 8, 2 );
89  m_viaSizesGrid->EnableEditing( true );
90  m_viaSizesGrid->EnableGridLines( true );
91  m_viaSizesGrid->EnableDragGridSize( false );
92  m_viaSizesGrid->SetMargins( 40, 0 );
93 
94  // Columns
95  m_viaSizesGrid->EnableDragColMove( false );
96  m_viaSizesGrid->EnableDragColSize( false );
98  m_viaSizesGrid->SetColLabelValue( 0, _("Size") );
99  m_viaSizesGrid->SetColLabelValue( 1, _("Hole") );
100  m_viaSizesGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
101 
102  // Rows
103  m_viaSizesGrid->EnableDragRowSize( false );
104  m_viaSizesGrid->SetRowLabelSize( 0 );
105  m_viaSizesGrid->SetRowLabelValue( 0, _("1") );
106  m_viaSizesGrid->SetRowLabelValue( 1, _("2") );
107  m_viaSizesGrid->SetRowLabelValue( 2, _("3") );
108  m_viaSizesGrid->SetRowLabelValue( 3, _("4") );
109  m_viaSizesGrid->SetRowLabelValue( 4, _("5") );
110  m_viaSizesGrid->SetRowLabelValue( 5, _("6") );
111  m_viaSizesGrid->SetRowLabelValue( 6, _("7") );
112  m_viaSizesGrid->SetRowLabelValue( 7, _("8") );
113  m_viaSizesGrid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
114 
115  // Label Appearance
116 
117  // Cell Defaults
118  m_viaSizesGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
119  sbSizer5->Add( m_viaSizesGrid, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
120 
121  wxBoxSizer* bSizer4;
122  bSizer4 = new wxBoxSizer( wxHORIZONTAL );
123 
124  m_viaSizesAddButton = new wxBitmapButton( sbSizer5->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
125  bSizer4->Add( m_viaSizesAddButton, 0, wxLEFT|wxRIGHT, 5 );
126 
127 
128  bSizer4->Add( 20, 0, 0, wxEXPAND, 5 );
129 
130  m_viaSizesRemoveButton = new wxBitmapButton( sbSizer5->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
131  bSizer4->Add( m_viaSizesRemoveButton, 0, wxLEFT|wxRIGHT, 5 );
132 
133 
134  sbSizer5->Add( bSizer4, 0, wxBOTTOM|wxEXPAND|wxTOP, 2 );
135 
136 
137  bSizerLower->Add( sbSizer5, 0, wxEXPAND|wxRIGHT, 10 );
138 
139  wxStaticBoxSizer* sbSizer6;
140  sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Differential Pairs") ), wxVERTICAL );
141 
142  m_diffPairsGrid = new WX_GRID( sbSizer6->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
143 
144  // Grid
145  m_diffPairsGrid->CreateGrid( 8, 3 );
146  m_diffPairsGrid->EnableEditing( true );
147  m_diffPairsGrid->EnableGridLines( true );
148  m_diffPairsGrid->EnableDragGridSize( false );
149  m_diffPairsGrid->SetMargins( 40, 0 );
150 
151  // Columns
152  m_diffPairsGrid->EnableDragColMove( false );
153  m_diffPairsGrid->EnableDragColSize( false );
155  m_diffPairsGrid->SetColLabelValue( 0, _("Width") );
156  m_diffPairsGrid->SetColLabelValue( 1, _("Gap") );
157  m_diffPairsGrid->SetColLabelValue( 2, _("Via Gap") );
158  m_diffPairsGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
159 
160  // Rows
161  m_diffPairsGrid->EnableDragRowSize( false );
162  m_diffPairsGrid->SetRowLabelSize( 0 );
163  m_diffPairsGrid->SetRowLabelValue( 0, _("1") );
164  m_diffPairsGrid->SetRowLabelValue( 1, _("2") );
165  m_diffPairsGrid->SetRowLabelValue( 2, _("3") );
166  m_diffPairsGrid->SetRowLabelValue( 3, _("4") );
167  m_diffPairsGrid->SetRowLabelValue( 4, _("5") );
168  m_diffPairsGrid->SetRowLabelValue( 5, _("6") );
169  m_diffPairsGrid->SetRowLabelValue( 6, _("7") );
170  m_diffPairsGrid->SetRowLabelValue( 7, _("8") );
171  m_diffPairsGrid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
172 
173  // Label Appearance
174 
175  // Cell Defaults
176  m_diffPairsGrid->SetDefaultCellBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
177  m_diffPairsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
178  sbSizer6->Add( m_diffPairsGrid, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
179 
180  wxBoxSizer* bSizer5;
181  bSizer5 = new wxBoxSizer( wxHORIZONTAL );
182 
183  m_diffPairsAddButton = new wxBitmapButton( sbSizer6->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
184  bSizer5->Add( m_diffPairsAddButton, 0, wxLEFT|wxRIGHT, 5 );
185 
186 
187  bSizer5->Add( 20, 0, 0, wxEXPAND, 5 );
188 
189  m_diffPairsRemoveButton = new wxBitmapButton( sbSizer6->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
190  bSizer5->Add( m_diffPairsRemoveButton, 0, wxLEFT|wxRIGHT, 5 );
191 
192 
193  sbSizer6->Add( bSizer5, 0, wxBOTTOM|wxEXPAND|wxTOP, 2 );
194 
195 
196  bSizerLower->Add( sbSizer6, 0, wxEXPAND, 5 );
197 
198 
199  bMainSizer->Add( bSizerLower, 5, wxEXPAND|wxLEFT, 20 );
200 
201 
202  this->SetSizer( bMainSizer );
203  this->Layout();
204 
205  // Connect Events
206  m_trackWidthsAddButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_TRACKS_AND_VIAS_BASE::OnAddTrackWidthsClick ), NULL, this );
207  m_trackWidthsRemoveButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_TRACKS_AND_VIAS_BASE::OnRemoveTrackWidthsClick ), NULL, this );
208  m_viaSizesAddButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_TRACKS_AND_VIAS_BASE::OnAddViaSizesClick ), NULL, this );
209  m_viaSizesRemoveButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_TRACKS_AND_VIAS_BASE::OnRemoveViaSizesClick ), NULL, this );
210  m_diffPairsAddButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_TRACKS_AND_VIAS_BASE::OnAddDiffPairsClick ), NULL, this );
211  m_diffPairsRemoveButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_TRACKS_AND_VIAS_BASE::OnRemoveDiffPairsClick ), NULL, this );
212 }
213 
215 {
216  // Disconnect Events
217  m_trackWidthsAddButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_TRACKS_AND_VIAS_BASE::OnAddTrackWidthsClick ), NULL, this );
218  m_trackWidthsRemoveButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_TRACKS_AND_VIAS_BASE::OnRemoveTrackWidthsClick ), NULL, this );
219  m_viaSizesAddButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_TRACKS_AND_VIAS_BASE::OnAddViaSizesClick ), NULL, this );
220  m_viaSizesRemoveButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_TRACKS_AND_VIAS_BASE::OnRemoveViaSizesClick ), NULL, this );
221  m_diffPairsAddButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_TRACKS_AND_VIAS_BASE::OnAddDiffPairsClick ), NULL, this );
222  m_diffPairsRemoveButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_TRACKS_AND_VIAS_BASE::OnRemoveDiffPairsClick ), NULL, this );
223 
224 }
PANEL_SETUP_TRACKS_AND_VIAS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(674, 343), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
virtual void OnAddViaSizesClick(wxCommandEvent &event)
virtual void OnRemoveDiffPairsClick(wxCommandEvent &event)
virtual void OnRemoveTrackWidthsClick(wxCommandEvent &event)
#define _(s)
virtual void OnRemoveViaSizesClick(wxCommandEvent &event)
const char * name
Definition: DXF_plotter.cpp:56
virtual void OnAddDiffPairsClick(wxCommandEvent &event)
virtual void OnAddTrackWidthsClick(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:53