56#include <wx/filedlg.h> 
  101    void SetValue( 
int aRow, 
int aCol, 
const wxString &aValue )
 override 
  103        wxCHECK( aRow < (
int) 
size(),  );
 
  113            wxFileName fn( uri );
 
  123                if( pluginType == SCH_IO_MGR::SCH_FILE_UNKNOWN )
 
  124                    pluginType = SCH_IO_MGR::SCH_KICAD;
 
 
 
  145                        std::function<
void( wxCommandEvent& )> aAddHandler ) :
 
 
  169            wxString title = row.
Type() == 
"Table" 
  170                    ? wxString::Format( 
_( 
"Error loading library table '%s'" ), row.
Nickname() )
 
  171                    : wxString::Format( 
_( 
"Error loading library '%s'" ), row.
Nickname() );
 
 
  198        if( tbl->GetNumberRows() > aRow )
 
  201            const wxString&    options = row.
Options();
 
  202            wxString           
result = options;
 
  203            std::map<std::string, UTF8> choices;
 
  207            pi->GetLibraryOptions( &choices );
 
 
  227        if( 
size_t ndx = cb_text.find( 
"(sym_lib_table" ); ndx != std::string::npos )
 
  234                std::ranges::copy( tempTable.Rows(),
 
  239                    wxGridTableMessage msg( tbl, wxGRIDTABLE_NOTIFY_ROWS_INSERTED, 0, 0 );
 
  240                    tbl->GetView()->ProcessTableMessage( msg );
 
  250            wxString 
text = cb_text;
 
  252            if( !
text.Contains( 
'\t' ) && 
text.Contains( 
',' ) )
 
  253                text.Replace( 
',', 
'\t' );
 
  255            if( 
text.Contains( 
'\t' ) )
 
  257                int row = 
m_grid->GetGridCursorRow();
 
  260                m_grid->SetGridCursor( row, 0 );
 
  266            m_grid->AutoSizeColumns( 
false );
 
  269        m_grid->AutoSizeColumns( 
false );
 
 
 
  285            [&]( 
WX_GRID* aCurrGrid, 
int aCol )
 
  287                int prevWidth = aCurrGrid->GetColSize( aCol );
 
  289                aCurrGrid->AutoSizeColumn( aCol, 
false );
 
  290                aCurrGrid->SetColSize( aCol, std::max( prevWidth, aCurrGrid->GetColSize( aCol ) ) );
 
  295    for( 
int ii = 0; ii < aGrid->GetNumberRows(); ++ii )
 
  301            if( std::optional<LIBRARY_ERROR> error = adapter->
LibraryError( tableRow.Nickname() ) )
 
  303                aGrid->SetCellValue( ii, 
COL_STATUS, error->message );
 
  310                                     wxString::Format( 
_( 
"Library settings for %s..." ),
 
  311                                                       tableRow.Nickname() ) );
 
  318            aGrid->SetCellValue( ii, 
COL_STATUS, tableRow.ErrorDescription() );
 
  326            [
this]( wxCommandEvent& event )
 
  328                appendRowHandler( event );
 
  331    aGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
 
  334    wxGridCellAttr* attr = 
new wxGridCellAttr;
 
  342                    auto libTable = static_cast<SYMBOL_LIB_TABLE_GRID*>( grid->GetTable() );
 
  343                    LIBRARY_TABLE_ROW& tableRow = libTable->at( row );
 
  344                    SCH_IO_MGR::SCH_FILE_T pi_type = SCH_IO_MGR::EnumFromStr( tableRow.Type() );
 
  346                    IO_RELEASER<SCH_IO> pi( SCH_IO_MGR::FindPlugin( pi_type ) );
 
  350                        const IO_BASE::IO_FILE_DESC& desc = pi->GetLibraryDesc();
 
  353                            return desc.FileFilter();
 
  358                        return wxString::Format( _( 
"Symbol Library Tables (%s)|*" ),
 
  359                                                 FILEEXT::SymbolLibraryTableFileName,
 
  360                                                 FILEEXT::SymbolLibraryTableFileName );
 
  363                    return wxEmptyString;
 
  367    aGrid->SetColAttr( 
COL_URI, attr );
 
  369    attr = 
