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 <stambaughw@gmail.com>
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 
26 
27 
28 class SYMBOL_LIB_TABLE;
30 
31 
36 {
37 
38 public:
40  SYMBOL_LIB_TABLE* aGlobal, const wxString& aGlobalTablePath,
41  SYMBOL_LIB_TABLE* aProject, const wxString& aProjectTablePath );
42  virtual ~PANEL_SYM_LIB_TABLE();
43 
44 private:
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 
77 private:
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 
91 void InvokeSchEditSymbolLibTable( KIWAY* aKiway, wxWindow *aParent );
92 
93 
94 #endif // PANEL_SYM_LIB_TABLE_H
void moveUpHandler(wxCommandEvent &event) override
Container for project specific data.
Definition: project.h:62
void OnUpdateUI(wxUpdateUIEvent &event) override
WX_GRID * m_cur_grid
changed based on tab choice
SYMBOL_LIB_TABLE_GRID * global_model() const
static size_t m_pageNdx
Remember the last notebook page selected.
void adjustPathSubsGridColumns(int aWidth)
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_GRID * cur_model() const
SYMBOL_LIB_TABLE * m_projectTable
bool TransferDataFromWindow() override
bool convertLibrary(const wxString &aLibrary, const wxString &legacyFilepath, const wxString &newFilepath)
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)
Class PANEL_SYM_LIB_TABLE_BASE.
void onConvertLegacyLibraries(wxCommandEvent &event) override
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:260
Dialog to show and edit symbol library tables.
void deleteRowHandler(wxCommandEvent &event) override
void appendRowHandler(wxCommandEvent &event) override
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.
void onSizeGrid(wxSizeEvent &event) override
SYMBOL_LIB_TABLE * m_globalTable
void InvokeSchEditSymbolLibTable(KIWAY *aKiway, wxWindow *aParent)
void moveDownHandler(wxCommandEvent &event) override
void browseLibrariesHandler(wxCommandEvent &event) override