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

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

Detailed Description

Definition at line 49 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 m_frame( aFrame )
29{
30}
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)
EDA_DRAW_FRAME * m_frame
Definition: search_pane.h:68

◆ ~SEARCH_PANE()

SEARCH_PANE::~SEARCH_PANE ( )
virtual

Definition at line 33 of file search_pane.cpp.

34{
35}

Member Function Documentation

◆ AddSearcher()

void SEARCH_PANE::AddSearcher ( SEARCH_HANDLER aHandler)

Definition at line 51 of file search_pane.cpp.

52{
53 SEARCH_PANE_TAB* tab = new SEARCH_PANE_TAB( aHandler, m_notebook );
54
55 m_notebook->AddPage( tab, _( aHandler->GetName() ) );
56 m_handlers.push_back( aHandler );
57 m_tabs.push_back( tab );
58}
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
#define _(s)

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 70 of file search_pane.cpp.

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

References m_tabs.

Referenced by PCB_SEARCH_PANE::onBoardChanged().

◆ FocusSearch()

void SEARCH_PANE::FocusSearch ( )

Definition at line 88 of file search_pane.cpp.

89{
90 m_searchCtrl1->SetFocus();
91}
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 103 of file search_pane.cpp.

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

References SEARCH_PANE_BASE::m_notebook.

Referenced by OnNotebookPageChanged(), and RefreshSearch().

◆ OnLanguageChange()

void SEARCH_PANE::OnLanguageChange ( )

Definition at line 38 of file search_pane.cpp.

39{
40 for( size_t i = 0; i < m_notebook->GetPageCount(); ++i )
41 {
42 wxWindow* page = m_notebook->GetPage( i );
43 SEARCH_PANE_TAB* tab = dynamic_cast<SEARCH_PANE_TAB*>( page );
44
45 tab->RefreshColumnNames();
46 m_notebook->SetPageText( i, _( tab->GetSearchHandler()->GetName() ) );
47 }
48}
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 94 of file search_pane.cpp.

95{
97
98 if( tab )
99 tab->Search( m_lastQuery );
100}
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 79 of file search_pane.cpp.

80{
81 wxString query = m_searchCtrl1->GetValue();
82 m_lastQuery = query;
83
85}
void RefreshSearch()
Definition: search_pane.cpp:61

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_frame

EDA_DRAW_FRAME* SEARCH_PANE::m_frame
private

Definition at line 68 of file search_pane.h.

◆ 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: