KiCad PCB EDA Suite
dialog_edit_component_in_lib.h
Go to the documentation of this file.
1 
5 /*
6  * This program source code file is part of KiCad, a free EDA CAD application.
7  *
8  * Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, you may find one here:
22  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
23  * or you may search the http://www.gnu.org website for the version 2 license,
24  * or you may write to the Free Software Foundation, Inc.,
25  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
26  */
27 
28 
29 #ifndef _DIALOG_EDIT_COMPONENT_IN_LIB_H_
30 #define _DIALOG_EDIT_COMPONENT_IN_LIB_H_
31 
32 #include <fields_grid_table.h>
33 #include <class_library.h>
34 #include <widgets/unit_binder.h>
36 
37 
38 class LIB_EDIT_FRAME;
39 class LIB_PART;
40 class WX_GRID;
41 
42 
44 {
45  static int m_lastOpenedPage; // To remember the last notebook selection
46 
47 public:
48  wxConfigBase* m_config;
49 
52 
54 
58 
59  wxControl* m_delayedFocusCtrl;
65 
66  wxString m_shownColumns;
67 
68  bool TransferDataToWindow() override;
69  bool TransferDataFromWindow() override;
70 
71  bool Validate() override;
72 
73 public:
77 
78 private:
80 
81  void OnAddField( wxCommandEvent& event ) override;
82  void OnDeleteField( wxCommandEvent& event ) override;
83  void OnMoveUp( wxCommandEvent& event ) override;
84  void OnMoveDown( wxCommandEvent& event ) override;
85  void OnSymbolNameKillFocus( wxFocusEvent& event ) override;
86  void OnSymbolNameText( wxCommandEvent& event ) override;
87  void OnSelectAlias( wxCommandEvent& event ) override;
88  void OnAddAlias( wxCommandEvent& event ) override;
89  void OnDeleteAlias( wxCommandEvent& event ) override;
90  void OnAddFootprintFilter( wxCommandEvent& event ) override;
91  void OnDeleteFootprintFilter( wxCommandEvent& event ) override;
92  void OnEditFootprintFilter( wxCommandEvent& event ) override;
93  void OnSizeGrid( wxSizeEvent& event ) override;
94  void OnSizeAliasGrid( wxSizeEvent& event ) override;
95  void OnGridCellChanging( wxGridEvent& event );
96  void OnAliasGridCellChanging( wxGridEvent& event );
97  void OnAliasNameKillFocus( wxFocusEvent& event ) override;
98  void OnAliasNameText( wxCommandEvent& event ) override;
99  void OnUpdateUI( wxUpdateUIEvent& event ) override;
100 
101  void updateAliasName( bool aFromGrid, const wxString& aName );
102  bool checkAliasName( const wxString& aName );
103  void adjustGridColumns( int aWidth );
104  void adjustAliasGridColumns( int aWidth );
105 };
106 
107 #endif
108  // _DIALOG_EDIT_COMPONENT_IN_LIB_H_
void OnAddFootprintFilter(wxCommandEvent &event) override
void OnUpdateUI(wxUpdateUIEvent &event) override
void OnAliasNameText(wxCommandEvent &event) override
void OnEditFootprintFilter(wxCommandEvent &event) override
void OnSizeGrid(wxSizeEvent &event) override
void updateAliasName(bool aFromGrid, const wxString &aName)
void OnSymbolNameText(wxCommandEvent &event) override
std::vector< LIB_ALIAS * > LIB_ALIASES
void OnDeleteFootprintFilter(wxCommandEvent &event) override
void OnAliasNameKillFocus(wxFocusEvent &event) override
void OnMoveUp(wxCommandEvent &event) override
DIALOG_EDIT_COMPONENT_IN_LIBRARY(LIB_EDIT_FRAME *parent, LIB_PART *aLibEntry)
Constructors.
void OnDeleteField(wxCommandEvent &event) override
Define a library symbol object.
void OnSelectAlias(wxCommandEvent &event) override
void OnSizeAliasGrid(wxSizeEvent &event) override
void OnSymbolNameKillFocus(wxFocusEvent &event) override
void OnMoveDown(wxCommandEvent &event) override
void OnDeleteAlias(wxCommandEvent &event) override
The symbol library editor main window.
Class DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE.
void OnAddAlias(wxCommandEvent &event) override
Definition for part library class.
void OnAddField(wxCommandEvent &event) override
FIELDS_GRID_TABLE< LIB_FIELD > * m_fields