KiCad PCB EDA Suite
dialog_update_fields.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) 2017 CERN
5  * @author Maciej Suminski <maciej.suminski@cern.ch>
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 3
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  * https://www.gnu.org/licenses/gpl-3.0.html
20  * or you may search the http://www.gnu.org website for the version 3 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_UPDATE_FIELDS_H
26 #define DIALOG_UPDATE_FIELDS_H
27 
29 
30 #include <set>
31 #include <list>
32 
33 class SCH_COMPONENT;
34 class SCH_SCREEN;
35 class SCH_EDIT_FRAME;
36 
41 {
42 public:
43  DIALOG_UPDATE_FIELDS( SCH_EDIT_FRAME* aParent, SCH_COMPONENT* aComponent,
44  bool aCreateUndoEntry );
45 
46 private:
47  bool TransferDataFromWindow() override;
48  bool TransferDataToWindow() override;
49 
51  void updateFields( SCH_COMPONENT* aComponent );
52 
54  void checkAll( bool aCheck );
55 
56  void onSelectAll( wxCommandEvent& event ) override
57  {
58  checkAll( true );
59  }
60 
61  void onSelectNone( wxCommandEvent& event ) override
62  {
63  checkAll( false );
64  }
65 
67 
69  std::set<wxString> m_updateFields;
70 
72  std::vector< std::pair<SCH_SCREEN*, SCH_COMPONENT*>> m_components;
73 
75 };
76 
77 #endif /* DIALOG_UPDATE_FIELDS_H */
void checkAll(bool aCheck)
Selects or deselects all fields in the listbox widget
bool TransferDataFromWindow() override
Dialog to update component fields (i.e.
Schematic editor (Eeschema) main window.
bool TransferDataToWindow() override
std::set< wxString > m_updateFields
Set of field names that should have values updated
void onSelectNone(wxCommandEvent &event) override
std::vector< std::pair< SCH_SCREEN *, SCH_COMPONENT * > > m_components
Components to update
Class DIALOG_UPDATE_FIELDS_BASE.
DIALOG_UPDATE_FIELDS(SCH_EDIT_FRAME *aParent, SCH_COMPONENT *aComponent, bool aCreateUndoEntry)
SCH_EDIT_FRAME * m_frame
Schematic symbol object.
Definition: sch_component.h:88
void updateFields(SCH_COMPONENT *aComponent)
Update fields for a single component
void onSelectAll(wxCommandEvent &event) override