25 changed files with 1217 additions and 3 deletions
-
3common/CMakeLists.txt
-
12common/eda_draw_frame.cpp
-
6common/tool/actions.cpp
-
82common/widgets/search_pane.cpp
-
51common/widgets/search_pane_base.cpp
-
192common/widgets/search_pane_base.fbp
-
52common/widgets/search_pane_base.h
-
95common/widgets/search_pane_tab.cpp
-
7include/eda_draw_frame.h
-
1include/tool/actions.h
-
70include/widgets/search_pane.h
-
66include/widgets/search_pane_tab.h
-
2pcbnew/CMakeLists.txt
-
3pcbnew/menubar_pcb_editor.cpp
-
18pcbnew/pcb_edit_frame.cpp
-
9pcbnew/pcb_edit_frame.h
-
15pcbnew/toolbars_pcb_editor.cpp
-
18pcbnew/tools/board_editor_control.cpp
-
2pcbnew/tools/board_editor_control.h
-
5pcbnew/tools/pcb_actions.cpp
-
1pcbnew/tools/pcb_actions.h
-
119pcbnew/widgets/pcb_search_pane.cpp
-
53pcbnew/widgets/pcb_search_pane.h
-
248pcbnew/widgets/search_handlers.cpp
-
90pcbnew/widgets/search_handlers.h
@ -0,0 +1,82 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2022 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify it |
|||
* under the terms of the GNU General Public License as published by the |
|||
* Free Software Foundation, either version 3 of the License, or (at your |
|||
* option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, but |
|||
* WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|||
* General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License along |
|||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
#include <widgets/search_pane.h>
|
|||
#include <widgets/search_pane_tab.h>
|
|||
#include <eda_draw_frame.h>
|
|||
#include <kiway.h>
|
|||
|
|||
|
|||
SEARCH_PANE::SEARCH_PANE( EDA_DRAW_FRAME* aFrame ) : |
|||
SEARCH_PANE_BASE( aFrame ), |
|||
m_frame( aFrame ) |
|||
{ |
|||
} |
|||
|
|||
|
|||
SEARCH_PANE::~SEARCH_PANE() |
|||
{ |
|||
} |
|||
|
|||
|
|||
void SEARCH_PANE::OnLanguageChange() |
|||
{ |
|||
for( size_t i = 0; i < m_notebook->GetPageCount(); ++i ) |
|||
{ |
|||
wxWindow* page = m_notebook->GetPage( i ); |
|||
SEARCH_PANE_TAB* tab = dynamic_cast<SEARCH_PANE_TAB*>( page ); |
|||
|
|||
tab->RefreshColumnNames(); |
|||
m_notebook->SetPageText( i, _( tab->GetSearchHandler()->GetName() ) ); |
|||
} |
|||
} |
|||
|
|||
|
|||
void SEARCH_PANE::AddSearcher( SEARCH_HANDLER* aHandler ) |
|||
{ |
|||
SEARCH_PANE_TAB* tab = new SEARCH_PANE_TAB( aHandler, m_notebook ); |
|||
|
|||
m_notebook->AddPage( tab, _( aHandler->GetName() ) ); |
|||
m_handlers.push_back( aHandler ); |
|||
m_tabs.push_back( tab ); |
|||
} |
|||
|
|||
|
|||
void SEARCH_PANE::RefreshSearch() |
|||
{ |
|||
for( SEARCH_PANE_TAB* tab : m_tabs ) |
|||
{ |
|||
tab->Search( m_lastQuery ); |
|||
} |
|||
} |
|||
|
|||
|
|||
void SEARCH_PANE::OnSearchTextEntry( wxCommandEvent& aEvent ) |
|||
{ |
|||
wxString query = m_searchCtrl1->GetValue(); |
|||
m_lastQuery = query; |
|||
|
|||
RefreshSearch(); |
|||
} |
|||
|
|||
|
|||
void SEARCH_PANE::FocusSearch() |
|||
{ |
|||
m_searchCtrl1->SetFocus(); |
|||
} |
|||
@ -0,0 +1,51 @@ |
|||
///////////////////////////////////////////////////////////////////////////
|
|||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3)
|
|||
// http://www.wxformbuilder.org/
|
|||
//
|
|||
// PLEASE DO *NOT* EDIT THIS FILE!
|
|||
///////////////////////////////////////////////////////////////////////////
|
|||
|
|||
#include "search_pane_base.h"
|
|||
|
|||
///////////////////////////////////////////////////////////////////////////
|
|||
|
|||
SEARCH_PANE_BASE::SEARCH_PANE_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name ) |
|||
{ |
|||
this->SetFont( wxFont( 10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) ); |
|||
this->SetMinSize( wxSize( 360,100 ) ); |
|||
|
|||
m_sizerOuter = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
m_searchCtrl1 = new wxSearchCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
#ifndef __WXMAC__
|
|||
m_searchCtrl1->ShowSearchButton( true ); |
|||
#endif
|
|||
m_searchCtrl1->ShowCancelButton( false ); |
|||
m_sizerOuter->Add( m_searchCtrl1, 0, wxALL|wxEXPAND, 5 ); |
|||
|
|||
m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
|
|||
m_sizerOuter->Add( m_notebook, 1, wxEXPAND, 5 ); |
|||
|
|||
|
|||
this->SetSizer( m_sizerOuter ); |
|||
this->Layout(); |
|||
|
|||
// Connect Events
|
|||
this->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( SEARCH_PANE_BASE::OnSetFocus ) ); |
|||
this->Connect( wxEVT_SIZE, wxSizeEventHandler( SEARCH_PANE_BASE::OnSize ) ); |
|||
m_searchCtrl1->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( SEARCH_PANE_BASE::OnSearchTextEntry ), NULL, this ); |
|||
m_notebook->Connect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( SEARCH_PANE_BASE::OnNotebookPageChanged ), NULL, this ); |
|||
m_notebook->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( SEARCH_PANE_BASE::OnSetFocus ), NULL, this ); |
|||
} |
|||
|
|||
SEARCH_PANE_BASE::~SEARCH_PANE_BASE() |
|||
{ |
|||
// Disconnect Events
|
|||
this->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( SEARCH_PANE_BASE::OnSetFocus ) ); |
|||
this->Disconnect( wxEVT_SIZE, wxSizeEventHandler( SEARCH_PANE_BASE::OnSize ) ); |
|||
m_searchCtrl1->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( SEARCH_PANE_BASE::OnSearchTextEntry ), NULL, this ); |
|||
m_notebook->Disconnect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( SEARCH_PANE_BASE::OnNotebookPageChanged ), NULL, this ); |
|||
m_notebook->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( SEARCH_PANE_BASE::OnSetFocus ), NULL, this ); |
|||
|
|||
} |
|||
@ -0,0 +1,192 @@ |
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> |
|||
<wxFormBuilder_Project> |
|||
<FileVersion major="1" minor="16" /> |
|||
<object class="Project" expanded="1"> |
|||
<property name="class_decoration">; </property> |
|||
<property name="code_generation">C++</property> |
|||
<property name="disconnect_events">1</property> |
|||
<property name="disconnect_mode">source_name</property> |
|||
<property name="disconnect_php_events">0</property> |
|||
<property name="disconnect_python_events">0</property> |
|||
<property name="embedded_files_path">res</property> |
|||
<property name="encoding">UTF-8</property> |
|||
<property name="event_generation">connect</property> |
|||
<property name="file">search_pane_base</property> |
|||
<property name="first_id">1000</property> |
|||
<property name="help_provider">none</property> |
|||
<property name="image_path_wrapper_function_name"></property> |
|||
<property name="indent_with_spaces"></property> |
|||
<property name="internationalize">1</property> |
|||
<property name="name">SEARCH PANE</property> |
|||
<property name="namespace"></property> |
|||
<property name="path">.</property> |
|||
<property name="precompiled_header"></property> |
|||
<property name="relative_path">1</property> |
|||
<property name="skip_lua_events">1</property> |
|||
<property name="skip_php_events">1</property> |
|||
<property name="skip_python_events">1</property> |
|||
<property name="ui_table">UI</property> |
|||
<property name="use_array_enum">0</property> |
|||
<property name="use_enum">0</property> |
|||
<property name="use_microsoft_bom">0</property> |
|||
<object class="Panel" expanded="1"> |
|||
<property name="aui_managed">0</property> |
|||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property> |
|||
<property name="bg"></property> |
|||
<property name="context_help"></property> |
|||
<property name="context_menu">1</property> |
|||
<property name="enabled">1</property> |
|||
<property name="event_handler">impl_virtual</property> |
|||
<property name="fg"></property> |
|||
<property name="font">,90,90,10,70,0</property> |
|||
<property name="hidden">0</property> |
|||
<property name="id">wxID_ANY</property> |
|||
<property name="maximum_size"></property> |
|||
<property name="minimum_size">360,100</property> |
|||
<property name="name">SEARCH_PANE_BASE</property> |
|||
<property name="pos"></property> |
|||
<property name="size">360,250</property> |
|||
<property name="subclass">; ; forward_declare</property> |
|||
<property name="tooltip"></property> |
|||
<property name="two_step_creation">0</property> |
|||
<property name="window_extra_style"></property> |
|||
<property name="window_name"></property> |
|||
<property name="window_style">wxTAB_TRAVERSAL</property> |
|||
<event name="OnSetFocus">OnSetFocus</event> |
|||
<event name="OnSize">OnSize</event> |
|||
<object class="wxBoxSizer" expanded="1"> |
|||
<property name="minimum_size"></property> |
|||
<property name="name">m_sizerOuter</property> |
|||
<property name="orient">wxVERTICAL</property> |
|||
<property name="permission">protected</property> |
|||
<object class="sizeritem" expanded="1"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxALL|wxEXPAND</property> |
|||
<property name="proportion">0</property> |
|||
<object class="wxSearchCtrl" expanded="1"> |
|||
<property name="BottomDockable">1</property> |
|||
<property name="LeftDockable">1</property> |
|||
<property name="RightDockable">1</property> |
|||
<property name="TopDockable">1</property> |
|||
<property name="aui_layer"></property> |
|||
<property name="aui_name"></property> |
|||
<property name="aui_position"></property> |
|||
<property name="aui_row"></property> |
|||
<property name="best_size"></property> |
|||
<property name="bg"></property> |
|||
<property name="cancel_button">0</property> |
|||
<property name="caption"></property> |
|||
<property name="caption_visible">1</property> |
|||
<property name="center_pane">0</property> |
|||
<property name="close_button">1</property> |
|||
<property name="context_help"></property> |
|||
<property name="context_menu">1</property> |
|||
<property name="default_pane">0</property> |
|||
<property name="dock">Dock</property> |
|||
<property name="dock_fixed">0</property> |
|||
<property name="docking">Left</property> |
|||
<property name="enabled">1</property> |
|||
<property name="fg"></property> |
|||
<property name="floatable">1</property> |
|||
<property name="font"></property> |
|||
<property name="gripper">0</property> |
|||
<property name="hidden">0</property> |
|||
<property name="id">wxID_ANY</property> |
|||
<property name="max_size"></property> |
|||
<property name="maximize_button">0</property> |
|||
<property name="maximum_size"></property> |
|||
<property name="min_size"></property> |
|||
<property name="minimize_button">0</property> |
|||
<property name="minimum_size"></property> |
|||
<property name="moveable">1</property> |
|||
<property name="name">m_searchCtrl1</property> |
|||
<property name="pane_border">1</property> |
|||
<property name="pane_position"></property> |
|||
<property name="pane_size"></property> |
|||
<property name="permission">protected</property> |
|||
<property name="pin_button">1</property> |
|||
<property name="pos"></property> |
|||
<property name="resize">Resizable</property> |
|||
<property name="search_button">1</property> |
|||
<property name="show">1</property> |
|||
<property name="size"></property> |
|||
<property name="style"></property> |
|||
<property name="subclass">; ; forward_declare</property> |
|||
<property name="toolbar_pane">0</property> |
|||
<property name="tooltip"></property> |
|||
<property name="validator_data_type"></property> |
|||
<property name="validator_style">wxFILTER_NONE</property> |
|||
<property name="validator_type">wxDefaultValidator</property> |
|||
<property name="validator_variable"></property> |
|||
<property name="value"></property> |
|||
<property name="window_extra_style"></property> |
|||
<property name="window_name"></property> |
|||
<property name="window_style"></property> |
|||
<event name="OnText">OnSearchTextEntry</event> |
|||
</object> |
|||
</object> |
|||
<object class="sizeritem" expanded="1"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxEXPAND</property> |
|||
<property name="proportion">1</property> |
|||
<object class="wxNotebook" expanded="1"> |
|||
<property name="BottomDockable">1</property> |
|||
<property name="LeftDockable">1</property> |
|||
<property name="RightDockable">1</property> |
|||
<property name="TopDockable">1</property> |
|||
<property name="aui_layer"></property> |
|||
<property name="aui_name"></property> |
|||
<property name="aui_position"></property> |
|||
<property name="aui_row"></property> |
|||
<property name="best_size"></property> |
|||
<property name="bg"></property> |
|||
<property name="bitmapsize"></property> |
|||
<property name="caption"></property> |
|||
<property name="caption_visible">1</property> |
|||
<property name="center_pane">0</property> |
|||
<property name="close_button">1</property> |
|||
<property name="context_help"></property> |
|||
<property name="context_menu">1</property> |
|||
<property name="default_pane">0</property> |
|||
<property name="dock">Dock</property> |
|||
<property name="dock_fixed">0</property> |
|||
<property name="docking">Left</property> |
|||
<property name="enabled">1</property> |
|||
<property name="fg"></property> |
|||
<property name="floatable">1</property> |
|||
<property name="font"></property> |
|||
<property name="gripper">0</property> |
|||
<property name="hidden">0</property> |
|||
<property name="id">wxID_ANY</property> |
|||
<property name="max_size"></property> |
|||
<property name="maximize_button">0</property> |
|||
<property name="maximum_size"></property> |
|||
<property name="min_size"></property> |
|||
<property name="minimize_button">0</property> |
|||
<property name="minimum_size"></property> |
|||
<property name="moveable">1</property> |
|||
<property name="name">m_notebook</property> |
|||
<property name="pane_border">1</property> |
|||
<property name="pane_position"></property> |
|||
<property name="pane_size"></property> |
|||
<property name="permission">protected</property> |
|||
<property name="pin_button">1</property> |
|||
<property name="pos"></property> |
|||
<property name="resize">Resizable</property> |
|||
<property name="show">1</property> |
|||
<property name="size"></property> |
|||
<property name="style"></property> |
|||
<property name="subclass">; ; forward_declare</property> |
|||
<property name="toolbar_pane">0</property> |
|||
<property name="tooltip"></property> |
|||
<property name="window_extra_style"></property> |
|||
<property name="window_name"></property> |
|||
<property name="window_style"></property> |
|||
<event name="OnNotebookPageChanged">OnNotebookPageChanged</event> |
|||
<event name="OnSetFocus">OnSetFocus</event> |
|||
</object> |
|||
</object> |
|||
</object> |
|||
</object> |
|||
</object> |
|||
</wxFormBuilder_Project> |
|||
@ -0,0 +1,52 @@ |
|||
/////////////////////////////////////////////////////////////////////////// |
|||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3) |
|||
// http://www.wxformbuilder.org/ |
|||
// |
|||
// PLEASE DO *NOT* EDIT THIS FILE! |
|||
/////////////////////////////////////////////////////////////////////////// |
|||
|
|||
#pragma once |
|||
|
|||
#include <wx/artprov.h> |
|||
#include <wx/xrc/xmlres.h> |
|||
#include <wx/intl.h> |
|||
#include <wx/string.h> |
|||
#include <wx/srchctrl.h> |
|||
#include <wx/gdicmn.h> |
|||
#include <wx/font.h> |
|||
#include <wx/colour.h> |
|||
#include <wx/settings.h> |
|||
#include <wx/notebook.h> |
|||
#include <wx/sizer.h> |
|||
#include <wx/panel.h> |
|||
|
|||
/////////////////////////////////////////////////////////////////////////// |
|||
|
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
/// Class SEARCH_PANE_BASE |
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
class SEARCH_PANE_BASE : public wxPanel |
|||
{ |
|||
private: |
|||
|
|||
protected: |
|||
wxBoxSizer* m_sizerOuter; |
|||
wxSearchCtrl* m_searchCtrl1; |
|||
wxNotebook* m_notebook; |
|||
|
|||
// Virtual event handlers, override them in your derived class |
|||
virtual void OnSetFocus( wxFocusEvent& event ) { event.Skip(); } |
|||
virtual void OnSize( wxSizeEvent& event ) { event.Skip(); } |
|||
virtual void OnSearchTextEntry( wxCommandEvent& event ) { event.Skip(); } |
|||
virtual void OnNotebookPageChanged( wxNotebookEvent& event ) { event.Skip(); } |
|||
|
|||
|
|||
public: |
|||
|
|||
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_BASE(); |
|||
|
|||
}; |
|||
|
|||
@ -0,0 +1,95 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2022 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify it |
|||
* under the terms of the GNU General Public License as published by the |
|||
* Free Software Foundation, either version 3 of the License, or (at your |
|||
* option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, but |
|||
* WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|||
* General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License along |
|||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
#include <widgets/search_pane_tab.h>
|
|||
#include <widgets/search_pane.h>
|
|||
#include <kiway.h>
|
|||
|
|||
SEARCH_PANE_LISTVIEW::SEARCH_PANE_LISTVIEW( SEARCH_HANDLER* handler, wxWindow* parent, |
|||
wxWindowID winid, const wxPoint& pos, |
|||
const wxSize& size ) : |
|||
wxListView( parent, winid, pos, size, wxLC_REPORT | wxLC_VIRTUAL ), |
|||
m_handler( handler ) |
|||
{ |
|||
SetItemCount( 0 ); |
|||
|
|||
RefreshColumnNames(); |
|||
|
|||
Bind( wxEVT_LIST_ITEM_SELECTED, &SEARCH_PANE_LISTVIEW::onItemSelected, this ); |
|||
} |
|||
|
|||
|
|||
void SEARCH_PANE_LISTVIEW::onItemSelected( wxListEvent& aEvent ) |
|||
{ |
|||
long idx = aEvent.GetIndex(); |
|||
|
|||
m_handler->SelectItem( idx ); |
|||
} |
|||
|
|||
|
|||
void SEARCH_PANE_LISTVIEW::RefreshColumnNames() |
|||
{ |
|||
Freeze(); |
|||
DeleteAllColumns(); |
|||
|
|||
std::vector<wxString> columns = m_handler->GetColumnNames(); |
|||
for( wxString& columnName : columns ) |
|||
{ |
|||
AppendColumn( _( columnName ) ); |
|||
} |
|||
|
|||
Thaw(); |
|||
} |
|||
|
|||
|
|||
wxString SEARCH_PANE_LISTVIEW::OnGetItemText( long item, long column ) const |
|||
{ |
|||
return m_handler->GetResultCell( item, column ); |
|||
} |
|||
|
|||
|
|||
SEARCH_PANE_TAB::SEARCH_PANE_TAB( SEARCH_HANDLER* handler, wxWindow* parent, wxWindowID aId, |
|||
const wxPoint& aLocation, const wxSize& aSize ) : |
|||
wxPanel( parent, aId, aLocation, aSize ), |
|||
m_handler( handler ) |
|||
{ |
|||
wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
m_listView = new SEARCH_PANE_LISTVIEW( handler, this ); |
|||
sizer->Add( m_listView, 5, wxRIGHT | wxBOTTOM | wxEXPAND, 1 ); |
|||
|
|||
SetSizer( sizer ); |
|||
|
|||
Layout(); |
|||
sizer->Fit( this ); |
|||
} |
|||
|
|||
|
|||
void SEARCH_PANE_TAB::Search( wxString& query ) |
|||
{ |
|||
int results = m_handler->Search( query ); |
|||
m_listView->SetItemCount( results ); |
|||
m_listView->Refresh(); |
|||
} |
|||
|
|||
|
|||
void SEARCH_PANE_TAB::RefreshColumnNames() |
|||
{ |
|||
m_listView->RefreshColumnNames(); |
|||
} |
|||
@ -0,0 +1,70 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2022 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify it |
|||
* under the terms of the GNU General Public License as published by the |
|||
* Free Software Foundation, either version 3 of the License, or (at your |
|||
* option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, but |
|||
* WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|||
* General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License along |
|||
* with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
*/ |
|||
|
|||
#ifndef SEARCH_PANE_H |
|||
#define SEARCH_PANE_H |
|||
|
|||
#include <widgets/search_pane_base.h> |
|||
#include <vector> |
|||
|
|||
class EDA_DRAW_FRAME; |
|||
class SEARCH_PANE_TAB; |
|||
|
|||
class SEARCH_HANDLER |
|||
{ |
|||
public: |
|||
SEARCH_HANDLER( wxString aName ) : |
|||
m_name( aName ) {} |
|||
|
|||
wxString GetName() const { return m_name; } |
|||
|
|||
std::vector<wxString> GetColumnNames() const { return m_columnNames; } |
|||
|
|||
virtual int Search( const wxString& string ) = 0; |
|||
virtual wxString GetResultCell( int row, int col ) = 0; |
|||
|
|||
virtual void SelectItem(int row) {} |
|||
|
|||
protected: |
|||
wxString m_name; |
|||
std::vector<wxString> m_columnNames; |
|||
}; |
|||
|
|||
class SEARCH_PANE : public SEARCH_PANE_BASE |
|||
{ |
|||
public: |
|||
SEARCH_PANE( EDA_DRAW_FRAME* aFrame ); |
|||
virtual ~SEARCH_PANE(); |
|||
|
|||
void AddSearcher( SEARCH_HANDLER* aHandler ); |
|||
void OnSearchTextEntry( wxCommandEvent& aEvent ) override; |
|||
|
|||
void RefreshSearch(); |
|||
void OnLanguageChange(); |
|||
void FocusSearch(); |
|||
|
|||
private: |
|||
|
|||
EDA_DRAW_FRAME* m_frame; |
|||
std::vector<SEARCH_HANDLER*> m_handlers; |
|||
std::vector<SEARCH_PANE_TAB*> m_tabs; |
|||
wxString m_lastQuery; |
|||
}; |
|||
|
|||
#endif |
|||
@ -0,0 +1,66 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2022 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify it |
|||
* under the terms of the GNU General Public License as published by the |
|||
* Free Software Foundation, either version 3 of the License, or (at your |
|||
* option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, but |
|||
* WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|||
* General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License along |
|||
* with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
*/ |
|||
|
|||
#ifndef SEARCH_PANE_TAB_H |
|||
#define SEARCH_PANE_TAB_H |
|||
|
|||
#include <wx/listctrl.h> |
|||
#include <wx/sizer.h> |
|||
#include <wx/panel.h> |
|||
|
|||
class SEARCH_HANDLER; |
|||
|
|||
|
|||
class SEARCH_PANE_LISTVIEW : public wxListView |
|||
{ |
|||
public: |
|||
SEARCH_PANE_LISTVIEW( SEARCH_HANDLER* handler, |
|||
wxWindow* parent, wxWindowID winid = wxID_ANY, |
|||
const wxPoint& pos = wxDefaultPosition, |
|||
const wxSize& size = wxDefaultSize ); |
|||
|
|||
void RefreshColumnNames(); |
|||
|
|||
protected: |
|||
wxString OnGetItemText( long item, long column ) const override; |
|||
void onItemSelected( wxListEvent& aEvent ); |
|||
|
|||
private: |
|||
SEARCH_HANDLER* m_handler; |
|||
}; |
|||
|
|||
|
|||
class SEARCH_PANE_TAB : public wxPanel |
|||
{ |
|||
public: |
|||
SEARCH_PANE_TAB( SEARCH_HANDLER* handler, wxWindow* parent, wxWindowID aId = wxID_ANY, |
|||
const wxPoint& aLocation = wxDefaultPosition, |
|||
const wxSize& aSize = wxDefaultSize ); |
|||
|
|||
void Search( wxString& query ); |
|||
void RefreshColumnNames(); |
|||
|
|||
SEARCH_HANDLER* GetSearchHandler() const { return m_handler; } |
|||
|
|||
private: |
|||
SEARCH_PANE_LISTVIEW* m_listView; |
|||
SEARCH_HANDLER* m_handler; |
|||
}; |
|||
|
|||
#endif |
|||
@ -0,0 +1,119 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2022 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify it |
|||
* under the terms of the GNU General Public License as published by the |
|||
* Free Software Foundation, either version 3 of the License, or (at your |
|||
* option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, but |
|||
* WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|||
* General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License along |
|||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
#include <pcb_edit_frame.h>
|
|||
#include "pcb_search_pane.h"
|
|||
#include "search_handlers.h"
|
|||
|
|||
|
|||
PCB_SEARCH_PANE::PCB_SEARCH_PANE( PCB_EDIT_FRAME* aFrame ) : |
|||
m_pcbFrame( aFrame ), SEARCH_PANE( aFrame ) |
|||
{ |
|||
m_brd = m_pcbFrame->GetBoard(); |
|||
|
|||
if( m_brd != nullptr ) |
|||
{ |
|||
m_brd->AddListener( this ); |
|||
} |
|||
|
|||
m_pcbFrame->Connect( UNITS_CHANGED, wxCommandEventHandler( PCB_SEARCH_PANE::onUnitsChanged ), |
|||
nullptr, this ); |
|||
|
|||
m_pcbFrame->Connect( BOARD_CHANGED, wxCommandEventHandler( PCB_SEARCH_PANE::onBoardChanged ), |
|||
nullptr, this ); |
|||
|
|||
AddSearcher( new FOOTPRINT_SEARCH_HANDLER( aFrame ) ); |
|||
AddSearcher( new ZONE_SEARCH_HANDLER( aFrame ) ); |
|||
AddSearcher( new NETS_SEARCH_HANDLER( aFrame ) ); |
|||
AddSearcher( new TEXT_SEARCH_HANDLER( aFrame ) ); |
|||
} |
|||
|
|||
|
|||
PCB_SEARCH_PANE::~PCB_SEARCH_PANE() |
|||
{ |
|||
m_pcbFrame->Disconnect( UNITS_CHANGED, wxCommandEventHandler( PCB_SEARCH_PANE::onUnitsChanged ), |
|||
nullptr, this ); |
|||
m_pcbFrame->Disconnect( BOARD_CHANGED, wxCommandEventHandler( PCB_SEARCH_PANE::onBoardChanged ), |
|||
nullptr, this ); |
|||
} |
|||
|
|||
|
|||
void PCB_SEARCH_PANE::onUnitsChanged( wxCommandEvent& event ) |
|||
{ |
|||
event.Skip(); |
|||
} |
|||
|
|||
|
|||
void PCB_SEARCH_PANE::onBoardChanged( wxCommandEvent& event ) |
|||
{ |
|||
m_brd = m_pcbFrame->GetBoard(); |
|||
|
|||
if( m_brd != nullptr ) |
|||
m_brd->AddListener( this ); |
|||
|
|||
RefreshSearch(); |
|||
|
|||
event.Skip(); |
|||
} |
|||
|
|||
|
|||
void PCB_SEARCH_PANE::OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardItem ) |
|||
{ |
|||
RefreshSearch(); |
|||
} |
|||
|
|||
|
|||
void PCB_SEARCH_PANE::OnBoardItemsAdded( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems ) |
|||
{ |
|||
RefreshSearch(); |
|||
} |
|||
|
|||
|
|||
void PCB_SEARCH_PANE::OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoardItem ) |
|||
{ |
|||
RefreshSearch(); |
|||
} |
|||
|
|||
|
|||
void PCB_SEARCH_PANE::OnBoardItemsRemoved( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems ) |
|||
{ |
|||
RefreshSearch(); |
|||
} |
|||
|
|||
|
|||
void PCB_SEARCH_PANE::OnBoardNetSettingsChanged( BOARD& aBoard ) |
|||
{ |
|||
} |
|||
|
|||
|
|||
void PCB_SEARCH_PANE::OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aBoardItem ) |
|||
{ |
|||
RefreshSearch(); |
|||
} |
|||
|
|||
|
|||
void PCB_SEARCH_PANE::OnBoardItemsChanged( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems ) |
|||
{ |
|||
RefreshSearch(); |
|||
} |
|||
|
|||
|
|||
void PCB_SEARCH_PANE::OnBoardHighlightNetChanged( BOARD& aBoard ) |
|||
{ |
|||
} |
|||
@ -0,0 +1,53 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2022 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify it |
|||
* under the terms of the GNU General Public License as published by the |
|||
* Free Software Foundation, either version 3 of the License, or (at your |
|||
* option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, but |
|||
* WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|||
* General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License along |
|||
* with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
*/ |
|||
|
|||
#ifndef PCB_SEARCH_PANE_H |
|||
#define PCB_SEARCH_PANE_H |
|||
|
|||
#include <board.h> |
|||
#include <widgets/search_pane.h> |
|||
|
|||
class PCB_EDIT_FRAME; |
|||
|
|||
class PCB_SEARCH_PANE : public SEARCH_PANE, public BOARD_LISTENER |
|||
{ |
|||
public: |
|||
PCB_SEARCH_PANE( PCB_EDIT_FRAME* aFrame ); |
|||
virtual ~PCB_SEARCH_PANE(); |
|||
|
|||
virtual void OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardItem ) override; |
|||
virtual void OnBoardItemsAdded( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems ) override; |
|||
virtual void OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoardItem ) override; |
|||
virtual void OnBoardItemsRemoved( BOARD& aBoard, |
|||
std::vector<BOARD_ITEM*>& aBoardItems ) override; |
|||
virtual void OnBoardNetSettingsChanged( BOARD& aBoard ) override; |
|||
virtual void OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aBoardItem ) override; |
|||
virtual void OnBoardItemsChanged( BOARD& aBoard, |
|||
std::vector<BOARD_ITEM*>& aBoardItems ) override; |
|||
virtual void OnBoardHighlightNetChanged( BOARD& aBoard ) override; |
|||
|
|||
private: |
|||
void onUnitsChanged( wxCommandEvent& event ); |
|||
void onBoardChanged( wxCommandEvent& event ); |
|||
|
|||
PCB_EDIT_FRAME* m_pcbFrame; |
|||
BOARD* m_brd; |
|||
}; |
|||
|
|||
#endif |
|||
@ -0,0 +1,248 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2022 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify it |
|||
* under the terms of the GNU General Public License as published by the |
|||
* Free Software Foundation, either version 3 of the License, or (at your |
|||
* option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, but |
|||
* WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|||
* General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License along |
|||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
#include <base_units.h>
|
|||
#include <footprint.h>
|
|||
#include <tool/tool_manager.h>
|
|||
#include <tools/pcb_actions.h>
|
|||
#include <pcb_edit_frame.h>
|
|||
#include <pcb_marker.h>
|
|||
#include <pcb_text.h>
|
|||
#include <zone.h>
|
|||
#include "search_handlers.h"
|
|||
|
|||
|
|||
FOOTPRINT_SEARCH_HANDLER::FOOTPRINT_SEARCH_HANDLER( PCB_EDIT_FRAME* aFrame ) : |
|||
SEARCH_HANDLER( wxT( "Footprint" ) ), m_frame( aFrame ) |
|||
{ |
|||
m_columnNames.emplace_back( wxT( "Reference" ) ); |
|||
m_columnNames.emplace_back( wxT( "Value" ) ); |
|||
m_columnNames.emplace_back( wxT( "Layer" ) ); |
|||
m_columnNames.emplace_back( wxT( "X" ) ); |
|||
m_columnNames.emplace_back( wxT( "Y" ) ); |
|||
} |
|||
|
|||
|
|||
int FOOTPRINT_SEARCH_HANDLER::Search( const wxString& query ) |
|||
{ |
|||
m_hitlist.clear(); |
|||
BOARD* board = m_frame->GetBoard(); |
|||
|
|||
EDA_SEARCH_DATA frp; |
|||
frp.findString = query; |
|||
frp.matchMode = EDA_SEARCH_MATCH_MODE::WILDCARD; |
|||
|
|||
for( FOOTPRINT* fp : board->Footprints() ) |
|||
{ |
|||
if( fp->Reference().Matches( frp, nullptr ) || fp->Value().Matches( frp, nullptr ) ) |
|||
{ |
|||
m_hitlist.push_back( fp ); |
|||
} |
|||
} |
|||
|
|||
return m_hitlist.size(); |
|||
} |
|||
|
|||
|
|||
wxString FOOTPRINT_SEARCH_HANDLER::GetResultCell( int row, int col ) |
|||
{ |
|||
FOOTPRINT* fp = m_hitlist[row]; |
|||
|
|||
if( col == 0 ) |
|||
return fp->GetReference(); |
|||
else if( col == 1 ) |
|||
return fp->GetValue(); |
|||
else if( col == 2 ) |
|||
return fp->GetLayerName(); |
|||
else if( col == 3 ) |
|||
return MessageTextFromValue( m_frame->GetUserUnits(), fp->GetX() ); |
|||
else if( col == 4 ) |
|||
return MessageTextFromValue( m_frame->GetUserUnits(), fp->GetY() ); |
|||
|
|||
return wxEmptyString; |
|||
} |
|||
|
|||
|
|||
void FOOTPRINT_SEARCH_HANDLER::SelectItem( int row ) |
|||
{ |
|||
FOOTPRINT* fp = m_hitlist[row]; |
|||
|
|||
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true ); |
|||
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectItem, true, fp ); |
|||
} |
|||
|
|||
|
|||
ZONE_SEARCH_HANDLER::ZONE_SEARCH_HANDLER( PCB_EDIT_FRAME* aFrame ) : |
|||
SEARCH_HANDLER( wxT( "Zones" ) ), m_frame( aFrame ) |
|||
{ |
|||
m_columnNames.emplace_back( wxT( "Name" ) ); |
|||
m_columnNames.emplace_back( wxT( "Layer" ) ); |
|||
m_columnNames.emplace_back( wxT( "X" ) ); |
|||
m_columnNames.emplace_back( wxT( "Y" ) ); |
|||
} |
|||
|
|||
|
|||
int ZONE_SEARCH_HANDLER::Search( const wxString& query ) |
|||
{ |
|||
m_hitlist.clear(); |
|||
BOARD* board = m_frame->GetBoard(); |
|||
|
|||
EDA_SEARCH_DATA frp; |
|||
frp.findString = query; |
|||
frp.matchMode = EDA_SEARCH_MATCH_MODE::WILDCARD; |
|||
|
|||
for( BOARD_ITEM* item : board->Zones() ) |
|||
{ |
|||
ZONE* zoneItem = dynamic_cast<ZONE*>( item ); |
|||
|
|||
if( zoneItem && zoneItem->Matches( frp, nullptr ) ) |
|||
{ |
|||
m_hitlist.push_back( zoneItem ); |
|||
} |
|||
} |
|||
|
|||
return m_hitlist.size(); |
|||
} |
|||
|
|||
|
|||
wxString ZONE_SEARCH_HANDLER::GetResultCell( int row, int col ) |
|||
{ |
|||
ZONE* zone = m_hitlist[row]; |
|||
|
|||
if( col == 0 ) |
|||
return zone->GetNetname(); |
|||
else if( col == 1 ) |
|||
return zone->GetLayerName(); |
|||
else if( col == 2 ) |
|||
return MessageTextFromValue( m_frame->GetUserUnits(), zone->GetX() ); |
|||
else if( col == 3 ) |
|||
return MessageTextFromValue( m_frame->GetUserUnits(), zone->GetY() ); |
|||
|
|||
return wxEmptyString; |
|||
} |
|||
|
|||
|
|||
void ZONE_SEARCH_HANDLER::SelectItem( int row ) |
|||
{ |
|||
ZONE* zone = m_hitlist[row]; |
|||
|
|||
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true ); |
|||
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectItem, true, zone ); |
|||
} |
|||
|
|||
|
|||
TEXT_SEARCH_HANDLER::TEXT_SEARCH_HANDLER( PCB_EDIT_FRAME* aFrame ) : |
|||
SEARCH_HANDLER( wxT( "Text" ) ), m_frame( aFrame ) |
|||
{ |
|||
m_columnNames.emplace_back( wxT( "Text" ) ); |
|||
m_columnNames.emplace_back( wxT( "Layer" ) ); |
|||
m_columnNames.emplace_back( wxT( "X" ) ); |
|||
m_columnNames.emplace_back( wxT( "Y" ) ); |
|||
} |
|||
|
|||
|
|||
int TEXT_SEARCH_HANDLER::Search( const wxString& query ) |
|||
{ |
|||
m_hitlist.clear(); |
|||
BOARD* board = m_frame->GetBoard(); |
|||
|
|||
EDA_SEARCH_DATA frp; |
|||
frp.findString = query; |
|||
frp.matchMode = EDA_SEARCH_MATCH_MODE::WILDCARD; |
|||
|
|||
for( BOARD_ITEM* item : board->Drawings() ) |
|||
{ |
|||
PCB_TEXT* textItem = dynamic_cast<PCB_TEXT*>( item ); |
|||
|
|||
if( textItem && textItem->Matches( frp, nullptr ) ) |
|||
{ |
|||
m_hitlist.push_back( textItem ); |
|||
} |
|||
} |
|||
|
|||
return m_hitlist.size(); |
|||
} |
|||
|
|||
|
|||
wxString TEXT_SEARCH_HANDLER::GetResultCell( int row, int col ) |
|||
{ |
|||
PCB_TEXT* text = m_hitlist[row]; |
|||
|
|||
if( col == 0 ) |
|||
return text->GetText(); |
|||
if( col == 1 ) |
|||
return text->GetLayerName(); |
|||
else if( col == 2 ) |
|||
return MessageTextFromValue( m_frame->GetUserUnits(), text->GetX() ); |
|||
else if( col == 3 ) |
|||
return MessageTextFromValue( m_frame->GetUserUnits(), text->GetY() ); |
|||
|
|||
return wxEmptyString; |
|||
} |
|||
|
|||
|
|||
void TEXT_SEARCH_HANDLER::SelectItem( int row ) |
|||
{ |
|||
PCB_TEXT* text = m_hitlist[row]; |
|||
|
|||
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true ); |
|||
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectItem, true, text ); |
|||
} |
|||
|
|||
|
|||
NETS_SEARCH_HANDLER::NETS_SEARCH_HANDLER( PCB_EDIT_FRAME* aFrame ) : |
|||
SEARCH_HANDLER( wxT( "Nets" ) ), m_frame( aFrame ) |
|||
{ |
|||
m_columnNames.emplace_back( wxT( "Name" ) ); |
|||
m_columnNames.emplace_back( wxT( "Class" ) ); |
|||
} |
|||
|
|||
|
|||
int NETS_SEARCH_HANDLER::Search( const wxString& query ) |
|||
{ |
|||
m_hitlist.clear(); |
|||
|
|||
EDA_SEARCH_DATA frp; |
|||
frp.findString = query; |
|||
frp.matchMode = EDA_SEARCH_MATCH_MODE::WILDCARD; |
|||
|
|||
BOARD* board = m_frame->GetBoard(); |
|||
for( NETINFO_ITEM* net : board->GetNetInfo() ) |
|||
{ |
|||
if( net && net->Matches( frp, nullptr ) ) |
|||
{ |
|||
m_hitlist.push_back( net ); |
|||
} |
|||
} |
|||
|
|||
return m_hitlist.size(); |
|||
} |
|||
|
|||
|
|||
wxString NETS_SEARCH_HANDLER::GetResultCell( int row, int col ) |
|||
{ |
|||
NETINFO_ITEM* net = m_hitlist[row]; |
|||
|
|||
if( col == 0 ) |
|||
return net->GetNetname(); |
|||
else if( col == 1 ) |
|||
return net->GetNetClass()->GetName(); |
|||
|
|||
return wxEmptyString; |
|||
} |
|||
@ -0,0 +1,90 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2022 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU General Public License |
|||
* as published by the Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
|||
* or you may search the http://www.gnu.org website for the version 2 license, |
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#ifndef SEARCH_HANDLERS_H |
|||
#define SEARCH_HANDLERS_H |
|||
|
|||
#include <widgets/search_pane.h> |
|||
|
|||
class ZONE; |
|||
class FOOTPRINT; |
|||
class PCB_TEXT; |
|||
|
|||
class FOOTPRINT_SEARCH_HANDLER : public SEARCH_HANDLER |
|||
{ |
|||
public: |
|||
FOOTPRINT_SEARCH_HANDLER( PCB_EDIT_FRAME* aFrame ); |
|||
|
|||
int Search( const wxString& query ) override; |
|||
wxString GetResultCell( int row, int col ) override; |
|||
void SelectItem( int row ) override; |
|||
|
|||
private: |
|||
PCB_EDIT_FRAME* m_frame; |
|||
std::vector<FOOTPRINT*> m_hitlist; |
|||
}; |
|||
|
|||
class ZONE_SEARCH_HANDLER : public SEARCH_HANDLER |
|||
{ |
|||
public: |
|||
ZONE_SEARCH_HANDLER( PCB_EDIT_FRAME* aFrame ); |
|||
|
|||
int Search( const wxString& query ) override; |
|||
wxString GetResultCell( int row, int col ) override; |
|||
void SelectItem( int row ) override; |
|||
|
|||
private: |
|||
PCB_EDIT_FRAME* m_frame; |
|||
std::vector<ZONE*> m_hitlist; |
|||
}; |
|||
|
|||
|
|||
class TEXT_SEARCH_HANDLER : public SEARCH_HANDLER |
|||
{ |
|||
public: |
|||
TEXT_SEARCH_HANDLER( PCB_EDIT_FRAME* aFrame ); |
|||
|
|||
int Search( const wxString& query ) override; |
|||
wxString GetResultCell( int row, int col ) override; |
|||
void SelectItem( int row ) override; |
|||
|
|||
private: |
|||
PCB_EDIT_FRAME* m_frame; |
|||
std::vector<PCB_TEXT*> m_hitlist; |
|||
}; |
|||
|
|||
|
|||
class NETS_SEARCH_HANDLER : public SEARCH_HANDLER |
|||
{ |
|||
public: |
|||
NETS_SEARCH_HANDLER( PCB_EDIT_FRAME* aFrame ); |
|||
|
|||
int Search( const wxString& query ) override; |
|||
wxString GetResultCell( int row, int col ) override; |
|||
|
|||
private: |
|||
PCB_EDIT_FRAME* m_frame; |
|||
std::vector<NETINFO_ITEM*> m_hitlist; |
|||
}; |
|||
|
|||
#endif |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue