From 29e3e55ad303f49b7fcb531b9af3fcab2e89ef49 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 25 Apr 2017 12:55:49 +1000 Subject: [PATCH] Removed BOM functionality - Removed ability to generate BOM to file - Removed Save/Cancel window when closing table - No longer updates table table is closed - Bugfix for field names (previously comparison was case insensitive) --- eeschema/CMakeLists.txt | 5 +- eeschema/bom_exporter.cpp | 420 -------------------- eeschema/bom_exporter.h | 123 ------ eeschema/bom_table_column.cpp | 2 +- eeschema/bom_table_model.cpp | 10 +- eeschema/dialogs/dialog_bom_editor.cpp | 178 ++------- eeschema/dialogs/dialog_bom_editor.h | 8 +- eeschema/dialogs/dialog_bom_editor_base.cpp | 38 +- eeschema/dialogs/dialog_bom_editor_base.fbp | 314 +-------------- eeschema/dialogs/dialog_bom_editor_base.h | 14 +- 10 files changed, 44 insertions(+), 1068 deletions(-) delete mode 100644 eeschema/bom_exporter.cpp delete mode 100644 eeschema/bom_exporter.h diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index fd1135eaa2..8624b1b366 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -25,8 +25,8 @@ set( EESCHEMA_DLGS dialogs/dialog_annotate_base.cpp dialogs/dialog_bom.cpp dialogs/dialog_bom_base.cpp - dialogs/dialog_bom_editor.cpp - dialogs/dialog_bom_editor_base.cpp + dialogs/dialog_bom_editor.cpp + dialogs/dialog_bom_editor_base.cpp dialogs/dialog_bom_cfg_keywords.cpp dialogs/dialog_choose_component.cpp dialogs/dialog_lib_edit_text.cpp @@ -87,7 +87,6 @@ set( EESCHEMA_SRCS backanno.cpp block.cpp block_libedit.cpp - bom_exporter.cpp bom_table_model.cpp bom_table_column.cpp busentry.cpp diff --git a/eeschema/bom_exporter.cpp b/eeschema/bom_exporter.cpp deleted file mode 100644 index 0c2a43f437..0000000000 --- a/eeschema/bom_exporter.cpp +++ /dev/null @@ -1,420 +0,0 @@ -/* -* This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2017 Oliver Walters - * Copyright (C) 2017 KiCad Developers, see CHANGELOG.TXT for contributors. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "bom_exporter.h" - -/** - * BOM_FILE_WRITER class (pure virtual) - */ -BOM_FILE_WRITER::BOM_FILE_WRITER() : - m_includeExtraData( true ), - m_showRowNumbers( true ) -{ -} - -void BOM_FILE_WRITER::SetHeader( const wxArrayString aHeader ) -{ - m_bomHeader = aHeader; -} - -void BOM_FILE_WRITER::AddLine( wxArrayString aLine ) -{ - m_bomLines.push_back( aLine ); -} - -/** - * Function ExtraDataPairs - * Format extra data for writing to file - */ -wxArrayString BOM_FILE_WRITER::ExtraDataPairs() -{ - wxArrayString pairs; - - if( m_groupCount != m_componentCount ) - { - pairs.Add( DataPair( _( "Group Count" ), m_groupCount ) ); - } - - pairs.Add( DataPair( _( "Component Count" ), m_componentCount ) ); - pairs.Add( DataPair( _( "Schematic Title" ), m_schematicTitle ) ); - pairs.Add( DataPair( _( "Schematic Date" ), m_schematicDate ) ); - pairs.Add( DataPair( _( "Schematic Version" ), m_schematicVersion ) ); - pairs.Add( DataPair( _( "KiCad Version" ), m_kicadVersion ) ); - - return pairs; -} - -BOM_CSV_WRITER::BOM_CSV_WRITER( wxChar aDelim ) : - BOM_FILE_WRITER() -{ - m_delim = aDelim; -} - -/** - * Function WriteToFile - * Write delimited data to file - */ -bool BOM_CSV_WRITER::WriteToFile( wxFile& aFile ) -{ - - // Generate table header - wxString line = wxJoin( EscapeLine( m_bomHeader ), m_delim )+ "\n"; - - if( m_showRowNumbers ) - { - line = m_delim + line; - } - - if( !aFile.Write( line )) - { - return false; - } - - // Write each line in the file - for( unsigned int ii=0; ii\n" ) ) - return false; - - if( !aFile.Write( TableHeader( m_bomHeader ) ) ) - return false; - - // Write each line of the BOM - for( unsigned int ii=0; ii\n" ) ) - return false; - - if( !aFile.Write( HtmlFooter() ) ) - return false; - - return true; -} - -wxString BOM_HTML_WRITER::HtmlHeader() -{ - wxString header = wxEmptyString; - - header += "\n\n"; - //TODO - Project title - header += ""; - header += m_schematicTitle; - header += "\n"; - - header += HtmlMetaTag( "charset", "UTF-8" ) + "\n"; - - //TODO - KiCad reference data here - - header += "\n\n"; - - header += "\n"; - - return header; -} - -wxString BOM_HTML_WRITER::HtmlFooter() -{ - wxString footer = wxEmptyString; - - footer += "\n\n"; - footer += "\n"; - - return footer; -} - -wxString BOM_HTML_WRITER::HtmlMetaTag( const wxString aTitle, const wxString aData ) -{ - wxString tag = "\n"; - - for( wxString pair : ExtraDataPairs() ) - { - extra += pair + "\n"; - } - - extra += "\n"; - - return extra; -} - -/** - * Function LinkText - * Automatically detect linkable text, and wrap it in tag - * @aText - Text to (potentially) link - */ -wxString BOM_HTML_WRITER::LinkText( const wxString& aText ) -{ - // Should we provide a link to the text? - wxString lower = aText.Lower(); - - bool found = false; - - for( wxString check : m_linkChecks ) - { - if( lower.Matches( check ) ) - { - found = true; - break; - } - } - - if( found ) - { - wxString link = ""; - link += aText; - link += ""; - - return link; - } - else - { - return aText; - } -} - -wxString BOM_HTML_WRITER::TableHeader( const wxArrayString& aHeaderData ) -{ - wxString header = "\n"; - - if( m_showRowNumbers ) - { - header += "\n"; - } - - for( wxString item : aHeaderData ) - { - header += ""; - header += item; - header += ""; - header += "\n"; - } - - header += "\n"; - - return header; -} - -wxString BOM_HTML_WRITER::DataPair( const wxString& aFirst, const wxString& aSecond ) -{ - wxString html = "\n"; - - html += TableEntry( aFirst ) + "\n"; - html += TableEntry( aSecond ) + "\n"; - - html += "\n"; - - return html; -} - -/** - * Function TableRow - * Generate a single row of BOM data - * @aRowNum is the number of the row - * @aRowData is the array of data for the given row - */ -wxString BOM_HTML_WRITER::TableRow( const int& aRowNum, const wxArrayString& aRowData ) -{ - wxString row = wxEmptyString; - - row += "\n"; - - if( m_showRowNumbers ) - { - row += ""; - row += wxString::Format( "%i", aRowNum ); - row += "\n"; - } - - for( wxString data : aRowData ) - { - row += TableEntry( data ); - row += "\n"; - } - - row += "\n"; - - return row; -} - -/** - * Function TableEntry - * Wrap a string in tags - * @aData is the text to be wrapped - * @aColor is an (optional) HTML background color - */ -wxString BOM_HTML_WRITER::TableEntry( wxString aData, wxString aColor ) -{ - wxString cell = " -#include - -#include "bom_table_column.h" -#include "bom_table_model.h" - -enum BOM_EXPORT_TYPE -{ - BOM_EXPORT_CSV = 0, - BOM_EXPORT_HTML -}; - -class BOM_FILE_WRITER -{ -public: - BOM_FILE_WRITER(); - virtual ~BOM_FILE_WRITER() {}; - - virtual bool WriteToFile( wxFile& aFile ) = 0; - - void SetHeader( const wxArrayString aHeader ); - void AddLine( const wxArrayString aLine ); - - void IncludeExtraData( bool aInclude = true ) { m_includeExtraData = aInclude; } - void ShowRowNumbers( bool aShow = true ) { m_showRowNumbers = aShow; } - - // Project information - void SetKicadVersion( const wxString aVersion ) { m_kicadVersion = aVersion; } - void SetSchematicTitle( const wxString aProject ) { m_schematicTitle = aProject; } - void SetSchematicVersion( const wxString aVersion ) { m_schematicVersion = aVersion; } - void SetSchematicDate( const wxString aDate ) { m_schematicDate = aDate; } - - void SetGroupCount( unsigned int aCount ) { m_groupCount = wxString::Format( "%u", aCount ); } - void SetComponentCount( unsigned int aCount ) { m_componentCount = wxString::Format( "%u", aCount ); } - -protected: - wxArrayString ExtraDataPairs(); - virtual wxString DataPair( const wxString& aFirst, const wxString& aSecond ) = 0; - - wxArrayString m_bomHeader; - std::vector< wxArrayString > m_bomLines; - - bool m_includeExtraData; - bool m_showRowNumbers; - - // Extra details for BOM file - wxString m_kicadVersion; - wxString m_schematicTitle; - wxString m_schematicVersion; - wxString m_schematicDate; - - wxString m_componentCount; - wxString m_groupCount; - -}; - -class BOM_CSV_WRITER : public BOM_FILE_WRITER -{ -public: - BOM_CSV_WRITER( wxChar aDelim=',' ); - - virtual bool WriteToFile( wxFile& aFile ) override; - -protected: - wxArrayString EscapeLine( wxArrayString line ); - virtual wxString DataPair( const wxString& aFirst, const wxString& aSecond ) override; - - wxChar m_delim; -}; - -class BOM_HTML_WRITER : public BOM_FILE_WRITER -{ -public: - BOM_HTML_WRITER(); - - virtual bool WriteToFile( wxFile& aFile ) override; - -protected: - virtual wxString DataPair( const wxString& aFirst, const wxString& aSecond ) override; - - wxString HtmlHeader(); - wxString HtmlFooter(); - wxString HtmlMetaTag( const wxString aTitle, const wxString aData ); - - wxString ExtraData(); - - wxString LinkText( const wxString& aText ); - - wxString TableHeader( const wxArrayString& aHeaderData ); - wxString TableRow( const int& aRowNum, const wxArrayString& aRowData ); - wxString TableEntry( wxString aData, wxString aColor = wxEmptyString ); - - wxArrayString m_linkChecks; -}; - -#endif /* EESCHEMA_BOM_EXPORTER_H_ */ diff --git a/eeschema/bom_table_column.cpp b/eeschema/bom_table_column.cpp index 01b71205c7..ef270217ee 100644 --- a/eeschema/bom_table_column.cpp +++ b/eeschema/bom_table_column.cpp @@ -86,7 +86,7 @@ BOM_COLUMN* BOM_COLUMN_LIST::GetColumnByTitle( wxString aColTitle ) { for( unsigned int ii=0; iiTitle().CmpNoCase( aColTitle ) == 0 ) + if( Columns[ii] && Columns[ii]->Title().Cmp( aColTitle ) == 0 ) return Columns[ii]; } diff --git a/eeschema/bom_table_model.cpp b/eeschema/bom_table_model.cpp index 1005a78d58..d531dbde0c 100644 --- a/eeschema/bom_table_model.cpp +++ b/eeschema/bom_table_model.cpp @@ -682,6 +682,7 @@ void BOM_TABLE_COMPONENT::ApplyFieldChanges() break; } + // New field needs to be added? if( !field && !value.IsEmpty() ) { SCH_FIELD newField( wxPoint( 0, 0 ), -1, cmp, column->Title() ); @@ -1396,8 +1397,6 @@ void BOM_TABLE_MODEL::ApplyFieldChanges() if( !group ) continue; - bool changed = false; - for( auto& component : group->Components ) { if( !component ) @@ -1406,15 +1405,8 @@ void BOM_TABLE_MODEL::ApplyFieldChanges() if( component->HasChanged() ) { component->ApplyFieldChanges(); - ItemChanged( RowToItem( &*component ) ); - changed = true; } } - - if( changed ) - { - ItemChanged( RowToItem( &*group ) ); - } } } diff --git a/eeschema/dialogs/dialog_bom_editor.cpp b/eeschema/dialogs/dialog_bom_editor.cpp index 722cbd59e8..2b070b8a7f 100644 --- a/eeschema/dialogs/dialog_bom_editor.cpp +++ b/eeschema/dialogs/dialog_bom_editor.cpp @@ -35,8 +35,6 @@ #include #include -#include - #include "dialog_bom_editor.h" #include @@ -112,31 +110,9 @@ typedef struct */ bool DIALOG_BOM_EDITOR::TransferDataFromWindow() { - bool saveChanges = false; - - // If there are changed values, warn the user first if( m_bom->HaveFieldsChanged() ) { - int result = DisplayExitDialog( this, _( "Changes exist in component table" ) ); - - switch( result ) - { - // Save and exit - case wxID_YES: - saveChanges = true; - break; - // Cancel (do not exit) - case wxID_CANCEL: - return false; - // Do not save, exit - default: - return true; - } - } - - if( saveChanges ) - { - /** + /** * As we may be saving changes across multiple sheets, * we need to first determine which changes need to be made to which sheet. * To this end, we perform the following: @@ -144,7 +120,7 @@ bool DIALOG_BOM_EDITOR::TransferDataFromWindow() * 2. Create a MAP of changes that need to be made * 3. Push UNDO actions to appropriate sheets * 4. Perform all the update actions - * 5. Reset the sheet view to the current sheet + * 5. Reset the view to the current sheet */ auto currentSheet = m_parent->GetCurrentSheet(); @@ -169,7 +145,6 @@ bool DIALOG_BOM_EDITOR::TransferDataFromWindow() picker = ITEM_PICKER( cmp, UR_CHANGED ); picker.SetFlags( cmp->GetFlags() ); - /* * If there is not currently an undo list for the given sheet, * create an empty one @@ -199,7 +174,7 @@ bool DIALOG_BOM_EDITOR::TransferDataFromWindow() m_parent->OnModify(); } - // Apply all the field changes + // Make all component changes m_bom->ApplyFieldChanges(); // Redraw the current sheet and mark as dirty @@ -209,7 +184,6 @@ bool DIALOG_BOM_EDITOR::TransferDataFromWindow() // Reset the view to where we left the user m_parent->SetCurrentSheet(currentSheet); - } return true; @@ -352,131 +326,6 @@ void DIALOG_BOM_EDITOR::OnUpdateUI( wxUpdateUIEvent& event ) UpdateTitle(); } -/** - * Called when the "Export BOM" button is pressed - * Extract row data from the component table, - * and export it to a BOM file - */ -void DIALOG_BOM_EDITOR::OnExportBOM( wxCommandEvent& event ) -{ - // Allowable BOM file formats - static const wxString wildcard = _( "BOM Files" ) + wxString( " *.csv, *.tsv, *.html)|*.csv;*.tsv;*.htm;*.html" ); - - wxFileDialog bomFileDialog(this, _("Select BOM file"), - Prj().GetProjectPath(), - wxEmptyString, - wildcard, - wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); - - - if( bomFileDialog.ShowModal() == wxID_CANCEL ) - { - return; - } - - // Ensure the component groups are correct - m_bom->ReloadTable(); - - wxString msg; - - wxFileName filename = bomFileDialog.GetPath(); - - // Ensure correct file format - BOM_FILE_WRITER* writer; - - wxString fn = filename.GetFullPath().Lower(); - - // CSV File - if( fn.EndsWith( ".csv" ) ) - { - writer = new BOM_CSV_WRITER(); - } - // TSV file - else if( fn.EndsWith( ".tsv" ) ) - { - writer = new BOM_CSV_WRITER( '\t' ); - } - // HTML file - else if( fn.EndsWith( ".html" ) || fn.EndsWith( ".htm" ) ) - { - writer = new BOM_HTML_WRITER(); - } - // Unknown file! - else - { - msg.Printf("%s:\n%s", - _( "Unsupported file type" ), - filename.GetExt() ); - - wxMessageBox( msg ); - return; - } - - // Set export preferences - writer->IncludeExtraData( m_includeProjectData->GetValue() ); - writer->ShowRowNumbers( m_showRowNumbers->GetValue() ); - - // Project information - writer->SetKicadVersion( GetBuildVersion() ); - - // Extract sheet info from top-level sheet - if( g_RootSheet ) - { - const TITLE_BLOCK& tb = g_RootSheet->GetScreen()->GetTitleBlock(); - - writer->SetSchematicDate( tb.GetDate() ); - writer->SetSchematicVersion( tb.GetRevision() ); - writer->SetSchematicTitle( tb.GetTitle() ); - } - - std::vector columns; - wxArrayString headings; - - // Extract the visible column data - for( auto column : m_bom->ColumnList.Columns ) - { - if( column && column->IsVisible() ) - { - columns.push_back( column ); - headings.push_back( column->Title() ); - } - } - - writer->SetHeader( headings ); - - // Extract the row data - for( unsigned int row=0; rowGroupCount(); row++ ) - { - writer->AddLine( m_bom->GetRowData( row, columns ) ); - } - - writer->SetGroupCount( m_bom->GroupCount() ); - writer->SetComponentCount( m_bom->ComponentCount() ); - - // Open the BOM file for writing - wxFile bomFile( filename.GetFullPath(), wxFile::write ); - - if( bomFile.IsOpened() ) - { - if( !writer->WriteToFile( bomFile ) ) - { - msg.Printf( "%s:\n%s", - _( "Error writing BOM file" ), - filename.GetFullPath() ); - } - - bomFile.Close(); - } - else - { - msg.Printf( "%s:\n%s", - _( "Error opening BOM file" ), - filename.GetFullPath() ); - - wxMessageBox( msg ); - } -} - void DIALOG_BOM_EDITOR::OnTableValueChanged( wxDataViewEvent& event ) { Update(); @@ -499,3 +348,24 @@ void DIALOG_BOM_EDITOR::OnRevertFieldChanges( wxCommandEvent& event ) } } } + +// Called when a cell is left-clicked +void DIALOG_BOM_EDITOR::OnTableItemActivated( wxDataViewEvent& event ) +{ + /* TODO + * - Focus on component selected in SCH_FRAME + */ + + event.Skip(); +} +// Called when a cell is right-clicked +void DIALOG_BOM_EDITOR::OnTableItemContextMenu( wxDataViewEvent& event ) +{ + /* TODO + * - Display contect menu + * - Option to revert local changes if changes have been made + * - Option to select footprint if FOOTPRINT column selected + */ + + event.Skip(); +} diff --git a/eeschema/dialogs/dialog_bom_editor.h b/eeschema/dialogs/dialog_bom_editor.h index 0f79e98c2d..90a18ff045 100644 --- a/eeschema/dialogs/dialog_bom_editor.h +++ b/eeschema/dialogs/dialog_bom_editor.h @@ -69,8 +69,6 @@ private: virtual void OnColumnItemToggled( wxDataViewEvent& event ) override; virtual void OnGroupComponentsToggled( wxCommandEvent& event ) override; - virtual void OnExportBOM( wxCommandEvent& event ) override; - virtual void OnRevertFieldChanges( wxCommandEvent& event ) override; virtual void OnRegroupComponents( wxCommandEvent& event ) override; @@ -78,6 +76,12 @@ private: // Called after a value in the table has changed virtual void OnTableValueChanged( wxDataViewEvent& event ) override; + // Called when a cell is left-clicked + virtual void OnTableItemActivated( wxDataViewEvent& event ) override; + + // Called when a cell is right-clicked + virtual void OnTableItemContextMenu( wxDataViewEvent& event ) override; + void UpdateTitle( void ); virtual void OnUpdateUI( wxUpdateUIEvent& event ) override; diff --git a/eeschema/dialogs/dialog_bom_editor_base.cpp b/eeschema/dialogs/dialog_bom_editor_base.cpp index d83d34d50f..018e2b2290 100644 --- a/eeschema/dialogs/dialog_bom_editor_base.cpp +++ b/eeschema/dialogs/dialog_bom_editor_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Mar 22 2017) +// C++ code generated with wxFormBuilder (version Apr 1 2017) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -15,9 +15,10 @@ BEGIN_EVENT_TABLE( DIALOG_BOM_EDITOR_BASE, DIALOG_SHIM ) EVT_BUTTON( ID_BUTTON_REGROUP, DIALOG_BOM_EDITOR_BASE::_wxFB_OnRegroupComponents ) EVT_BUTTON( ID_BUTTON_REVERT_CHANGES, DIALOG_BOM_EDITOR_BASE::_wxFB_OnRevertFieldChanges ) EVT_DATAVIEW_ITEM_VALUE_CHANGED( wxID_ANY, DIALOG_BOM_EDITOR_BASE::_wxFB_OnColumnItemToggled ) - EVT_BUTTON( wxID_BOM_BUTTON_EXPORT, DIALOG_BOM_EDITOR_BASE::_wxFB_OnExportBOM ) EVT_DATAVIEW_COLUMN_REORDERED( wxID_ANY, DIALOG_BOM_EDITOR_BASE::_wxFB_OnBomColumReordered ) EVT_DATAVIEW_COLUMN_SORTED( wxID_ANY, DIALOG_BOM_EDITOR_BASE::_wxFB_OnBomColumnSorted ) + EVT_DATAVIEW_ITEM_ACTIVATED( wxID_ANY, DIALOG_BOM_EDITOR_BASE::_wxFB_OnTableItemActivated ) + EVT_DATAVIEW_ITEM_CONTEXT_MENU( wxID_ANY, DIALOG_BOM_EDITOR_BASE::_wxFB_OnTableItemContextMenu ) EVT_DATAVIEW_ITEM_EDITING_DONE( wxID_ANY, DIALOG_BOM_EDITOR_BASE::_wxFB_OnTableValueChanged ) EVT_DATAVIEW_SELECTION_CHANGED( wxID_ANY, DIALOG_BOM_EDITOR_BASE::_wxFB_OnSelectionChanged ) END_EVENT_TABLE() @@ -79,39 +80,6 @@ DIALOG_BOM_EDITOR_BASE::DIALOG_BOM_EDITOR_BASE( wxWindow* parent, wxWindowID id, bSizer6->Add( 0, 0, 0, wxEXPAND, 5 ); - wxStaticBoxSizer* sbSizer2; - sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( m_leftPanel, wxID_ANY, _("Export options") ), wxVERTICAL ); - - m_includeProjectData = new wxCheckBox( sbSizer2->GetStaticBox(), wxID_BOM_OPT_INC_PRJ_DATA, _("Include project data"), wxDefaultPosition, wxDefaultSize, 0 ); - m_includeProjectData->SetValue(true); - m_includeProjectData->SetToolTip( _("Include project information in BOM file") ); - - sbSizer2->Add( m_includeProjectData, 0, wxALL|wxEXPAND, 5 ); - - m_showRowNumbers = new wxCheckBox( sbSizer2->GetStaticBox(), wxID_BOM_OPT_SHOW_ROW_NUMS, _("Show row numbers"), wxDefaultPosition, wxDefaultSize, 0 ); - m_showRowNumbers->SetValue(true); - m_showRowNumbers->SetToolTip( _("Show BOM row numbers ") ); - - sbSizer2->Add( m_showRowNumbers, 0, wxALL|wxEXPAND, 5 ); - - - sbSizer2->Add( 0, 0, 1, wxEXPAND, 5 ); - - wxBoxSizer* bSizer13; - bSizer13 = new wxBoxSizer( wxHORIZONTAL ); - - - bSizer13->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_exportButton = new wxButton( sbSizer2->GetStaticBox(), wxID_BOM_BUTTON_EXPORT, _("Export BOM"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer13->Add( m_exportButton, 0, wxALL, 5 ); - - - sbSizer2->Add( bSizer13, 0, wxEXPAND, 5 ); - - - bSizer6->Add( sbSizer2, 0, wxEXPAND, 5 ); - wxStaticBoxSizer* sbSizer4; sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( m_leftPanel, wxID_ANY, _("Apply changes") ), wxVERTICAL ); diff --git a/eeschema/dialogs/dialog_bom_editor_base.fbp b/eeschema/dialogs/dialog_bom_editor_base.fbp index 2fcc929908..b6427b03c5 100644 --- a/eeschema/dialogs/dialog_bom_editor_base.fbp +++ b/eeschema/dialogs/dialog_bom_editor_base.fbp @@ -727,316 +727,6 @@ 0 - - 5 - wxEXPAND - 0 - - wxID_ANY - Export options - - sbSizer2 - wxVERTICAL - 1 - none - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_BOM_OPT_INC_PRJ_DATA - Include project data - - 0 - - - 0 - - 1 - m_includeProjectData - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Include project information in BOM file - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_BOM_OPT_SHOW_ROW_NUMS - Show row numbers - - 0 - - - 0 - - 1 - m_showRowNumbers - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Show BOM row numbers - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxEXPAND - 0 - - - bSizer13 - wxHORIZONTAL - none - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_BOM_BUTTON_EXPORT - Export BOM - - 0 - - - 0 - - 1 - m_exportButton - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnExportBOM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 wxEXPAND @@ -1191,11 +881,11 @@ OnBomColumReordered OnBomColumnSorted - + OnTableItemActivated - + OnTableItemContextMenu OnTableValueChanged diff --git a/eeschema/dialogs/dialog_bom_editor_base.h b/eeschema/dialogs/dialog_bom_editor_base.h index 87d70ef6e2..c7689db3f9 100644 --- a/eeschema/dialogs/dialog_bom_editor_base.h +++ b/eeschema/dialogs/dialog_bom_editor_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Mar 22 2017) +// C++ code generated with wxFormBuilder (version Apr 1 2017) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -33,9 +33,6 @@ class DIALOG_SHIM; #define OPT_GROUP_COMPONENTS 1000 #define ID_BUTTON_REGROUP 1001 #define ID_BUTTON_REVERT_CHANGES 1002 -#define wxID_BOM_OPT_INC_PRJ_DATA 1003 -#define wxID_BOM_OPT_SHOW_ROW_NUMS 1004 -#define wxID_BOM_BUTTON_EXPORT 1005 /////////////////////////////////////////////////////////////////////////////// /// Class DIALOG_BOM_EDITOR_BASE @@ -51,9 +48,10 @@ class DIALOG_BOM_EDITOR_BASE : public DIALOG_SHIM void _wxFB_OnRegroupComponents( wxCommandEvent& event ){ OnRegroupComponents( event ); } void _wxFB_OnRevertFieldChanges( wxCommandEvent& event ){ OnRevertFieldChanges( event ); } void _wxFB_OnColumnItemToggled( wxDataViewEvent& event ){ OnColumnItemToggled( event ); } - void _wxFB_OnExportBOM( wxCommandEvent& event ){ OnExportBOM( event ); } void _wxFB_OnBomColumReordered( wxDataViewEvent& event ){ OnBomColumReordered( event ); } void _wxFB_OnBomColumnSorted( wxDataViewEvent& event ){ OnBomColumnSorted( event ); } + void _wxFB_OnTableItemActivated( wxDataViewEvent& event ){ OnTableItemActivated( event ); } + void _wxFB_OnTableItemContextMenu( wxDataViewEvent& event ){ OnTableItemContextMenu( event ); } void _wxFB_OnTableValueChanged( wxDataViewEvent& event ){ OnTableValueChanged( event ); } void _wxFB_OnSelectionChanged( wxDataViewEvent& event ){ OnSelectionChanged( event ); } @@ -66,9 +64,6 @@ class DIALOG_BOM_EDITOR_BASE : public DIALOG_SHIM wxButton* m_regroupComponentsButton; wxButton* m_reloadTableButton; wxDataViewListCtrl* m_columnListCtrl; - wxCheckBox* m_includeProjectData; - wxCheckBox* m_showRowNumbers; - wxButton* m_exportButton; wxStdDialogButtonSizer* m_sdbSizer1; wxButton* m_sdbSizer1OK; wxButton* m_sdbSizer1Cancel; @@ -81,9 +76,10 @@ class DIALOG_BOM_EDITOR_BASE : public DIALOG_SHIM virtual void OnRegroupComponents( wxCommandEvent& event ) { event.Skip(); } virtual void OnRevertFieldChanges( wxCommandEvent& event ) { event.Skip(); } virtual void OnColumnItemToggled( wxDataViewEvent& event ) { event.Skip(); } - virtual void OnExportBOM( wxCommandEvent& event ) { event.Skip(); } virtual void OnBomColumReordered( wxDataViewEvent& event ) { event.Skip(); } virtual void OnBomColumnSorted( wxDataViewEvent& event ) { event.Skip(); } + virtual void OnTableItemActivated( wxDataViewEvent& event ) { event.Skip(); } + virtual void OnTableItemContextMenu( wxDataViewEvent& event ) { event.Skip(); } virtual void OnTableValueChanged( wxDataViewEvent& event ) { event.Skip(); } virtual void OnSelectionChanged( wxDataViewEvent& event ) { event.Skip(); }