Use a wxSearchCtrl instead of wxTextCtrl for the symbol chooser window

This just makes it prettier with the search icon and cancel
This commit is contained in:
Marek Roszko 2021-07-04 21:24:03 -04:00
parent 8e229a26c8
commit 3b33f94c56
2 changed files with 6 additions and 2 deletions

View File

@ -30,6 +30,7 @@
#include <wx/html/htmlwin.h>
#include <tool/tool_interactive.h>
#include <tool/tool_manager.h>
#include <wx/srchctrl.h>
#include <wx/settings.h>
#include <wx/statbmp.h>
@ -51,9 +52,11 @@ LIB_TREE::LIB_TREE( wxWindow* aParent, LIB_TABLE* aLibTable,
{
auto search_sizer = new wxBoxSizer( wxHORIZONTAL );
m_query_ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition,
m_query_ctrl = new wxSearchCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition,
wxDefaultSize, wxTE_PROCESS_ENTER );
m_query_ctrl->ShowCancelButton( true );
// Additional visual cue for GTK, which hides the placeholder text on focus
#ifdef __WXGTK__
auto bitmap = new wxStaticBitmap( this, wxID_ANY, wxArtProvider::GetBitmap( wxART_FIND, wxART_FRAME_ICON ) );

View File

@ -32,6 +32,7 @@ class wxDataViewCtrl;
class wxTextCtrl;
class wxHtmlWindow;
class wxHtmlLinkEvent;
class wxSearchCtrl;
class ACTION_MENU;
class LIB_ID;
class LIB_TABLE;
@ -171,7 +172,7 @@ protected:
wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER> m_adapter;
wxTextCtrl* m_query_ctrl;
wxSearchCtrl* m_query_ctrl;
wxDataViewCtrl* m_tree_ctrl;
wxHtmlWindow* m_details_ctrl;