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 The 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#pragma once
21
23#include <widgets/wx_grid.h>
24#include <pcb_io/pcb_io_mgr.h>
25
26class LIBRARY_TABLE;
27class FP_LIB_TABLE;
29class PROJECT;
30
31
36{
37
38public:
40 ~PANEL_FP_LIB_TABLE() override;
41
42 bool TransferDataToWindow() override;
43 bool TransferDataFromWindow() override;
44
45 void AddTable( LIBRARY_TABLE* table, const wxString& aTitle, bool aClosable );
46 void OpenTable( const std::shared_ptr<LIBRARY_TABLE>& table, const wxString& aTitle );
47
48private:
54 bool verifyTables();
55
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 onPageChange( wxAuiNotebookEvent& event ) override;
65 void onReset( wxCommandEvent& event ) override;
66
67 void onNotebookPageCloseRequest( wxAuiNotebookEvent& aEvent );
68
69 void adjustPathSubsGridColumns( int aWidth );
70
74 void populatePluginList();
75
76 FP_LIB_TABLE_GRID_DATA_MODEL* get_model( int aPage ) const;
77 FP_LIB_TABLE_GRID_DATA_MODEL* cur_model() const { return get_model( m_notebook->GetSelection() ); }
78
79 WX_GRID* get_grid( int aPage ) const;
80 WX_GRID* cur_grid() const { return get_grid( m_notebook->GetSelection() ); }
81
82private:
85 wxArrayString m_pluginChoices;
86
87 wxString m_lastProjectLibDir; //< Transient (unsaved) last browsed folder when adding a
88 // project level library.
89
90 std::vector<std::shared_ptr<LIBRARY_TABLE>> m_nestedTables;
91
92 std::map<PCB_IO_MGR::PCB_FILE_T, IO_BASE::IO_FILE_DESC> m_supportedFpFiles;
93};
This class builds a wxGridTableBase by wrapping an #FP_LIB_TABLE object.
PANEL_FP_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)
void OpenTable(const std::shared_ptr< LIBRARY_TABLE > &table, const wxString &aTitle)
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
bool TransferDataToWindow() override
WX_GRID * cur_grid() const
void adjustPathSubsGridColumns(int aWidth)
void moveDownHandler(wxCommandEvent &event) override
wxArrayString m_pluginChoices
PANEL_FP_LIB_TABLE(DIALOG_EDIT_LIBRARY_TABLES *aParent, PROJECT *aProject)
void populateEnvironReadOnlyTable()
Populate the readonly environment variable table with names and values by examining all the full_uri ...
void deleteRowHandler(wxCommandEvent &event) override
void onNotebookPageCloseRequest(wxAuiNotebookEvent &aEvent)
FP_LIB_TABLE_GRID_DATA_MODEL * get_model(int aPage) const
FP_LIB_TABLE_GRID_DATA_MODEL * cur_model() const
void onReset(wxCommandEvent &event) override
std::vector< std::shared_ptr< LIBRARY_TABLE > > m_nestedTables
void onMigrateLibraries(wxCommandEvent &event) override
void browseLibrariesHandler(wxCommandEvent &event)
void onPageChange(wxAuiNotebookEvent &event) override
bool TransferDataFromWindow() override
void AddTable(LIBRARY_TABLE *table, const wxString &aTitle, bool aClosable)
WX_GRID * get_grid(int aPage) const
DIALOG_EDIT_LIBRARY_TABLES * m_parent
void appendRowHandler(wxCommandEvent &event) override
Container for project specific data.
Definition project.h:65