KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_footprint_properties_fp_editor.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) 2010-2015 Jean-Pierre Charras, jean-pierre.charras at wanadoo.fr
5 * Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#ifndef DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR_H
26#define DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR_H
27
28#include <vector>
29#include <fp_text_grid_table.h>
30#include <widgets/unit_binder.h>
31#include <footprint.h>
33
34
37
38
39class PRIVATE_LAYERS_GRID_TABLE : public wxGridTableBase, public std::vector<PCB_LAYER_ID>
40{
41public:
44
45 int GetNumberRows() override { return (int) size(); }
46 int GetNumberCols() override { return 1; }
47
48 bool CanGetValueAs( int aRow, int aCol, const wxString& aTypeName ) override;
49 bool CanSetValueAs( int aRow, int aCol, const wxString& aTypeName ) override;
50 wxGridCellAttr* GetAttr( int row, int col, wxGridCellAttr::wxAttrKind kind ) override;
51
52 wxString GetValue( int aRow, int aCol ) override;
53 long GetValueAsLong( int aRow, int aCol ) override;
54
55 void SetValue( int aRow, int aCol, const wxString& aValue ) override;
56 void SetValueAsLong( int aRow, int aCol, long aValue ) override;
57
58private:
60 wxGridCellAttr* m_layerColAttr;
61};
62
63
65{
66 PAGE_UNKNOWN = -1,
67 PAGE_GENERAL = 0,
70};
71
73{
74public:
77
78 bool Validate() override;
79
80 bool TransferDataToWindow() override;
81 bool TransferDataFromWindow() override;
82
83private:
84 // virtual event functions
85 void OnGridSize( wxSizeEvent& event ) override;
86 void OnFootprintNameText( wxCommandEvent& event ) override;
87 void OnAddField( wxCommandEvent& event ) override;
88 void OnDeleteField( wxCommandEvent& event ) override;
89 void OnAddLayer( wxCommandEvent& event ) override;
90 void OnDeleteLayer( wxCommandEvent& event ) override;
91 void OnAddPadGroup( wxCommandEvent& event ) override;
92 void OnRemovePadGroup( wxCommandEvent& event ) override;
93 void OnUpdateUI( wxUpdateUIEvent& event ) override;
94
95 bool checkFootprintName( const wxString& aFootprintName );
96
97 void adjustGridColumns();
98
99private:
102
103 static NOTEBOOK_PAGES m_page; // remember the last open page during session
104
107
112
115
120
122
125};
126
127
128#endif // DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR_H
Class DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR_BASE.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
wxString GetValue(int aRow, int aCol) override
bool CanGetValueAs(int aRow, int aCol, const wxString &aTypeName) override
long GetValueAsLong(int aRow, int aCol) override
bool CanSetValueAs(int aRow, int aCol, const wxString &aTypeName) override
void SetValue(int aRow, int aCol, const wxString &aValue) override
wxGridCellAttr * GetAttr(int row, int col, wxGridCellAttr::wxAttrKind kind) override
void SetValueAsLong(int aRow, int aCol, long aValue) override