KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_lib_fields_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) 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
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include <vector>
23
26
27class LIB_SYMBOL;
29
30
32{
33public:
36 ~DIALOG_LIB_FIELDS_TABLE() override;
37
38 bool TransferDataToWindow() override;
39 bool TransferDataFromWindow() override;
40
41private:
42 void loadSymbols();
43
44 wxGridCellEditor* createReferenceEditor() override;
45 wxGridCellEditor* createDatasheetEditor() override;
46 wxGridCellEditor* createFootprintEditor() override;
47
48 // Don't mark the frame modified for lib tables, we're not modifying the library,
49 // just the application settings for the library editor.
50 void onBomSettingsChanged() override {}
51
53
58 void LoadFieldNames();
59
60 void OnTableSelectionChanged( const std::set<int>& aRows ) override {}
61
62 void OnScope( wxCommandEvent& aEvent ) override;
63 void OnMenu( wxCommandEvent& aEvent ) override;
64
65 void OnSaveAndContinue( wxCommandEvent& aEvent ) override;
66 void OnCancel( wxCommandEvent& aEvent ) override;
67 void OnOk( wxCommandEvent& aEvent ) override;
68 void OnClose( wxCloseEvent& aEvent ) override;
69
71
72private:
73 std::vector<BOM_PRESET> getBuiltInBomPresets() const override;
74
75 wxString resolveVariant() const override;
76 bool resolveTextVar( wxString* aToken ) const override;
77
78private:
80 std::vector<LIB_SYMBOL*> m_symbolsList;
82};
DIALOG_FIELDS_TABLE(wxWindow *aParent, FIELDS_TABLE_SETTINGS &aPanelSettings, FIELDS_TABLE_BOM_SETTINGS &aBomSettings, JOB_EXPORT_BOM *aJob)
wxGridCellEditor * createFootprintEditor() override
void OnOk(wxCommandEvent &aEvent) override
void OnSaveAndContinue(wxCommandEvent &aEvent) override
LIB_FIELDS_EDITOR_GRID_DATA_MODEL * m_dataModel
std::vector< BOM_PRESET > getBuiltInBomPresets() const override
void OnCancel(wxCommandEvent &aEvent) override
void OnMenu(wxCommandEvent &aEvent) override
void LoadFieldNames()
Construct the rows of m_fieldsCtrl and the columns of m_dataModel from a union of all field names in ...
wxGridCellEditor * createReferenceEditor() override
Lib symbols have different rules for references.
void setScope(LIB_FIELDS_EDITOR_GRID_DATA_MODEL::SCOPE aScope)
std::vector< LIB_SYMBOL * > m_symbolsList
void OnClose(wxCloseEvent &aEvent) override
wxString resolveVariant() const override
wxGridCellEditor * createDatasheetEditor() override
FIELDS_TABLE_DATA_MODEL_BASE * getDataModel() const override
void OnTableSelectionChanged(const std::set< int > &aRows) override
DIALOG_LIB_FIELDS_TABLE(SYMBOL_EDIT_FRAME *aParent, LIB_FIELDS_EDITOR_GRID_DATA_MODEL::SCOPE aScope)
bool resolveTextVar(wxString *aToken) const override
void OnScope(wxCommandEvent &aEvent) override
Contains everything completly generic to fields tables data models, as well as column functionality t...
Define a library symbol object.
Definition lib_symbol.h:119
The symbol library editor main window.