KiCad PCB EDA Suite
PANEL_SYM_LIB_TABLE Class Reference

Dialog to show and edit symbol library tables. More...

#include <panel_sym_lib_table.h>

Inheritance diagram for PANEL_SYM_LIB_TABLE:
PANEL_SYM_LIB_TABLE_BASE

Public Member Functions

 PANEL_SYM_LIB_TABLE (DIALOG_EDIT_LIBRARY_TABLES *aParent, PROJECT *m_project, SYMBOL_LIB_TABLE *aGlobal, const wxString &aGlobalTablePath, SYMBOL_LIB_TABLE *aProject, const wxString &aProjectTablePath)
 
virtual ~PANEL_SYM_LIB_TABLE ()
 

Protected Attributes

wxNotebook * m_notebook
 
wxPanel * m_global_panel
 
WX_GRIDm_global_grid
 
wxPanel * m_project_panel
 
WX_GRIDm_project_grid
 
wxBitmapButton * m_append_button
 
wxBitmapButton * m_browse_button
 
wxBitmapButton * m_move_up_button
 
wxBitmapButton * m_move_down_button
 
wxBitmapButton * m_delete_button
 
wxButton * m_convertLegacy
 
WX_GRIDm_path_subs_grid
 

Private Member Functions

bool verifyTables ()
 Trim important fields, removes blank row entries, and checks for duplicates. More...
 
void OnUpdateUI (wxUpdateUIEvent &event) override
 
void browseLibrariesHandler (wxCommandEvent &event) override
 
void appendRowHandler (wxCommandEvent &event) override
 
void deleteRowHandler (wxCommandEvent &event) override
 
void moveUpHandler (wxCommandEvent &event) override
 
void moveDownHandler (wxCommandEvent &event) override
 
void onSizeGrid (wxSizeEvent &event) override
 
void adjustPathSubsGridColumns (int aWidth)
 
void onConvertLegacyLibraries (wxCommandEvent &event) override
 
bool TransferDataFromWindow () override
 
void populateEnvironReadOnlyTable ()
 Populate the readonly environment variable table with names and values by examining all the full_uri columns. More...
 
bool convertLibrary (const wxString &aLibrary, const wxString &legacyFilepath, const wxString &newFilepath)
 
SYMBOL_LIB_TABLE_GRIDglobal_model () const
 
SYMBOL_LIB_TABLE_GRIDproject_model () const
 
SYMBOL_LIB_TABLE_GRIDcur_model () const
 

Private Attributes

SYMBOL_LIB_TABLEm_globalTable
 
SYMBOL_LIB_TABLEm_projectTable
 
PROJECTm_project
 
DIALOG_EDIT_LIBRARY_TABLESm_parent
 
WX_GRIDm_cur_grid
 changed based on tab choice More...
 
wxString m_lastProjectLibDir
 

Static Private Attributes

static size_t m_pageNdx = 0
 Remember the last notebook page selected. More...
 

Detailed Description

Dialog to show and edit symbol library tables.

Definition at line 35 of file panel_sym_lib_table.h.

Constructor & Destructor Documentation

◆ PANEL_SYM_LIB_TABLE()

PANEL_SYM_LIB_TABLE::PANEL_SYM_LIB_TABLE ( DIALOG_EDIT_LIBRARY_TABLES aParent,
PROJECT m_project,
SYMBOL_LIB_TABLE aGlobal,
const wxString &  aGlobalTablePath,
SYMBOL_LIB_TABLE aProject,
const wxString &  aProjectTablePath 
)

Definition at line 177 of file panel_sym_lib_table.cpp.

181  :
182  PANEL_SYM_LIB_TABLE_BASE( aParent ),
183  m_globalTable( aGlobalTable ),
184  m_projectTable( aProjectTable ),
185  m_project( aProject ),
186  m_parent( aParent )
187 {
188  // wxGrid only supports user owned tables if they exist past end of ~wxGrid(),
189  // so make it a grid owned table.
191 
192  wxArrayString pluginChoices;
193 
194  pluginChoices.Add( SCH_IO_MGR::ShowType( SCH_IO_MGR::SCH_KICAD ) );
195  pluginChoices.Add( SCH_IO_MGR::ShowType( SCH_IO_MGR::SCH_LEGACY ) );
196 
197  EESCHEMA_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EESCHEMA_SETTINGS>();
198 
199  if( cfg->m_lastSymbolLibDir.IsEmpty() )
201 
203 
204  auto setupGrid =
205  [&]( WX_GRID* aGrid )
206  {
207  // Give a bit more room for combobox editors
208  aGrid->SetDefaultRowSize( aGrid->GetDefaultRowSize() + 4 );
209 
210  // add Cut, Copy, and Paste to wxGrids
211  aGrid->PushEventHandler( new SYMBOL_GRID_TRICKS( m_parent, aGrid ) );
212 
213  aGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
214  aGrid->AutoSizeColumns( false );
215 
216  // Set special attributes
217  wxGridCellAttr* attr;
218 
219  attr = new wxGridCellAttr;
220 
221  wxString wildcards = AllSymbolLibFilesWildcard()
223  + "|" + LegacySymbolLibFileWildcard();
224  attr->SetEditor( new GRID_CELL_PATH_EDITOR( m_parent, aGrid,
225  &cfg->m_lastSymbolLibDir, wildcards,
226  true, m_project->GetProjectPath() ) );
227  aGrid->SetColAttr( COL_URI, attr );
228 
229  attr = new wxGridCellAttr;
230  attr->SetEditor( new wxGridCellChoiceEditor( pluginChoices ) );
231  aGrid->SetColAttr( COL_TYPE, attr );
232 
233  attr = new wxGridCellAttr;
234  attr->SetRenderer( new wxGridCellBoolRenderer() );
235  attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS
236  aGrid->SetColAttr( COL_ENABLED, attr );
237 
238  // all but COL_OPTIONS, which is edited with Option Editor anyways.
239  aGrid->AutoSizeColumn( COL_NICKNAME, false );
240  aGrid->AutoSizeColumn( COL_TYPE, false );
241  aGrid->AutoSizeColumn( COL_URI, false );
242  aGrid->AutoSizeColumn( COL_DESCR, false );
243  aGrid->AutoSizeColumn( COL_ENABLED, false );
244 
245  // would set this to width of title, if it was easily known.
246  aGrid->SetColSize( COL_OPTIONS, 80 );
247 
248  // Gives a selection to each grid, mainly for delete button. wxGrid's wake up with
249  // a currentCell which is sometimes not highlighted.
250  if( aGrid->GetNumberRows() > 0 )
251  aGrid->SelectRow( 0 );
252  };
253 
254  setupGrid( m_global_grid );
255 
256  if( m_projectTable )
257  {
259  setupGrid( m_project_grid );
260  }
261  else
262  {
263  m_pageNdx = 0;
264  m_notebook->DeletePage( 1 );
265  m_project_grid = nullptr;
266  }
267 
268  // add Cut, Copy, and Paste to wxGrids
269  m_path_subs_grid->PushEventHandler( new GRID_TRICKS( m_path_subs_grid ) );
270 
272 
273  // select the last selected page
274  m_notebook->SetSelection( m_pageNdx );
276 
277  m_path_subs_grid->SetColLabelValue( 0, _( "Name" ) );
278  m_path_subs_grid->SetColLabelValue( 1, _( "Value" ) );
279 
280  // for ALT+A handling, we want the initial focus to be on the first selected grid.
282 
283  // Configure button logos
289 }
wxString AllSymbolLibFilesWildcard()
static const wxString ShowType(SCH_FILE_T aFileType)
Return a brief name for a plugin, given aFileType enum.
Definition: sch_io_mgr.cpp:79
WX_GRID * m_cur_grid
changed based on tab choice
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
Definition: grid_tricks.h:52
static size_t m_pageNdx
Remember the last notebook page selected.
void SetTable(wxGridTableBase *table, bool aTakeOwnership=false)
Hide wxGrid's SetTable() method with one which doesn't mess up the grid column widths when setting th...
Definition: wx_grid.cpp:65
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
virtual const wxString GetProjectPath() const
Return the full path of the project.
Definition: project.cpp:123
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Definition: dialog_shim.h:98
void populateEnvironReadOnlyTable()
Populate the readonly environment variable table with names and values by examining all the full_uri ...
Build a wxGridTableBase by wrapping an SYMBOL_LIB_TABLE object.
SYMBOL_LIB_TABLE * m_projectTable
PANEL_SYM_LIB_TABLE_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
wxString KiCadSymbolLibFileWildcard()
Editor for wxGrid cells that adds a file/folder browser to the grid input field.
wxString LegacySymbolLibFileWildcard()
DIALOG_EDIT_LIBRARY_TABLES * m_parent
static wxString GetDefaultUserSymbolsPath()
Gets the default path we point users to create projects.
Definition: paths.cpp:97
#define _(s)
Definition: 3d_actions.cpp:33
SYMBOL_LIB_TABLE * m_globalTable
wxBitmap KiBitmap(BITMAPS aBitmap)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:104

