diff --git a/pcbnew/dialogs/dialog_board_statistics.cpp b/pcbnew/dialogs/dialog_board_statistics.cpp index 0dd1e8b9ba..00d8b712b9 100644 --- a/pcbnew/dialogs/dialog_board_statistics.cpp +++ b/pcbnew/dialogs/dialog_board_statistics.cpp @@ -45,8 +45,8 @@ */ struct DIALOG_BOARD_STATISTICS_SAVED_STATE { - DIALOG_BOARD_STATISTICS_SAVED_STATE() - : excludeNoPins( false ), + DIALOG_BOARD_STATISTICS_SAVED_STATE() : + excludeNoPins( false ), subtractHoles( false ), saveReportInitialized(false) { @@ -66,8 +66,8 @@ struct DIALOG_BOARD_STATISTICS_SAVED_STATE static DIALOG_BOARD_STATISTICS_SAVED_STATE s_savedDialogState; -DIALOG_BOARD_STATISTICS::DIALOG_BOARD_STATISTICS( PCB_EDIT_FRAME* aParentFrame ) - : DIALOG_BOARD_STATISTICS_BASE( aParentFrame ) +DIALOG_BOARD_STATISTICS::DIALOG_BOARD_STATISTICS( PCB_EDIT_FRAME* aParentFrame ) : + DIALOG_BOARD_STATISTICS_BASE( aParentFrame ) { m_parentFrame = aParentFrame; @@ -104,9 +104,8 @@ DIALOG_BOARD_STATISTICS::DIALOG_BOARD_STATISTICS( PCB_EDIT_FRAME* aParentFrame ) wxFileName fn = m_parentFrame->GetBoard()->GetFileName(); - if( !s_savedDialogState.saveReportInitialized || - s_savedDialogState.m_project != Prj().GetProjectFullName() - ) + if( !s_savedDialogState.saveReportInitialized + || s_savedDialogState.m_project != Prj().GetProjectFullName() ) { fn.SetName( fn.GetName() + "_report" ); fn.SetExt( "txt" ); @@ -154,6 +153,7 @@ void DIALOG_BOARD_STATISTICS::refreshItemsTypes() m_gridPads->AppendRows( appendRows ); appendRows = m_viasTypes.size() + 1 - m_gridVias->GetNumberRows(); + if( appendRows ) m_gridVias->AppendRows( appendRows ); } @@ -257,13 +257,14 @@ void DIALOG_BOARD_STATISTICS::getDataFromPCB() int outlinesCount = polySet.OutlineCount(); for( int i = 0; i < outlinesCount; i++ ) { - auto& outline = polySet.Outline( i ); + SHAPE_LINE_CHAIN& outline = polySet.Outline( i ); m_boardArea += abs( outline.Area() ); // If checkbox "subtract holes" is checked if( m_checkBoxSubtractHoles->GetValue() ) { int holesCount = polySet.HoleCount( i ); + for( int j = 0; j < holesCount; j++ ) { m_boardArea -= abs( polySet.Hole( i, j ).Area() ); @@ -294,6 +295,7 @@ void DIALOG_BOARD_STATISTICS::updateWidets() { int totalPads = 0; int currentRow = 0; + for( auto& type : m_padsTypes ) { m_gridPads->SetCellValue( currentRow, COL_LABEL, type.title ); @@ -302,11 +304,13 @@ void DIALOG_BOARD_STATISTICS::updateWidets() totalPads += type.qty; currentRow++; } + m_gridPads->SetCellValue( currentRow, COL_LABEL, _( "Total:" ) ); m_gridPads->SetCellValue( currentRow, COL_AMOUNT, wxString::Format( "%i ", totalPads ) ); int totalVias = 0; currentRow = 0; + for( auto& type : m_viasTypes ) { m_gridVias->SetCellValue( currentRow, COL_LABEL, type.title ); @@ -315,6 +319,7 @@ void DIALOG_BOARD_STATISTICS::updateWidets() totalVias += type.qty; currentRow++; } + m_gridVias->SetCellValue( currentRow, COL_LABEL, _( "Total:" ) ); m_gridVias->SetCellValue( currentRow, COL_AMOUNT, wxString::Format( "%i ", totalVias ) ); @@ -324,6 +329,7 @@ void DIALOG_BOARD_STATISTICS::updateWidets() // We don't use row 0, as there labels are currentRow = 1; + for( auto& type : m_componentsTypes ) { m_gridComponents->SetCellValue( currentRow, COL_LABEL, type.title ); @@ -342,18 +348,19 @@ void DIALOG_BOARD_STATISTICS::updateWidets() wxString::Format( "%i ", totalFront ) ); m_gridComponents->SetCellValue( currentRow, COL_BOTTOM_SIDE, wxString::Format( "%i ", totalBack ) ); - m_gridComponents->SetCellValue( - currentRow, COL_TOTAL, wxString::Format( "%i ", totalFront + totalBack ) ); + m_gridComponents->SetCellValue( currentRow, COL_TOTAL, + wxString::Format( "%i ", totalFront + totalBack ) ); if( m_hasOutline ) { m_gridBoard->SetCellValue( ROW_BOARD_WIDTH, COL_AMOUNT, - MessageTextFromValue( m_parentFrame->GetUserUnits(), m_boardWidth, false ) + " " ); + MessageTextFromValue( GetUserUnits(), m_boardWidth ) + " " ); m_gridBoard->SetCellValue( ROW_BOARD_HEIGHT, COL_AMOUNT, - MessageTextFromValue( m_parentFrame->GetUserUnits(), m_boardHeight, false ) + " " ); + MessageTextFromValue( GetUserUnits(), m_boardHeight ) + " " ); m_gridBoard->SetCellValue( ROW_BOARD_AREA, COL_AMOUNT, - wxString::Format( wxT( "%.3f %s²" ), m_boardArea, - GetAbbreviatedUnitsLabel( GetUserUnits(), false ) ) ); + wxString::Format( wxT( "%.3f %s²" ), + m_boardArea, + GetAbbreviatedUnitsLabel( GetUserUnits() ) ) ); } else { @@ -388,9 +395,11 @@ void DIALOG_BOARD_STATISTICS::saveReportClicked( wxCommandEvent& event ) wxFileName fn = m_parentFrame->GetBoard()->GetFileName(); boardName = fn.GetName(); - wxFileDialog saveFileDialog( this, _( "Save Report File" ), s_savedDialogState.saveReportFolder, - s_savedDialogState.saveReportName, TextFileWildcard(), - wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + wxFileDialog saveFileDialog( this, _( "Save Report File" ), + s_savedDialogState.saveReportFolder, + s_savedDialogState.saveReportName, + TextFileWildcard(), + wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); if( saveFileDialog.ShowModal() == wxID_CANCEL ) return; @@ -406,6 +415,7 @@ void DIALOG_BOARD_STATISTICS::saveReportClicked( wxCommandEvent& event ) DisplayErrorMessage( this, msg ); return; } + msg << _( "PCB statistics report" ) << "\n"; msg << _( "Date: " ) << wxDateTime::Now().Format() << "\n"; msg << _( "Project: " ) << Prj().GetProjectName() << "\n"; @@ -416,14 +426,10 @@ void DIALOG_BOARD_STATISTICS::saveReportClicked( wxCommandEvent& event ) if( m_hasOutline ) { - msg << _( "Width: " ) - << MessageTextFromValue( m_parentFrame->GetUserUnits(), m_boardWidth, false ) << "\n"; - msg << _( "Height: " ) - << MessageTextFromValue( m_parentFrame->GetUserUnits(), m_boardHeight, false ) << "\n"; - msg << _( "Area: " ) - << wxString::Format( wxT( "%.3f %s²" ), m_boardArea, - GetAbbreviatedUnitsLabel( GetUserUnits(), false ) ) - << "\n"; + msg << _( "Width: " ) << MessageTextFromValue( GetUserUnits(), m_boardWidth ) << "\n"; + msg << _( "Height: " ) << MessageTextFromValue( GetUserUnits(), m_boardHeight ) << "\n"; + msg << _( "Area: " ) << wxString::Format( wxT( "%.3f %s²" ), m_boardArea, + GetAbbreviatedUnitsLabel( GetUserUnits() ) ) << "\n"; } else { @@ -434,11 +440,13 @@ void DIALOG_BOARD_STATISTICS::saveReportClicked( wxCommandEvent& event ) msg << "\n"; msg << "Pads\n"; + for( auto& type : m_padsTypes ) msg << type.title << " " << type.qty << "\n"; msg << "\n"; msg << "Vias\n"; + for( auto& type : m_viasTypes ) msg << type.title << " " << type.qty << "\n"; @@ -447,12 +455,13 @@ void DIALOG_BOARD_STATISTICS::saveReportClicked( wxCommandEvent& event ) size_t colsWidth[4]; wxString columns[4] = { "", _( "Front Side" ), _( "Back Side" ), _( "Total" ) }; wxString tmp; + for( int i = 0; i < 4; i++ ) - { colsWidth[i] = columns[i].size(); - } + int frontTotal = 0; int backTotal = 0; + for( auto& type : m_componentsTypes ) { // Get maximum width for left label column @@ -473,26 +482,35 @@ void DIALOG_BOARD_STATISTICS::saveReportClicked( wxCommandEvent& event ) msg << "\n"; msg << _( "Components" ) << "\n"; tmp.Printf( "%-*s | %*s | %*s | %*s |\n", - colsWidth[0], columns[0], colsWidth[1], columns[1], - colsWidth[2], columns[2], colsWidth[3], columns[3] ); - msg += tmp; - for( auto& type : m_componentsTypes ) - { - tmp.Printf( "%-*s | %*d | %*d | %*d |\n", colsWidth[0], type.title, colsWidth[1], - type.frontSideQty, colsWidth[2], type.backSideQty, colsWidth[3], - type.backSideQty + type.frontSideQty ); - msg += tmp; - } - tmp.Printf( "%-*s | %*d | %*d | %*d |\n", colsWidth[0], _( "Total:" ), colsWidth[1], frontTotal, - colsWidth[2], backTotal, colsWidth[3], frontTotal + backTotal ); + colsWidth[0], columns[0], + colsWidth[1], columns[1], + colsWidth[2], columns[2], + colsWidth[3], columns[3] ); msg += tmp; - int success = fprintf( outFile, "%s", TO_UTF8( msg ) ); - if( success < 0 ) + for( auto& type : m_componentsTypes ) + { + tmp.Printf( "%-*s | %*d | %*d | %*d |\n", + colsWidth[0], type.title, + colsWidth[1], type.frontSideQty, + colsWidth[2], type.backSideQty, + colsWidth[3], type.backSideQty + type.frontSideQty ); + msg += tmp; + } + + tmp.Printf( "%-*s | %*d | %*d | %*d |\n", + colsWidth[0], _( "Total:" ), + colsWidth[1], frontTotal, + colsWidth[2], backTotal, + colsWidth[3], frontTotal + backTotal ); + msg += tmp; + + if( fprintf( outFile, "%s", TO_UTF8( msg ) ) < 0 ) { msg.Printf( _( "Error writing to file \"%s\"" ), saveFileDialog.GetPath() ); DisplayErrorMessage( this, msg ); } + fclose( outFile ); } diff --git a/pcbnew/dialogs/dialog_board_statistics_base.cpp b/pcbnew/dialogs/dialog_board_statistics_base.cpp index 229573b212..87fa24e09e 100644 --- a/pcbnew/dialogs/dialog_board_statistics_base.cpp +++ b/pcbnew/dialogs/dialog_board_statistics_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jul 10 2019) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -12,10 +12,10 @@ 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 ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - + wxBoxSizer* bMainBoxSizer; bMainBoxSizer = new wxBoxSizer( wxVERTICAL ); - + wxFlexGridSizer* fgSizerContents; fgSizerContents = new wxFlexGridSizer( 0, 2, 0, 0 ); fgSizerContents->AddGrowableCol( 0 ); @@ -24,213 +24,207 @@ DIALOG_BOARD_STATISTICS_BASE::DIALOG_BOARD_STATISTICS_BASE( wxWindow* parent, wx fgSizerContents->AddGrowableRow( 1 ); fgSizerContents->SetFlexibleDirection( wxBOTH ); fgSizerContents->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL ); - + wxBoxSizer* bSizerComponents; bSizerComponents = new wxBoxSizer( wxVERTICAL ); - + wxStaticText* componentsLabel; componentsLabel = new wxStaticText( this, wxID_ANY, _("Components"), wxDefaultPosition, wxDefaultSize, 0 ); componentsLabel->Wrap( -1 ); bSizerComponents->Add( componentsLabel, 0, wxALL, 5 ); - + m_gridComponents = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL ); - + // Grid m_gridComponents->CreateGrid( 5, 4 ); m_gridComponents->EnableEditing( false ); m_gridComponents->EnableGridLines( false ); m_gridComponents->EnableDragGridSize( false ); m_gridComponents->SetMargins( 0, 0 ); - + // Columns m_gridComponents->EnableDragColMove( false ); m_gridComponents->EnableDragColSize( true ); m_gridComponents->SetColLabelSize( 0 ); m_gridComponents->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); - + // Rows m_gridComponents->EnableDragRowSize( true ); m_gridComponents->SetRowLabelSize( 0 ); m_gridComponents->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); - + // Label Appearance m_gridComponents->SetLabelFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) ); - + // Cell Defaults m_gridComponents->SetDefaultCellAlignment( wxALIGN_CENTER, wxALIGN_TOP ); m_gridComponents->SetMaxSize( wxSize( -1,300 ) ); - + bSizerComponents->Add( m_gridComponents, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); - - - fgSizerContents->Add( bSizerComponents, 1, wxEXPAND, 5 ); - + + + fgSizerContents->Add( bSizerComponents, 1, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + wxBoxSizer* bSizerPads; bSizerPads = new wxBoxSizer( wxVERTICAL ); - + wxStaticText* padsLabel; padsLabel = new wxStaticText( this, wxID_ANY, _("Pads"), wxDefaultPosition, wxDefaultSize, 0 ); padsLabel->Wrap( -1 ); bSizerPads->Add( padsLabel, 0, wxALL, 5 ); - + m_gridPads = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL ); - + // Grid m_gridPads->CreateGrid( 5, 2 ); m_gridPads->EnableEditing( false ); m_gridPads->EnableGridLines( false ); m_gridPads->EnableDragGridSize( false ); m_gridPads->SetMargins( 0, 0 ); - + // Columns m_gridPads->EnableDragColMove( false ); m_gridPads->EnableDragColSize( true ); m_gridPads->SetColLabelSize( 0 ); m_gridPads->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); - + // Rows m_gridPads->EnableDragRowSize( true ); m_gridPads->SetRowLabelSize( 0 ); m_gridPads->SetRowLabelAlignment( wxALIGN_RIGHT, wxALIGN_CENTER ); - + // Label Appearance m_gridPads->SetLabelFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) ); - + // Cell Defaults m_gridPads->SetDefaultCellAlignment( wxALIGN_CENTER, wxALIGN_TOP ); m_gridPads->SetMaxSize( wxSize( -1,300 ) ); - + bSizerPads->Add( m_gridPads, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - fgSizerContents->Add( bSizerPads, 1, wxEXPAND, 5 ); - + + + fgSizerContents->Add( bSizerPads, 1, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 ); + wxBoxSizer* bSizerBrdSize; bSizerBrdSize = new wxBoxSizer( wxVERTICAL ); - + wxStaticText* boardLabel; boardLabel = new wxStaticText( this, wxID_ANY, _("Board Size"), wxDefaultPosition, wxDefaultSize, 0 ); boardLabel->Wrap( -1 ); bSizerBrdSize->Add( boardLabel, 0, wxALL, 5 ); - + m_gridBoard = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL ); - + // Grid m_gridBoard->CreateGrid( 3, 2 ); m_gridBoard->EnableEditing( false ); m_gridBoard->EnableGridLines( false ); m_gridBoard->EnableDragGridSize( false ); m_gridBoard->SetMargins( 0, 0 ); - + // Columns m_gridBoard->EnableDragColMove( false ); m_gridBoard->EnableDragColSize( true ); m_gridBoard->SetColLabelSize( 0 ); m_gridBoard->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); - + // Rows m_gridBoard->EnableDragRowSize( true ); m_gridBoard->SetRowLabelSize( 0 ); m_gridBoard->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); - + // Label Appearance m_gridBoard->SetLabelFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) ); - + // Cell Defaults m_gridBoard->SetDefaultCellAlignment( wxALIGN_CENTER, wxALIGN_TOP ); m_gridBoard->SetMaxSize( wxSize( -1,300 ) ); - + bSizerBrdSize->Add( m_gridBoard, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); - - - fgSizerContents->Add( bSizerBrdSize, 1, wxEXPAND, 5 ); - + + + fgSizerContents->Add( bSizerBrdSize, 1, wxEXPAND|wxRIGHT, 5 ); + wxBoxSizer* bSizerVias; bSizerVias = new wxBoxSizer( wxVERTICAL ); - + viasLabel = new wxStaticText( this, wxID_ANY, _("Vias"), wxDefaultPosition, wxDefaultSize, 0 ); viasLabel->Wrap( -1 ); bSizerVias->Add( viasLabel, 0, wxALL, 5 ); - + m_gridVias = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL ); - + // Grid m_gridVias->CreateGrid( 4, 2 ); m_gridVias->EnableEditing( false ); m_gridVias->EnableGridLines( false ); m_gridVias->EnableDragGridSize( false ); m_gridVias->SetMargins( 0, 0 ); - + // Columns m_gridVias->EnableDragColMove( false ); m_gridVias->EnableDragColSize( true ); m_gridVias->SetColLabelSize( 0 ); m_gridVias->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); - + // Rows m_gridVias->EnableDragRowSize( true ); m_gridVias->SetRowLabelSize( 0 ); m_gridVias->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); - + // Label Appearance m_gridVias->SetLabelFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) ); - + // Cell Defaults m_gridVias->SetDefaultCellAlignment( wxALIGN_CENTER, wxALIGN_TOP ); m_gridVias->SetMaxSize( wxSize( -1,300 ) ); - + bSizerVias->Add( m_gridVias, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); - - - fgSizerContents->Add( bSizerVias, 1, wxEXPAND, 5 ); - - + + + fgSizerContents->Add( bSizerVias, 1, wxEXPAND|wxLEFT, 5 ); + + bMainBoxSizer->Add( fgSizerContents, 1, wxEXPAND|wxLEFT|wxRIGHT, 10 ); - - m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bMainBoxSizer->Add( m_staticline1, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 ); - + wxGridSizer* gOptionsSizer; gOptionsSizer = new wxGridSizer( 0, 2, 0, 0 ); - + m_checkBoxSubtractHoles = new wxCheckBox( this, wxID_ANY, _("Subtract holes from board area"), wxDefaultPosition, wxDefaultSize, 0 ); gOptionsSizer->Add( m_checkBoxSubtractHoles, 0, wxALL|wxEXPAND, 5 ); - + m_checkBoxExcludeComponentsNoPins = new wxCheckBox( this, wxID_ANY, _("Exclude components with no pins"), wxDefaultPosition, wxDefaultSize, 0 ); gOptionsSizer->Add( m_checkBoxExcludeComponentsNoPins, 0, wxALL|wxEXPAND, 5 ); - - - bMainBoxSizer->Add( gOptionsSizer, 0, wxEXPAND|wxLEFT|wxRIGHT, 10 ); - + + + bMainBoxSizer->Add( gOptionsSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 ); + m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bMainBoxSizer->Add( m_staticline2, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 ); - + wxBoxSizer* bSizerBottom; bSizerBottom = new wxBoxSizer( wxHORIZONTAL ); - - - bSizerBottom->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_buttonSaveReport = new wxButton( this, wxID_ANY, _("Generate Report File"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerBottom->Add( m_buttonSaveReport, 0, wxALL, 5 ); - + + m_buttonSaveReport = new wxButton( this, wxID_ANY, _("Generate Report File..."), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerBottom->Add( m_buttonSaveReport, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 15 ); + m_sdbControlSizer = new wxStdDialogButtonSizer(); m_sdbControlSizerCancel = new wxButton( this, wxID_CANCEL ); m_sdbControlSizer->AddButton( m_sdbControlSizerCancel ); m_sdbControlSizer->Realize(); - - bSizerBottom->Add( m_sdbControlSizer, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxTOP, 5 ); - - + + bSizerBottom->Add( m_sdbControlSizer, 1, wxBOTTOM|wxLEFT|wxRIGHT|wxTOP, 5 ); + + bMainBoxSizer->Add( bSizerBottom, 0, wxEXPAND, 5 ); - - + + this->SetSizer( bMainBoxSizer ); this->Layout(); bMainBoxSizer->Fit( this ); - + this->Centre( wxBOTH ); - + // Connect Events m_checkBoxSubtractHoles->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BOARD_STATISTICS_BASE::checkboxClicked ), NULL, this ); m_checkBoxExcludeComponentsNoPins->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BOARD_STATISTICS_BASE::checkboxClicked ), NULL, this ); @@ -243,5 +237,5 @@ DIALOG_BOARD_STATISTICS_BASE::~DIALOG_BOARD_STATISTICS_BASE() m_checkBoxSubtractHoles->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BOARD_STATISTICS_BASE::checkboxClicked ), NULL, this ); m_checkBoxExcludeComponentsNoPins->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BOARD_STATISTICS_BASE::checkboxClicked ), NULL, this ); m_buttonSaveReport->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOARD_STATISTICS_BASE::saveReportClicked ), NULL, this ); - + } diff --git a/pcbnew/dialogs/dialog_board_statistics_base.fbp b/pcbnew/dialogs/dialog_board_statistics_base.fbp index b8c02acd4e..af55a060d8 100644 --- a/pcbnew/dialogs/dialog_board_statistics_base.fbp +++ b/pcbnew/dialogs/dialog_board_statistics_base.fbp @@ -1,6 +1,6 @@ - + ; C++ @@ -14,8 +14,6 @@ dialog_board_statistics_base 1000 none - - 1 DIALOG_BOARD_STATISTCS_BASE @@ -26,7 +24,6 @@ 1 1 UI - 0 0 0 @@ -55,6 +52,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bMainBoxSizer @@ -78,7 +111,7 @@ 0 5 - wxEXPAND + wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT 1 @@ -118,7 +151,6 @@ 0 wxID_ANY Components - 0 0 @@ -144,6 +176,29 @@ -1 + + + + + + + + + + + + + + + + + + + + + + + @@ -232,13 +287,68 @@ wxVSCROLL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 - wxEXPAND + wxEXPAND|wxTOP|wxBOTTOM|wxLEFT 1 @@ -278,7 +388,6 @@ 0 wxID_ANY Pads - 0 0 @@ -304,6 +413,29 @@ -1 + + + + + + + + + + + + + + + + + + + + + + + @@ -392,13 +524,68 @@ wxVSCROLL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 - wxEXPAND + wxEXPAND|wxRIGHT 1 @@ -438,7 +625,6 @@ 0 wxID_ANY Board Size - 0 0 @@ -464,6 +650,29 @@ -1 + + + + + + + + + + + + + + + + + + + + + + + @@ -552,13 +761,68 @@ wxVSCROLL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 - wxEXPAND + wxEXPAND|wxLEFT 1 @@ -598,7 +862,6 @@ 0 wxID_ANY Vias - 0 0 @@ -624,6 +887,29 @@ -1 + + + + + + + + + + + + + + + + + + + + + + + @@ -712,6 +998,61 @@ wxVSCROLL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -720,65 +1061,7 @@ 10 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline1 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - ; forward_declare - 0 - - - - - - - - 10 - wxEXPAND|wxLEFT|wxRIGHT + wxEXPAND|wxTOP|wxRIGHT|wxLEFT 0 2 @@ -850,7 +1133,30 @@ + checkboxClicked + + + + + + + + + + + + + + + + + + + + + + @@ -915,7 +1221,30 @@ + checkboxClicked + + + + + + + + + + + + + + + + + + + + + + @@ -976,6 +1305,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -988,18 +1340,8 @@ wxHORIZONTAL none - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxALL + 15 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -1012,31 +1354,25 @@ - 1 0 1 1 - 0 0 - Dock 0 Left 1 1 - 0 0 wxID_ANY - Generate Report File - - 0 + Generate Report File... 0 @@ -1051,8 +1387,6 @@ protected 1 - - Resizable 1 @@ -1068,12 +1402,35 @@ saveReportClicked + + + + + + + + + + + + + + + + + + + + + + + 5 wxBOTTOM|wxLEFT|wxRIGHT|wxTOP - 0 + 1 0 1 @@ -1086,6 +1443,14 @@ m_sdbControlSizer protected + + + + + + + + diff --git a/pcbnew/dialogs/dialog_board_statistics_base.h b/pcbnew/dialogs/dialog_board_statistics_base.h index 3c5d133fe1..3f896c2827 100644 --- a/pcbnew/dialogs/dialog_board_statistics_base.h +++ b/pcbnew/dialogs/dialog_board_statistics_base.h @@ -1,11 +1,12 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jul 10 2019) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#pragma once +#ifndef __DIALOG_BOARD_STATISTICS_BASE_H__ +#define __DIALOG_BOARD_STATISTICS_BASE_H__ #include #include @@ -19,11 +20,8 @@ #include #include #include -#include #include -#include -#include -#include +#include #include #include @@ -36,30 +34,30 @@ class DIALOG_BOARD_STATISTICS_BASE : public DIALOG_SHIM { private: - + protected: wxGrid* m_gridComponents; wxGrid* m_gridPads; wxGrid* m_gridBoard; wxStaticText* viasLabel; wxGrid* m_gridVias; - wxStaticLine* m_staticline1; wxCheckBox* m_checkBoxSubtractHoles; wxCheckBox* m_checkBoxExcludeComponentsNoPins; wxStaticLine* m_staticline2; wxButton* m_buttonSaveReport; wxStdDialogButtonSizer* m_sdbControlSizer; wxButton* m_sdbControlSizerCancel; - + // Virtual event handlers, overide them in your derived class virtual void checkboxClicked( wxCommandEvent& event ) { event.Skip(); } virtual void saveReportClicked( wxCommandEvent& event ) { event.Skip(); } - - + + public: - - 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 ); + + 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 ); ~DIALOG_BOARD_STATISTICS_BASE(); - + }; +#endif //__DIALOG_BOARD_STATISTICS_BASE_H__