Use wxSearchCtrl in the footprint viewer/picker.

This commit is contained in:
Marek Roszko 2021-07-04 22:06:01 -04:00
parent d2aeddc6cb
commit a92d337905
2 changed files with 8 additions and 6 deletions

View File

@ -57,6 +57,7 @@
#include <tools/pcb_selection_tool.h> #include <tools/pcb_selection_tool.h>
#include <wildcards_and_files_ext.h> #include <wildcards_and_files_ext.h>
#include <wx/listbox.h> #include <wx/listbox.h>
#include <wx/srchctrl.h>
#include <wx/tokenzr.h> #include <wx/tokenzr.h>
using namespace std::placeholders; using namespace std::placeholders;
@ -137,9 +138,9 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
wxPanel* libPanel = new wxPanel( this ); wxPanel* libPanel = new wxPanel( this );
wxSizer* libSizer = new wxBoxSizer( wxVERTICAL ); wxSizer* libSizer = new wxBoxSizer( wxVERTICAL );
m_libFilter = new wxTextCtrl( libPanel, ID_MODVIEW_LIB_FILTER, wxEmptyString, m_libFilter = new wxSearchCtrl( libPanel, ID_MODVIEW_LIB_FILTER, wxEmptyString,
wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER ); wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
m_libFilter->SetHint( _( "Filter" ) ); m_libFilter->SetDescriptiveText( _( "Filter" ) );
libSizer->Add( m_libFilter, 0, wxEXPAND, 5 ); libSizer->Add( m_libFilter, 0, wxEXPAND, 5 );
m_libList = new wxListBox( libPanel, ID_MODVIEW_LIB_LIST, wxDefaultPosition, wxDefaultSize, m_libList = new wxListBox( libPanel, ID_MODVIEW_LIB_LIST, wxDefaultPosition, wxDefaultSize,
@ -152,9 +153,9 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
wxPanel* fpPanel = new wxPanel( this ); wxPanel* fpPanel = new wxPanel( this );
wxSizer* fpSizer = new wxBoxSizer( wxVERTICAL ); wxSizer* fpSizer = new wxBoxSizer( wxVERTICAL );
m_fpFilter = new wxTextCtrl( fpPanel, ID_MODVIEW_FOOTPRINT_FILTER, wxEmptyString, m_fpFilter = new wxSearchCtrl( fpPanel, ID_MODVIEW_FOOTPRINT_FILTER, wxEmptyString,
wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER ); wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
m_fpFilter->SetHint( _( "Filter" ) ); m_fpFilter->SetDescriptiveText( _( "Filter" ) );
m_fpFilter->SetToolTip( m_fpFilter->SetToolTip(
_( "Filter on footprint name, keywords, description and pad count.\n" _( "Filter on footprint name, keywords, description and pad count.\n"
"Search terms are separated by spaces. All search terms must match.\n" "Search terms are separated by spaces. All search terms must match.\n"

View File

@ -32,6 +32,7 @@
class wxSashLayoutWindow; class wxSashLayoutWindow;
class wxListBox; class wxListBox;
class wxSearchCtrl;
class FP_LIB_TABLE; class FP_LIB_TABLE;
class BOARD_ITEM; class BOARD_ITEM;
class SELECTION; class SELECTION;
@ -166,9 +167,9 @@ private:
friend struct PCB::IFACE; // constructor called from here only friend struct PCB::IFACE; // constructor called from here only
wxTextCtrl* m_libFilter; wxSearchCtrl* m_libFilter;
wxListBox* m_libList; // The list of library names. wxListBox* m_libList; // The list of library names.
wxTextCtrl* m_fpFilter; wxSearchCtrl* m_fpFilter;
wxListBox* m_fpList; // The list of footprint names. wxListBox* m_fpList; // The list of footprint names.
bool m_autoZoom; bool m_autoZoom;