References _, AllSymbolLibFilesWildcard(), COL_DESCR, COL_ENABLED, COL_NICKNAME, COL_OPTIONS, COL_TYPE, COL_URI, PATHS::GetDefaultUserSymbolsPath(), PROJECT::GetProjectPath(), KiBitmap(), KiCadSymbolLibFileWildcard(), LegacySymbolLibFileWildcard(), PANEL_SYM_LIB_TABLE_BASE::m_append_button, PANEL_SYM_LIB_TABLE_BASE::m_browse_button, m_cur_grid, PANEL_SYM_LIB_TABLE_BASE::m_delete_button, PANEL_SYM_LIB_TABLE_BASE::m_global_grid, m_globalTable, m_lastProjectLibDir, EESCHEMA_SETTINGS::m_lastSymbolLibDir, PANEL_SYM_LIB_TABLE_BASE::m_move_down_button, PANEL_SYM_LIB_TABLE_BASE::m_move_up_button, PANEL_SYM_LIB_TABLE_BASE::m_notebook, m_pageNdx, m_parent, PANEL_SYM_LIB_TABLE_BASE::m_path_subs_grid, m_project, PANEL_SYM_LIB_TABLE_BASE::m_project_grid, m_projectTable, Pgm(), populateEnvironReadOnlyTable(), DIALOG_SHIM::SetInitialFocus(), WX_GRID::SetTable(), SCH_IO_MGR::ShowType(), small_down, small_folder, small_plus, small_trash, and small_up.

◆ ~PANEL_SYM_LIB_TABLE()

PANEL_SYM_LIB_TABLE::~PANEL_SYM_LIB_TABLE ( )
virtual

Definition at line 292 of file panel_sym_lib_table.cpp.

293 {
294  // When the dialog is closed it will hide the current notebook page first, which will
295  // in turn select the other one. We then end up saving its index as the "current page".
296  // So flip them back again:
297  m_pageNdx = m_pageNdx == 1 ? 0 : 1;
298 
299  // Delete the GRID_TRICKS.
300  // Any additional event handlers should be popped before the window is deleted.
301  m_global_grid->PopEventHandler( true );
302 
303  if( m_project_grid )
304  m_project_grid->PopEventHandler( true );
305 
306  m_path_subs_grid->PopEventHandler( true );
307 }
static size_t m_pageNdx
Remember the last notebook page selected.

References PANEL_SYM_LIB_TABLE_BASE::m_global_grid, m_pageNdx, PANEL_SYM_LIB_TABLE_BASE::m_path_subs_grid, and PANEL_SYM_LIB_TABLE_BASE::m_project_grid.

Member Function Documentation

◆ adjustPathSubsGridColumns()

void PANEL_SYM_LIB_TABLE::adjustPathSubsGridColumns ( int  aWidth)
private

Definition at line 918 of file panel_sym_lib_table.cpp.

919 {
920  // Account for scroll bars
921  aWidth -= ( m_path_subs_grid->GetSize().x - m_path_subs_grid->GetClientSize().x );
922 
923  m_path_subs_grid->AutoSizeColumn( 0 );
924 
925  int remaining_width = aWidth - m_path_subs_grid->GetColSize( 0 );
926 
927  if( remaining_width < 0 )
928  m_path_subs_grid->SetColSize( 1, -1 );
929  else
930  m_path_subs_grid->SetColSize( 1, remaining_width );
931 }

References PANEL_SYM_LIB_TABLE_BASE::m_path_subs_grid.

Referenced by onSizeGrid(), and populateEnvironReadOnlyTable().

◆ appendRowHandler()

void PANEL_SYM_LIB_TABLE::appendRowHandler ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_SYM_LIB_TABLE_BASE.

