From 21c81b19faeded5ea7c223aed4220c111c94f014 Mon Sep 17 00:00:00 2001 From: Mike Williams Date: Tue, 28 Feb 2023 12:16:36 -0500 Subject: [PATCH] Symbol Fields Table: upgrade dialog in prep for exporter --- .../dialogs/dialog_symbol_fields_table.cpp | 9 + .../dialog_symbol_fields_table_base.cpp | 153 +- .../dialog_symbol_fields_table_base.fbp | 2194 +++++++++++++---- .../dialogs/dialog_symbol_fields_table_base.h | 30 +- 4 files changed, 1849 insertions(+), 537 deletions(-) diff --git a/eeschema/dialogs/dialog_symbol_fields_table.cpp b/eeschema/dialogs/dialog_symbol_fields_table.cpp index 2d4718c5e6..2bad4e93b8 100644 --- a/eeschema/dialogs/dialog_symbol_fields_table.cpp +++ b/eeschema/dialogs/dialog_symbol_fields_table.cpp @@ -863,6 +863,15 @@ DIALOG_SYMBOL_FIELDS_TABLE::DIALOG_SYMBOL_FIELDS_TABLE( SCH_EDIT_FRAME* parent ) m_separator1->SetIsSeparator(); m_separator2->SetIsSeparator(); m_bRefresh->SetBitmap( KiBitmap( BITMAPS::small_refresh ) ); + m_bRefreshPreview->SetBitmap( KiBitmap( BITMAPS::small_refresh ) ); + m_browseButton->SetBitmap( KiBitmap( BITMAPS::small_folder ) ); + + m_addFieldButton->SetBitmap( KiBitmap( BITMAPS::small_plus ) ); + m_removeFieldButton->SetBitmap( KiBitmap( BITMAPS::small_trash ) ); + m_renameFieldButton->SetBitmap( KiBitmap( BITMAPS::small_edit ) ); + + m_removeFieldButton->Enable( false ); + m_renameFieldButton->Enable( false ); m_fieldsCtrl->AppendTextColumn( _( "Field" ), wxDATAVIEW_CELL_INERT, 0, wxALIGN_LEFT, 0 ); m_fieldsCtrl->AppendTextColumn( _( "Label" ), wxDATAVIEW_CELL_EDITABLE, 0, wxALIGN_LEFT, 0 ); diff --git a/eeschema/dialogs/dialog_symbol_fields_table_base.cpp b/eeschema/dialogs/dialog_symbol_fields_table_base.cpp index 71e989e166..baf5d39034 100644 --- a/eeschema/dialogs/dialog_symbol_fields_table_base.cpp +++ b/eeschema/dialogs/dialog_symbol_fields_table_base.cpp @@ -19,7 +19,12 @@ DIALOG_SYMBOL_FIELDS_TABLE_BASE::DIALOG_SYMBOL_FIELDS_TABLE_BASE( wxWindow* pare wxBoxSizer* bMainSizer; bMainSizer = new wxBoxSizer( wxVERTICAL ); - m_splitterMainWindow = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH|wxSP_LIVE_UPDATE|wxSP_NO_XP_THEME ); + m_notebook1 = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_panelEdit = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bEditSizer; + bEditSizer = new wxBoxSizer( wxVERTICAL ); + + m_splitterMainWindow = new wxSplitterWindow( m_panelEdit, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH|wxSP_LIVE_UPDATE|wxSP_NO_XP_THEME ); m_splitterMainWindow->SetMinimumPaneSize( 200 ); m_leftPanel = new wxPanel( m_splitterMainWindow, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); @@ -47,18 +52,20 @@ DIALOG_SYMBOL_FIELDS_TABLE_BASE::DIALOG_SYMBOL_FIELDS_TABLE_BASE( wxWindow* pare bLeftSizer->Add( m_fieldsCtrl, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); - m_addFieldButton = new wxButton( m_leftPanel, wxID_ANY, _("Add Field..."), wxDefaultPosition, wxDefaultSize, 0 ); - bLeftSizer->Add( m_addFieldButton, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); + wxBoxSizer* bFieldsButtons; + bFieldsButtons = new wxBoxSizer( wxHORIZONTAL ); - m_removeFieldButton = new wxButton( m_leftPanel, wxID_ANY, _("Remove Field..."), wxDefaultPosition, wxDefaultSize, 0 ); - m_removeFieldButton->Enable( false ); + m_addFieldButton = new wxBitmapButton( m_leftPanel, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); + bFieldsButtons->Add( m_addFieldButton, 0, wxALL, 5 ); - bLeftSizer->Add( m_removeFieldButton, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 ); + m_removeFieldButton = new wxBitmapButton( m_leftPanel, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); + bFieldsButtons->Add( m_removeFieldButton, 0, wxALL, 5 ); - m_renameFieldButton = new wxButton( m_leftPanel, wxID_ANY, _("Rename Field..."), wxDefaultPosition, wxDefaultSize, 0 ); - m_renameFieldButton->Enable( false ); + m_renameFieldButton = new wxBitmapButton( m_leftPanel, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); + bFieldsButtons->Add( m_renameFieldButton, 0, wxALL, 5 ); - bLeftSizer->Add( m_renameFieldButton, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); + + bLeftSizer->Add( bFieldsButtons, 0, wxEXPAND, 5 ); m_leftPanel->SetSizer( bLeftSizer ); @@ -102,7 +109,7 @@ DIALOG_SYMBOL_FIELDS_TABLE_BASE::DIALOG_SYMBOL_FIELDS_TABLE_BASE( wxWindow* pare bControls->Add( m_bRefresh, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - bRightSizer->Add( bControls, 0, wxEXPAND, 5 ); + bRightSizer->Add( bControls, 0, wxEXPAND|wxLEFT, 5 ); m_grid = new WX_GRID( m_rightPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); @@ -130,14 +137,124 @@ DIALOG_SYMBOL_FIELDS_TABLE_BASE::DIALOG_SYMBOL_FIELDS_TABLE_BASE( wxWindow* pare m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); m_grid->SetMinSize( wxSize( 600,240 ) ); - bRightSizer->Add( m_grid, 1, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + bRightSizer->Add( m_grid, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); m_rightPanel->SetSizer( bRightSizer ); m_rightPanel->Layout(); bRightSizer->Fit( m_rightPanel ); m_splitterMainWindow->SplitVertically( m_leftPanel, m_rightPanel, -1 ); - bMainSizer->Add( m_splitterMainWindow, 1, wxALL|wxEXPAND, 5 ); + bEditSizer->Add( m_splitterMainWindow, 1, wxALL|wxEXPAND, 5 ); + + + m_panelEdit->SetSizer( bEditSizer ); + m_panelEdit->Layout(); + bEditSizer->Fit( m_panelEdit ); + m_notebook1->AddPage( m_panelEdit, _("Edit"), true ); + m_panelExport = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxGridBagSizer* gbExport; + gbExport = new wxGridBagSizer( 0, 0 ); + gbExport->SetFlexibleDirection( wxBOTH ); + gbExport->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + wxFlexGridSizer* fgExportOptions; + fgExportOptions = new wxFlexGridSizer( 6, 2, 0, 0 ); + fgExportOptions->AddGrowableRow( 5 ); + fgExportOptions->SetFlexibleDirection( wxBOTH ); + fgExportOptions->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_labelBomExportPresets = new wxStaticText( m_panelExport, wxID_ANY, _("Presets:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelBomExportPresets->Wrap( -1 ); + fgExportOptions->Add( m_labelBomExportPresets, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); + + wxString m_cbBomExportPresetsChoices[] = { _("CSV"), _("Semicolons"), _("(unsaved)") }; + int m_cbBomExportPresetsNChoices = sizeof( m_cbBomExportPresetsChoices ) / sizeof( wxString ); + m_cbBomExportPresets = new wxChoice( m_panelExport, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_cbBomExportPresetsNChoices, m_cbBomExportPresetsChoices, 0 ); + m_cbBomExportPresets->SetSelection( 1 ); + fgExportOptions->Add( m_cbBomExportPresets, 0, wxALL|wxEXPAND, 5 ); + + m_labelFieldDelimiter = new wxStaticText( m_panelExport, wxID_ANY, _("Field Delimeter:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelFieldDelimiter->Wrap( -1 ); + fgExportOptions->Add( m_labelFieldDelimiter, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); + + m_textFieldDelimiter = new wxTextCtrl( m_panelExport, wxID_ANY, _(","), wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_TAB ); + fgExportOptions->Add( m_textFieldDelimiter, 0, wxALL|wxEXPAND, 5 ); + + m_labelStringDelimiter = new wxStaticText( m_panelExport, wxID_ANY, _("String Delimeter:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelStringDelimiter->Wrap( -1 ); + fgExportOptions->Add( m_labelStringDelimiter, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); + + m_textStringDelimiter = new wxTextCtrl( m_panelExport, wxID_ANY, _("\""), wxDefaultPosition, wxDefaultSize, 0 ); + #ifdef __WXGTK__ + if ( !m_textStringDelimiter->HasFlag( wxTE_MULTILINE ) ) + { + m_textStringDelimiter->SetMaxLength( 1 ); + } + #else + m_textStringDelimiter->SetMaxLength( 1 ); + #endif + fgExportOptions->Add( m_textStringDelimiter, 0, wxALL|wxEXPAND, 5 ); + + m_labelExcludeDNP = new wxStaticText( m_panelExport, wxID_ANY, _("Exclude DNP:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelExcludeDNP->Wrap( -1 ); + fgExportOptions->Add( m_labelExcludeDNP, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); + + m_checkExludeDNP = new wxCheckBox( m_panelExport, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_checkExludeDNP->SetValue(true); + fgExportOptions->Add( m_checkExludeDNP, 0, wxALL, 5 ); + + + gbExport->Add( fgExportOptions, wxGBPosition( 0, 0 ), wxGBSpan( 3, 1 ), wxEXPAND, 5 ); + + wxBoxSizer* bOutputDirectory; + bOutputDirectory = new wxBoxSizer( wxHORIZONTAL ); + + m_labelOutputDirectory = new wxStaticText( m_panelExport, wxID_ANY, _("Output folder:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelOutputDirectory->Wrap( -1 ); + bOutputDirectory->Add( m_labelOutputDirectory, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_outputDirectoryName = new wxTextCtrl( m_panelExport, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bOutputDirectory->Add( m_outputDirectoryName, 1, wxALL|wxEXPAND, 5 ); + + m_browseButton = new wxBitmapButton( m_panelExport, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); + m_browseButton->SetMinSize( wxSize( 30,30 ) ); + + bOutputDirectory->Add( m_browseButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + + gbExport->Add( bOutputDirectory, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxEXPAND, 5 ); + + wxBoxSizer* bPreview; + bPreview = new wxBoxSizer( wxHORIZONTAL ); + + m_labelPreview = new wxStaticText( m_panelExport, wxID_ANY, _("Preview:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelPreview->Wrap( -1 ); + bPreview->Add( m_labelPreview, 0, wxALIGN_BOTTOM|wxALL, 5 ); + + + bPreview->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_bRefreshPreview = new wxBitmapButton( m_panelExport, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); + m_bRefreshPreview->SetMinSize( wxSize( 30,30 ) ); + + bPreview->Add( m_bRefreshPreview, 0, wxALL, 5 ); + + + gbExport->Add( bPreview, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxEXPAND, 5 ); + + m_textOutput = new wxTextCtrl( m_panelExport, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxTE_MULTILINE|wxTE_READONLY ); + gbExport->Add( m_textOutput, wxGBPosition( 2, 1 ), wxGBSpan( 2, 1 ), wxALL|wxEXPAND, 5 ); + + + gbExport->AddGrowableCol( 1 ); + gbExport->AddGrowableRow( 3 ); + + m_panelExport->SetSizer( gbExport ); + m_panelExport->Layout(); + gbExport->Fit( m_panelExport ); + m_notebook1->AddPage( m_panelExport, _("Export"), false ); + + bMainSizer->Add( m_notebook1, 1, wxEXPAND | wxALL, 5 ); wxBoxSizer* bButtonsSizer; bButtonsSizer = new wxBoxSizer( wxHORIZONTAL ); @@ -145,11 +262,11 @@ DIALOG_SYMBOL_FIELDS_TABLE_BASE::DIALOG_SYMBOL_FIELDS_TABLE_BASE( wxWindow* pare bButtonsSizer->Add( 0, 0, 9, wxEXPAND, 5 ); - m_buttonExport = new wxButton( this, wxID_ANY, _("Export as CSV..."), wxDefaultPosition, wxDefaultSize, 0 ); - bButtonsSizer->Add( m_buttonExport, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + m_buttonExport = new wxButton( this, wxID_ANY, _("Export"), wxDefaultPosition, wxDefaultSize, 0 ); + bButtonsSizer->Add( m_buttonExport, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); m_buttonApply = new wxButton( this, wxID_ANY, _("Apply, Save Schematic && Continue"), wxDefaultPosition, wxDefaultSize, 0 ); - bButtonsSizer->Add( m_buttonApply, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + bButtonsSizer->Add( m_buttonApply, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); m_sdbSizer = new wxStdDialogButtonSizer(); m_sdbSizerOK = new wxButton( this, wxID_OK ); @@ -158,7 +275,7 @@ DIALOG_SYMBOL_FIELDS_TABLE_BASE::DIALOG_SYMBOL_FIELDS_TABLE_BASE( wxWindow* pare m_sdbSizer->AddButton( m_sdbSizerCancel ); m_sdbSizer->Realize(); - bButtonsSizer->Add( m_sdbSizer, 0, wxBOTTOM|wxLEFT, 5 ); + bButtonsSizer->Add( m_sdbSizer, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); bMainSizer->Add( bButtonsSizer, 0, wxEXPAND, 5 ); @@ -188,6 +305,8 @@ DIALOG_SYMBOL_FIELDS_TABLE_BASE::DIALOG_SYMBOL_FIELDS_TABLE_BASE( wxWindow* pare m_grid->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnTableItemContextMenu ), NULL, this ); m_grid->Connect( wxEVT_GRID_COL_SIZE, wxGridSizeEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnTableColSize ), NULL, this ); m_grid->Connect( wxEVT_GRID_RANGE_SELECT, wxGridRangeSelectEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnTableRangeSelected ), NULL, this ); + m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnRegroupSymbols ), NULL, this ); + m_bRefreshPreview->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnRegroupSymbols ), NULL, this ); m_buttonExport->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnExport ), NULL, this ); m_buttonApply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnSaveAndContinue ), NULL, this ); m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnCancel ), NULL, this ); @@ -213,6 +332,8 @@ DIALOG_SYMBOL_FIELDS_TABLE_BASE::~DIALOG_SYMBOL_FIELDS_TABLE_BASE() m_grid->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnTableItemContextMenu ), NULL, this ); m_grid->Disconnect( wxEVT_GRID_COL_SIZE, wxGridSizeEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnTableColSize ), NULL, this ); m_grid->Disconnect( wxEVT_GRID_RANGE_SELECT, wxGridRangeSelectEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnTableRangeSelected ), NULL, this ); + m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnRegroupSymbols ), NULL, this ); + m_bRefreshPreview->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnRegroupSymbols ), NULL, this ); m_buttonExport->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnExport ), NULL, this ); m_buttonApply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnSaveAndContinue ), NULL, this ); m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnCancel ), NULL, this ); diff --git a/eeschema/dialogs/dialog_symbol_fields_table_base.fbp b/eeschema/dialogs/dialog_symbol_fields_table_base.fbp index 5067b2d46b..e31da85138 100644 --- a/eeschema/dialogs/dialog_symbol_fields_table_base.fbp +++ b/eeschema/dialogs/dialog_symbol_fields_table_base.fbp @@ -62,11 +62,11 @@ bMainSizer wxVERTICAL none - + 5 - wxALL|wxEXPAND + wxEXPAND | wxALL 1 - + 1 1 1 @@ -77,6 +77,7 @@ + 1 0 @@ -97,12 +98,11 @@ 0 - 200 0 - -1,-1 + 1 - m_splitterMainWindow + m_notebook1 1 @@ -110,20 +110,1121 @@ 1 Resizable - 0.0 - -1 - -1 1 - wxSPLIT_VERTICAL - wxSP_3DSASH|wxSP_LIVE_UPDATE|wxSP_NO_XP_THEME - + + ; ; forward_declare 0 - + + + Edit + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_panelEdit + 1 + + + protected + 1 + + Resizable + 1 + + ; ; forward_declare + 0 + + + + wxTAB_TRAVERSAL + + + bEditSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 200 + + 0 + -1,-1 + 1 + m_splitterMainWindow + 1 + + + protected + 1 + + Resizable + 0.0 + -1 + -1 + 1 + + wxSPLIT_VERTICAL + wxSP_3DSASH|wxSP_LIVE_UPDATE|wxSP_NO_XP_THEME + + 0 + + + + + + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_leftPanel + 1 + + + protected + 1 + + Resizable + 1 + + + 0 + + + + wxTAB_TRAVERSAL + + + bLeftSizer + wxVERTICAL + none + + 5 + wxEXPAND|wxLEFT|wxRIGHT + 0 + + + bPresets + wxVERTICAL + none + + 2 + wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Presets (Ctrl+Tab): + 0 + + 0 + + + 0 + + 1 + m_bomPresetsLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Default" "(unsaved)" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_cbBomPresets + 1 + + + protected + 1 + + Resizable + 1 + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP + 1 + + + + 1 + 1 + + + 0 + wxID_ANY + + -1,320 + m_fieldsCtrl + protected + + + + + + + + + OnColumnItemToggled + OnFieldsCtrlSelectionChanged + OnSizeFieldList + + + + 5 + wxEXPAND + 0 + + + bFieldsButtons + wxHORIZONTAL + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + MyButton + + 0 + + 0 + + + 0 + + 1 + m_addFieldButton + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnAddField + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + Remove Field... + + 0 + + 0 + + + 0 + + 1 + m_removeFieldButton + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnRemoveField + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + Rename Field... + + 0 + + 0 + + + 0 + + 1 + m_renameFieldButton + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnRenameField + + + + + + + + + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_rightPanel + 1 + + + protected + 1 + + Resizable + 1 + + + 0 + + + + wxTAB_TRAVERSAL + + + bRightSizer + wxVERTICAL + none + + 5 + wxEXPAND|wxLEFT + 0 + + + bControls + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 1 + + 1 + 1 + 1 + 1 + + + + + + + 1 + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + 140,-1 + 1 + m_filter + 1 + + + protected + 1 + + Resizable + 1 + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnFilterMouseMoved + OnFilterText + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + + 0 + + 1 + m_separator1 + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + OPT_GROUP_COMPONENTS + Group symbols + + 0 + + + 0 + + 1 + m_groupSymbolsBox + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Group symbols together based on common properties + + wxFILTER_NONE + wxDefaultValidator + + + + + OnGroupSymbolsToggled + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + + 0 + + 1 + m_separator2 + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + Refresh Grouping + + 0 + + 0 + + + 0 + 30,30 + 1 + m_bRefresh + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnRegroupSymbols + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP + 1 + + 1 + 1 + 1 + 1 + + + + + 0 + 0 + + + + 1 + + + wxALIGN_LEFT + + wxALIGN_TOP + 0 + 1 + wxALIGN_CENTER + 20 + + wxALIGN_CENTER + 5 + + + 1 + 0 + Dock + 0 + Left + 1 + 1 + 0 + 0 + 1 + 1 + + 1 + + + 1 + 0 + 0 + wxID_ANY + + + + 0 + 0 + + 0 + + + 0 + 600,240 + 1 + m_grid + 1 + + + protected + 1 + + Resizable + wxALIGN_CENTER + 0 + + wxALIGN_CENTER + + 5 + 1 + + WX_GRID; widgets/wx_grid.h; forward_declare + 0 + + + + + OnTableValueChanged + OnTableCellClick + OnTableCellClick + OnTableItemContextMenu + OnTableColSize + OnTableRangeSelected + + + + + + + + + + + + + Export + 0 1 1 @@ -159,7 +1260,7 @@ 0 1 - m_leftPanel + m_panelExport 1 @@ -169,29 +1270,45 @@ Resizable 1 - + ; ; forward_declare 0 wxTAB_TRAVERSAL - + + + wxBOTH + 1 + 3 + 0 - bLeftSizer - wxVERTICAL + gbExport + wxFLEX_GROWMODE_SPECIFIED none - + 0 + 5 - wxEXPAND|wxLEFT|wxRIGHT - 0 - + 1 + 0 + wxEXPAND + 0 + 3 + + 2 + wxBOTH + + 5 + 0 - bPresets - wxVERTICAL + fgExportOptions + wxFLEX_GROWMODE_SPECIFIED none + 6 + 0 - 2 - wxLEFT|wxRIGHT + 5 + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 1 @@ -221,7 +1338,7 @@ 0 0 wxID_ANY - Presets (Ctrl+Tab): + Presets: 0 0 @@ -230,7 +1347,7 @@ 0 1 - m_bomPresetsLabel + m_labelBomExportPresets 1 @@ -268,7 +1385,7 @@ 1 0 - "Default" "(unsaved)" + "CSV" "Semicolons" "(unsaved)" 1 1 @@ -290,7 +1407,7 @@ 0 1 - m_cbBomPresets + m_cbBomExportPresets 1 @@ -314,334 +1431,72 @@ - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP - 1 - - - - 1 - 1 - - - 0 - wxID_ANY - - -1,320 - m_fieldsCtrl - protected - - - - - - - - - OnColumnItemToggled - OnFieldsCtrlSelectionChanged - OnSizeFieldList - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Add Field... - - 0 - - 0 - - - 0 - - 1 - m_addFieldButton - 1 - - - protected - 1 - - - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnAddField - - - - 5 - wxEXPAND|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 0 - - 1 - - - 0 - 0 - wxID_ANY - Remove Field... - - 0 - - 0 - - - 0 - - 1 - m_removeFieldButton - 1 - - - protected - 1 - - - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnRemoveField - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 0 - - 1 - - - 0 - 0 - wxID_ANY - Rename Field... - - 0 - - 0 - - - 0 - - 1 - m_renameFieldButton - 1 - - - protected - 1 - - - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnRenameField - - - - - - - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_rightPanel - 1 - - - protected - 1 - - Resizable - 1 - - - 0 - - - - wxTAB_TRAVERSAL - - - bRightSizer - wxVERTICAL - none - - 5 - wxEXPAND - 0 - - - bControls - wxHORIZONTAL - none 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT - 1 - + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Field Delimeter: + 0 + + 0 + + + 0 + + 1 + m_labelFieldDelimiter + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL|wxEXPAND + 0 + 1 1 1 @@ -652,7 +1507,6 @@ - 1 1 0 @@ -673,11 +1527,137 @@ 0 + 0 - 140,-1 + 1 - m_filter + m_textFieldDelimiter + 1 + + + protected + 1 + + Resizable + 1 + + wxTE_PROCESS_TAB + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + , + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + String Delimeter: + 0 + + 0 + + + 0 + + 1 + m_labelStringDelimiter + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 1 + + 0 + + 1 + m_textStringDelimiter 1 @@ -685,7 +1665,6 @@ 1 Resizable - 1 1 @@ -696,19 +1675,17 @@ wxFILTER_NONE wxDefaultValidator - + " - OnFilterMouseMoved - OnFilterText 5 - wxALL + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - + 1 1 1 @@ -717,33 +1694,26 @@ - 0 - 1 0 1 1 - - 0 0 - Dock 0 Left - 0 + 1 1 - 0 0 wxID_ANY - - + Exclude DNP: 0 0 @@ -752,34 +1722,29 @@ 0 1 - m_separator1 + m_labelExcludeDNP 1 protected 1 - - Resizable 1 - 21,21 - wxBORDER_NONE - BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + + + ; ; forward_declare 0 - - wxFILTER_NONE - wxDefaultValidator - + -1 5 - wxALIGN_CENTER_VERTICAL|wxLEFT + wxALL 0 1 @@ -809,8 +1774,8 @@ 0 0 - OPT_GROUP_COMPONENTS - Group symbols + wxID_ANY + 0 @@ -818,7 +1783,7 @@ 0 1 - m_groupSymbolsBox + m_checkExludeDNP 1 @@ -829,81 +1794,7 @@ 1 - - 0 - Group symbols together based on common properties - - wxFILTER_NONE - wxDefaultValidator - - - - - OnGroupSymbolsToggled - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 0 - - 1 - - - 0 - 0 - wxID_ANY - - - 0 - - 0 - - - 0 - - 1 - m_separator2 - 1 - - - protected - 1 - - - - Resizable - 1 - 21,21 - wxBORDER_NONE - BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + ; ; forward_declare 0 @@ -915,9 +1806,148 @@ + + + + 5 + 1 + 1 + wxEXPAND + 0 + 1 + + + bOutputDirectory + wxHORIZONTAL + none 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Output folder: + 0 + + 0 + + + 0 + + 1 + m_labelOutputDirectory + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL|wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_outputDirectoryName + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALL 0 1 @@ -963,7 +1993,7 @@ 0 30,30 1 - m_bRefresh + m_browseButton 1 @@ -991,11 +2021,173 @@ - + 5 - wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT - 1 - + 1 + 1 + wxEXPAND + 1 + 1 + + + bPreview + wxHORIZONTAL + none + + 5 + wxALIGN_BOTTOM|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Preview: + 0 + + 0 + + + 0 + + 1 + m_labelPreview + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + Refresh Grouping + + 0 + + 0 + + + 0 + 30,30 + 1 + m_bRefreshPreview + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnRegroupSymbols + + + + + + 5 + 1 + 1 + wxALL|wxEXPAND + 2 + 2 + 1 1 1 @@ -1004,58 +2196,34 @@ - 0 - 0 1 - - - wxALIGN_LEFT - - wxALIGN_TOP 0 1 - wxALIGN_CENTER - 20 - - wxALIGN_CENTER - 5 - 1 0 Dock 0 Left - 1 - 1 - 0 - 0 - 1 1 1 - - 1 0 0 wxID_ANY - - - - 0 - 0 0 + 0 - 600,240 + 1 - m_grid + m_textOutput 1 @@ -1063,26 +2231,20 @@ 1 Resizable - wxALIGN_CENTER - 0 - - wxALIGN_CENTER - - 5 1 - WX_GRID; widgets/wx_grid.h; forward_declare + wxHSCROLL|wxTE_MULTILINE|wxTE_READONLY + ; ; forward_declare 0 + + wxFILTER_NONE + wxDefaultValidator + + - OnTableValueChanged - OnTableCellClick - OnTableCellClick - OnTableItemContextMenu - OnTableColSize - OnTableRangeSelected @@ -1090,11 +2252,11 @@ - + 5 wxEXPAND 0 - + bButtonsSizer wxHORIZONTAL @@ -1109,9 +2271,9 @@ 0 - + 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxALL 0 1 @@ -1147,7 +2309,7 @@ 0 0 wxID_ANY - Export as CSV... + Export 0 @@ -1185,7 +2347,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT + wxALIGN_CENTER_VERTICAL|wxALL 0 1 @@ -1259,7 +2421,7 @@ 5 - wxBOTTOM|wxLEFT + wxALIGN_CENTER_VERTICAL|wxALL 0 0 diff --git a/eeschema/dialogs/dialog_symbol_fields_table_base.h b/eeschema/dialogs/dialog_symbol_fields_table_base.h index e73d83e3a6..9d439a87c1 100644 --- a/eeschema/dialogs/dialog_symbol_fields_table_base.h +++ b/eeschema/dialogs/dialog_symbol_fields_table_base.h @@ -23,16 +23,19 @@ class WX_GRID; #include #include #include -#include +#include #include #include #include +#include #include #include -#include #include #include #include +#include +#include +#include #include /////////////////////////////////////////////////////////////////////////// @@ -47,14 +50,16 @@ class DIALOG_SYMBOL_FIELDS_TABLE_BASE : public DIALOG_SHIM private: protected: + wxNotebook* m_notebook1; + wxPanel* m_panelEdit; wxSplitterWindow* m_splitterMainWindow; wxPanel* m_leftPanel; wxStaticText* m_bomPresetsLabel; wxChoice* m_cbBomPresets; wxDataViewListCtrl* m_fieldsCtrl; - wxButton* m_addFieldButton; - wxButton* m_removeFieldButton; - wxButton* m_renameFieldButton; + wxBitmapButton* m_addFieldButton; + wxBitmapButton* m_removeFieldButton; + wxBitmapButton* m_renameFieldButton; wxPanel* m_rightPanel; wxSearchCtrl* m_filter; BITMAP_BUTTON* m_separator1; @@ -62,6 +67,21 @@ class DIALOG_SYMBOL_FIELDS_TABLE_BASE : public DIALOG_SHIM BITMAP_BUTTON* m_separator2; wxBitmapButton* m_bRefresh; WX_GRID* m_grid; + wxPanel* m_panelExport; + wxStaticText* m_labelBomExportPresets; + wxChoice* m_cbBomExportPresets; + wxStaticText* m_labelFieldDelimiter; + wxTextCtrl* m_textFieldDelimiter; + wxStaticText* m_labelStringDelimiter; + wxTextCtrl* m_textStringDelimiter; + wxStaticText* m_labelExcludeDNP; + wxCheckBox* m_checkExludeDNP; + wxStaticText* m_labelOutputDirectory; + wxTextCtrl* m_outputDirectoryName; + wxBitmapButton* m_browseButton; + wxStaticText* m_labelPreview; + wxBitmapButton* m_bRefreshPreview; + wxTextCtrl* m_textOutput; wxButton* m_buttonExport; wxButton* m_buttonApply; wxStdDialogButtonSizer* m_sdbSizer;