diff --git a/eeschema/dialogs/panel_sym_lib_table.cpp b/eeschema/dialogs/panel_sym_lib_table.cpp index 0bf6dd2670..58e7116c39 100644 --- a/eeschema/dialogs/panel_sym_lib_table.cpp +++ b/eeschema/dialogs/panel_sym_lib_table.cpp @@ -38,6 +38,7 @@ #include #include #include +#include /** * Build a wxGridTableBase by wrapping an #SYMBOL_LIB_TABLE object. @@ -151,7 +152,8 @@ PANEL_SYM_LIB_TABLE::PANEL_SYM_LIB_TABLE( DIALOG_EDIT_LIBRARY_TABLES* aParent, m_globalTable( aGlobal ), m_projectTable( aProject ), m_projectBasePath( aProjectBasePath ), - m_parent( aParent ) + m_parent( aParent ), + m_lastBrowseDir( aProjectBasePath ) { // For user info, shows the table filenames: m_GblTableFilename->SetLabel( aGlobalTablePath ); @@ -163,8 +165,8 @@ PANEL_SYM_LIB_TABLE::PANEL_SYM_LIB_TABLE( DIALOG_EDIT_LIBRARY_TABLES* aParent, m_project_grid->SetTable( new SYMBOL_LIB_TABLE_GRID( *aProject ), true ); // Give a bit more room for combobox editors - m_global_grid->SetDefaultRowSize( m_global_grid->GetDefaultRowSize() + 2 ); - m_project_grid->SetDefaultRowSize( m_project_grid->GetDefaultRowSize() + 2 ); + m_global_grid->SetDefaultRowSize( m_global_grid->GetDefaultRowSize() + 4 ); + m_project_grid->SetDefaultRowSize( m_project_grid->GetDefaultRowSize() + 4 ); // add Cut, Copy, and Paste to wxGrids m_global_grid->PushEventHandler( new SYMBOL_GRID_TRICKS( m_parent, m_global_grid ) ); @@ -189,6 +191,10 @@ PANEL_SYM_LIB_TABLE::PANEL_SYM_LIB_TABLE( DIALOG_EDIT_LIBRARY_TABLES* aParent, // Set special attributes wxGridCellAttr* attr; + attr = new wxGridCellAttr; + attr->SetEditor( new GRID_CELL_PATH_EDITOR( m_parent, &m_lastBrowseDir ) ); + g->SetColAttr( COL_URI, attr ); + attr = new wxGridCellAttr; attr->SetEditor( new wxGridCellChoiceEditor( pluginChoices ) ); g->SetColAttr( COL_TYPE, attr ); @@ -338,9 +344,6 @@ void PANEL_SYM_LIB_TABLE::pageChangedHandler( wxAuiNotebookEvent& event ) void PANEL_SYM_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event ) { - if( m_lastBrowseDir.IsEmpty() ) - m_lastBrowseDir = m_projectBasePath; - wxFileDialog dlg( this, _( "Select Library" ), m_lastBrowseDir, wxEmptyString, SchematicLibraryFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE ); diff --git a/pcbnew/dialogs/panel_fp_lib_table.cpp b/pcbnew/dialogs/panel_fp_lib_table.cpp index 5b09f27bc2..5c6c9dc5a9 100644 --- a/pcbnew/dialogs/panel_fp_lib_table.cpp +++ b/pcbnew/dialogs/panel_fp_lib_table.cpp @@ -58,6 +58,7 @@ #include #include #include +#include // Filters for the file picker static constexpr int FILTER_COUNT = 4; @@ -282,8 +283,8 @@ PANEL_FP_LIB_TABLE::PANEL_FP_LIB_TABLE( DIALOG_EDIT_LIBRARY_TABLES* aParent, m_project_grid->SetTable( new FP_LIB_TABLE_GRID( *aProject ), true ); // Give a bit more room for wxChoice editors - m_global_grid->SetDefaultRowSize( m_global_grid->GetDefaultRowSize() + 2 ); - m_project_grid->SetDefaultRowSize( m_project_grid->GetDefaultRowSize() + 2 ); + m_global_grid->SetDefaultRowSize( m_global_grid->GetDefaultRowSize() + 4 ); + m_project_grid->SetDefaultRowSize( m_project_grid->GetDefaultRowSize() + 4 ); // add Cut, Copy, and Paste to wxGrids m_global_grid->PushEventHandler( new FP_GRID_TRICKS( m_parent, m_global_grid ) ); @@ -314,6 +315,10 @@ PANEL_FP_LIB_TABLE::PANEL_FP_LIB_TABLE( DIALOG_EDIT_LIBRARY_TABLES* aParent, { wxGridCellAttr* attr; + attr = new wxGridCellAttr; + attr->SetEditor( new GRID_CELL_PATH_EDITOR( m_parent, &m_lastBrowseDir ) ); + g->SetColAttr( COL_URI, attr ); + attr = new wxGridCellAttr; attr->SetEditor( new wxGridCellChoiceEditor( choices ) ); g->SetColAttr( COL_TYPE, attr );