Definition at line 542 of file panel_sym_lib_table.cpp.

543 {
545  return;
546 
547  if( m_cur_grid->AppendRows( 1 ) )
548  {
549  int row = m_cur_grid->GetNumberRows() - 1;
550 
551  // wx documentation is wrong, SetGridCursor does not make visible.
552  m_cur_grid->MakeCellVisible( row, 0 );
553  m_cur_grid->SetGridCursor( row, 1 );
554  m_cur_grid->EnableCellEditControl( true );
555  m_cur_grid->ShowCellEditControl();
556  }
557 }
WX_GRID * m_cur_grid
changed based on tab choice
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
Definition: wx_grid.cpp:182

References WX_GRID::CommitPendingChanges(), and m_cur_grid.

◆ browseLibrariesHandler()

void PANEL_SYM_LIB_TABLE::browseLibrariesHandler ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_SYM_LIB_TABLE_BASE.

Definition at line 442 of file panel_sym_lib_table.cpp.

443 {
444  wxString wildcards = AllSymbolLibFilesWildcard()
446  + "|" + LegacySymbolLibFileWildcard();
447 
448  EESCHEMA_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EESCHEMA_SETTINGS>();
449 
450  wxString openDir = cfg->m_lastSymbolLibDir;
451  if( m_cur_grid == m_project_grid )
452  {
453  openDir = m_lastProjectLibDir;
454  }
455 
456  wxFileDialog dlg( this, _( "Select Library" ),
457  openDir, wxEmptyString, wildcards,
458  wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE );
459 
460  if( dlg.ShowModal() == wxID_CANCEL )
461  return;
462 
463  if( m_cur_grid == m_global_grid )
464  {
465  cfg->m_lastSymbolLibDir = dlg.GetPath();
466  }
467  else
468  {
469  m_lastProjectLibDir = dlg.GetPath();
470  }
471 
472  const ENV_VAR_MAP& envVars = Pgm().GetLocalEnvVariables();
473  bool addDuplicates = false;
474  bool applyToAll = false;
475  wxString warning = _( "Warning: Duplicate Nickname" );
476  wxString msg = _( "A library nicknamed '%s' already exists." );
477  wxString detailedMsg = _( "One of the nicknames will need to be changed after "
478  "adding this library." );
479 
480  wxArrayString files;
481  dlg.GetFilenames( files );
482 
483  for( const wxString& file : files )
484  {
485  wxString filePath = dlg.GetDirectory() + wxFileName::GetPathSeparator() + file;
486  wxFileName fn( filePath );
487  wxString nickname = LIB_ID::FixIllegalChars( fn.GetName() );
488  bool doAdd = true;
489 
490  if( cur_model()->ContainsNickname( nickname ) )
491  {
492  if( !applyToAll )
493  {
494  // The cancel button adds the library to the table anyway
495  addDuplicates = OKOrCancelDialog( this, warning, wxString::Format( msg, nickname ),
496  detailedMsg, _( "Skip" ), _( "Add Anyway" ),
497  &applyToAll ) == wxID_CANCEL;
498  }
499 
500  doAdd = addDuplicates;
501  }
502 
503  if( doAdd && m_cur_grid->AppendRows( 1 ) )
504  {
505  int last_row = m_cur_grid->GetNumberRows() - 1;
506 
507  m_cur_grid->SetCellValue( last_row, COL_NICKNAME, nickname );
508 
509  // TODO the following code can detect only schematic types, not libs
510  // SCH_IO_MGR needs to provide file extension information for libraries too
511 
512  // auto detect the plugin type
513  for( SCH_IO_MGR::SCH_FILE_T piType : SCH_IO_MGR::SCH_FILE_T_vector )
514  {
515  if( SCH_IO_MGR::GetLibraryFileExtension( piType ).Lower() == fn.GetExt().Lower() )
516  {
517  m_cur_grid->SetCellValue( last_row, COL_TYPE, SCH_IO_MGR::ShowType( piType ) );
518  break;
519  }
520  }
521 
522  // try to use path normalized to an environmental variable or project path
523  wxString path = NormalizePath( filePath, &envVars, m_project->GetProjectPath() );
524 
525  // Do not use the project path in the global library table. This will almost
526  // assuredly be wrong for a different project.
527  if( path.IsEmpty() || (m_pageNdx == 0 && path.Contains( "${KIPRJMOD}" )) )
528  path = fn.GetFullPath();
529 
530  m_cur_grid->SetCellValue( last_row, COL_URI, path );
531  }
532  }
533 
534  if( !files.IsEmpty() )
535  {
536  m_cur_grid->MakeCellVisible( m_cur_grid->GetNumberRows() - 1, 0 );
537  m_cur_grid->SetGridCursor( m_cur_grid->GetNumberRows() - 1, 1 );
538  }
539 }
wxString AllSymbolLibFilesWildcard()
static UTF8 FixIllegalChars(const UTF8 &aLibItemName, bool aLib=false)
Replace illegal LIB_ID item name characters with underscores '_'.
Definition: lib_id.cpp:347
bool ContainsNickname(const wxString &aNickname)
static const wxString ShowType(SCH_FILE_T aFileType)
Return a brief name for a plugin, given aFileType enum.
Definition: sch_io_mgr.cpp:79
WX_GRID * m_cur_grid
changed based on tab choice
static const wxString GetLibraryFileExtension(SCH_FILE_T aFileType)
Return the symbol library file extension (if any) for aFileType.
Definition: sch_io_mgr.cpp:136
static size_t m_pageNdx
Remember the last notebook page selected.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
virtual const wxString GetProjectPath() const
Return the full path of the project.
Definition: project.cpp:123
std::map< wxString, ENV_VAR_ITEM > ENV_VAR_MAP
Definition: pgm_base.h:112
SYMBOL_LIB_TABLE_GRID * cur_model() const
wxString KiCadSymbolLibFileWildcard()
wxString LegacySymbolLibFileWildcard()
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
int OKOrCancelDialog(wxWindow *aParent, const wxString &aWarning, const wxString &aMessage, wxString aDetailedMessage, wxString aOKLabel, wxString aCancelLabel, bool *aApplyToAll)
Display a warning dialog with aMessage and returns the user response.
Definition: confirm.cpp:220
#define _(s)
Definition: 3d_actions.cpp:33
wxString NormalizePath(const wxFileName &aFilePath, const ENV_VAR_MAP *aEnvVars, const wxString &aProjectPath)
Normalize a file path to an environmental variable, if possible.
Definition: env_paths.cpp:67