new wxGridCellAttr;
 
  370    attr->SetEditor( 
new wxGridCellChoiceEditor( m_pluginChoices ) );
 
  371    aGrid->SetColAttr( 
COL_TYPE, attr );
 
  373    attr = 
new wxGridCellAttr;
 
  377    attr = 
new wxGridCellAttr;
 
  378    attr->SetRenderer( 
new wxGridCellBoolRenderer() );
 
  380    attr->SetAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
 
  383    attr = 
new wxGridCellAttr;
 
  384    attr->SetRenderer( 
new wxGridCellBoolRenderer() );
 
  386    attr->SetAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
 
  405    if( aGrid->GetNumberRows() > 0 )
 
  406        aGrid->SelectRow( 0 );
 
 
  429    for( 
const SCH_IO_MGR::SCH_FILE_T& type : SCH_IO_MGR::SCH_FILE_T_vector )
 
  442        if( cfg->m_lastSymbolLibDir.IsEmpty() )
 
 
  507    wxFileName fn( aLibraryPath );
 
  508    wxString   ext = fn.GetExt().Lower();
 
 
  523    std::unique_ptr<wxBusyCursor> wait;
 
  524    wait.reset( 
new wxBusyCursor );
 
  531        for( 
int r = 0; r < model->GetNumberRows(); ++r )
 
  533            wxString nick = model->GetValue( r, 
COL_NICKNAME ).Trim( 
false ).Trim();
 
  534            wxString uri  = model->GetValue( r, 
COL_URI ).Trim( 
false ).Trim();
 
  535            unsigned illegalCh = 0;
 
  541                    msg = 
_( 
"Nickname and path cannot be empty." );
 
  546                    msg = 
_( 
"Nickname cannot be empty." );
 
  551                    msg = 
