KiCad PCB EDA Suite
pcb_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) 2022 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 <pcb_edit_frame.h>
21#include "pcb_search_pane.h"
22#include "search_handlers.h"
23
24
26 SEARCH_PANE( aFrame ), m_pcbFrame( aFrame )
27{
29
30 if( m_brd != nullptr )
31 m_brd->AddListener( this );
32
33 m_pcbFrame->Connect( UNITS_CHANGED, wxCommandEventHandler( PCB_SEARCH_PANE::onUnitsChanged ),
34 nullptr, this );
35
36 m_pcbFrame->Connect( BOARD_CHANGED, wxCommandEventHandler( PCB_SEARCH_PANE::onBoardChanged ),
37 nullptr, this );
38
39 wxFont infoFont = KIUI::GetDockedPaneFont( this );
40 SetFont( infoFont );
41 m_notebook->SetFont( infoFont );
42
44 AddSearcher( new ZONE_SEARCH_HANDLER( aFrame ) );
45 AddSearcher( new NETS_SEARCH_HANDLER( aFrame ) );
46 AddSearcher( new TEXT_SEARCH_HANDLER( aFrame ) );
47}
48
49
51{
52 m_pcbFrame->Disconnect( UNITS_CHANGED, wxCommandEventHandler( PCB_SEARCH_PANE::onUnitsChanged ),
53 nullptr, this );
54 m_pcbFrame->Disconnect( BOARD_CHANGED, wxCommandEventHandler( PCB_SEARCH_PANE::onBoardChanged ),
55 nullptr, this );
56}
57
58
59void PCB_SEARCH_PANE::onUnitsChanged( wxCommandEvent& event )
60{
61 event.Skip();
62}
63
64
65void PCB_SEARCH_PANE::onBoardChanged( wxCommandEvent& event )
66{
68
69 if( m_brd != nullptr )
70 m_brd->AddListener( this );
71
74
75 event.Skip();
76}
77
78
80{
81 if( !IsShown() )
82 return;
83
85}
86
87
88void PCB_SEARCH_PANE::OnBoardItemsAdded( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems )
89{
90 if( !IsShown() )
91 return;
92
94}
95
96
98{
99 if( !IsShown() )
100 return;
101
103}
104
105
106void PCB_SEARCH_PANE::OnBoardItemsRemoved( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems )
107{
108 if( !IsShown() )
109 return;
110
112}
113
114
116{
117}
118
119
121{
122 if( !IsShown() )
123 return;
124
126}
127
128
129void PCB_SEARCH_PANE::OnBoardItemsChanged( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems )
130{
131 if( !IsShown() )
132 return;
133
135}
136
137
139{
140}
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:70
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:265
void AddListener(BOARD_LISTENER *aListener)
Add a listener to the board to receive calls whenever something on the board has been modified.
Definition: board.cpp:2027
BOARD * GetBoard() const
The main frame for Pcbnew.
virtual void OnBoardItemRemoved(BOARD &aBoard, BOARD_ITEM *aBoardItem) override
virtual void OnBoardHighlightNetChanged(BOARD &aBoard) override
virtual ~PCB_SEARCH_PANE()
void onUnitsChanged(wxCommandEvent &event)
virtual void OnBoardNetSettingsChanged(BOARD &aBoard) override
virtual void OnBoardItemAdded(BOARD &aBoard, BOARD_ITEM *aBoardItem) override
void onBoardChanged(wxCommandEvent &event)
virtual void OnBoardItemsChanged(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItems) override
PCB_SEARCH_PANE(PCB_EDIT_FRAME *aFrame)
virtual void OnBoardItemsRemoved(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItems) override
virtual void OnBoardItemChanged(BOARD &aBoard, BOARD_ITEM *aBoardItem) override
virtual void OnBoardItemsAdded(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItems) override
PCB_EDIT_FRAME * m_pcbFrame
wxNotebook * m_notebook
void RefreshSearch()
Definition: search_pane.cpp:61
void AddSearcher(SEARCH_HANDLER *aHandler)
Definition: search_pane.cpp:51
void ClearAllResults()
Definition: search_pane.cpp:70
wxFont GetDockedPaneFont(wxWindow *aWindow)
Definition: ui_common.cpp:144