References _, AllSymbolLibFilesWildcard(), COL_NICKNAME, COL_TYPE, COL_URI, LIB_TABLE_GRID::ContainsNickname(), cur_model(), LIB_ID::FixIllegalChars(), Format(), SCH_IO_MGR::GetLibraryFileExtension(), PROJECT::GetProjectPath(), KiCadSymbolLibFileWildcard(), LegacySymbolLibFileWildcard(), m_cur_grid, PANEL_SYM_LIB_TABLE_BASE::m_global_grid, m_lastProjectLibDir, EESCHEMA_SETTINGS::m_lastSymbolLibDir, m_pageNdx, m_project, PANEL_SYM_LIB_TABLE_BASE::m_project_grid, NormalizePath(), OKOrCancelDialog(), path, Pgm(), and SCH_IO_MGR::ShowType().

◆ convertLibrary()

bool PANEL_SYM_LIB_TABLE::convertLibrary ( const wxString &  aLibrary,
const wxString &  legacyFilepath,
const wxString &  newFilepath 
)
private

Definition at line 765 of file panel_sym_lib_table.cpp.

767 {
768  SCH_PLUGIN::SCH_PLUGIN_RELEASER legacyPI( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_LEGACY ) );
769  SCH_PLUGIN::SCH_PLUGIN_RELEASER kicadPI( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD ) );
770  std::vector<LIB_PART*> parts;
771  std::vector<LIB_PART*> newParts;
772  std::map<LIB_PART*, LIB_PART*> partMap;
773 
774  try
775  {
776  // Write a stub file; SaveSymbol() expects something to be there already.
777  FILE_OUTPUTFORMATTER* formatter = new FILE_OUTPUTFORMATTER( newFilepath );
778 
779  formatter->Print( 0, "(kicad_symbol_lib (version %d) (generator kicad_converter))",
781 
782  // This will write the file
783  delete formatter;
784 
785  legacyPI->EnumerateSymbolLib( parts, legacyFilepath );
786 
787  // Copy non-aliases first so we can build a map from parts to newParts
788  for( LIB_PART* part : parts )
789  {
790  if( part->IsAlias() )
791  continue;
792 
793  newParts.push_back( new LIB_PART( *part ) );
794  partMap[part] = newParts.back();
795  }
796 
797  // Now do the aliases using the map to hook them up to their newPart parents
798  for( LIB_PART* part : parts )
799  {
800  if( !part->IsAlias() )
801  continue;
802 
803  newParts.push_back( new LIB_PART( *part ) );
804  newParts.back()->SetParent( partMap[ part->GetParent().lock().get() ] );
805  }
806 
807  // Finally write out newParts
808  for( LIB_PART* part : newParts )
809  {
810  kicadPI->SaveSymbol( newFilepath, part );
811  }
812  }
813  catch( ... )
814  {
815  return false;
816  }
817 
818  return true;
819 }
#define SEXPR_SYMBOL_LIB_FILE_VERSION
This file contains the file format version information for the s-expression schematic and symbol libr...
Define a library symbol object.
Definition: lib_symbol.h:93
Helper object to release a SCH_PLUGIN in the context of a potential thrown exception through its dest...
Definition: sch_io_mgr.h:473
Used for text file output.
Definition: richio.h:453
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Format and write text to the output stream.
Definition: richio.cpp:408

References OUTPUTFORMATTER::Print(), and SEXPR_SYMBOL_LIB_FILE_VERSION.

Referenced by onConvertLegacyLibraries().

◆ cur_model()

SYMBOL_LIB_TABLE_GRID * PANEL_SYM_LIB_TABLE::cur_model ( ) const
private

Definition at line 954 of file panel_sym_lib_table.cpp.

955 {
956  return (SYMBOL_LIB_TABLE_GRID*) m_cur_grid->GetTable();
957 }
WX_GRID * m_cur_grid
changed based on tab choice
Build a wxGridTableBase by wrapping an SYMBOL_LIB_TABLE object.

References m_cur_grid.

Referenced by browseLibrariesHandler(), moveDownHandler(), moveUpHandler(), and verifyTables().

◆ deleteRowHandler()

void PANEL_SYM_LIB_TABLE::deleteRowHandler ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_SYM_LIB_TABLE_BASE.

Definition at line 560 of file panel_sym_lib_table.cpp.

561 {
563  return;
564 
565  int curRow = m_cur_grid->GetGridCursorRow();
566  int curCol = m_cur_grid->GetGridCursorCol();
567 
568  // In a wxGrid, collect rows that have a selected cell, or are selected
569  // It is not so easy: it depends on the way the selection was made.
570  // Here, we collect rows selected by clicking on a row label, and rows that contain
571  // previously-selected cells.
572  // If no candidate, just delete the row with the grid cursor.
573  wxArrayInt selectedRows = m_cur_grid->GetSelectedRows();
574  wxGridCellCoordsArray cells = m_cur_grid->GetSelectedCells();
575  wxGridCellCoordsArray blockTopLeft = m_cur_grid->GetSelectionBlockTopLeft();
576  wxGridCellCoordsArray blockBotRight = m_cur_grid->GetSelectionBlockBottomRight();
577 
578  // Add all row having cell selected to list:
579  for( unsigned ii = 0; ii < cells.GetCount(); ii++ )
580  selectedRows.Add( cells[ii].GetRow() );
581 
582  // Handle block selection
583  if( !blockTopLeft.IsEmpty() && !blockBotRight.IsEmpty() )
584  {
585  for( int i = blockTopLeft[0].GetRow(); i <= blockBotRight[0].GetRow(); ++i )
586  selectedRows.Add( i );
587  }
588 
589  // Use the row having the grid cursor only if we have no candidate:
590  if( selectedRows.size() == 0 && m_cur_grid->GetGridCursorRow() >= 0 )
591  selectedRows.Add( m_cur_grid->GetGridCursorRow() );
592 
593  if( selectedRows.size() == 0 )
594  {
595  wxBell();
596  return;
597  }
598 
599  std::sort( selectedRows.begin(), selectedRows.end() );
600 
601  // Remove selected rows (note: a row can be stored more than once in list)
602  int last_row = -1;
603 
604  for( int ii = selectedRows.GetCount()-1; ii >= 0; ii-- )
605  {
606  int row = selectedRows[ii];
607 
608  if( row != last_row )
609  {
610  last_row = row;
611  m_cur_grid->DeleteRows( row, 1 );
612  }
613  }
614 
615  if( m_cur_grid->GetNumberRows() > 0 && curRow >= 0 )
616  m_cur_grid->SetGridCursor( std::min( curRow, m_cur_grid->GetNumberRows() - 1 ), curCol );
617 }
WX_GRID * m_cur_grid
changed based on tab choice
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
Definition: wx_grid.cpp:182

