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 POWER_SEARCH_HANDLER( aFrame ) );
51 AddSearcher( new TEXT_SEARCH_HANDLER( aFrame ) );
52 AddSearcher( new LABEL_SEARCH_HANDLER( aFrame ) );
53}
54
55
57{
58 m_schFrame->Disconnect( EDA_EVT_UNITS_CHANGED,
59 wxCommandEventHandler( SCH_SEARCH_PANE::onUnitsChanged ), nullptr,
60 this );
61 m_schFrame->Disconnect( EDA_EVT_SCHEMATIC_CHANGED,
62 wxCommandEventHandler( SCH_SEARCH_PANE::onSchChanged ), nullptr,
63 this );
64}
65
66
67void SCH_SEARCH_PANE::onUnitsChanged( wxCommandEvent& event )
68{
71
72 event.Skip();
73}
74
75
76void SCH_SEARCH_PANE::onSchChanged( wxCommandEvent& event )
77{
80
81 event.Skip();
82}
83
84
85void SCH_SEARCH_PANE::OnSchItemsAdded( SCHEMATIC& aBoard, std::vector<SCH_ITEM*>& aBoardItems )
86{
87 if( !IsShownOnScreen() )
88 return;
89
91}
92
93
94void SCH_SEARCH_PANE::OnSchItemsRemoved( SCHEMATIC& aBoard, std::vector<SCH_ITEM*>& aBoardItems )
95{
96 if( !IsShownOnScreen() )
97 return;
98
100}
101
102
103void SCH_SEARCH_PANE::OnSchItemsChanged( SCHEMATIC& aBoard, std::vector<SCH_ITEM*>& aBoardItems )
104{
105 if( !IsShownOnScreen() )
106 return;
107
109}
Holds all the data relating to one schematic.
Definition: schematic.h:77
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:792
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()
void AddSearcher(SEARCH_HANDLER *aHandler)
void ClearAllResults()
KICOMMON_API wxFont GetDockedPaneFont(wxWindow *aWindow)
Definition: ui_common.cpp:142