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