_( 
"Path cannot be empty." );
 
  562                wxWindow* topLevelParent = wxGetTopLevelParent( 
this );
 
  564                wxMessageDialog errdlg( topLevelParent, msg, 
_( 
"Library Table Error" ) );
 
  572                msg = wxString::Format( 
_( 
"Illegal character '%c' in nickname '%s'" ),
 
  583                wxWindow* topLevelParent = wxGetTopLevelParent( 
this );
 
  585                wxMessageDialog errdlg( topLevelParent, msg, 
_( 
"Library Nickname Error" ) );
 
  598                    model->SetValue( r, 
COL_URI, uri );
 
  602                    wxString ltype = model->GetValue( r, 
COL_TYPE );
 
  603                    model->LIB_TABLE_GRID::SetValue( r, 
COL_URI, uri );
 
  604                    model->SetValue( r, 
COL_TYPE, ltype );
 
  616        for( 
int r1 = 0; r1 < model->GetNumberRows() - 1; ++r1 )
 
  620            for( 
int r2 = r1 + 1; r2 < model->GetNumberRows(); ++r2 )
 
  626                    msg = wxString::Format( 
_( 
"Multiple libraries cannot share the same nickname ('%s')." ),
 
  637                    wxWindow* topLevelParent = wxGetTopLevelParent( 
this );
 
  640                    wxMessageDialog errdlg( topLevelParent, msg, 
_( 
"Library Nickname Error" ) );
 
 
  660    wxString fileFiltersStr;
 
  661    wxString allWildcardsStr;
 
  663    for( 
const SCH_IO_MGR::SCH_FILE_T& 
fileType : SCH_IO_MGR::SCH_FILE_T_vector )
 
  675        if( !fileFiltersStr.IsEmpty() )
 
  676            fileFiltersStr += wxChar( 
'|' );
 
  684    fileFiltersStr = 
_( 
"All supported formats" ) + wxT( 
"|" ) + allWildcardsStr + wxT( 
"|" )
 
  696    wxWindow* topLevelParent = wxGetTopLevelParent( 
this );
 
  698    wxFileDialog dlg( topLevelParent, 
_( 
"Add Library" ), *lastDir, wxEmptyString, fileFiltersStr,
 
  699                      wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE );
 
  701    if( dlg.ShowModal() == wxID_CANCEL )
 
  704    *lastDir = dlg.GetDirectory();
 
  707    bool               addDuplicates = 
false;
 
  708    bool               applyToAll    = 
false;
 
  710    wxArrayString filePathsList;
 
  711    dlg.GetPaths( filePathsList );
 
  713    for( 
const wxString& filePath : filePathsList )
 
  715        wxFileName fn( filePath );
 
  719        if( 
cur_model()->ContainsNickname( nickname ) )
 
  724                addDuplicates = 
OKOrCancelDialog( wxGetTopLevelParent( 
this ), 
_( 
"Warning: Duplicate Nickname" ),
 
  725                                                  wxString::Format( 
_( 
"A library nicknamed '%s' already exists." ),
 
  727                                                  _( 
"One of the nicknames will need to be changed after adding " 
  729                                                  _( 
"Skip" ), 
_( 
"Add Anyway" ),
 
  730                                                  &applyToAll ) == wxID_CANCEL;
 
  733            doAdd = addDuplicates;
 
  738            int last_row = 
m_cur_grid->GetNumberRows() - 1;
 
  745            if( pluginType == SCH_IO_MGR::SCH_FILE_UNKNOWN )
 
  746                pluginType = SCH_IO_MGR::SCH_KICAD;
 
  756                path = fn.GetFullPath();
 
  762    if( !filePathsList.IsEmpty() )
 
 
  773            [&]() -> std::pair<int, int>
 
 
  796    wxArrayInt selectedRows = 
m_cur_grid->GetSelectedRows();
 
  797    wxGridCellCoordsArray cells = 
m_cur_grid->GetSelectedCells();
 
  798    wxGridCellCoordsArray blockTopLeft = 
m_cur_grid->GetSelectionBlockTopLeft();
 
  799    wxGridCellCoordsArray blockBotRight = 
m_cur_grid->GetSelectionBlockBottomRight();
 
  802    for( 
unsigned ii = 0; ii < cells.GetCount(); ii++ )
 
  803        selectedRows.Add( cells[ii].GetRow() );
 
  806    if( !blockTopLeft.IsEmpty() && !blockBotRight.IsEmpty() )
 
  808        for( 
int i = blockTopLeft[0].GetRow(); i <= blockBotRight[0].GetRow(); ++i )
 
  809            selectedRows.Add( i );
 
  813    if( selectedRows.size() == 0 && 
m_cur_grid->GetGridCursorRow() >= 0 )
 
  814        selectedRows.Add( 
m_cur_grid->GetGridCursorRow() );
 
  816    if( selectedRows.size() == 0 )
 
  822    std::sort( selectedRows.begin(), selectedRows.end() );
 
  831    for( 
int ii = selectedRows.GetCount()-1; ii >= 0; ii-- )
 
  833        int row = selectedRows[ii];
 
  835        if( row != last_row )
 
  842    if( 
m_cur_grid->GetNumberRows() > 0 && curRow >= 0 )
 
 
  855                std::vector<LIBRARY_TABLE_ROW>& rows = tbl->
Table().
Rows();
 
  857                auto current = rows.begin() + curRow;
 
  858                auto prev    = rows.begin() + curRow - 1;
 
  860                std::iter_swap( current, prev );
 
  863                wxGridTableMessage msg( 
cur_model(), wxGRIDTABLE_NOTIFY_ROWS_INSERTED, row - 1, 0 );
 
  864                cur_model()->GetView()->ProcessTableMessage( msg );
 
 
  876                std::vector<LIBRARY_TABLE_ROW>& rows = tbl->
Table().
Rows();
 
  878                auto current = rows.begin() + curRow;
 
  879                auto next    = rows.begin() + curRow + 1;
 
  881                std::iter_swap( current, 
next );
 
  884                wxGridTableMessage msg( 
cur_model(), wxGRIDTABLE_NOTIFY_ROWS_INSERTED, row, 0 );
 
  885                cur_model()->GetView()->ProcessTableMessage( msg );
 
 
  897        !
IsOK( 
this, wxString::Format( 
_( 
"This action will reset your global library table on " 
  898                                          "disk and cannot be undone." ) ) ) )
 
  909        schface->PreloadLibraries( &
m_parent->Kiway() );
 
  916    std::optional<LIBRARY_TABLE*> newTable =
 
  919    wxASSERT( newTable );
 
  926    m_parent->m_GlobalTableChanged = 
true;
 
 
  954    wxArrayInt selectedRows = 
m_cur_grid->GetSelectedRows();
 
  956    if( selectedRows.empty() && 
m_cur_grid->GetGridCursorRow() >= 0 )
 
  957        selectedRows.push_back( 
m_cur_grid->GetGridCursorRow() );
 
  959    wxArrayInt legacyRows;
 
  964    for( 
int row : selectedRows )
 
  969            legacyRows.push_back( row );
 
  973    if( legacyRows.size() <= 0 )
 
  975        wxMessageBox( 
_( 
"Select one or more rows containing libraries " 
  976                         "to save as current KiCad format (*.kicad_sym)." ) );
 
  981        if( legacyRows.size() == 1 )
 
  983            msg.Printf( 
_( 
"Save '%s' as current KiCad format (*.kicad_sym) " 
  984                           "and replace legacy entry in table?" ),
 
  989            msg.Printf( 
_( 
"Save %d libraries as current KiCad format (*.kicad_sym) " 
  990                           "and replace legacy entries in table?" ),
 
  991                        (
int) legacyRows.size() );
 
  998    for( 
int row : legacyRows )
 
 1002        wxFileName legacyLib( resolvedPath );
 
 1004        if( !legacyLib.Exists() )
 
 1006            msg.Printf( 
_( 
"Library '%s' not found." ), relPath );
 
 1008            wxWindow* topLevelParent = wxGetTopLevelParent( 
this );
 
 1014        wxFileName newLib( resolvedPath );
 
 1015        newLib.SetExt( 
"kicad_sym" );
 
 1017        if( newLib.Exists() )
 
 1019            msg.Printf( 
_( 
"File '%s' already exists. Do you want overwrite this file?" ),
 
 1020                        newLib.GetFullPath() );
 
 1022            switch( wxMessageBox( msg, 
_( 
"Migrate Library" ),
 
 1023                                  wxYES_NO | wxCANCEL | wxICON_QUESTION, 
m_parent ) )
 
 1026            case wxNO:     
continue;
 
 1027            case wxCANCEL: 
return;
 
 1041                relPath = newLib.GetFullPath();
 
 1049            msg.Printf( 
_( 
"Failed to save symbol library file '%s'." ), newLib.GetFullPath() );
 
 1051            wxWindow* topLevelParent = wxGetTopLevelParent( 
this );
 
 
 1067    std::optional<LIBRARY_TABLE*> optTable =
 
 1069    wxCHECK( optTable, 
false );
 
 1074        m_parent->m_GlobalTableChanged = 
true;
 
 1087            m_parent->m_ProjectTableChanged = 
true;
 
 
 1098    wxRegEx re( 
".*?(\\$\\{(.+?)\\})|(\\$\\((.+?)\\)).*?", wxRE_ADVANCED );
 
 1099    wxASSERT( re.IsValid() );   
 
 1101    std::set< wxString > unique;
 
 1111        for( 
int row = 0; row < tbl->GetNumberRows(); ++row )
 
 1113            wxString uri = tbl->GetValue( row, 
COL_URI );
 
 1115            while( re.Matches( uri ) )
 
 1117                wxString envvar = re.GetMatch( uri, 2 );
 
 1120                if( envvar.IsEmpty() )
 
 1121                    envvar = re.GetMatch( uri, 4 );
 
 1124                unique.insert( envvar );
 
 1127                uri.Replace( re.GetMatch( uri, 0 ), wxEmptyString );
 
 1138    for( 
const wxString& evName : unique )
 
 1143        m_path_subs_grid->SetCellValue( row, 0, wxT( 
"${" ) + evName + wxT( 
"}" ) );
 
 1147        wxGetEnv( evName, &evValue );
 
 
 1205        symbolEditor->FreezeLibraryTree();
 
 1207        if( symbolEditor->HasLibModifications() )
 
 1209            msg = 
_( 
"Modifications have been made to one or more symbol libraries.\n" 
 1210                     "Changes must be saved or discarded before the symbol library table can be modified." );
 
 1214            case wxID_YES:    symbolEditor->SaveAll();         
break;
 
 1215            case wxID_NO:     symbolEditor->RevertAll();       
break;
 
 1217            case wxID_CANCEL: symbolEditor->ThawLibraryTree(); 
return;
 
 1230            symbolEditor->ThawLibraryTree();
 
 1237        std::optional<LIBRARY_TABLE*> optTable =
 
 1239        wxCHECK( optTable,  );
 
 1242        globalTable->
Save().map_error(
 
 1245                wxMessageBox( wxString::Format( 
_( 
"Error saving global library table:\n\n%s" ), aError.
message ),
 
 1246                              _( 
"File Save Error" ), wxOK | wxICON_ERROR );
 
 1252    std::optional<LIBRARY_TABLE*> projectTable =
 
 1257        ( *projectTable )->Save().map_error(
 
 1260                wxMessageBox( wxString::Format( 
_( 
"Error saving project-specific library table:\n\n%s" ),
 
 1262                              _( 
"File Save Error" ), wxOK | wxICON_ERROR );
 
 1271        schface->PreloadLibraries( aKiway );
 
 1274        symbolEditor->ThawLibraryTree();
 
 
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
 
bool m_ProjectTableChanged
 
void InstallPanel(wxPanel *aPanel)
 
bool m_GlobalTableChanged
 
An options editor in the form of a two column name/value spreadsheet like (table) UI.
 
wxString m_lastSymbolLibDir
 
Editor for wxGrid cells that adds a file/folder browser to the grid input field.
 
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
 
virtual void paste_text(const wxString &cb_text)
 
void getSelectedArea()
Puts the selected area into a sensible rectangle of m_sel_{row,col}_{start,count} above.
 
WX_GRID * m_grid
I don't own the grid, but he owns me.
 
void SetTooltipEnable(int aCol, bool aEnable=true)
Enable the tooltip for a column.
 
virtual void onGridCellLeftClick(wxGridEvent &event)
 
void SetKiway(wxWindow *aDest, KIWAY *aKiway)
It is only used for debugging, since "this" is not a wxWindow*.
 
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
 
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
 
virtual KIFACE * KiFACE(FACE_T aFaceId, bool doLoad=true)
Return the KIFACE* given a FACE_T.
 
virtual PROJECT & Prj() const
Return the PROJECT associated with this KIWAY.
 
static wxString ExpandURI(const wxString &aShortURI, const PROJECT &aProject)
 
std::optional< LIBRARY_TABLE * > Table(LIBRARY_TABLE_TYPE aType, LIBRARY_TABLE_SCOPE aScope)
Retrieves a given table; creating a new empty project table if a valid project is loaded and the give...
 
static bool CreateGlobalTable(LIBRARY_TABLE_TYPE aType, bool aPopulateDefaultLibraries)
 
void LoadGlobalTables(std::initializer_list< LIBRARY_TABLE_TYPE > aTablesToLoad={})
(Re)loads the global library tables in the given list, or all tables if no list is given
 
void ProjectChanged()
Notify all adapters that the project has changed.
 
void SetOptions(const wxString &aOptions)
 
const wxString & ErrorDescription() const
 
const wxString & Type() const
 
static const wxString TABLE_TYPE_NAME
 
const wxString & URI() const
 
const wxString & Nickname() const
 
const wxString & Options() const
 
LIBRARY_RESULT< void > Save()
 
LIBRARY_TABLE_SCOPE Scope() const
 
const std::vector< LIBRARY_TABLE_ROW > & Rows() const
 
static unsigned FindIllegalLibraryNameChar(const UTF8 &aLibraryName)
Looks for characters that are illegal in library nicknames.
 
static UTF8 FixIllegalChars(const UTF8 &aLibItemName, bool aLib)
Replace illegal LIB_ID item name characters with underscores '_'.
 
LIB_TABLE_GRID_TRICKS(WX_GRID *aGrid)
 
LIB_TABLE_GRID(const LIBRARY_TABLE &aTableToEdit, LIBRARY_MANAGER_ADAPTER *aAdapter=nullptr)
 
void SetValue(int aRow, int aCol, const wxString &aValue) override
 
virtual size_t size() const
 
virtual LIBRARY_TABLE_ROW & at(size_t aIndex)
 
static std::map< std::string, UTF8 > ParseOptions(const std::string &aOptionsList)
Parses aOptionsList and places the result into a #PROPERTIES object which is returned.
 
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)
 
STD_BITMAP_BUTTON * m_browse_button
 
STD_BITMAP_BUTTON * m_move_up_button
 
STD_BITMAP_BUTTON * m_delete_button
 
STD_BITMAP_BUTTON * m_move_down_button
 
STD_BITMAP_BUTTON * m_append_button
 
WX_GRID * m_path_subs_grid
 
Dialog to show and edit symbol library tables.
 
void OnUpdateUI(wxUpdateUIEvent &event) override
 
void moveUpHandler(wxCommandEvent &event) override
 
void onPageChange(wxBookCtrlEvent &event) override
 
virtual ~PANEL_SYM_LIB_TABLE()
 
bool allowAutomaticPluginTypeSelection(wxString &aLibraryPath)
 
static size_t m_pageNdx
Remember the last notebook page selected.
 
void setupGrid(WX_GRID *aGrid)
 
void onReset(wxCommandEvent &event) override
 
void deleteRowHandler(wxCommandEvent &event) override
 
wxString m_lastProjectLibDir
Transient (unsaved) last browsed folder when adding a project level library.
 
void browseLibrariesHandler(wxCommandEvent &event) override
 
SYMBOL_LIB_TABLE_GRID * cur_model() const
 
bool verifyTables()
Trim important fields, removes blank row entries, and checks for duplicates.
 
void adjustPathSubsGridColumns(int aWidth)
 
SYMBOL_LIB_TABLE_GRID * global_model() const
 
void onSizeGrid(wxSizeEvent &event) override
 
void onConvertLegacyLibraries(wxCommandEvent &event) override
 
SYMBOL_LIB_TABLE_GRID * project_model() const
 
wxArrayString m_pluginChoices
 
void moveDownHandler(wxCommandEvent &event) override
 
PANEL_SYM_LIB_TABLE(DIALOG_EDIT_LIBRARY_TABLES *aParent, PROJECT *m_project)
 
void populateEnvironReadOnlyTable()
Populate the readonly environment variable table with names and values by examining all the full_uri ...
 
WX_GRID * m_cur_grid
changed based on tab choice
 
DIALOG_EDIT_LIBRARY_TABLES * m_parent
 
bool TransferDataFromWindow() override
 
void appendRowHandler(wxCommandEvent &event) override
 
static wxString GetDefaultUserSymbolsPath()
Gets the default path we point users to create projects.
 
virtual ENV_VAR_MAP & GetLocalEnvVariables() const
 
virtual LIBRARY_MANAGER & GetLibraryManager() const
 
static SYMBOL_LIBRARY_ADAPTER * SymbolLibAdapter(PROJECT *aProject)
Accessor for project symbol library manager adapter.
 
Container for project specific data.
 
static bool ConvertLibrary(std::map< std::string, UTF8 > *aOldFileProps, const wxString &aOldFilePath, const wxString &aNewFilepath)
Convert a schematic symbol library to the latest KiCad format.
 
static SCH_FILE_T EnumFromStr(const wxString &aFileType)
Return the #SCH_FILE_T from the corresponding plugin type name: "kicad", "legacy",...
 
static const wxString ShowType(SCH_FILE_T aFileType)
Return a brief name for a plugin, given aFileType enum.
 
static SCH_FILE_T GuessPluginTypeFromLibPath(const wxString &aLibPath, int aCtl=0)
Return a plugin type given a symbol library using the file extension of aLibPath.
 
The symbol library editor main window.
 
bool supportsVisibilityColumn() override
 
void onGridCellLeftClick(wxGridEvent &aEvent) override
 
void paste_text(const wxString &cb_text) override
handle specialized clipboard text, with leading "(sym_lib_table" or spreadsheet formatted text.
 
DIALOG_EDIT_LIBRARY_TABLES * m_dialog
 
SYMBOL_GRID_TRICKS(DIALOG_EDIT_LIBRARY_TABLES *aParent, WX_GRID *aGrid, PROJECT &aProject, std::function< void(wxCommandEvent &)> aAddHandler)
 
void optionsEditor(int aRow) override
 
SYMBOL_GRID_TRICKS(DIALOG_EDIT_LIBRARY_TABLES *aParent, WX_GRID *aGrid, PROJECT &aProject)
 
An interface to the global shared library manager that is schematic-specific and linked to one projec...
 
bool SupportsConfigurationDialog(const wxString &aNickname) const override
 
void ShowConfigurationDialog(const wxString &aNickname, wxWindow *aParent) const override
 
std::optional< LIBRARY_ERROR > LibraryError(const wxString &aNickname) const
 
SYMBOL_LIB_TABLE_GRID(const LIBRARY_TABLE &aTableToEdit, SYMBOL_LIBRARY_ADAPTER *aAdapter)
 
friend class SYMBOL_GRID_TRICKS
 
void SetValue(int aRow, int aCol, const wxString &aValue) override
 
friend class PANEL_SYM_LIB_TABLE
 
const wxString ExpandEnvVarSubstitutions(const wxString &aString, const PROJECT *aProject)
Replace any environment variable & text variable references with their values.
 
int OKOrCancelDialog(wxWindow *aParent, const wxString &aWarning, const wxString &aMessage, const wxString &aDetailedMessage, const wxString &aOKLabel, const wxString &aCancelLabel, bool *aApplyToAll)
Display a warning dialog with aMessage and returns the user response.
 
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
 
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
 
int UnsavedChangesDialog(wxWindow *parent, const wxString &aMessage, bool *aApplyToAll)
A specialized version of HandleUnsavedChanges which handles an apply-to-all checkbox.
 
void DisplayError(wxWindow *aParent, const wxString &aText)
Display an error or warning message box with aMessage.
 
This file is part of the common library.
 
@ ID_END_EESCHEMA_ID_LIST
 
wxString NormalizePath(const wxFileName &aFilePath, const ENV_VAR_MAP *aEnvVars, const wxString &aProjectPath)
Normalize a file path to an environmental variable, if possible.
 
Helper functions to substitute paths with environmental variables.
 
Functions related to environment variables, including help functions.
 
@ FRAME_SCH_SYMBOL_EDITOR
 
static const std::string SymbolLibraryTableFileName
 
static const std::string LegacySymbolLibFileExtension
 
std::map< wxString, ENV_VAR_ITEM > ENV_VAR_MAP
 
std::unique_ptr< T > IO_RELEASER
Helper to hold and release an IO_BASE object when exceptions are thrown.
 
KICOMMON_API wxString GetVersionedEnvVarName(const wxString &aBaseName)
Construct a versioned environment variable based on this KiCad major version.
 
void InvokeSchEditSymbolLibTable(KIWAY *aKiway, wxWindow *aParent)
 
@ ID_PANEL_SYM_LIB_LEGACY
 
SETTINGS_MANAGER * GetSettingsManager()
 
PGM_BASE & Pgm()
The global program "get" accessor.
 
#define PROJECT_VAR_NAME
A variable name whose value holds the current project directory.
 
T * GetAppSettings(const char *aFilename)
 
std::vector< FAB_LAYER_COLOR > dummy
 
MODEL3D_FORMAT_TYPE fileType(const char *aFileName)
 
Container that describes file type info.
 
std::vector< std::string > m_FileExtensions
Filter used for file pickers if m_IsFile is true.
 
wxString FileFilter() const
 
Implement a participant in the KIWAY alchemy.
 
Container that describes file type info for the add a library options.
 
bool m_IsFile
Whether the library is a folder or a file.
 
wxString m_Description
Description shown in the file picker dialog.
 
wxString m_FileFilter
Filter used for file pickers if m_IsFile is true.
 
DESIGN_BLOCK_IO_MGR::DESIGN_BLOCK_FILE_T m_Plugin
 
wxString m_FolderSearchExtension
In case of folders it stands for extensions of files stored inside.
 
wxString result
Test unit parsing edge cases and error handling.
 
wxString formatWildcardExt(const wxString &aWildcard)
Format wildcard extension to support case sensitive file dialogs.
 
Definition of file extensions used in Kicad.