KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_design_block_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-2024 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_DESIGN_BLOCK_LIB_TABLE_H
21#define PANEL_DESIGN_BLOCK_LIB_TABLE_H
22
25#include <widgets/wx_grid.h>
26#include <design_block_io.h>
27
30class PROJECT;
31
32
37{
38public:
40 DESIGN_BLOCK_LIB_TABLE* aGlobalTable,
41 const wxString& aGlobalTblPath,
42 DESIGN_BLOCK_LIB_TABLE* aProjectTable,
43 const wxString& aProjectTblPath,
44 const wxString& aProjectBasePath );
46
47private:
48 bool TransferDataFromWindow() override;
49
55 bool verifyTables();
56
57 void OnUpdateUI( wxUpdateUIEvent& event ) override;
58 void appendRowHandler( wxCommandEvent& event ) override;
59 void browseLibrariesHandler( wxCommandEvent& event );
60 void deleteRowHandler( wxCommandEvent& event ) override;
61 void moveUpHandler( wxCommandEvent& event ) override;
62 void moveDownHandler( wxCommandEvent& event ) override;
63 void onMigrateLibraries( wxCommandEvent& event ) override;
64 void onSizeGrid( wxSizeEvent& event ) override;
65
66 void adjustPathSubsGridColumns( int aWidth );
67
71 void populatePluginList();
72
74 {
75 return (DESIGN_BLOCK_LIB_TABLE_GRID*) m_global_grid->GetTable();
76 }
77
79 {
80 return m_project_grid ? (DESIGN_BLOCK_LIB_TABLE_GRID*) m_project_grid->GetTable() : nullptr;
81 }
82
84 {
85 return (DESIGN_BLOCK_LIB_TABLE_GRID*) m_cur_grid->GetTable();
86 }
87
88 // caller's tables are modified only on OK button and successful verification.
93
95
96 WX_GRID* m_cur_grid; // changed based on tab choice
97 static size_t m_pageNdx; // Remember last notebook page selected during a session
98
99 //< Transient (unsaved) last browsed folder when adding a project level library.
101
102 std::map<DESIGN_BLOCK_IO_MGR::DESIGN_BLOCK_FILE_T, IO_BASE::IO_FILE_DESC>
104};
105
106
107void InvokeEditDesignBlockLibTable( KIWAY* aKiway, wxWindow *aParent );
108
109#endif // PANEL_DESIGN_BLOCK_LIB_TABLE_H
This class builds a wxGridTableBase by wrapping an DESIGN_BLOCK_LIB_TABLE object.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:284
Class PANEL_DESIGN_BLOCK_LIB_TABLE_BASE.
Dialog to show and edit symbol library tables.
void moveUpHandler(wxCommandEvent &event) override
void onMigrateLibraries(wxCommandEvent &event) override
DESIGN_BLOCK_LIB_TABLE_GRID * project_model() const
void browseLibrariesHandler(wxCommandEvent &event)
void populateEnvironReadOnlyTable()
Populate the readonly environment variable table with names and values by examining all the full_uri ...
DESIGN_BLOCK_LIB_TABLE_GRID * cur_model() const
std::map< DESIGN_BLOCK_IO_MGR::DESIGN_BLOCK_FILE_T, IO_BASE::IO_FILE_DESC > m_supportedDesignBlockFiles
void moveDownHandler(wxCommandEvent &event) override
DIALOG_EDIT_LIBRARY_TABLES * m_parent
void OnUpdateUI(wxUpdateUIEvent &event) override
void appendRowHandler(wxCommandEvent &event) override
DESIGN_BLOCK_LIB_TABLE_GRID * global_model() const
void onSizeGrid(wxSizeEvent &event) override
void deleteRowHandler(wxCommandEvent &event) override
bool verifyTables()
Trim important fields, removes blank row entries, and checks for duplicates.
Container for project specific data.
Definition: project.h:64
void InvokeEditDesignBlockLibTable(KIWAY *aKiway, wxWindow *aParent)