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 
37 using std::set;
38 using std::list;
39 
44 {
45 public:
46  DIALOG_UPDATE_FIELDS( SCH_EDIT_FRAME* aParent, const list<SCH_COMPONENT*>& aComponents,
47  bool aCreateUndoEntry = true );
48 
49 private:
50  bool TransferDataFromWindow() override;
51  bool TransferDataToWindow() override;
52 
54  void updateFields( SCH_COMPONENT* aComponent );
55 
57  void checkAll( bool aCheck );
58 
59  void onSelectAll( wxCommandEvent& event ) override
60  {
61  checkAll( true );
62  }
63 
64  void onSelectNone( wxCommandEvent& event ) override
65  {
66  checkAll( false );
67  }
68 
71 
73  set<wxString> m_updateFields;
74 
76  list<SCH_COMPONENT*> m_components;
77 
80 };
81 
82 #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.
set< wxString > m_updateFields
Set of field names that should have values updated
Schematic editor (Eeschema) main window.
bool TransferDataToWindow() override
list< SCH_COMPONENT * > m_components
Components to update
bool m_createUndo
Flag indicating whether an undo buffer entry should be created
DIALOG_UPDATE_FIELDS(SCH_EDIT_FRAME *aParent, const list< SCH_COMPONENT * > &aComponents, bool aCreateUndoEntry=true)
void onSelectNone(wxCommandEvent &event) override
Class DIALOG_UPDATE_FIELDS_BASE.
SCH_EDIT_FRAME * m_frame
Parent 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