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 wxFont infoFont = KIUI::GetDockedPaneFont( this );
41 SetFont( infoFont );
42 m_notebook->SetFont( infoFont );
43
44 AddSearcher( new SYMBOL_SEARCH_HANDLER( aFrame ) );
45 AddSearcher( new TEXT_SEARCH_HANDLER( aFrame ) );
46 AddSearcher( new LABEL_SEARCH_HANDLER( aFrame ) );
47}
48
49
51{
52 m_schFrame->Disconnect( EDA_EVT_UNITS_CHANGED,
53 wxCommandEventHandler( SCH_SEARCH_PANE::onUnitsChanged ), nullptr,
54 this );
55 m_schFrame->Disconnect( EDA_EVT_SCHEMATIC_CHANGED,
56 wxCommandEventHandler( SCH_SEARCH_PANE::onSchChanged ), nullptr,
57 this );
58}
59
60
61void SCH_SEARCH_PANE::onUnitsChanged( wxCommandEvent& event )
62{
65
66 event.Skip();
67}
68
69
70void SCH_SEARCH_PANE::onSchChanged( wxCommandEvent& event )
71{
74
75 event.Skip();
76}
77
78
79void SCH_SEARCH_PANE::OnSchItemsAdded( SCHEMATIC& aBoard, std::vector<SCH_ITEM*>& aBoardItems )
80{
81 if( !IsShownOnScreen() )
82 return;
83
85}
86
87
88void SCH_SEARCH_PANE::OnSchItemsRemoved( SCHEMATIC& aBoard, std::vector<SCH_ITEM*>& aBoardItems )
89{
90 if( !IsShownOnScreen() )
91 return;
92
94}
95
96
97void SCH_SEARCH_PANE::OnSchItemsChanged( SCHEMATIC& aBoard, std::vector<SCH_ITEM*>& aBoardItems )
98{
99 if( !IsShownOnScreen() )
100 return;
101
103}
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:786
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:62
void AddSearcher(SEARCH_HANDLER *aHandler)
Definition: search_pane.cpp:52
void ClearAllResults()
Definition: search_pane.cpp:71
wxFont GetDockedPaneFont(wxWindow *aWindow)
Definition: ui_common.cpp:139