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 (C) 2023 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{
30
31 if( m_sch != nullptr )
32 m_sch->AddListener( this );
33
34 m_schFrame->Connect( EDA_EVT_UNITS_CHANGED,
35 wxCommandEventHandler( SCH_SEARCH_PANE::onUnitsChanged ), nullptr, this );
36
37 m_schFrame->Connect( EDA_EVT_SCHEMATIC_CHANGED,
38 wxCommandEventHandler( SCH_SEARCH_PANE::onSchChanged ), nullptr, this );
39
40 m_schFrame->Bind( EDA_EVT_SCHEMATIC_CHANGING, [&]( wxCommandEvent& )
41 {
43 } );
44
45 wxFont infoFont = KIUI::GetDockedPaneFont( this );
46 SetFont( infoFont );
47 m_notebook->SetFont( infoFont );
48
49 AddSearcher( new SYMBOL_SEARCH_HANDLER( aFrame ) );
50 AddSearcher( new TEXT_SEARCH_HANDLER( aFrame ) );
51 AddSearcher( new LABEL_SEARCH_HANDLER( aFrame ) );
52}
53
54
56{
57 m_schFrame->Disconnect( EDA_EVT_UNITS_CHANGED,
58 wxCommandEventHandler( SCH_SEARCH_PANE::onUnitsChanged ), nullptr,
59 this );
60 m_schFrame->Disconnect( EDA_EVT_SCHEMATIC_CHANGED,
61 wxCommandEventHandler( SCH_SEARCH_PANE::onSchChanged ), nullptr,
62 this );
63}
64
65
66void SCH_SEARCH_PANE::onUnitsChanged( wxCommandEvent& event )
67{
70
71 event.Skip();
72}
73
74
75void SCH_SEARCH_PANE::onSchChanged( wxCommandEvent& event )
76{
79
80 event.Skip();
81}
82
83
84void SCH_SEARCH_PANE::OnSchItemsAdded( SCHEMATIC& aBoard, std::vector<SCH_ITEM*>& aBoardItems )
85{
86 if( !IsShownOnScreen() )
87 return;
88
90}
91
92
93void SCH_SEARCH_PANE::OnSchItemsRemoved( SCHEMATIC& aBoard, std::vector<SCH_ITEM*>& aBoardItems )
94{
95 if( !IsShownOnScreen() )
96 return;
97
99}
100
101
102void SCH_SEARCH_PANE::OnSchItemsChanged( SCHEMATIC& aBoard, std::vector<SCH_ITEM*>& aBoardItems )
103{
104 if( !IsShownOnScreen() )
105 return;
106
108}
Holds all the data relating to one schematic.
Definition: schematic.h:75
void AddListener(SCHEMATIC_LISTENER *aListener)
Add a listener to the schematic to receive calls whenever something on the schematic has been modifie...
Definition: schematic.cpp:773
Schematic editor (Eeschema) main window.
SCHEMATIC & Schematic() const
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
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()
Definition: search_pane.cpp:69
void AddSearcher(SEARCH_HANDLER *aHandler)
Definition: search_pane.cpp:59
void ClearAllResults()
Definition: search_pane.cpp:78
KICOMMON_API wxFont GetDockedPaneFont(wxWindow *aWindow)
Definition: ui_common.cpp:139