References WX_GRID::CommitPendingChanges(), and m_cur_grid.

◆ global_model()

SYMBOL_LIB_TABLE_GRID * PANEL_SYM_LIB_TABLE::global_model ( ) const
private

Definition at line 942 of file panel_sym_lib_table.cpp.

943 {
944  return (SYMBOL_LIB_TABLE_GRID*) m_global_grid->GetTable();
945 }
Build a wxGridTableBase by wrapping an SYMBOL_LIB_TABLE object.

References PANEL_SYM_LIB_TABLE_BASE::m_global_grid.

Referenced by populateEnvironReadOnlyTable(), TransferDataFromWindow(), and verifyTables().

◆ moveDownHandler()

void PANEL_SYM_LIB_TABLE::moveDownHandler ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_SYM_LIB_TABLE_BASE.

Definition at line 650 of file panel_sym_lib_table.cpp.

651 {
653  return;
654 
656  int curRow = m_cur_grid->GetGridCursorRow();
657 
658  // @todo: add multiple selection moves.
659  if( unsigned( curRow + 1 ) < tbl->rows.size() )
660  {
661  boost::ptr_vector< LIB_TABLE_ROW >::auto_type move_me =
662  tbl->rows.release( tbl->rows.begin() + curRow );
663 
664  ++curRow;
665  tbl->rows.insert( tbl->rows.begin() + curRow, move_me.release() );
666 
667  if( tbl->GetView() )
668  {
669  // Update the wxGrid
670  wxGridTableMessage msg( tbl, wxGRIDTABLE_NOTIFY_ROWS_INSERTED, curRow - 1, 0 );
671  tbl->GetView()->ProcessTableMessage( msg );
672  }
673 
674  m_cur_grid->MakeCellVisible( curRow, m_cur_grid->GetGridCursorCol() );
675  m_cur_grid->SetGridCursor( curRow, m_cur_grid->GetGridCursorCol() );
676  }
677 }
WX_GRID * m_cur_grid
changed based on tab choice
LIB_TABLE_ROWS rows
Build a wxGridTableBase by wrapping an SYMBOL_LIB_TABLE object.
SYMBOL_LIB_TABLE_GRID * cur_model() const
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
Definition: wx_grid.cpp:182

References WX_GRID::CommitPendingChanges(), cur_model(), m_cur_grid, and LIB_TABLE::rows.

◆ moveUpHandler()

void PANEL_SYM_LIB_TABLE::moveUpHandler ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_SYM_LIB_TABLE_BASE.

Definition at line 620 of file panel_sym_lib_table.cpp.

621 {
623  return;
624 
626  int curRow = m_cur_grid->GetGridCursorRow();
627 
628  // @todo: add multiple selection moves.
629  if( curRow >= 1 )
630  {
631  boost::ptr_vector< LIB_TABLE_ROW >::auto_type move_me =
632  tbl->rows.release( tbl->rows.begin() + curRow );
633 
634  --curRow;
635  tbl->rows.insert( tbl->rows.begin() + curRow, move_me.release() );
636 
637  if( tbl->GetView() )
638  {
639  // Update the wxGrid
640  wxGridTableMessage msg( tbl, wxGRIDTABLE_NOTIFY_ROWS_INSERTED, curRow, 0 );
641  tbl->GetView()->ProcessTableMessage( msg );
642  }
643 
644  m_cur_grid->MakeCellVisible( curRow, m_cur_grid->GetGridCursorCol() );
645  m_cur_grid->SetGridCursor( curRow, m_cur_grid->GetGridCursorCol() );
646  }
647 }
WX_GRID * m_cur_grid
changed based on tab choice
LIB_TABLE_ROWS rows
Build a wxGridTableBase by wrapping an SYMBOL_LIB_TABLE object.
SYMBOL_LIB_TABLE_GRID * cur_model() const
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
Definition: wx_grid.cpp:182

References WX_GRID::CommitPendingChanges(), cur_model(), m_cur_grid, and LIB_TABLE::rows.

◆ onConvertLegacyLibraries()

void PANEL_SYM_LIB_TABLE::onConvertLegacyLibraries ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_SYM_LIB_TABLE_BASE.

Definition at line 680 of file panel_sym_lib_table.cpp.

