diff --git a/eeschema/dialogs/dialog_fields_editor_global.cpp b/eeschema/dialogs/dialog_fields_editor_global.cpp index 767ff4dd6c..f27584d06e 100644 --- a/eeschema/dialogs/dialog_fields_editor_global.cpp +++ b/eeschema/dialogs/dialog_fields_editor_global.cpp @@ -722,6 +722,9 @@ DIALOG_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL( SCH_EDIT_FRAME* parent m_grid->UseNativeColHeader( false ); m_grid->SetTable( m_dataModel, true ); + // must be done after SetTable(), which appears to re-set it + m_grid->SetSelectionMode( wxGrid::wxGridSelectRows ); + // sync m_grid's column visibilities to Show checkboxes in m_fieldsCtrl for( int i = 0; i < m_fieldsCtrl->GetItemCount(); ++i ) { @@ -759,22 +762,34 @@ DIALOG_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL( SCH_EDIT_FRAME* parent m_grid->SetColFormatNumber( m_dataModel->GetColsCount() - 1 ); m_grid->AutoSizeColumns( false ); - for( int col = 0; col < m_grid->GetNumberCols(); ++ col ) + for( int col = 0; col < m_grid->GetNumberCols(); ++col ) { // Columns are hidden by setting their width to 0 so if we resize them they will // become unhidden. if( m_grid->IsColShown( col ) ) { - int textWidth = m_dataModel->GetDataWidth( col ) + COLUMN_MARGIN; - int maxWidth = defaultDlgSize.x / 3; + EESCHEMA_SETTINGS* cfg = static_cast( Kiface().KifaceSettings() ); + wxString key = m_dataModel->GetColLabelValue( col ); - if( col == m_grid->GetNumberCols() - 1 ) - m_grid->SetColSize( col, std::min( std::max( 50, textWidth ), maxWidth ) ); + if( cfg->m_FieldEditorPanel.column_widths.count( key ) ) + { + int width = cfg->m_FieldEditorPanel.column_widths.at( key ); + m_grid->SetColSize( col, width ); + } else - m_grid->SetColSize( col, std::min( std::max( 100, textWidth ), maxWidth ) ); + { + int textWidth = m_dataModel->GetDataWidth( col ) + COLUMN_MARGIN; + int maxWidth = defaultDlgSize.x / 3; + + if( col == m_grid->GetNumberCols() - 1 ) + m_grid->SetColSize( col, std::min( std::max( 50, textWidth ), maxWidth ) ); + else + m_grid->SetColSize( col, std::min( std::max( 100, textWidth ), maxWidth ) ); + } } } + m_grid->SelectRow( 0 ); m_grid->SetGridCursor( 0, 1 ); SetInitialFocus( m_grid ); @@ -884,31 +899,21 @@ void DIALOG_FIELDS_EDITOR_GLOBAL::AddField( const wxString& aName, wxVector fieldsCtrlRow; - auto cfg = static_cast( Kiface().KifaceSettings() ); - bool show = defaultShow; - bool sort_by = defaultSortBy; + EESCHEMA_SETTINGS* cfg = static_cast( Kiface().KifaceSettings() ); + bool show = defaultShow; + bool sort_by = defaultSortBy; std::string key( aName.ToUTF8() ); - try - { + if( cfg->m_FieldEditorPanel.fields_show.count( key ) ) show = cfg->m_FieldEditorPanel.fields_show.at( key ); - } - catch( std::out_of_range& ) - { - } - try - { - show = cfg->m_FieldEditorPanel.fields_group_by.at( key ); - } - catch( std::out_of_range& ) - { - } + if( cfg->m_FieldEditorPanel.fields_group_by.count( key ) ) + sort_by = cfg->m_FieldEditorPanel.fields_group_by.at( key ); - fieldsCtrlRow.push_back( wxVariant( aName ) ); - fieldsCtrlRow.push_back( wxVariant( show ) ); - fieldsCtrlRow.push_back( wxVariant( sort_by ) ); + fieldsCtrlRow.emplace_back( wxVariant( aName ) ); + fieldsCtrlRow.emplace_back( wxVariant( show ) ); + fieldsCtrlRow.emplace_back( wxVariant( sort_by ) ); m_fieldsCtrl->AppendItem( fieldsCtrlRow ); } @@ -1008,8 +1013,8 @@ void DIALOG_FIELDS_EDITOR_GLOBAL::OnAddField( wxCommandEvent& event ) void DIALOG_FIELDS_EDITOR_GLOBAL::OnColumnItemToggled( wxDataViewEvent& event ) { - auto cfg = static_cast( Kiface().KifaceSettings() ); - wxDataViewItem item = event.GetItem(); + EESCHEMA_SETTINGS* cfg = static_cast( Kiface().KifaceSettings() ); + wxDataViewItem item = event.GetItem(); int row = m_fieldsCtrl->ItemToRow( item ); int col = event.GetColumn(); @@ -1083,13 +1088,26 @@ void DIALOG_FIELDS_EDITOR_GLOBAL::OnColSort( wxGridEvent& aEvent ) } -void DIALOG_FIELDS_EDITOR_GLOBAL::OnTableValueChanged( wxGridEvent& event ) +void DIALOG_FIELDS_EDITOR_GLOBAL::OnTableValueChanged( wxGridEvent& aEvent ) { m_grid->ForceRefresh(); } -void DIALOG_FIELDS_EDITOR_GLOBAL::OnRegroupComponents( wxCommandEvent& event ) +void DIALOG_FIELDS_EDITOR_GLOBAL::OnTableColSize( wxGridSizeEvent& aEvent ) +{ + EESCHEMA_SETTINGS* cfg = static_cast( Kiface().KifaceSettings() ); + int col = aEvent.GetRowOrCol(); + wxString key = m_grid->GetColLabelValue( col ); + + if( m_grid->GetColSize( col ) ) + cfg->m_FieldEditorPanel.column_widths[ key ] = m_grid->GetColSize( col ); + + aEvent.Skip(); +} + + +void DIALOG_FIELDS_EDITOR_GLOBAL::OnRegroupComponents( wxCommandEvent& aEvent ) { m_dataModel->RebuildRows( m_groupComponentsBox, m_fieldsCtrl ); m_dataModel->Sort( m_grid->GetSortingColumn(), m_grid->IsSortOrderAscending() ); diff --git a/eeschema/dialogs/dialog_fields_editor_global.h b/eeschema/dialogs/dialog_fields_editor_global.h index 55075e7dce..9de3da202e 100644 --- a/eeschema/dialogs/dialog_fields_editor_global.h +++ b/eeschema/dialogs/dialog_fields_editor_global.h @@ -62,6 +62,7 @@ private: void OnTableValueChanged( wxGridEvent& event ) override; void OnTableCellClick( wxGridEvent& event ) override; void OnTableItemContextMenu( wxGridEvent& event ) override; + void OnTableColSize( wxGridSizeEvent& event ) override; void OnSizeFieldList( wxSizeEvent& event ) override; void OnAddField( wxCommandEvent& event ) override; void OnSaveAndContinue( wxCommandEvent& aEvent ) override; diff --git a/eeschema/dialogs/dialog_fields_editor_global_base.cpp b/eeschema/dialogs/dialog_fields_editor_global_base.cpp index 90c9978756..99077a6812 100644 --- a/eeschema/dialogs/dialog_fields_editor_global_base.cpp +++ b/eeschema/dialogs/dialog_fields_editor_global_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -14,116 +14,116 @@ DIALOG_FIELDS_EDITOR_GLOBAL_BASE::DIALOG_FIELDS_EDITOR_GLOBAL_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( wxSize( -1,-1 ), wxDefaultSize ); - + wxBoxSizer* bMainSizer; bMainSizer = new wxBoxSizer( wxVERTICAL ); - + m_splitter1 = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_LIVE_UPDATE ); m_splitter1->SetMinimumPaneSize( 200 ); - + m_leftPanel = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bLeftSizer; bLeftSizer = new wxBoxSizer( wxVERTICAL ); - + wxBoxSizer* bGroupSizer; bGroupSizer = new wxBoxSizer( wxHORIZONTAL ); - + m_groupComponentsBox = new wxCheckBox( m_leftPanel, OPT_GROUP_COMPONENTS, _("Group symbols"), wxDefaultPosition, wxDefaultSize, 0 ); - m_groupComponentsBox->SetValue(true); + m_groupComponentsBox->SetValue(true); m_groupComponentsBox->SetToolTip( _("Group components together based on common properties") ); - + bGroupSizer->Add( m_groupComponentsBox, 0, wxALL|wxEXPAND, 5 ); - - + + bGroupSizer->Add( 0, 0, 1, wxEXPAND|wxRIGHT|wxLEFT, 10 ); - - m_bRefresh = new wxBitmapButton( m_leftPanel, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + + m_bRefresh = new wxBitmapButton( m_leftPanel, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); m_bRefresh->SetMinSize( wxSize( 30,30 ) ); - + bGroupSizer->Add( m_bRefresh, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - + + bLeftSizer->Add( bGroupSizer, 0, wxALL|wxBOTTOM|wxEXPAND|wxTOP, 2 ); - + m_fieldsCtrl = new wxDataViewListCtrl( m_leftPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); m_fieldsCtrl->SetMinSize( wxSize( -1,220 ) ); - + bLeftSizer->Add( m_fieldsCtrl, 1, wxALL|wxEXPAND, 5 ); - + m_addFieldButton = new wxButton( m_leftPanel, wxID_ANY, _("Add Field..."), wxDefaultPosition, wxDefaultSize, 0 ); bLeftSizer->Add( m_addFieldButton, 0, wxALL|wxEXPAND, 5 ); - - + + m_leftPanel->SetSizer( bLeftSizer ); m_leftPanel->Layout(); bLeftSizer->Fit( m_leftPanel ); m_panel4 = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bRightSizer; bRightSizer = new wxBoxSizer( wxVERTICAL ); - + m_grid = new WX_GRID( m_panel4, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - + // Grid - m_grid->CreateGrid( 5, 6 ); + m_grid->CreateGrid( 5, 5 ); m_grid->EnableEditing( true ); m_grid->EnableGridLines( true ); m_grid->EnableDragGridSize( false ); m_grid->SetMargins( 0, 0 ); - + // Columns m_grid->EnableDragColMove( true ); m_grid->EnableDragColSize( true ); m_grid->SetColLabelSize( 20 ); - m_grid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - + m_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); + // Rows m_grid->EnableDragRowSize( false ); m_grid->SetRowLabelSize( 0 ); - m_grid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - + m_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); + // Label Appearance - + // Cell Defaults m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); m_grid->SetMinSize( wxSize( 400,240 ) ); - + bRightSizer->Add( m_grid, 1, wxALL|wxEXPAND, 5 ); - - + + m_panel4->SetSizer( bRightSizer ); m_panel4->Layout(); bRightSizer->Fit( m_panel4 ); m_splitter1->SplitVertically( m_leftPanel, m_panel4, -1 ); bMainSizer->Add( m_splitter1, 1, wxALL|wxEXPAND, 5 ); - + wxBoxSizer* bButtonsSizer; bButtonsSizer = new wxBoxSizer( wxHORIZONTAL ); - - + + bButtonsSizer->Add( 0, 0, 1, wxEXPAND, 5 ); - + m_button1 = new wxButton( this, wxID_ANY, _("Apply, Save Schematic && Continue"), wxDefaultPosition, wxDefaultSize, 0 ); bButtonsSizer->Add( m_button1, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); - + m_sdbSizer1 = new wxStdDialogButtonSizer(); m_sdbSizer1OK = new wxButton( this, wxID_OK ); m_sdbSizer1->AddButton( m_sdbSizer1OK ); m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); m_sdbSizer1->Realize(); - + bButtonsSizer->Add( m_sdbSizer1, 0, wxBOTTOM|wxEXPAND|wxLEFT, 5 ); - - + + bMainSizer->Add( bButtonsSizer, 0, wxEXPAND, 5 ); - - + + this->SetSizer( bMainSizer ); this->Layout(); bMainSizer->Fit( this ); - + this->Centre( wxBOTH ); - + // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnClose ) ); m_groupComponentsBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnGroupComponentsToggled ), NULL, this ); @@ -135,6 +135,7 @@ DIALOG_FIELDS_EDITOR_GLOBAL_BASE::DIALOG_FIELDS_EDITOR_GLOBAL_BASE( wxWindow* pa m_grid->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableCellClick ), NULL, this ); m_grid->Connect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableCellClick ), NULL, this ); m_grid->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableItemContextMenu ), NULL, this ); + m_grid->Connect( wxEVT_GRID_COL_SIZE, wxGridSizeEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableColSize ), NULL, this ); m_button1->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnSaveAndContinue ), NULL, this ); m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnCancel ), NULL, this ); } @@ -152,7 +153,8 @@ DIALOG_FIELDS_EDITOR_GLOBAL_BASE::~DIALOG_FIELDS_EDITOR_GLOBAL_BASE() m_grid->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableCellClick ), NULL, this ); m_grid->Disconnect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableCellClick ), NULL, this ); m_grid->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableItemContextMenu ), NULL, this ); + m_grid->Disconnect( wxEVT_GRID_COL_SIZE, wxGridSizeEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableColSize ), NULL, this ); m_button1->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnSaveAndContinue ), NULL, this ); m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnCancel ), NULL, this ); - + } diff --git a/eeschema/dialogs/dialog_fields_editor_global_base.fbp b/eeschema/dialogs/dialog_fields_editor_global_base.fbp index 6e4c89459d..548d161595 100644 --- a/eeschema/dialogs/dialog_fields_editor_global_base.fbp +++ b/eeschema/dialogs/dialog_fields_editor_global_base.fbp @@ -2,7 +2,7 @@ - + C++ 1 source_name @@ -14,11 +14,12 @@ dialog_fields_editor_global_base 1000 none + 1 dialog_fields_editor_global_base - + . - + 1 1 1 @@ -29,65 +30,30 @@ 0 wxAUI_MGR_DEFAULT - + wxBOTH - + 1 1 impl_virtual - - - + + + 0 wxID_ANY - + -1,-1 DIALOG_FIELDS_EDITOR_GLOBAL_BASE - + -1,-1 wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Symbol Fields - - - - - - - - - - - - - + + + + OnClose - - - - - - - - - - - - - - - - - - - - - - - - - - -1,-1 bMainSizer @@ -102,162 +68,112 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 200 - + 0 -1,-1 1 m_splitter1 1 - - + + protected 1 - + Resizable 0.0 -1 -1 1 - + wxSPLIT_VERTICAL wxSP_LIVE_UPDATE - + 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 @@ -266,7 +182,7 @@ wxALL|wxBOTTOM|wxEXPAND|wxTOP 0 - + bGroupSizer wxHORIZONTAL none @@ -279,83 +195,60 @@ 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_groupComponentsBox 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 Group components together based on common properties - + wxFILTER_NONE wxDefaultValidator - - - - - + + + + OnGroupComponentsToggled - - - - - - - - - - - - - - - - - - - - - - @@ -377,88 +270,68 @@ 1 1 1 - - - - - - - - + + + + + + + + 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 - - - - + + + + OnRegroupComponents - - - - - - - - - - - - - - - - - - - - - - - @@ -468,67 +341,28 @@ wxALL|wxEXPAND 1 - - + + 1 1 - - + + 0 wxID_ANY - + -1,220 m_fieldsCtrl protected - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + OnColumnItemToggled - - - - - - - - - - - - - - - - - - - - - OnSizeFieldList - @@ -540,83 +374,68 @@ 1 1 1 - - - - - - - + + + + + + + + 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 - - - - - - - - - - - - - - - - - - - - - - - @@ -628,77 +447,54 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - + + 0 - + 1 m_panel4 1 - - + + protected 1 - + Resizable 1 - - + + 0 - - - + + + wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - + bRightSizer wxVERTICAL none @@ -711,30 +507,30 @@ 1 1 1 - - - - + + + + 0 0 - - - + + + 1 - - + + wxALIGN_LEFT - + wxALIGN_TOP 0 1 wxALIGN_CENTER 20 - + wxALIGN_CENTER 5 - - + + 1 0 Dock @@ -746,103 +542,53 @@ 0 1 1 - + 1 - - + + 1 0 0 wxID_ANY - - - + + + 0 0 - + 0 - - + + 0 400,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 @@ -855,7 +601,7 @@ wxEXPAND 0 - + bButtonsSizer wxHORIZONTAL none @@ -878,83 +624,68 @@ 1 1 1 - - - - - - - + + + + + + + + 1 0 1 - + 1 + 0 0 + Dock 0 Left 1 - + 1 - + + 0 0 wxID_ANY Apply, Save Schematic && Continue - + + 0 + 0 - - + + 0 - + 1 m_button1 1 - - + + protected 1 - + + + Resizable 1 - - + + ; forward_declare 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnSaveAndContinue - - - - - - - - - - - - - - - - - - - - - - - @@ -970,17 +701,10 @@ 1 0 0 - + m_sdbSizer1 protected - OnCancel - - - - - - diff --git a/eeschema/dialogs/dialog_fields_editor_global_base.h b/eeschema/dialogs/dialog_fields_editor_global_base.h index c2162a60a9..db8064fc76 100644 --- a/eeschema/dialogs/dialog_fields_editor_global_base.h +++ b/eeschema/dialogs/dialog_fields_editor_global_base.h @@ -1,12 +1,11 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __DIALOG_FIELDS_EDITOR_GLOBAL_BASE_H__ -#define __DIALOG_FIELDS_EDITOR_GLOBAL_BASE_H__ +#pragma once #include #include @@ -20,10 +19,10 @@ class WX_GRID; #include #include #include +#include #include #include #include -#include #include #include #include @@ -42,7 +41,7 @@ class WX_GRID; class DIALOG_FIELDS_EDITOR_GLOBAL_BASE : public DIALOG_SHIM { private: - + protected: wxSplitterWindow* m_splitter1; wxPanel* m_leftPanel; @@ -56,7 +55,7 @@ class DIALOG_FIELDS_EDITOR_GLOBAL_BASE : public DIALOG_SHIM wxStdDialogButtonSizer* m_sdbSizer1; wxButton* m_sdbSizer1OK; wxButton* m_sdbSizer1Cancel; - + // Virtual event handlers, overide them in your derived class virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } virtual void OnGroupComponentsToggled( wxCommandEvent& event ) { event.Skip(); } @@ -67,15 +66,15 @@ class DIALOG_FIELDS_EDITOR_GLOBAL_BASE : public DIALOG_SHIM virtual void OnTableValueChanged( wxGridEvent& event ) { event.Skip(); } virtual void OnTableCellClick( wxGridEvent& event ) { event.Skip(); } virtual void OnTableItemContextMenu( wxGridEvent& event ) { event.Skip(); } + virtual void OnTableColSize( wxGridSizeEvent& event ) { event.Skip(); } virtual void OnSaveAndContinue( wxCommandEvent& event ) { event.Skip(); } virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } - - + + public: - - DIALOG_FIELDS_EDITOR_GLOBAL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Symbol Fields"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER ); + + DIALOG_FIELDS_EDITOR_GLOBAL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Symbol Fields"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER ); ~DIALOG_FIELDS_EDITOR_GLOBAL_BASE(); - + }; -#endif //__DIALOG_FIELDS_EDITOR_GLOBAL_BASE_H__ diff --git a/eeschema/eeschema_settings.cpp b/eeschema/eeschema_settings.cpp index 6a0564185d..5512d5a841 100644 --- a/eeschema/eeschema_settings.cpp +++ b/eeschema/eeschema_settings.cpp @@ -194,6 +194,9 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() : APP_SETTINGS_BASE( "eeschema", eeschema m_params.emplace_back( new PARAM_MAP( "field_editor.fields_group_by", &m_FieldEditorPanel.fields_group_by, {} ) ); + m_params.emplace_back( new PARAM_MAP( "field_editor.column_widths", + &m_FieldEditorPanel.column_widths, {} ) ); + m_params.emplace_back( new PARAM( "plot.background_color", &m_PlotPanel.background_color, false ) ); diff --git a/eeschema/eeschema_settings.h b/eeschema/eeschema_settings.h index 6c0951cb80..1304485bc8 100644 --- a/eeschema/eeschema_settings.h +++ b/eeschema/eeschema_settings.h @@ -120,6 +120,7 @@ public: { std::map fields_show; std::map fields_group_by; + std::map column_widths; }; struct PANEL_LIB_VIEW