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 The 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>
30#include <widgets/unit_binder.h>
31#include <footprint.h>
33
34
38
39
40class PRIVATE_LAYERS_GRID_TABLE : public WX_GRID_TABLE_BASE, public std::vector<PCB_LAYER_ID>
41{
42public:
45
46 int GetNumberRows() override { return (int) size(); }
47 int GetNumberCols() override { return 1; }
48
49 bool CanGetValueAs( int aRow, int aCol, const wxString& aTypeName ) override;
50 bool CanSetValueAs( int aRow, int aCol, const wxString& aTypeName ) override;
51 wxGridCellAttr* GetAttr( int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind ) override;
52
53 wxString GetValue( int aRow, int aCol ) override;
54 long GetValueAsLong( int aRow, int aCol ) override;
55
56 void SetValue( int aRow, int aCol, const wxString& aValue ) override;
57 void SetValueAsLong( int aRow, int aCol, long aValue ) override;
58
59private:
61 wxGridCellAttr* m_layerColAttr;
62};
63
64
66{
67 PAGE_UNKNOWN = -1,
68 PAGE_GENERAL = 0,
71};
72
74{
75public:
78
79 bool Validate() override;
80
81 bool TransferDataToWindow() override;
82 bool TransferDataFromWindow() override;
83
84private:
85 // virtual event functions
86 void OnGridSize( wxSizeEvent& 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 void OnPageChanging( wxNotebookEvent& event ) override;
95 void OnText( wxCommandEvent& event ) override;
96 void OnChoice( wxCommandEvent& event ) override;
97 void OnCheckBox( wxCommandEvent& event ) override;
98
99 bool checkFootprintName( const wxString& aFootprintName );
100
101 void adjustGridColumns();
102
103private:
107
108 static NOTEBOOK_PAGES m_page; // remember the last open page during session
109
112
117
120
125
127
131};
132
133
134#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
wxGridCellAttr * GetAttr(int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind) override
void SetValue(int aRow, int aCol, const wxString &aValue) override
void SetValueAsLong(int aRow, int aCol, long aValue) override