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 
8 #include "widgets/wx_grid.h"
9 
11 
13 
14 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 )
15 {
16  this->SetSizeHints( wxDefaultSize, wxDefaultSize );
17 
18  wxBoxSizer* bMainBoxSizer;
19  bMainBoxSizer = new wxBoxSizer( wxVERTICAL );
20 
21  topNotebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
22  m_generalPanel = new wxPanel( topNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
23  wxBoxSizer* bGeneralPanelSizer;
24  bGeneralPanelSizer = new wxBoxSizer( wxVERTICAL );
25 
26  wxFlexGridSizer* fgSizerContents;
27  fgSizerContents = new wxFlexGridSizer( 0, 2, 0, 0 );
28  fgSizerContents->AddGrowableCol( 0 );
29  fgSizerContents->AddGrowableCol( 1 );
30  fgSizerContents->AddGrowableRow( 0 );
31  fgSizerContents->AddGrowableRow( 1 );
32  fgSizerContents->SetFlexibleDirection( wxBOTH );
33  fgSizerContents->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL );
34 
35  wxBoxSizer* bSizerComponents;
36  bSizerComponents = new wxBoxSizer( wxVERTICAL );
37 
38  wxStaticText* componentsLabel;
39  componentsLabel = new wxStaticText( m_generalPanel, wxID_ANY, _("Components"), wxDefaultPosition, wxDefaultSize, 0 );
40  componentsLabel->Wrap( -1 );
41  bSizerComponents->Add( componentsLabel, 0, wxALL, 5 );
42 
43  m_gridComponents = new wxGrid( m_generalPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL );
44 
45  // Grid
46  m_gridComponents->CreateGrid( 5, 4 );
47  m_gridComponents->EnableEditing( false );
48  m_gridComponents->EnableGridLines( false );
49  m_gridComponents->EnableDragGridSize( false );
50  m_gridComponents->SetMargins( 0, 0 );
51 
52  // Columns
53  m_gridComponents->EnableDragColMove( false );
54  m_gridComponents->EnableDragColSize( true );
55  m_gridComponents->SetColLabelSize( 0 );
56  m_gridComponents->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
57 
58  // Rows
59  m_gridComponents->EnableDragRowSize( true );
60  m_gridComponents->SetRowLabelSize( 0 );
61  m_gridComponents->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
62 
63  // Label Appearance
64  m_gridComponents->SetLabelFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
65 
66  // Cell Defaults
67  m_gridComponents->SetDefaultCellAlignment( wxALIGN_CENTER, wxALIGN_TOP );
68  m_gridComponents->SetMaxSize( wxSize( -1,300 ) );
69 
70  bSizerComponents->Add( m_gridComponents, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
71 
72 
73  fgSizerContents->Add( bSizerComponents, 1, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 );
74 
75  wxBoxSizer* bSizerPads;
76  bSizerPads = new wxBoxSizer( wxVERTICAL );
77 
78  wxStaticText* padsLabel;
79  padsLabel = new wxStaticText( m_generalPanel, wxID_ANY, _("Pads"), wxDefaultPosition, wxDefaultSize, 0 );
80  padsLabel->Wrap( -1 );
81  bSizerPads->Add( padsLabel, 0, wxALL, 5 );
82 
83  m_gridPads = new wxGrid( m_generalPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL );
84 
85  // Grid
86  m_gridPads->CreateGrid( 5, 2 );
87  m_gridPads->EnableEditing( false );
88  m_gridPads->EnableGridLines( false );
89  m_gridPads->EnableDragGridSize( false );
90  m_gridPads->SetMargins( 0, 0 );
91 
92  // Columns
93  m_gridPads->EnableDragColMove( false );
94  m_gridPads->EnableDragColSize( true );
95  m_gridPads->SetColLabelSize( 0 );
96  m_gridPads->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
97 
98  // Rows
99  m_gridPads->EnableDragRowSize( true );
100  m_gridPads->SetRowLabelSize( 0 );
101  m_gridPads->SetRowLabelAlignment( wxALIGN_RIGHT, wxALIGN_CENTER );
102 
103  // Label Appearance
104  m_gridPads->SetLabelFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
105 
106  // Cell Defaults
107  m_gridPads->SetDefaultCellAlignment( wxALIGN_CENTER, wxALIGN_TOP );
108  m_gridPads->SetMaxSize( wxSize( -1,300 ) );
109 
110  bSizerPads->Add( m_gridPads, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
111 
112 
113  fgSizerContents->Add( bSizerPads, 1, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 );
114 
115  wxBoxSizer* bSizerBrdSize;
116  bSizerBrdSize = new wxBoxSizer( wxVERTICAL );
117 
118  wxStaticText* boardLabel;
119  boardLabel = new wxStaticText( m_generalPanel, wxID_ANY, _("Board Size"), wxDefaultPosition, wxDefaultSize, 0 );
120  boardLabel->Wrap( -1 );
121  bSizerBrdSize->Add( boardLabel, 0, wxALL, 5 );
122 
123  m_gridBoard = new wxGrid( m_generalPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL );
124 
125  // Grid
126  m_gridBoard->CreateGrid( 3, 2 );
127  m_gridBoard->EnableEditing( false );
128  m_gridBoard->EnableGridLines( false );
129  m_gridBoard->EnableDragGridSize( false );
130  m_gridBoard->SetMargins( 0, 0 );
131 
132  // Columns
133  m_gridBoard->EnableDragColMove( false );
134  m_gridBoard->EnableDragColSize( true );
135  m_gridBoard->SetColLabelSize( 0 );
136  m_gridBoard->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
137 
138  // Rows
139  m_gridBoard->EnableDragRowSize( true );
140  m_gridBoard->SetRowLabelSize( 0 );
141  m_gridBoard->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
142 
143  // Label Appearance
144  m_gridBoard->SetLabelFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
145 
146  // Cell Defaults
147  m_gridBoard->SetDefaultCellAlignment( wxALIGN_CENTER, wxALIGN_TOP );
148  m_gridBoard->SetMaxSize( wxSize( -1,300 ) );
149 
150  bSizerBrdSize->Add( m_gridBoard, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
151 
152 
153  fgSizerContents->Add( bSizerBrdSize, 1, wxEXPAND|wxRIGHT, 5 );
154 
155  wxBoxSizer* bSizerVias;
156  bSizerVias = new wxBoxSizer( wxVERTICAL );
157 
158  viasLabel = new wxStaticText( m_generalPanel, wxID_ANY, _("Vias"), wxDefaultPosition, wxDefaultSize, 0 );
159  viasLabel->Wrap( -1 );
160  bSizerVias->Add( viasLabel, 0, wxALL, 5 );
161 
162  m_gridVias = new wxGrid( m_generalPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL );
163 
164  // Grid
165  m_gridVias->CreateGrid( 4, 2 );
166  m_gridVias->EnableEditing( false );
167  m_gridVias->EnableGridLines( false );
168  m_gridVias->EnableDragGridSize( false );
169  m_gridVias->SetMargins( 0, 0 );
170 
171  // Columns
172  m_gridVias->EnableDragColMove( false );
173  m_gridVias->EnableDragColSize( true );
174  m_gridVias->SetColLabelSize( 0 );
175  m_gridVias->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
176 
177  // Rows
178  m_gridVias->EnableDragRowSize( true );
179  m_gridVias->SetRowLabelSize( 0 );
180  m_gridVias->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
181 
182  // Label Appearance
183  m_gridVias->SetLabelFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
184 
185  // Cell Defaults
186  m_gridVias->SetDefaultCellAlignment( wxALIGN_CENTER, wxALIGN_TOP );
187  m_gridVias->SetMaxSize( wxSize( -1,300 ) );
188 
189  bSizerVias->Add( m_gridVias, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
190 
191 
192  fgSizerContents->Add( bSizerVias, 1, wxEXPAND|wxLEFT, 5 );
193 
194 
195  bGeneralPanelSizer->Add( fgSizerContents, 1, wxEXPAND, 5 );
196 
197  wxGridSizer* gOptionsSizer;
198  gOptionsSizer = new wxGridSizer( 0, 2, 0, 0 );
199 
200  m_checkBoxSubtractHoles = new wxCheckBox( m_generalPanel, wxID_ANY, _("Subtract holes from board area"), wxDefaultPosition, wxDefaultSize, 0 );
201  gOptionsSizer->Add( m_checkBoxSubtractHoles, 0, wxALL|wxEXPAND, 5 );
202 
203  m_checkBoxExcludeComponentsNoPins = new wxCheckBox( m_generalPanel, wxID_ANY, _("Exclude components with no pins"), wxDefaultPosition, wxDefaultSize, 0 );
204  gOptionsSizer->Add( m_checkBoxExcludeComponentsNoPins, 0, wxALL|wxEXPAND, 5 );
205 
206 
207  bGeneralPanelSizer->Add( gOptionsSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 );
208 
209 
210  m_generalPanel->SetSizer( bGeneralPanelSizer );
211  m_generalPanel->Layout();
212  bGeneralPanelSizer->Fit( m_generalPanel );
213  topNotebook->AddPage( m_generalPanel, _("General"), true );
214  m_drillsPanel = new wxPanel( topNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
215  wxBoxSizer* bDrillsSizer;
216  bDrillsSizer = new wxBoxSizer( wxVERTICAL );
217 
218  m_gridDrills = new WX_GRID( m_drillsPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
219 
220  // Grid
221  m_gridDrills->CreateGrid( 0, 8 );
222  m_gridDrills->EnableEditing( false );
223  m_gridDrills->EnableGridLines( true );
224  m_gridDrills->EnableDragGridSize( false );
225  m_gridDrills->SetMargins( 0, 0 );
226 
227  // Columns
228  m_gridDrills->AutoSizeColumns();
229  m_gridDrills->EnableDragColMove( true );
230  m_gridDrills->EnableDragColSize( true );
232  m_gridDrills->SetColLabelValue( 0, _("Count") );
233  m_gridDrills->SetColLabelValue( 1, _("Shape") );
234  m_gridDrills->SetColLabelValue( 2, _("X Size") );
235  m_gridDrills->SetColLabelValue( 3, _("Y Size") );
236  m_gridDrills->SetColLabelValue( 4, _("Plated") );
237  m_gridDrills->SetColLabelValue( 5, _("Via/Pad") );
238  m_gridDrills->SetColLabelValue( 6, _("Start Layer") );
239  m_gridDrills->SetColLabelValue( 7, _("Stop Layer") );
240  m_gridDrills->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
241 
242  // Rows
243  m_gridDrills->EnableDragRowSize( false );
244  m_gridDrills->SetRowLabelSize( 0 );
245  m_gridDrills->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
246 
247  // Label Appearance
248  m_gridDrills->SetLabelFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
249 
250  // Cell Defaults
251  m_gridDrills->SetDefaultCellAlignment( wxALIGN_CENTER, wxALIGN_TOP );
252  bDrillsSizer->Add( m_gridDrills, 1, wxALL|wxEXPAND, 5 );
253 
254 
255  m_drillsPanel->SetSizer( bDrillsSizer );
256  m_drillsPanel->Layout();
257  bDrillsSizer->Fit( m_drillsPanel );
258  topNotebook->AddPage( m_drillsPanel, _("Drill Holes"), false );
259 
260  bMainBoxSizer->Add( topNotebook, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 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:82
virtual void saveReportClicked(wxCommandEvent &event)
#define _(s)
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)
virtual void checkboxClicked(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
wxStdDialogButtonSizer * m_sdbControlSizer