KiCad PCB EDA Suite
dialog_change_symbols.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) 2020 CERN
5 * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * @author Wayne Stambaugh <[email protected]>
8 *
9 * This program is free software: you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation, either version 3 of the License, or (at your
12 * option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program. If not, see <http://www.gnu.org/licenses/>.
21 */
22
23#ifndef _DIALOG_CHANGE_SYMBOLS_H_
24#define _DIALOG_CHANGE_SYMBOLS_H_
25
27
28class LIB_ID;
29class SCH_SYMBOL;
30class SCH_EDIT_FRAME;
31class SCH_SCREEN;
32class SCH_SHEET_PATH;
33
38{
39public:
40 enum class MODE { CHANGE = 0, UPDATE };
41
43 MODE aMode = MODE::UPDATE );
44 ~DIALOG_CHANGE_SYMBOLS() override;
45
46protected:
47 void launchMatchIdSymbolBrowser( wxCommandEvent& aEvent ) override;
48 void launchNewIdSymbolBrowser( wxCommandEvent& aEvent ) override;
49 void onMatchTextKillFocus( wxFocusEvent& event ) override;
50 void onMatchIDKillFocus( wxFocusEvent& event ) override;
51 void onNewLibIDKillFocus( wxFocusEvent& event ) override;
52 void onOkButtonClicked( wxCommandEvent& aEvent ) override;
53 void onMatchByAll( wxCommandEvent& aEvent ) override;
54 void onMatchBySelected( wxCommandEvent& aEvent ) override;
55 void onMatchByReference( wxCommandEvent& aEvent ) override;
56 void onMatchByValue( wxCommandEvent& aEvent ) override;
57 void onMatchById( wxCommandEvent& aEvent ) override;
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
70 void checkAll( bool aCheck );
71
72private:
73 void updateFieldsList();
74
75 bool isMatch( SCH_SYMBOL* aSymbol, SCH_SHEET_PATH* aInstance );
77 bool processSymbol( SCH_SYMBOL* aSymbol, const SCH_SHEET_PATH* aInstance,
78 const LIB_ID& aNewId, bool aAppendToUndo );
79
82
84 std::set<wxString> m_updateFields;
85};
86
87#endif // _DIALOG_CHANGE_SYMBOLS_H_
Class DIALOG_CHANGE_SYMBOLS_BASE.
Dialog to update or change schematic library symbols.
void onNewLibIDKillFocus(wxFocusEvent &event) override
void onMatchBySelected(wxCommandEvent &aEvent) override
MODE m_mode
Set of field names that should have values updated.
bool isMatch(SCH_SYMBOL *aSymbol, SCH_SHEET_PATH *aInstance)
void onOkButtonClicked(wxCommandEvent &aEvent) override
void onSelectNone(wxCommandEvent &event) override
Select or deselect all fields in the listbox widget.
std::set< wxString > m_updateFields
void onMatchById(wxCommandEvent &aEvent) override
void launchMatchIdSymbolBrowser(wxCommandEvent &aEvent) override
void onMatchByReference(wxCommandEvent &aEvent) override
void onMatchByValue(wxCommandEvent &aEvent) override
bool processSymbol(SCH_SYMBOL *aSymbol, const SCH_SHEET_PATH *aInstance, const LIB_ID &aNewId, bool aAppendToUndo)
DIALOG_CHANGE_SYMBOLS(SCH_EDIT_FRAME *aParent, SCH_SYMBOL *aSymbol, MODE aMode=MODE::UPDATE)
void onMatchTextKillFocus(wxFocusEvent &event) override
void onSelectAll(wxCommandEvent &event) override
void onMatchIDKillFocus(wxFocusEvent &event) override
void launchNewIdSymbolBrowser(wxCommandEvent &aEvent) override
void onMatchByAll(wxCommandEvent &aEvent) override
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:52
Schematic editor (Eeschema) main window.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Schematic symbol object.
Definition: sch_symbol.h:79