KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_symbol_chooser.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19#ifndef DIALOG_SYMBOL_CHOOSER_H
20#define DIALOG_SYMBOL_CHOOSER_H
21
22#include "dialog_shim.h"
23#include <template_fieldnames.h>
26#include <footprint_info.h>
27#include <widgets/html_window.h>
28#include <wx/checkbox.h>
29
30
31class SCH_BASE_FRAME;
33struct PICKED_SYMBOL;
34
35
37{
38public:
48 DIALOG_SYMBOL_CHOOSER( SCH_BASE_FRAME* aParent, const LIB_ID* aPreselect,
49 const SYMBOL_LIBRARY_FILTER* aFilter,
50 std::vector<PICKED_SYMBOL>& aHistoryList,
51 std::vector<PICKED_SYMBOL>& aAlreadyPlaced, bool aAllowFieldEdits,
52 bool aShowFootprints, bool& aCancelled );
53
55
67 LIB_ID GetSelectedLibId( int* aUnit = nullptr ) const;
68
74 std::vector<std::pair<FIELD_T, wxString>> GetFields() const;
75
76 bool GetKeepSymbol() { return m_keepSymbol->GetValue(); }
77 bool GetPlaceAllUnits() { return m_useUnits->GetValue(); }
78
79public:
80 static std::mutex g_Mutex;
81
82protected:
84 wxCheckBox* m_keepSymbol;
85 wxCheckBox* m_useUnits;
86
87private:
88 void onLazyLoadUpdate();
89
91};
92
93#endif /* DIALOG_SYMBOL_CHOOSER_H */
DIALOG_SHIM(wxWindow *aParent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER, const wxString &name=wxDialogNameStr)
std::vector< std::pair< FIELD_T, wxString > > GetFields() const
Get a list of fields edited by the user.
PANEL_SYMBOL_CHOOSER * m_chooserPanel
DIALOG_SYMBOL_CHOOSER(SCH_BASE_FRAME *aParent, const LIB_ID *aPreselect, const SYMBOL_LIBRARY_FILTER *aFilter, std::vector< PICKED_SYMBOL > &aHistoryList, std::vector< PICKED_SYMBOL > &aAlreadyPlaced, bool aAllowFieldEdits, bool aShowFootprints, bool &aCancelled)
Create dialog to choose symbol.
LIB_ID GetSelectedLibId(int *aUnit=nullptr) const
To be called after this dialog returns from ShowModal().
A logical library item identifier and consists of various portions much like a URI.
Definition lib_id.h:45
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
Helper object to filter a list of libraries.