|
KiCad PCB EDA Suite
|
The footprint filters/matches panel of the symbol properties dialog. More...
#include <panel_footprint_filters.h>
Public Types | |
| using | FOOTPRINT_ASSIGN_QUERY = std::function<bool()> |
| using | FOOTPRINT_ASSIGNER = std::function<void( const wxString& )> |
Public Member Functions | |
| PANEL_FOOTPRINT_FILTERS (wxWindow *aParent, KIWAY &aKiway) | |
| ~PANEL_FOOTPRINT_FILTERS () override | |
| void | SetFilters (const wxArrayString &aFilters) |
| Replace the filters in the list with aFilters. | |
| wxArrayString | GetFilters () const |
| void | SetFootprintFieldAccessors (FOOTPRINT_ASSIGN_QUERY aCanAssign, FOOTPRINT_ASSIGNER aAssign) |
| Injection for interfaces that reach outside the panel to interact with host dialog. | |
Protected Member Functions | |
| void | OnFpFilterDClick (wxMouseEvent &aEvent) override |
| void | OnEditFootprintFilter (wxCommandEvent &aEvent) override |
| void | OnAddFootprintFilter (wxCommandEvent &aEvent) override |
Protected Attributes | |
| wxStaticText * | m_staticTextFootprints |
| wxListBox * | m_FootprintFilterListBox |
| STD_BITMAP_BUTTON * | m_addFilterButton |
| STD_BITMAP_BUTTON * | m_editFilterButton |
| STD_BITMAP_BUTTON * | m_deleteFilterButton |
| wxStaticText * | m_staticTextFootprints1 |
| wxListCtrl * | m_matchingFootprints |
Private Member Functions | |
| void | onModify () |
| Mark the host dialog (the top level window) as modified. | |
| void | updateMatchingFootprints () |
| Refresh the matches list for the current filters, or for the filter being typed in the Add/Edit dialog. | |
| void | showFootprintMatches (const std::vector< wxString > &aPatterns) |
| wxString | matchingFootprintName (long aItem) const |
| Return the "library:footprint" name of the given item in the matches list, or an empty string when the item is not a footprint name. | |
| void | openFootprintInEditor (const wxString &aFootprintName) |
| void | copyFootprintName (const wxString &aFootprintName) |
| bool | matchLibrariesReady () |
| Return true once the footprint libraries can be queried. | |
| void | showFpFilterMatchLoadIndication (bool aShow, float aProgress=0.0f) |
| Show or hide the footprint filter match list's library load indicator. | |
| void | onFpFilterMatchLoadTimer (wxTimerEvent &aEvent) |
| void | onFilterPreviewText (wxCommandEvent &aEvent) |
| Preview the filter text typed in the Add/Edit dialog, once typing pauses. | |
| void | onMatchingFootprintDoubleClick (wxListEvent &aEvent) |
| void | onMatchingFootprintContextMenu (wxListEvent &aEvent) |
| void | onMatchingFootprintKeyDown (wxKeyEvent &aEvent) |
| void | onNotebookPageChanged (wxBookCtrlEvent &aEvent) |
| Query the matches when the page is selected; the libraries are not loaded before that, and native notebooks do not reliably report page visibility with show events. | |
Private Attributes | |
| KIWAY & | m_kiway |
| std::unique_ptr< LISTBOX_TRICKS > | m_fpFilterTricks |
| std::unique_ptr< FP_FILTER_MATCHER > | m_fpMatcher |
| Supplies the matches for the footprint filter patterns. | |
| wxString | m_fpFilterPreview |
| The sanitised filter text being typed in the Add/Edit filter dialog. | |
| FOOTPRINT_ASSIGN_QUERY | m_canAssignFootprint |
| Access to panel-external interfaces. | |
| FOOTPRINT_ASSIGNER | m_assignFootprint |
| bool | m_matchLibrariesReady = false |
| wxTimer | m_matchLoadTimer |
| WX_DEBOUNCED_ACTION | m_filterPreviewDebounce |
| Debounces the preview of the filter being type to avoid spamming queries. | |
The footprint filters/matches panel of the symbol properties dialog.
Definition at line 40 of file panel_footprint_filters.h.
| using PANEL_FOOTPRINT_FILTERS::FOOTPRINT_ASSIGN_QUERY = std::function<bool()> |
Definition at line 54 of file panel_footprint_filters.h.
| using PANEL_FOOTPRINT_FILTERS::FOOTPRINT_ASSIGNER = std::function<void( const wxString& )> |
Definition at line 55 of file panel_footprint_filters.h.
| PANEL_FOOTPRINT_FILTERS::PANEL_FOOTPRINT_FILTERS | ( | wxWindow * | aParent, |
| KIWAY & | aKiway ) |
Definition at line 161 of file panel_footprint_filters.cpp.
References m_filterPreviewDebounce, PANEL_FOOTPRINT_FILTERS_BASE::m_FootprintFilterListBox, m_fpFilterTricks, m_fpMatcher, m_kiway, m_matchLoadTimer, PANEL_FOOTPRINT_FILTERS_BASE::PANEL_FOOTPRINT_FILTERS_BASE(), and updateMatchingFootprints().
|
override |
Definition at line 246 of file panel_footprint_filters.cpp.
References m_matchLoadTimer, onFpFilterMatchLoadTimer(), and onNotebookPageChanged().
|
private |
Definition at line 470 of file panel_footprint_filters.cpp.
Referenced by onMatchingFootprintContextMenu(), and onMatchingFootprintKeyDown().
| wxArrayString PANEL_FOOTPRINT_FILTERS::GetFilters | ( | ) | const |
Definition at line 261 of file panel_footprint_filters.cpp.
References PANEL_FOOTPRINT_FILTERS_BASE::m_FootprintFilterListBox.
|
private |
Return the "library:footprint" name of the given item in the matches list, or an empty string when the item is not a footprint name.
Definition at line 445 of file panel_footprint_filters.cpp.
References LIB_ID::Format(), LIB_ID::IsValid(), PANEL_FOOTPRINT_FILTERS_BASE::m_matchingFootprints, and LIB_ID::Parse().
Referenced by onMatchingFootprintContextMenu(), onMatchingFootprintDoubleClick(), and onMatchingFootprintKeyDown().
|
private |
Return true once the footprint libraries can be queried.
While they load, show the loading indication, keep polling and return false.
Definition at line 382 of file panel_footprint_filters.cpp.
References GetFootprintLibrariesLoadProgress(), m_kiway, m_matchLibrariesReady, m_matchLoadTimer, and showFpFilterMatchLoadIndication().
Referenced by onFpFilterMatchLoadTimer(), and showFootprintMatches().
|
overrideprotectedvirtual |
Reimplemented from PANEL_FOOTPRINT_FILTERS_BASE.
Definition at line 551 of file panel_footprint_filters.cpp.
References _, WX_TEXT_ENTRY_DIALOG::GetValue(), m_filterPreviewDebounce, PANEL_FOOTPRINT_FILTERS_BASE::m_FootprintFilterListBox, m_fpFilterPreview, onFilterPreviewText(), onModify(), SanitizeFpFilter(), DIALOG_SHIM::ShowModal(), and updateMatchingFootprints().
Referenced by OnFpFilterDClick().
|
overrideprotectedvirtual |
Reimplemented from PANEL_FOOTPRINT_FILTERS_BASE.
Definition at line 582 of file panel_footprint_filters.cpp.
References _, filter, WX_TEXT_ENTRY_DIALOG::GetValue(), m_filterPreviewDebounce, PANEL_FOOTPRINT_FILTERS_BASE::m_FootprintFilterListBox, m_fpFilterPreview, onFilterPreviewText(), onModify(), SanitizeFpFilter(), DIALOG_SHIM::ShowModal(), and updateMatchingFootprints().
Referenced by OnFpFilterDClick().
|
private |
Preview the filter text typed in the Add/Edit dialog, once typing pauses.
Definition at line 438 of file panel_footprint_filters.cpp.
References m_filterPreviewDebounce, m_fpFilterPreview, and SanitizeFpFilter().
Referenced by OnAddFootprintFilter(), and OnEditFootprintFilter().
|
overrideprotectedvirtual |
Reimplemented from PANEL_FOOTPRINT_FILTERS_BASE.
Definition at line 296 of file panel_footprint_filters.cpp.
References dummy, PANEL_FOOTPRINT_FILTERS_BASE::m_FootprintFilterListBox, OnAddFootprintFilter(), and OnEditFootprintFilter().
|
private |
Definition at line 428 of file panel_footprint_filters.cpp.
References matchLibrariesReady(), and updateMatchingFootprints().
Referenced by ~PANEL_FOOTPRINT_FILTERS().
|
private |
Definition at line 489 of file panel_footprint_filters.cpp.
References _, copyFootprintName(), m_assignFootprint, m_canAssignFootprint, matchingFootprintName(), and openFootprintInEditor().
|
private |
Definition at line 480 of file panel_footprint_filters.cpp.
References matchingFootprintName(), and openFootprintInEditor().
|
private |
Definition at line 533 of file panel_footprint_filters.cpp.
References copyFootprintName(), PANEL_FOOTPRINT_FILTERS_BASE::m_matchingFootprints, and matchingFootprintName().
|
private |
Mark the host dialog (the top level window) as modified.
Definition at line 275 of file panel_footprint_filters.cpp.
Referenced by OnAddFootprintFilter(), and OnEditFootprintFilter().
|
private |
Query the matches when the page is selected; the libraries are not loaded before that, and native notebooks do not reliably report page visibility with show events.
Definition at line 282 of file panel_footprint_filters.cpp.
References updateMatchingFootprints().
Referenced by ~PANEL_FOOTPRINT_FILTERS().
|
private |
Definition at line 461 of file panel_footprint_filters.cpp.
References FRAME_FOOTPRINT_EDITOR, m_kiway, and MAIL_FP_EDIT_LIBID.
Referenced by onMatchingFootprintContextMenu(), and onMatchingFootprintDoubleClick().
| void PANEL_FOOTPRINT_FILTERS::SetFilters | ( | const wxArrayString & | aFilters | ) |
Replace the filters in the list with aFilters.
Definition at line 255 of file panel_footprint_filters.cpp.
References PANEL_FOOTPRINT_FILTERS_BASE::m_FootprintFilterListBox.
| void PANEL_FOOTPRINT_FILTERS::SetFootprintFieldAccessors | ( | FOOTPRINT_ASSIGN_QUERY | aCanAssign, |
| FOOTPRINT_ASSIGNER | aAssign ) |
Injection for interfaces that reach outside the panel to interact with host dialog.
| aCanAssign | reports whether the FP field can be written at all |
| aAssign | pushes a footprint name into the field. |
Definition at line 267 of file panel_footprint_filters.cpp.
References m_assignFootprint, and m_canAssignFootprint.
|
private |
Definition at line 350 of file panel_footprint_filters.cpp.
References _, m_fpMatcher, PANEL_FOOTPRINT_FILTERS_BASE::m_matchingFootprints, PANEL_FOOTPRINT_FILTERS_BASE::m_staticTextFootprints1, matchLibrariesReady(), and result.
Referenced by updateMatchingFootprints().
|
private |
Show or hide the footprint filter match list's library load indicator.
| aShow | Whether to show the load indicator. |
| aProgress | The progress of the library loading, between 0.0 and 1.0. |
Definition at line 403 of file panel_footprint_filters.cpp.
References _, PANEL_FOOTPRINT_FILTERS_BASE::m_matchingFootprints, and PANEL_FOOTPRINT_FILTERS_BASE::m_staticTextFootprints1.
Referenced by matchLibrariesReady().
|
private |
Refresh the matches list for the current filters, or for the filter being typed in the Add/Edit dialog.
Definition at line 308 of file panel_footprint_filters.cpp.
References filters, PANEL_FOOTPRINT_FILTERS_BASE::m_FootprintFilterListBox, m_fpFilterPreview, m_fpMatcher, and showFootprintMatches().
Referenced by OnAddFootprintFilter(), OnEditFootprintFilter(), onFpFilterMatchLoadTimer(), onNotebookPageChanged(), and PANEL_FOOTPRINT_FILTERS().
|
protectedinherited |
Definition at line 154 of file dialog_lib_symbol_properties_base.h.
Referenced by PANEL_FOOTPRINT_FILTERS_BASE(), and ~PANEL_FOOTPRINT_FILTERS_BASE().
|
private |
Definition at line 127 of file panel_footprint_filters.h.
Referenced by onMatchingFootprintContextMenu(), and SetFootprintFieldAccessors().
|
private |
Access to panel-external interfaces.
Definition at line 126 of file panel_footprint_filters.h.
Referenced by onMatchingFootprintContextMenu(), and SetFootprintFieldAccessors().
|
protectedinherited |
Definition at line 156 of file dialog_lib_symbol_properties_base.h.
Referenced by PANEL_FOOTPRINT_FILTERS_BASE().
|
protectedinherited |
Definition at line 155 of file dialog_lib_symbol_properties_base.h.
Referenced by PANEL_FOOTPRINT_FILTERS_BASE(), and ~PANEL_FOOTPRINT_FILTERS_BASE().
|
private |
Debounces the preview of the filter being type to avoid spamming queries.
Definition at line 133 of file panel_footprint_filters.h.
Referenced by OnAddFootprintFilter(), OnEditFootprintFilter(), onFilterPreviewText(), and PANEL_FOOTPRINT_FILTERS().
|
protectedinherited |
Definition at line 153 of file dialog_lib_symbol_properties_base.h.
Referenced by PANEL_FOOTPRINT_FILTERS::GetFilters(), PANEL_FOOTPRINT_FILTERS::OnAddFootprintFilter(), PANEL_FOOTPRINT_FILTERS::OnEditFootprintFilter(), PANEL_FOOTPRINT_FILTERS::OnFpFilterDClick(), PANEL_FOOTPRINT_FILTERS::PANEL_FOOTPRINT_FILTERS(), PANEL_FOOTPRINT_FILTERS_BASE(), PANEL_FOOTPRINT_FILTERS::SetFilters(), PANEL_FOOTPRINT_FILTERS::updateMatchingFootprints(), and ~PANEL_FOOTPRINT_FILTERS_BASE().
|
private |
The sanitised filter text being typed in the Add/Edit filter dialog.
If it is set, the match list previews this instead of the filters in the list pane.
Definition at line 123 of file panel_footprint_filters.h.
Referenced by OnAddFootprintFilter(), OnEditFootprintFilter(), onFilterPreviewText(), and updateMatchingFootprints().
|
private |
Definition at line 116 of file panel_footprint_filters.h.
Referenced by PANEL_FOOTPRINT_FILTERS().
|
private |
Supplies the matches for the footprint filter patterns.
Definition at line 119 of file panel_footprint_filters.h.
Referenced by PANEL_FOOTPRINT_FILTERS(), showFootprintMatches(), and updateMatchingFootprints().
|
private |
Definition at line 114 of file panel_footprint_filters.h.
Referenced by matchLibrariesReady(), openFootprintInEditor(), and PANEL_FOOTPRINT_FILTERS().
|
protectedinherited |
Definition at line 158 of file dialog_lib_symbol_properties_base.h.
Referenced by PANEL_FOOTPRINT_FILTERS::matchingFootprintName(), PANEL_FOOTPRINT_FILTERS::onMatchingFootprintKeyDown(), PANEL_FOOTPRINT_FILTERS_BASE(), PANEL_FOOTPRINT_FILTERS::showFootprintMatches(), and PANEL_FOOTPRINT_FILTERS::showFpFilterMatchLoadIndication().
|
private |
Definition at line 129 of file panel_footprint_filters.h.
Referenced by matchLibrariesReady().
|
private |
Definition at line 130 of file panel_footprint_filters.h.
Referenced by matchLibrariesReady(), PANEL_FOOTPRINT_FILTERS(), and ~PANEL_FOOTPRINT_FILTERS().
|
protectedinherited |
Definition at line 152 of file dialog_lib_symbol_properties_base.h.
Referenced by PANEL_FOOTPRINT_FILTERS_BASE().
|
protectedinherited |
Definition at line 157 of file dialog_lib_symbol_properties_base.h.
Referenced by PANEL_FOOTPRINT_FILTERS_BASE(), PANEL_FOOTPRINT_FILTERS::showFootprintMatches(), and PANEL_FOOTPRINT_FILTERS::showFpFilterMatchLoadIndication().