KiCad PCB EDA Suite
dialog_board_statistics_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 
9 
11 
12 DIALOG_BOARD_STATISTICS_BASE::DIALOG_BOARD_STATISTICS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
13 {
14  this->SetSizeHints( wxDefaultSize, wxDefaultSize );
15 
16  wxBoxSizer* bMainBoxSizer;
17  bMainBoxSizer = new wxBoxSizer( wxVERTICAL );
18 
19  topNotebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
20  generalPanel = new wxPanel( topNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
21  wxBoxSizer* bGeneralPanelSizer;
22  bGeneralPanelSizer = new wxBoxSizer( wxVERTICAL );
23 
24  wxFlexGridSizer* fgSizerContents;
25  fgSizerContents = new wxFlexGridSizer( 0, 2, 0, 0 );
26  fgSizerContents->AddGrowableCol( 0 );
27  fgSizerContents->AddGrowableCol( 1 );
28  fgSizerContents->AddGrowableRow( 0 );
29  fgSizerContents->AddGrowableRow( 1 );
30  fgSizerContents->SetFlexibleDirection( wxBOTH );
31  fgSizerContents->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL );
32 
33  wxBoxSizer* bSizerComponents;
34  bSizerComponents = new wxBoxSizer( wxVERTICAL );
35 
36  wxStaticText* componentsLabel;
37  componentsLabel = new wxStaticText( generalPanel, wxID_ANY, _("Components"), wxDefaultPosition, wxDefaultSize, 0 );
38  componentsLabel->Wrap( -1 );
39  bSizerComponents->Add( componentsLabel, 0, wxALL, 5 );
40 
41  m_gridComponents = new wxGrid( generalPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL );
42 
43  // Grid
44  m_gridComponents->CreateGrid( 5, 4 );
45  m_gridComponents->EnableEditing( false );
46  m_gridComponents->EnableGridLines( false );
47  m_gridComponents->EnableDragGridSize( false );
48  m_gridComponents->SetMargins( 0, 0 );
49 
50  // Columns
51  m_gridComponents->EnableDragColMove( false );
52  m_gridComponents->EnableDragColSize( true );
53  m_gridComponents->SetColLabelSize( 0 );
54  m_gridComponents->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
55 
56  // Rows
57  m_gridComponents->EnableDragRowSize( true );
58  m_gridComponents->SetRowLabelSize( 0 );
59  m_gridComponents->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
60 
61  // Label Appearance
62  m_gridComponents->SetLabelFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
63 
64  // Cell Defaults
65  m_gridComponents->SetDefaultCellAlignment( wxALIGN_CENTER, wxALIGN_TOP );
66  m_gridComponents->SetMaxSize( wxSize( -1,300 ) );
67 
68  bSizerComponents->Add( m_gridComponents, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
69 
70 
71  fgSizerContents->Add( bSizerComponents, 1, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 );
72 
73  wxBoxSizer* bSizerPads;
74  bSizerPads = new wxBoxSizer( wxVERTICAL );
75 
76  wxStaticText* padsLabel;
77  padsLabel = new wxStaticText( generalPanel, wxID_ANY, _("Pads"), wxDefaultPosition, wxDefaultSize, 0 );
78  padsLabel->Wrap( -1 );
79  bSizerPads->Add( padsLabel, 0, wxALL, 5 );
80 
81  m_gridPads = new wxGrid( generalPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL );
82 
83  // Grid
84  m_gridPads->CreateGrid( 5, 2 );
85  m_gridPads->EnableEditing( false );
86  m_gridPads->EnableGridLines( false );
87  m_gridPads->EnableDragGridSize( false );
88  m_gridPads->SetMargins( 0, 0 );
89 
90  // Columns
91  m_gridPads->EnableDragColMove( false );
92  m_gridPads->EnableDragColSize( true );
93  m_gridPads->SetColLabelSize( 0 );
94  m_gridPads->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
95 
96  // Rows
97  m_gridPads->EnableDragRowSize( true );
98  m_gridPads->SetRowLabelSize( 0 );
99  m_gridPads->SetRowLabelAlignment( wxALIGN_RIGHT, wxALIGN_CENTER );
100 
101  // Label Appearance
102  m_gridPads->SetLabelFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
103 
104  // Cell Defaults
105  m_gridPads->SetDefaultCellAlignment( wxALIGN_CENTER, wxALIGN_TOP );
106  m_gridPads->SetMaxSize( wxSize( -1,300 ) );
107 
108  bSizerPads->Add( m_gridPads, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
109 
110 
111  fgSizerContents->Add( bSizerPads, 1, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 );
112 
113  wxBoxSizer* bSizerBrdSize;
114  bSizerBrdSize = new wxBoxSizer( wxVERTICAL );
115 
116  wxStaticText* boardLabel;
117  boardLabel = new wxStaticText( generalPanel, wxID_ANY, _("Board Size"), wxDefaultPosition, wxDefaultSize, 0 );
118  boardLabel->Wrap( -1 );
119  bSizerBrdSize->Add( boardLabel, 0, wxALL, 5 );
120 
121  m_gridBoard = new wxGrid( generalPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL );
122 
123  // Grid
124  m_gridBoard->CreateGrid( 3, 2 );
125  m_gridBoard->EnableEditing( false );
126  m_gridBoard->EnableGridLines( false );
127  m_gridBoard->EnableDragGridSize( false );
128  m_gridBoard->SetMargins( 0, 0 );
129 
130  // Columns
131  m_gridBoard->EnableDragColMove( false );
132  m_gridBoard->EnableDragColSize( true );
133  m_gridBoard->SetColLabelSize( 0 );
134  m_gridBoard->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
135 
136  // Rows
137  m_gridBoard->EnableDragRowSize( true );
138  m_gridBoard->SetRowLabelSize( 0 );
139  m_gridBoard->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
140 
141  // Label Appearance
142  m_gridBoard->SetLabelFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
143 
144  // Cell Defaults
145  m_gridBoard->SetDefaultCellAlignment( wxALIGN_CENTER, wxALIGN_TOP );
146  m_gridBoard->SetMaxSize( wxSize( -1,300 ) );
147 
148  bSizerBrdSize->Add( m_gridBoard, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
149 
150 
151  fgSizerContents->Add( bSizerBrdSize, 1, wxEXPAND|wxRIGHT, 5 );
152 
153  wxBoxSizer* bSizerVias;
154  bSizerVias = new wxBoxSizer( wxVERTICAL );
155 
156  viasLabel = new wxStaticText( generalPanel, wxID_ANY, _("Vias"), wxDefaultPosition, wxDefaultSize, 0 );
157  viasLabel->Wrap( -1 );
158  bSizerVias->Add( viasLabel, 0, wxALL, 5 );
159 
160  m_gridVias = new wxGrid( generalPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL );
161 
162  // Grid
163  m_gridVias->CreateGrid( 4, 2 );
164  m_gridVias->EnableEditing( false );
165  m_gridVias->EnableGridLines( false );
166  m_gridVias->EnableDragGridSize( false );
167  m_gridVias->SetMargins( 0, 0 );
168 
169  // Columns
170  m_gridVias->EnableDragColMove( false );
171  m_gridVias->EnableDragColSize( true );
172  m_gridVias->SetColLabelSize( 0 );
173  m_gridVias->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
174 
175  // Rows
176  m_gridVias->EnableDragRowSize( true );
177  m_gridVias->SetRowLabelSize( 0 );
178  m_gridVias->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
179 
180  // Label Appearance
181  m_gridVias->SetLabelFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
182 
183  // Cell Defaults
184  m_gridVias->SetDefaultCellAlignment( wxALIGN_CENTER, wxALIGN_TOP );
185  m_gridVias->SetMaxSize( wxSize( -1,300 ) );
186 
187  bSizerVias->Add( m_gridVias, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
188 
189 
190  fgSizerContents->Add( bSizerVias, 1, wxEXPAND|wxLEFT, 5 );
191 
192 
193  bGeneralPanelSizer->Add( fgSizerContents, 1, wxEXPAND, 5 );
194 
195  wxGridSizer* gOptionsSizer;
196  gOptionsSizer = new wxGridSizer( 0, 2, 0, 0 );
197 
198  m_checkBoxSubtractHoles = new wxCheckBox( generalPanel, wxID_ANY, _("Subtract holes from board area"), wxDefaultPosition, wxDefaultSize, 0 );
199  gOptionsSizer->Add( m_checkBoxSubtractHoles, 0, wxALL|wxEXPAND, 5 );
200 
201  m_checkBoxExcludeComponentsNoPins = new wxCheckBox( generalPanel, wxID_ANY, _("Exclude components with no pins"), wxDefaultPosition, wxDefaultSize, 0 );
202  gOptionsSizer->Add( m_checkBoxExcludeComponentsNoPins, 0, wxALL|wxEXPAND, 5 );
203 
204 
205  bGeneralPanelSizer->Add( gOptionsSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 );
206 
207 
208  generalPanel->SetSizer( bGeneralPanelSizer );
209  generalPanel->Layout();
210  bGeneralPanelSizer->Fit( generalPanel );
211  topNotebook->AddPage( generalPanel, _("General"), true );
212  drillsPanel = new wxPanel( topNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
213  wxBoxSizer* bDrillsSizer;
214  bDrillsSizer = new wxBoxSizer( wxVERTICAL );
215 
216  m_gridDrills = new wxGrid( drillsPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
217 
218  // Grid
219  m_gridDrills->CreateGrid( 0, 8 );
220  m_gridDrills->EnableEditing( false );
221  m_gridDrills->EnableGridLines( true );
222  m_gridDrills->EnableDragGridSize( true );
223  m_gridDrills->SetMargins( 0, 0 );
224 
225  // Columns
226  m_gridDrills->AutoSizeColumns();
227  m_gridDrills->EnableDragColMove( true );
228  m_gridDrills->EnableDragColSize( true );
229  m_gridDrills->SetColLabelSize( 20 );
230  m_gridDrills->SetColLabelValue( 0, _("Count") );
231  m_gridDrills->SetColLabelValue( 1, _("Shape") );
232  m_gridDrills->SetColLabelValue( 2, _("X Size") );
233  m_gridDrills->SetColLabelValue( 3, _("Y Size") );
234  m_gridDrills->SetColLabelValue( 4, _("Plated") );
235  m_gridDrills->SetColLabelValue( 5, _("Via/Pad") );
236  m_gridDrills->SetColLabelValue( 6, _("Start Layer") );
237  m_gridDrills->SetColLabelValue( 7, _("Stop Layer") );
238  m_gridDrills->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
239 
240  // Rows
241  m_gridDrills->EnableDragRowSize( true );
242  m_gridDrills->SetRowLabelSize( 0 );
243  m_gridDrills->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
244 
245  // Label Appearance
246  m_gridDrills->SetLabelFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
247 
248  // Cell Defaults
249  m_gridDrills->SetDefaultCellAlignment( wxALIGN_CENTER, wxALIGN_TOP );
250  m_gridDrills->SetMaxSize( wxSize( -1,300 ) );
251 
252  bDrillsSizer->Add( m_gridDrills, 1, wxALL|wxEXPAND, 5 );
253 
254 
255  drillsPanel->SetSizer( bDrillsSizer );
256  drillsPanel->Layout();
257  bDrillsSizer->Fit( drillsPanel );
258  topNotebook->AddPage( drillsPanel, _("Drill Holes"), false );
259 
260  bMainBoxSizer->Add( topNotebook, 1, wxEXPAND | wxALL, 5 );
261 
262  wxBoxSizer* bSizerBottom;
263  bSizerBottom = new wxBoxSizer( wxHORIZONTAL );
264 
265  m_buttonSaveReport = new wxButton( this, wxID_ANY, _("Generate Report File..."), wxDefaultPosition, wxDefaultSize, 0 );
266  bSizerBottom->Add( m_buttonSaveReport, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 15 );
267 
268  m_sdbControlSizer = new wxStdDialogButtonSizer();
269  m_sdbControlSizerCancel = new wxButton( this, wxID_CANCEL );
271  m_sdbControlSizer->Realize();
272 
273  bSizerBottom->Add( m_sdbControlSizer, 1, wxBOTTOM|wxLEFT|wxRIGHT|wxTOP, 5 );
274 
275 
276  bMainBoxSizer->Add( bSizerBottom, 0, wxEXPAND, 5 );
277 
278 
279  this->SetSizer( bMainBoxSizer );
280  this->Layout();
281  bMainBoxSizer->Fit( this );
282 
283  this->Centre( wxBOTH );
284 
285  // Connect Events
286  this->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_BOARD_STATISTICS_BASE::windowSize ) );
287  m_checkBoxSubtractHoles->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BOARD_STATISTICS_BASE::checkboxClicked ), NULL, this );
288  m_checkBoxExcludeComponentsNoPins->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BOARD_STATISTICS_BASE::checkboxClicked ), NULL, this );
289  m_gridDrills->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_BOARD_STATISTICS_BASE::drillGridSize ), NULL, this );
290  m_buttonSaveReport->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOARD_STATISTICS_BASE::saveReportClicked ), NULL, this );
291 }
292 
294 {
295  // Disconnect Events
296  this->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_BOARD_STATISTICS_BASE::windowSize ) );
297  m_checkBoxSubtractHoles->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BOARD_STATISTICS_BASE::checkboxClicked ), NULL, this );
298  m_checkBoxExcludeComponentsNoPins->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BOARD_STATISTICS_BASE::checkboxClicked ), NULL, this );
299  m_gridDrills->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_BOARD_STATISTICS_BASE::drillGridSize ), NULL, this );
300  m_buttonSaveReport->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOARD_STATISTICS_BASE::saveReportClicked ), NULL, this );
301 
302 }
virtual void windowSize(wxSizeEvent &event)
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:83
virtual void saveReportClicked(wxCommandEvent &event)
#define NULL
DIALOG_BOARD_STATISTICS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Board Statistics"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
virtual void drillGridSize(wxSizeEvent &event)
#define _(s)
Definition: 3d_actions.cpp:33
virtual void checkboxClicked(wxCommandEvent &event)
wxStdDialogButtonSizer * m_sdbControlSizer