|
KiCad PCB EDA Suite
|
#include <footprint_select_widget.h>
Public Member Functions | |
| FOOTPRINT_SELECT_WIDGET (EDA_DRAW_FRAME *aFrame, wxWindow *aParent, int aMaxItems=400) | |
| Construct a footprint selector widget. | |
| virtual | ~FOOTPRINT_SELECT_WIDGET () |
| void | Load (KIWAY &aKiway, PROJECT &aProject) |
| Initialize the widget with a KIWAY for cross-module communication. | |
| void | ClearFilters () |
| Clear all filters. | |
| void | FilterByPinCount (int aPinCount) |
| Filter by pin count. | |
| void | FilterByFootprintFilters (const wxArrayString &aFilters, bool aZeroFilters) |
| Filter by footprint filter list. | |
| void | SetDefaultFootprint (const wxString &aFp) |
| Set the default footprint for a part. | |
| bool | UpdateList () |
| Update the contents of the list by fetching filtered footprints from pcbnew. | |
| void | SelectDefault () |
| Set current selection to the default footprint. | |
| virtual bool | Enable (bool aEnable=true) override |
| Enable or disable the control for input. | |
Private Member Functions | |
| void | OnComboBox (wxCommandEvent &aEvent) |
Private Attributes | |
| FOOTPRINT_CHOICE * | m_fp_sel_ctrl |
| wxSizer * | m_sizer |
| int | m_max_items |
| wxString | m_default_footprint |
| int | m_pin_count |
| wxArrayString | m_filters |
| bool | m_zero_filter |
| KIWAY * | m_kiway |
Definition at line 38 of file footprint_select_widget.h.
| FOOTPRINT_SELECT_WIDGET::FOOTPRINT_SELECT_WIDGET | ( | EDA_DRAW_FRAME * | aFrame, |
| wxWindow * | aParent, | ||
| int | aMaxItems = 400 ) |
Construct a footprint selector widget.
| aFrame | - parent frame for context |
| aParent | - parent window |
| aMaxItems | - maximum number of filter items to display |
Definition at line 31 of file footprint_select_widget.cpp.
References m_fp_sel_ctrl, m_kiway, m_max_items, m_pin_count, m_sizer, m_zero_filter, and OnComboBox().
|
inlinevirtual |
Definition at line 50 of file footprint_select_widget.h.
| void FOOTPRINT_SELECT_WIDGET::ClearFilters | ( | ) |
Clear all filters.
Does not update the list.
Definition at line 74 of file footprint_select_widget.cpp.
References m_default_footprint, m_filters, m_pin_count, and m_zero_filter.
|
overridevirtual |
Enable or disable the control for input.
Definition at line 196 of file footprint_select_widget.cpp.
References m_fp_sel_ctrl.
| void FOOTPRINT_SELECT_WIDGET::FilterByFootprintFilters | ( | const wxArrayString & | aFilters, |
| bool | aZeroFilters ) |
Filter by footprint filter list.
Does not update the list.
| aFilters | is a wxArrayString of strings used to filter the list of available footprints (can be empty). The final fp list is the list of footprint names matching at least one filtering string. A filtering string is something like sm0402 or DIP* |
| aZeroFilters | - if true, zero filters = zero footprints. If false, zero filters = not filtering. |
Definition at line 89 of file footprint_select_widget.cpp.
References m_filters, and m_zero_filter.
| void FOOTPRINT_SELECT_WIDGET::FilterByPinCount | ( | int | aPinCount | ) |
Filter by pin count.
Does not update the list.
Definition at line 83 of file footprint_select_widget.cpp.
References m_pin_count.
Initialize the widget with a KIWAY for cross-module communication.
| aKiway | - active kiway instance used to fetch filtered footprints from pcbnew |
| aProject | - current project (unused, kept for API compatibility) |
Definition at line 51 of file footprint_select_widget.cpp.
References m_kiway.
|
private |
Definition at line 57 of file footprint_select_widget.cpp.
References m_fp_sel_ctrl.
Referenced by FOOTPRINT_SELECT_WIDGET().
| void FOOTPRINT_SELECT_WIDGET::SelectDefault | ( | ) |
Set current selection to the default footprint.
Definition at line 190 of file footprint_select_widget.cpp.
References m_fp_sel_ctrl.
Referenced by UpdateList().
| void FOOTPRINT_SELECT_WIDGET::SetDefaultFootprint | ( | const wxString & | aFp | ) |
Set the default footprint for a part.
This will be listed at the top. May be an empty string.
Definition at line 97 of file footprint_select_widget.cpp.
References m_default_footprint.
| bool FOOTPRINT_SELECT_WIDGET::UpdateList | ( | ) |
Update the contents of the list by fetching filtered footprints from pcbnew.
The "default" footprint will be selected.
Definition at line 103 of file footprint_select_widget.cpp.
References _, KIWAY::FACE_PCB, filter, filterFootprints(), kiface(), KIFACE_FILTER_FOOTPRINTS, m_default_footprint, m_filters, m_fp_sel_ctrl, m_kiway, m_max_items, m_pin_count, m_zero_filter, and SelectDefault().
|
private |
Definition at line 113 of file footprint_select_widget.h.
Referenced by ClearFilters(), SetDefaultFootprint(), and UpdateList().
|
private |
Definition at line 117 of file footprint_select_widget.h.
Referenced by ClearFilters(), FilterByFootprintFilters(), and UpdateList().
|
private |
Definition at line 109 of file footprint_select_widget.h.
Referenced by Enable(), FOOTPRINT_SELECT_WIDGET(), OnComboBox(), SelectDefault(), and UpdateList().
|
private |
Definition at line 120 of file footprint_select_widget.h.
Referenced by FOOTPRINT_SELECT_WIDGET(), Load(), and UpdateList().
|
private |
Definition at line 112 of file footprint_select_widget.h.
Referenced by FOOTPRINT_SELECT_WIDGET(), and UpdateList().
|
private |
Definition at line 116 of file footprint_select_widget.h.
Referenced by ClearFilters(), FilterByPinCount(), FOOTPRINT_SELECT_WIDGET(), and UpdateList().
|
private |
Definition at line 110 of file footprint_select_widget.h.
Referenced by FOOTPRINT_SELECT_WIDGET().
|
private |
Definition at line 118 of file footprint_select_widget.h.
Referenced by ClearFilters(), FilterByFootprintFilters(), FOOTPRINT_SELECT_WIDGET(), and UpdateList().