KiCad PCB EDA Suite
SEARCH_PANE Class Reference

#include <search_pane.h>

Inheritance diagram for SEARCH_PANE:
SEARCH_PANE_BASE PCB_SEARCH_PANE

Public Member Functions

 SEARCH_PANE (EDA_DRAW_FRAME *aFrame)
 
virtual ~SEARCH_PANE ()
 
void AddSearcher (SEARCH_HANDLER *aHandler)
 
void OnSearchTextEntry (wxCommandEvent &aEvent) override
 
void OnNotebookPageChanged (wxBookCtrlEvent &aEvent) override
 
void RefreshSearch ()
 
void OnLanguageChange ()
 
void FocusSearch ()
 
void ClearAllResults ()
 

Protected Member Functions

SEARCH_PANE_TABGetCurrentTab () const
 
virtual void OnSetFocus (wxFocusEvent &event)
 
virtual void OnSize (wxSizeEvent &event)
 
virtual void OnNotebookPageChanged (wxNotebookEvent &event)
 

Protected Attributes

wxBoxSizer * m_sizerOuter
 
wxSearchCtrl * m_searchCtrl1
 
wxNotebook * m_notebook
 

Private Attributes

std::vector< SEARCH_HANDLER * > m_handlers
 
std::vector< SEARCH_PANE_TAB * > m_tabs
 
wxString m_lastQuery
 

Detailed Description

Definition at line 50 of file search_pane.h.

Constructor & Destructor Documentation

◆ SEARCH_PANE()

SEARCH_PANE::SEARCH_PANE ( EDA_DRAW_FRAME aFrame)

Definition at line 26 of file search_pane.cpp.

26 :
27 SEARCH_PANE_BASE( aFrame )
28{
29}
SEARCH_PANE_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(360, 250), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)

◆ ~SEARCH_PANE()

SEARCH_PANE::~SEARCH_PANE ( )
virtual

Definition at line 32 of file search_pane.cpp.

33{
34}

Member Function Documentation

◆ AddSearcher()

void SEARCH_PANE::AddSearcher ( SEARCH_HANDLER aHandler)

Definition at line 52 of file search_pane.cpp.

53{
54 SEARCH_PANE_TAB* tab = new SEARCH_PANE_TAB( aHandler, m_notebook );
55
56 m_notebook->AddPage( tab, wxGetTranslation( aHandler->GetName() ) );
57 m_handlers.push_back( aHandler );
58 m_tabs.push_back( tab );
59}
wxString GetName() const
Definition: search_pane.h:35
wxNotebook * m_notebook
std::vector< SEARCH_PANE_TAB * > m_tabs
Definition: search_pane.h:70
std::vector< SEARCH_HANDLER * > m_handlers
Definition: search_pane.h:69

References SEARCH_HANDLER::GetName(), m_handlers, SEARCH_PANE_BASE::m_notebook, and m_tabs.

Referenced by PCB_SEARCH_PANE::PCB_SEARCH_PANE().

◆ ClearAllResults()

void SEARCH_PANE::ClearAllResults ( )

Definition at line 71 of file search_pane.cpp.

72{
73 for( SEARCH_PANE_TAB* tab : m_tabs )
74 {
75 tab->Clear();
76 }
77}

References m_tabs.

Referenced by PCB_SEARCH_PANE::onBoardChanged().

◆ FocusSearch()

void SEARCH_PANE::FocusSearch ( )

Definition at line 89 of file search_pane.cpp.

90{
91 m_searchCtrl1->SetFocus();
92}
wxSearchCtrl * m_searchCtrl1

References SEARCH_PANE_BASE::m_searchCtrl1.

Referenced by PCB_EDIT_FRAME::ToggleSearch().

◆ GetCurrentTab()

SEARCH_PANE_TAB * SEARCH_PANE::GetCurrentTab ( ) const
protected

Definition at line 104 of file search_pane.cpp.

105{
106 return dynamic_cast<SEARCH_PANE_TAB*>( m_notebook->GetCurrentPage() );
107}

References SEARCH_PANE_BASE::m_notebook.

Referenced by OnNotebookPageChanged(), and RefreshSearch().

◆ OnLanguageChange()

void SEARCH_PANE::OnLanguageChange ( )

Definition at line 37 of file search_pane.cpp.