681 {
683  return;
684 
685  wxArrayInt selectedRows = m_cur_grid->GetSelectedRows();
686 
687  if( selectedRows.empty() && m_cur_grid->GetGridCursorRow() >= 0 )
688  selectedRows.push_back( m_cur_grid->GetGridCursorRow() );
689 
690  wxArrayInt legacyRows;
691  wxString legacyType = SCH_IO_MGR::ShowType( SCH_IO_MGR::SCH_LEGACY );
692  wxString kicadType = SCH_IO_MGR::ShowType( SCH_IO_MGR::SCH_KICAD );
693  wxString msg;
694 
695  for( int row : selectedRows )
696  {
697  if( m_cur_grid->GetCellValue( row, COL_TYPE ) == legacyType )
698  legacyRows.push_back( row );
699  }
700 
701  if( legacyRows.size() <= 0 )
702  {
703  wxMessageBox( _( "Select one or more table rows containing legacy libraries to save as "
704  "current format (*.kicad_sym)." ) );
705  return;
706  }
707  else
708  {
709  if( legacyRows.size() == 1 )
710  {
711  msg.Printf( _( "Save '%s' as current format (*.kicad_sym) and "
712  "replace legacy entry in table?" ),
713  m_cur_grid->GetCellValue( legacyRows[0], COL_NICKNAME ) );
714  }
715  else
716  {
717  msg.Printf( _( "Save %d legacy libraries as current format (*.kicad_sym) and "
718  "replace legacy entries in table?" ),
719  legacyRows.size() );
720  }
721 
722  if( !IsOK( m_parent, msg ) )
723  return;
724  }
725 
726  for( int row : legacyRows )
727  {
728  wxString libName = m_cur_grid->GetCellValue( row, COL_NICKNAME );
729  wxString relPath = m_cur_grid->GetCellValue( row, COL_URI );
730  wxString resolvedPath = ExpandEnvVarSubstitutions( relPath, m_project );
731  wxFileName legacyLib( resolvedPath );
732 
733  if( !legacyLib.Exists() )
734  {
735  msg.Printf( _( "Library '%s' not found." ), relPath );
736  DisplayErrorMessage( this, msg );
737  continue;
738  }
739 
740  wxFileName newLib( resolvedPath );
741  newLib.SetExt( "kicad_sym" );
742 
743  if( convertLibrary( libName, legacyLib.GetFullPath(), newLib.GetFullPath() ) )
744  {
745  relPath = NormalizePath( newLib.GetFullPath(), &Pgm().GetLocalEnvVariables(),
746  m_project );
747 
748  // Do not use the project path in the global library table. This will almost
749  // assuredly be wrong for a different project.
750  if( relPath.IsEmpty() || (m_cur_grid == m_global_grid && relPath.Contains( "${KIPRJMOD}" ) ) )
751  relPath = newLib.GetFullPath();
752 
753  m_cur_grid->SetCellValue( row, COL_URI, relPath );
754  m_cur_grid->SetCellValue( row, COL_TYPE, kicadType );
755  }
756  else
757  {
758  msg.Printf( _( "Failed to save symbol library file '%s'." ), newLib.GetFullPath() );
759  DisplayErrorMessage( this, msg );
760  }
761  }
762 }
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:265
static const wxString ShowType(SCH_FILE_T aFileType)
Return a brief name for a plugin, given aFileType enum.
Definition: sch_io_mgr.cpp:79
WX_GRID * m_cur_grid
changed based on tab choice
const wxString ExpandEnvVarSubstitutions(const wxString &aString, PROJECT *aProject)
Replace any environment variable & text variable references with their values.
Definition: common.cpp:273
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
bool convertLibrary(const wxString &aLibrary, const wxString &legacyFilepath, const wxString &newFilepath)
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
Definition: wx_grid.cpp:182
DIALOG_EDIT_LIBRARY_TABLES * m_parent
#define _(s)
Definition: 3d_actions.cpp:33
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:296
wxString NormalizePath(const wxFileName &aFilePath, const ENV_VAR_MAP *aEnvVars, const wxString &aProjectPath)
Normalize a file path to an environmental variable, if possible.
Definition: env_paths.cpp:67

References _, COL_NICKNAME, COL_TYPE, COL_URI, WX_GRID::CommitPendingChanges(), convertLibrary(), DisplayErrorMessage(), ExpandEnvVarSubstitutions(), IsOK(), m_cur_grid, PANEL_SYM_LIB_TABLE_BASE::m_global_grid, m_parent, m_project, NormalizePath(), Pgm(), and SCH_IO_MGR::ShowType().

◆ onSizeGrid()

