KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_fp_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) 2018-2023 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef PANEL_FP_LIB_TABLE_H
21#define PANEL_FP_LIB_TABLE_H
22
24#include <widgets/wx_grid.h>
25#include <pcb_io/pcb_io_mgr.h>
26
27class FP_LIB_TABLE;
29class PROJECT;
30
31
36{
37
38public:
40 FP_LIB_TABLE* aGlobalTable, const wxString& aGlobalTblPath,
41 FP_LIB_TABLE* aProjectTable, const wxString& aProjectTblPath,
42 const wxString& aProjectBasePath );
43 ~PANEL_FP_LIB_TABLE() override;
44
45private:
46 bool TransferDataFromWindow() override;
47
53 bool verifyTables();
54
55 void OnUpdateUI( wxUpdateUIEvent& event ) override;
56 void appendRowHandler( wxCommandEvent& event ) override;
57 void browseLibrariesHandler( wxCommandEvent& event );
58 void deleteRowHandler( wxCommandEvent& event ) override;
59 void moveUpHandler( wxCommandEvent& event ) override;
60 void moveDownHandler( wxCommandEvent& event ) override;
61 void onMigrateLibraries( wxCommandEvent& event ) override;
62 void onSizeGrid( wxSizeEvent& event ) override;
63
64 void adjustPathSubsGridColumns( int aWidth );
65
69 void populatePluginList();
70
72 {
73 return (FP_LIB_TABLE_GRID*) m_global_grid->GetTable();
74 }
75
77 {
78 return m_project_grid ? (FP_LIB_TABLE_GRID*) m_project_grid->GetTable() : nullptr;
79 }
80
82 {
83 return (FP_LIB_TABLE_GRID*) m_cur_grid->GetTable();
84 }
85
86 // caller's tables are modified only on OK button and successful verification.
91
93
94 WX_GRID* m_cur_grid; // changed based on tab choice
95 static size_t m_pageNdx; // Remember last notebook page selected during a session
96
97 //< Transient (unsaved) last browsed folder when adding a project level library.
99
100 std::map<PCB_IO_MGR::PCB_FILE_T, IO_BASE::IO_FILE_DESC> m_supportedFpFiles;
101};
102
103#endif // PANEL_FP_LIB_TABLE_H
This class builds a wxGridTableBase by wrapping an FP_LIB_TABLE object.
Class PANEL_FP_LIB_TABLE_BASE.
Dialog to show and edit symbol library tables.
FP_LIB_TABLE * m_globalTable
bool verifyTables()
Trim important fields, removes blank row entries, and checks for duplicates.
std::map< PCB_IO_MGR::PCB_FILE_T, IO_BASE::IO_FILE_DESC > m_supportedFpFiles
void onSizeGrid(wxSizeEvent &event) override
void moveUpHandler(wxCommandEvent &event) override
void adjustPathSubsGridColumns(int aWidth)
FP_LIB_TABLE_GRID * cur_model() const
FP_LIB_TABLE_GRID * project_model() const
void moveDownHandler(wxCommandEvent &event) override
FP_LIB_TABLE_GRID * global_model() const
static size_t m_pageNdx
void populateEnvironReadOnlyTable()
Populate the readonly environment variable table with names and values by examining all the full_uri ...
FP_LIB_TABLE * m_projectTable
void deleteRowHandler(wxCommandEvent &event) override
void onMigrateLibraries(wxCommandEvent &event) override
void browseLibrariesHandler(wxCommandEvent &event)
bool TransferDataFromWindow() override
DIALOG_EDIT_LIBRARY_TABLES * m_parent
void OnUpdateUI(wxUpdateUIEvent &event) override
void appendRowHandler(wxCommandEvent &event) override
Container for project specific data.
Definition: project.h:62