KiCad PCB EDA Suite
Loading...
Searching...
No Matches
footprint_select_widget.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 modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef FOOTPRINT_SELECT_WIDGET_H
21#define FOOTPRINT_SELECT_WIDGET_H
22
23#include <wx/arrstr.h>
24#include <wx/panel.h>
25
26class KIWAY;
27class PROJECT;
29class wxWindow;
30class EDA_DRAW_FRAME;
31
36wxDECLARE_EVENT( EVT_FOOTPRINT_SELECTED, wxCommandEvent );
37
38class FOOTPRINT_SELECT_WIDGET : public wxPanel
39{
40public:
48 FOOTPRINT_SELECT_WIDGET( EDA_DRAW_FRAME* aFrame, wxWindow* aParent, int aMaxItems = 400 );
49
51 {
52 }
53
60 void Load( KIWAY& aKiway, PROJECT& aProject );
61
65 void ClearFilters();
66
70 void FilterByPinCount( int aPinCount );
71
82 void FilterByFootprintFilters( const wxArrayString& aFilters, bool aZeroFilters );
83
88 void SetDefaultFootprint( const wxString& aFp );
89
96 bool UpdateList();
97
101 void SelectDefault();
102
106 virtual bool Enable( bool aEnable = true ) override;
107
108private:
110 wxSizer* m_sizer;
111
114
115 // Filter parameters
117 wxArrayString m_filters;
119
121
122 void OnComboBox( wxCommandEvent& aEvent );
123};
124
125
126#endif // FOOTPRINT_SELECT_WIDGET
The base class for create windows for drawing purpose.
Customized combo box for footprint selection.
virtual bool Enable(bool aEnable=true) override
Enable or disable the control for input.
void OnComboBox(wxCommandEvent &aEvent)
void FilterByFootprintFilters(const wxArrayString &aFilters, bool aZeroFilters)
Filter by footprint filter list.
void SetDefaultFootprint(const wxString &aFp)
Set the default footprint for a part.
FOOTPRINT_SELECT_WIDGET(EDA_DRAW_FRAME *aFrame, wxWindow *aParent, int aMaxItems=400)
Construct a footprint selector widget.
void FilterByPinCount(int aPinCount)
Filter by pin count.
void SelectDefault()
Set current selection to the default footprint.
bool UpdateList()
Update the contents of the list by fetching filtered footprints from pcbnew.
void ClearFilters()
Clear all filters.
void Load(KIWAY &aKiway, PROJECT &aProject)
Initialize the widget with a KIWAY for cross-module communication.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition kiway.h:294
Container for project specific data.
Definition project.h:65
wxDECLARE_EVENT(EVT_FOOTPRINT_SELECTED, wxCommandEvent)
This event is fired when a footprint is selected.