38{
39 for( size_t i = 0; i < m_notebook->GetPageCount(); ++i )
40 {
41 wxWindow* page = m_notebook->GetPage( i );
42 SEARCH_PANE_TAB* tab = dynamic_cast<SEARCH_PANE_TAB*>( page );
43
44 wxCHECK( tab, /* void */ );
45
46 tab->RefreshColumnNames();
47 m_notebook->SetPageText( i, wxGetTranslation( tab->GetSearchHandler()->GetName() ) );
48 }
49}
SEARCH_HANDLER * GetSearchHandler() const

References SEARCH_HANDLER::GetName(), SEARCH_PANE_TAB::GetSearchHandler(), SEARCH_PANE_BASE::m_notebook, and SEARCH_PANE_TAB::RefreshColumnNames().

Referenced by EDA_DRAW_FRAME::ShowChangedLanguage().

◆ OnNotebookPageChanged() [1/2]

void SEARCH_PANE::OnNotebookPageChanged ( wxBookCtrlEvent &  aEvent)
override

Definition at line 95 of file search_pane.cpp.

96{
98
99 if( tab )
100 tab->Search( m_lastQuery );
101}
void Search(wxString &query)
SEARCH_PANE_TAB * GetCurrentTab() const
wxString m_lastQuery
Definition: search_pane.h:71

References GetCurrentTab(), m_lastQuery, and SEARCH_PANE_TAB::Search().

◆ OnNotebookPageChanged() [2/2]

virtual void SEARCH_PANE_BASE::OnNotebookPageChanged ( wxNotebookEvent &  event)
inlineprotectedvirtualinherited

Definition at line 42 of file search_pane_base.h.

42{ event.Skip(); }

Referenced by SEARCH_PANE_BASE::SEARCH_PANE_BASE(), and SEARCH_PANE_BASE::~SEARCH_PANE_BASE().

◆ OnSearchTextEntry()

void SEARCH_PANE::OnSearchTextEntry ( wxCommandEvent &  aEvent)
overridevirtual

Reimplemented from SEARCH_PANE_BASE.

Definition at line 80 of file search_pane.cpp.

81{
82 wxString query = m_searchCtrl1->GetValue();
83 m_lastQuery = query;
84
86}
void RefreshSearch()
Definition: search_pane.cpp:62

References m_lastQuery, SEARCH_PANE_BASE::m_searchCtrl1, and RefreshSearch().

◆ OnSetFocus()

virtual void SEARCH_PANE_BASE::OnSetFocus ( wxFocusEvent &  event)
inlineprotectedvirtualinherited

Definition at line 39 of file search_pane_base.h.

39{ event.Skip(); }

Referenced by SEARCH_PANE_BASE::SEARCH_PANE_BASE(), and SEARCH_PANE_BASE::~SEARCH_PANE_BASE().

◆ OnSize()

virtual void SEARCH_PANE_BASE::OnSize ( wxSizeEvent &  event)
inlineprotectedvirtualinherited

Definition at line 40 of file search_pane_base.h.

40{ event.Skip(); }

Referenced by SEARCH_PANE_BASE::SEARCH_PANE_BASE(), and SEARCH_PANE_BASE::~SEARCH_PANE_BASE().

◆ RefreshSearch()

Member Data Documentation

◆ m_handlers

std::vector<SEARCH_HANDLER*> SEARCH_PANE::m_handlers
private

Definition at line 69 of file search_pane.h.

Referenced by AddSearcher().

◆ m_lastQuery

wxString SEARCH_PANE::m_lastQuery
private

Definition at line 71 of file search_pane.h.

Referenced by OnNotebookPageChanged(), OnSearchTextEntry(), and RefreshSearch().

◆ m_notebook

wxNotebook* SEARCH_PANE_BASE::m_notebook
protectedinherited

◆ m_searchCtrl1

wxSearchCtrl* SEARCH_PANE_BASE::m_searchCtrl1
protectedinherited

◆ m_sizerOuter

wxBoxSizer* SEARCH_PANE_BASE::m_sizerOuter
protectedinherited

Definition at line 34 of file search_pane_base.h.

Referenced by SEARCH_PANE_BASE::SEARCH_PANE_BASE().

◆ m_tabs

std::vector<SEARCH_PANE_TAB*> SEARCH_PANE::m_tabs
private

Definition at line 70 of file search_pane.h.

Referenced by AddSearcher(), and ClearAllResults().


The documentation for this class was generated from the following files: