KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_search_pane.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#include <sch_edit_frame.h>
21#include "sch_search_pane.h"
22#include "search_handlers.h"
23
24
26 SEARCH_PANE( aFrame ),
27 m_schFrame( aFrame )
28{
29 m_sch = &m_schFrame->Schematic();
30
31 if( m_sch != nullptr )
32 m_sch->AddListener( this );
33
34 m_schFrame->Bind( EDA_EVT_UNITS_CHANGED, &SCH_SEARCH_PANE::onUnitsChanged, this );
35 m_schFrame->Bind( EDA_EVT_SCHEMATIC_CHANGING, &SCH_SEARCH_PANE::onSchChanging, this );
36 m_schFrame->Bind( EDA_EVT_SCHEMATIC_CHANGED, &SCH_SEARCH_PANE::onSchChanged, this );
37
38 wxFont infoFont = KIUI::GetDockedPaneFont( this );
39 SetFont( infoFont );
40 m_notebook->SetFont( infoFont );
41
42 AddSearcher( std::make_shared<SYMBOL_SEARCH_HANDLER>( aFrame ) );
43 AddSearcher( std::make_shared<POWER_SEARCH_HANDLER>( aFrame ) );
44 AddSearcher( std::make_shared<TEXT_SEARCH_HANDLER>( aFrame ) );
45 AddSearcher( std::make_shared<LABEL_SEARCH_HANDLER>( aFrame ) );
46 AddSearcher( std::make_shared<GROUP_SEARCH_HANDLER>( aFrame ) );
47}
48
49
51{
52 m_schFrame->Unbind( EDA_EVT_UNITS_CHANGED, &SCH_SEARCH_PANE::onUnitsChanged, this );
53 m_schFrame->Unbind( EDA_EVT_SCHEMATIC_CHANGING, &SCH_SEARCH_PANE::onSchChanging, this );
54 m_schFrame->Unbind( EDA_EVT_SCHEMATIC_CHANGED, &SCH_SEARCH_PANE::onSchChanged, this );
55}
56
57
58void SCH_SEARCH_PANE::onUnitsChanged( wxCommandEvent& event )
59{
62 event.Skip();
63}
64
65
66void SCH_SEARCH_PANE::onSchChanging( wxCommandEvent& event )
67{
69 event.Skip();
70}
71
72
73void SCH_SEARCH_PANE::onSchChanged( wxCommandEvent& event )
74{
75 m_sch = &m_schFrame->Schematic();
76
77 if( m_sch != nullptr )
78 m_sch->AddListener( this );
79
82 event.Skip();
83}
84
85
86void SCH_SEARCH_PANE::OnSchItemsAdded( SCHEMATIC& aBoard, std::vector<SCH_ITEM*>& aBoardItems )
87{
88 if( !IsShownOnScreen() )
89 return;
90
92}
93
94
95void SCH_SEARCH_PANE::OnSchItemsRemoved( SCHEMATIC& aBoard, std::vector<SCH_ITEM*>& aBoardItems )
96{
97 if( !IsShownOnScreen() )
98 return;
99
101}
102
103
104void SCH_SEARCH_PANE::OnSchItemsChanged( SCHEMATIC& aBoard, std::vector<SCH_ITEM*>& aBoardItems )
105{
106 if( !IsShownOnScreen() )
107 return;
108
110}
Holds all the data relating to one schematic.
Definition schematic.h:88
Schematic editor (Eeschema) main window.
void onUnitsChanged(wxCommandEvent &event)
virtual ~SCH_SEARCH_PANE()
void onSchChanged(wxCommandEvent &event)
virtual void OnSchItemsRemoved(SCHEMATIC &aBoard, std::vector< SCH_ITEM * > &aBoardItems) override
virtual void OnSchItemsChanged(SCHEMATIC &aBoard, std::vector< SCH_ITEM * > &aBoardItems) override
void onSchChanging(wxCommandEvent &event)
SCH_EDIT_FRAME * m_schFrame
SCHEMATIC * m_sch
virtual void OnSchItemsAdded(SCHEMATIC &aBoard, std::vector< SCH_ITEM * > &aBoardItems) override
SCH_SEARCH_PANE(SCH_EDIT_FRAME *aFrame)
wxNotebook * m_notebook
void RefreshSearch()
void AddSearcher(const std::shared_ptr< SEARCH_HANDLER > &aHandler)
SEARCH_PANE(EDA_DRAW_FRAME *aFrame)
void ClearAllResults()
KICOMMON_API wxFont GetDockedPaneFont(wxWindow *aWindow)