From a92d337905ec4e8259b76ecb6a87e945eb84f5a7 Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Sun, 4 Jul 2021 22:06:01 -0400 Subject: [PATCH] Use wxSearchCtrl in the footprint viewer/picker. --- pcbnew/footprint_viewer_frame.cpp | 9 +++++---- pcbnew/footprint_viewer_frame.h | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index 69a45efe54..c26d04c8ea 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -57,6 +57,7 @@ #include #include #include +#include #include using namespace std::placeholders; @@ -137,9 +138,9 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent wxPanel* libPanel = new wxPanel( this ); 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 ); - m_libFilter->SetHint( _( "Filter" ) ); + m_libFilter->SetDescriptiveText( _( "Filter" ) ); libSizer->Add( m_libFilter, 0, wxEXPAND, 5 ); 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 ); 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 ); - m_fpFilter->SetHint( _( "Filter" ) ); + m_fpFilter->SetDescriptiveText( _( "Filter" ) ); m_fpFilter->SetToolTip( _( "Filter on footprint name, keywords, description and pad count.\n" "Search terms are separated by spaces. All search terms must match.\n" diff --git a/pcbnew/footprint_viewer_frame.h b/pcbnew/footprint_viewer_frame.h index 123808bddf..22e71c88d4 100644 --- a/pcbnew/footprint_viewer_frame.h +++ b/pcbnew/footprint_viewer_frame.h @@ -32,6 +32,7 @@ class wxSashLayoutWindow; class wxListBox; +class wxSearchCtrl; class FP_LIB_TABLE; class BOARD_ITEM; class SELECTION; @@ -166,9 +167,9 @@ private: friend struct PCB::IFACE; // constructor called from here only - wxTextCtrl* m_libFilter; + wxSearchCtrl* m_libFilter; wxListBox* m_libList; // The list of library names. - wxTextCtrl* m_fpFilter; + wxSearchCtrl* m_fpFilter; wxListBox* m_fpList; // The list of footprint names. bool m_autoZoom;