void PANEL_SYM_LIB_TABLE::onSizeGrid ( wxSizeEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_SYM_LIB_TABLE_BASE.

Definition at line 934 of file panel_sym_lib_table.cpp.

935 {
936  adjustPathSubsGridColumns( event.GetSize().GetX() );
937 
938  event.Skip();
939 }
void adjustPathSubsGridColumns(int aWidth)

References adjustPathSubsGridColumns().

◆ OnUpdateUI()

void PANEL_SYM_LIB_TABLE::OnUpdateUI ( wxUpdateUIEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_SYM_LIB_TABLE_BASE.

Definition at line 435 of file panel_sym_lib_table.cpp.

436 {
437  m_pageNdx = (unsigned) std::max( 0, m_notebook->GetSelection() );
439 }
WX_GRID * m_cur_grid
changed based on tab choice
static size_t m_pageNdx
Remember the last notebook page selected.

References m_cur_grid, PANEL_SYM_LIB_TABLE_BASE::m_global_grid, PANEL_SYM_LIB_TABLE_BASE::m_notebook, m_pageNdx, and PANEL_SYM_LIB_TABLE_BASE::m_project_grid.

◆ populateEnvironReadOnlyTable()

void PANEL_SYM_LIB_TABLE::populateEnvironReadOnlyTable ( )
private

Populate the readonly environment variable table with names and values by examining all the full_uri columns.

Definition at line 854 of file panel_sym_lib_table.cpp.

855 {
856  wxRegEx re( ".*?(\\$\\{(.+?)\\})|(\\$\\((.+?)\\)).*?", wxRE_ADVANCED );
857  wxASSERT( re.IsValid() ); // wxRE_ADVANCED is required.
858 
859  std::set< wxString > unique;
860 
861  // clear the table
862  m_path_subs_grid->DeleteRows( 0, m_path_subs_grid->GetNumberRows() );
863 
864  for( SYMBOL_LIB_TABLE_GRID* tbl : { global_model(), project_model() } )
865  {
866  if( !tbl )
867  continue;
868 
869  for( int row = 0; row < tbl->GetNumberRows(); ++row )
870  {
871  wxString uri = tbl->GetValue( row, COL_URI );
872 
873  while( re.Matches( uri ) )
874  {
875  wxString envvar = re.GetMatch( uri, 2 );
876 
877  // if not ${...} form then must be $(...)
878  if( envvar.IsEmpty() )
879  envvar = re.GetMatch( uri, 4 );
880 
881  // ignore duplicates
882  unique.insert( envvar );
883 
884  // delete the last match and search again
885  uri.Replace( re.GetMatch( uri, 0 ), wxEmptyString );
886  }
887  }
888  }
889 
890  // Make sure this special environment variable shows up even if it was
891  // not used yet. It is automatically set by KiCad to the directory holding
892  // the current project.
893  unique.insert( PROJECT_VAR_NAME );
895 
896  for( const wxString& evName : unique )
897  {
898  int row = m_path_subs_grid->GetNumberRows();
899  m_path_subs_grid->AppendRows( 1 );
900 
901  m_path_subs_grid->SetCellValue( row, 0, wxT( "${" ) + evName + wxT( "}" ) );
902  m_path_subs_grid->SetCellEditor( row, 0, new GRID_CELL_READONLY_TEXT_EDITOR() );
903 
904  wxString evValue;
905  wxGetEnv( evName, &evValue );
906  m_path_subs_grid->SetCellValue( row, 1, evValue );
907  m_path_subs_grid->SetCellEditor( row, 1, new GRID_CELL_READONLY_TEXT_EDITOR() );
908  }
909 
910  // No combobox editors here, but it looks better if its consistent with the other
911  // grids in the dialog.
912  m_path_subs_grid->SetDefaultRowSize( m_path_subs_grid->GetDefaultRowSize() + 2 );
913 
914  adjustPathSubsGridColumns( m_path_subs_grid->GetRect().GetWidth() );
915 }
#define PROJECT_VAR_NAME
A variable name whose value holds the current project directory.
Definition: project.h:38
SYMBOL_LIB_TABLE_GRID * global_model() const
static const wxString GlobalPathEnvVariableName()
Return the name of the environment variable used to hold the directory of locally installed "KiCad sp...
void adjustPathSubsGridColumns(int aWidth)
Build a wxGridTableBase by wrapping an SYMBOL_LIB_TABLE object.
SYMBOL_LIB_TABLE_GRID * project_model() const

References adjustPathSubsGridColumns(), COL_URI, global_model(), SYMBOL_LIB_TABLE::GlobalPathEnvVariableName(), PANEL_SYM_LIB_TABLE_BASE::m_path_subs_grid, project_model(), and PROJECT_VAR_NAME.

Referenced by PANEL_SYM_LIB_TABLE().

◆ project_model()

SYMBOL_LIB_TABLE_GRID * PANEL_SYM_LIB_TABLE::project_model ( ) const
private

Definition at line 948 of file panel_sym_lib_table.cpp.

949 {
950  return m_project_grid ? (SYMBOL_LIB_TABLE_GRID*) m_project_grid->GetTable() : nullptr;
951 }
Build a wxGridTableBase by wrapping an SYMBOL_LIB_TABLE object.

References PANEL_SYM_LIB_TABLE_BASE::m_project_grid.

Referenced by populateEnvironReadOnlyTable(), TransferDataFromWindow(), and verifyTables().

◆ TransferDataFromWindow()

bool PANEL_SYM_LIB_TABLE::TransferDataFromWindow ( )
overrideprivate

Definition at line 822 of file panel_sym_lib_table.cpp.

823 {
825  return false;
826 
827  if( !verifyTables() )
828  return false;
829 
830  if( *global_model() != *m_globalTable )
831  {
833 
834  m_globalTable->Clear();
835  m_globalTable->rows.transfer( m_globalTable->rows.end(), global_model()->rows.begin(),
836  global_model()->rows.end(), global_model()->rows );
838  }
839 
840  if( project_model() && *project_model() != *m_projectTable )
841  {
843 
845  m_projectTable->rows.transfer( m_projectTable->rows.end(), project_model()->rows.begin(),
846  project_model()->rows.end(), project_model()->rows );
848  }
849 
850  return true;
851 }
void Clear()
Delete all rows.
void reindex()
WX_GRID * m_cur_grid
changed based on tab choice
SYMBOL_LIB_TABLE_GRID * global_model() const
LIB_TABLE_ROWS rows
SYMBOL_LIB_TABLE * m_projectTable
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
Definition: wx_grid.cpp:182
DIALOG_EDIT_LIBRARY_TABLES * m_parent
SYMBOL_LIB_TABLE_GRID * project_model() const
bool verifyTables()
Trim important fields, removes blank row entries, and checks for duplicates.
SYMBOL_LIB_TABLE * m_globalTable

References LIB_TABLE::Clear(), WX_GRID::CommitPendingChanges(), global_model(), m_cur_grid, m_globalTable, DIALOG_EDIT_LIBRARY_TABLES::m_GlobalTableChanged, m_parent, m_projectTable, DIALOG_EDIT_LIBRARY_TABLES::m_ProjectTableChanged, project_model(), LIB_TABLE::reindex(), LIB_TABLE::rows, and verifyTables().

◆ verifyTables()

bool PANEL_SYM_LIB_TABLE::verifyTables ( )
private

Trim important fields, removes blank row entries, and checks for duplicates.

Returns
bool - true if tables are OK, else false.

Definition at line 310 of file panel_sym_lib_table.cpp.

311 {
312  for( SYMBOL_LIB_TABLE_GRID* model : { global_model(), project_model() } )
313  {
314  if( !model )
315  continue;
316 
317  for( int r = 0; r < model->GetNumberRows(); )
318  {
319  wxString nick = model->GetValue( r, COL_NICKNAME ).Trim( false ).Trim();
320  wxString uri = model->GetValue( r, COL_URI ).Trim( false ).Trim();
321  unsigned illegalCh = 0;
322 
323  if( !nick || !uri )
324  {
325  // Delete the "empty" row, where empty means missing nick or uri.
326  // This also updates the UI which could be slow, but there should only be a few
327  // rows to delete, unless the user fell asleep on the Add Row
328  // button.
329  model->DeleteRows( r, 1 );
330  }
331  else if( ( illegalCh = LIB_ID::FindIllegalLibraryNameChar( nick ) ) )
332  {
333  wxString msg = wxString::Format( _( "Illegal character '%c' in nickname '%s'" ),
334  illegalCh,
335  nick );
336 
337  // show the tabbed panel holding the grid we have flunked:
338  if( model != cur_model() )
339  m_notebook->SetSelection( model == global_model() ? 0 : 1 );
340 
341  m_cur_grid->MakeCellVisible( r, 0 );
342  m_cur_grid->SetGridCursor( r, 1 );
343 
344  wxMessageDialog errdlg( this, msg, _( "Library Nickname Error" ) );
345  errdlg.ShowModal();
346  return false;
347  }
348  else
349  {
350  // set the trimmed values back into the table so they get saved to disk.
351  model->SetValue( r, COL_NICKNAME, nick );
352  model->SetValue( r, COL_URI, uri );
353  ++r; // this row was OK.
354  }
355  }
356  }
357 
358  // check for duplicate nickNames, separately in each table.
359  for( SYMBOL_LIB_TABLE_GRID* model : { global_model(), project_model() } )
360  {
361  if( !model )
362  continue;
363 
364  for( int r1 = 0; r1 < model->GetNumberRows() - 1; ++r1 )
365  {
366  wxString nick1 = model->GetValue( r1, COL_NICKNAME );
367 
368  for( int r2=r1+1; r2 < model->GetNumberRows(); ++r2 )
369  {
370  wxString nick2 = model->GetValue( r2, COL_NICKNAME );
371 
372  if( nick1 == nick2 )
373  {
374  wxString msg = wxString::Format( _( "Multiple libraries cannot share the same "
375  "nickname ('%s')." ),
376  nick1 );
377 
378  // show the tabbed panel holding the grid we have flunked:
379  if( model != cur_model() )
380  m_notebook->SetSelection( model == global_model() ? 0 : 1 );
381 
382  // go to the lower of the two rows, it is technically the duplicate:
383  m_cur_grid->MakeCellVisible( r2, 0 );
384  m_cur_grid->SetGridCursor( r2, 1 );
385 
386  wxMessageDialog errdlg( this, msg, _( "Library Nickname Error" ) );
387  errdlg.ShowModal();
388 
389  return false;
390  }
391  }
392  }
393  }
394 
395  for( SYMBOL_LIB_TABLE* table : { global_model(), project_model() } )
396  {
397  if( !table )
398  continue;
399 
400  for( unsigned int r = 0; r < table->GetCount(); ++r )
401  {
402  SYMBOL_LIB_TABLE_ROW& row = dynamic_cast<SYMBOL_LIB_TABLE_ROW&>( table->At( r ) );
403 
404  if( !row.GetIsEnabled() )
405  continue;
406 
407  try
408  {
409  if( row.Refresh() )
410  {
411  if( table == global_model() )
413  else
415  }
416  }
417  catch( const IO_ERROR& ioe )
418  {
419  wxString msg = wxString::Format( _( "Symbol library \"%s\" failed to load.\n %s" ),
420  row.GetNickName(),
421  ioe.What() );
422 
423  wxMessageDialog errdlg( this, msg, _( "Error Loading Library" ) );
424  errdlg.ShowModal();
425 
426  return false;
427  }
428  }
429  }
430 
431  return true;
432 }
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_PLUGIN obje...
WX_GRID * m_cur_grid
changed based on tab choice
SYMBOL_LIB_TABLE_GRID * global_model() const
const wxString & GetNickName() const
Build a wxGridTableBase by wrapping an SYMBOL_LIB_TABLE object.
bool GetIsEnabled() const
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:29
SYMBOL_LIB_TABLE_GRID * cur_model() const
bool Refresh()
Attempt to reload the library.
DIALOG_EDIT_LIBRARY_TABLES * m_parent
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
SYMBOL_LIB_TABLE_GRID * project_model() const
#define _(s)
Definition: 3d_actions.cpp:33
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:75
static unsigned FindIllegalLibraryNameChar(const UTF8 &aLibraryName)
Looks for characters that are illegal in library nicknames.
Definition: lib_id.cpp:398

References _, COL_NICKNAME, COL_URI, cur_model(), LIB_ID::FindIllegalLibraryNameChar(), Format(), LIB_TABLE_ROW::GetIsEnabled(), LIB_TABLE_ROW::GetNickName(), global_model(), m_cur_grid, DIALOG_EDIT_LIBRARY_TABLES::m_GlobalTableChanged, PANEL_SYM_LIB_TABLE_BASE::m_notebook, m_parent, DIALOG_EDIT_LIBRARY_TABLES::m_ProjectTableChanged, project_model(), SYMBOL_LIB_TABLE_ROW::Refresh(), and IO_ERROR::What().

Referenced by TransferDataFromWindow().

Member Data Documentation

◆ m_append_button

wxBitmapButton* PANEL_SYM_LIB_TABLE_BASE::m_append_button
protectedinherited

◆ m_browse_button

wxBitmapButton* PANEL_SYM_LIB_TABLE_BASE::m_browse_button
protectedinherited

◆ m_convertLegacy

wxButton* PANEL_SYM_LIB_TABLE_BASE::m_convertLegacy
protectedinherited

◆ m_cur_grid

◆ m_delete_button

wxBitmapButton* PANEL_SYM_LIB_TABLE_BASE::m_delete_button
protectedinherited

◆ m_global_grid

◆ m_global_panel

wxPanel* PANEL_SYM_LIB_TABLE_BASE::m_global_panel
protectedinherited

◆ m_globalTable

SYMBOL_LIB_TABLE* PANEL_SYM_LIB_TABLE::m_globalTable
private

Definition at line 79 of file panel_sym_lib_table.h.

Referenced by PANEL_SYM_LIB_TABLE(), and TransferDataFromWindow().

◆ m_lastProjectLibDir

wxString PANEL_SYM_LIB_TABLE::m_lastProjectLibDir
private

Definition at line 87 of file panel_sym_lib_table.h.

Referenced by browseLibrariesHandler(), and PANEL_SYM_LIB_TABLE().

◆ m_move_down_button

wxBitmapButton* PANEL_SYM_LIB_TABLE_BASE::m_move_down_button
protectedinherited

◆ m_move_up_button

wxBitmapButton* PANEL_SYM_LIB_TABLE_BASE::m_move_up_button
protectedinherited

◆ m_notebook

wxNotebook* PANEL_SYM_LIB_TABLE_BASE::m_notebook
protectedinherited

◆ m_pageNdx

size_t PANEL_SYM_LIB_TABLE::m_pageNdx = 0
staticprivate

Remember the last notebook page selected.

Definition at line 86 of file panel_sym_lib_table.h.

Referenced by browseLibrariesHandler(), OnUpdateUI(), PANEL_SYM_LIB_TABLE(), and ~PANEL_SYM_LIB_TABLE().

◆ m_parent

DIALOG_EDIT_LIBRARY_TABLES* PANEL_SYM_LIB_TABLE::m_parent
private

◆ m_path_subs_grid

◆ m_project

PROJECT* PANEL_SYM_LIB_TABLE::m_project
private

◆ m_project_grid

WX_GRID* PANEL_SYM_LIB_TABLE_BASE::m_project_grid
protectedinherited

◆ m_project_panel

wxPanel* PANEL_SYM_LIB_TABLE_BASE::m_project_panel
protectedinherited

◆ m_projectTable

SYMBOL_LIB_TABLE* PANEL_SYM_LIB_TABLE::m_projectTable
private

Definition at line 80 of file panel_sym_lib_table.h.

Referenced by PANEL_SYM_LIB_TABLE(), and TransferDataFromWindow().


The documentation for this class was generated from the following files: