KiCad PCB EDA Suite
panel_sym_lib_table.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2017 Wayne Stambaugh <[email protected]>
5 * Copyright (C) 2017-2020 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef PANEL_SYM_LIB_TABLE_H
22#define PANEL_SYM_LIB_TABLE_H
23
24#include <grid_tricks.h>
27#include <lib_table_grid.h>
28
31
36{
37
38public:
40 SYMBOL_LIB_TABLE* aGlobal, const wxString& aGlobalTablePath,
41 SYMBOL_LIB_TABLE* aProject, const wxString& aProjectTablePath );
42 virtual ~PANEL_SYM_LIB_TABLE();
43
44private:
50 bool verifyTables();
51
52 void OnUpdateUI( wxUpdateUIEvent& event ) override;
53 void browseLibrariesHandler( wxCommandEvent& event ) override;
54 void appendRowHandler( wxCommandEvent& event ) override;
55 void deleteRowHandler( wxCommandEvent& event ) override;
56 void moveUpHandler( wxCommandEvent& event ) override;
57 void moveDownHandler( wxCommandEvent& event ) override;
58 void onSizeGrid( wxSizeEvent& event ) override;
59 void adjustPathSubsGridColumns( int aWidth );
60 void onConvertLegacyLibraries( wxCommandEvent& event ) override;
61
62 bool TransferDataFromWindow() override;
63
67
68 bool convertLibrary( const wxString& aLibrary, const wxString& legacyFilepath,
69 const wxString& newFilepath );
70
72
74
76
77private:
78 // Caller's tables are modified only on OK button and successful verification.
82
84
86 static size_t m_pageNdx;
87 wxString m_lastProjectLibDir; //< Transient (unsaved) last browsed folder when adding a project level library
88};
89
90
91void InvokeSchEditSymbolLibTable( KIWAY* aKiway, wxWindow *aParent );
92
93
94#endif // PANEL_SYM_LIB_TABLE_H
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:267
Class PANEL_SYM_LIB_TABLE_BASE.
Dialog to show and edit symbol library tables.
void OnUpdateUI(wxUpdateUIEvent &event) override
void moveUpHandler(wxCommandEvent &event) override
SYMBOL_LIB_TABLE * m_projectTable
static size_t m_pageNdx
Remember the last notebook page selected.
void deleteRowHandler(wxCommandEvent &event) override
void browseLibrariesHandler(wxCommandEvent &event) override
SYMBOL_LIB_TABLE_GRID * cur_model() const
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)
bool verifyTables()
Trim important fields, removes blank row entries, and checks for duplicates.
void adjustPathSubsGridColumns(int aWidth)
bool convertLibrary(const wxString &aLibrary, const wxString &legacyFilepath, const wxString &newFilepath)
SYMBOL_LIB_TABLE_GRID * global_model() const
SYMBOL_LIB_TABLE * m_globalTable
void onSizeGrid(wxSizeEvent &event) override
void onConvertLegacyLibraries(wxCommandEvent &event) override
SYMBOL_LIB_TABLE_GRID * project_model() const
void moveDownHandler(wxCommandEvent &event) override
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
Container for project specific data.
Definition: project.h:63
Build a wxGridTableBase by wrapping an SYMBOL_LIB_TABLE object.
void InvokeSchEditSymbolLibTable(KIWAY *aKiway, wxWindow *aParent)