KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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-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 <pcb_edit_frame.h>
21#include "pcb_search_pane.h"
22#include "search_handlers.h"
23
24
26 SEARCH_PANE( aFrame ),
27 m_pcbFrame( aFrame )
28{
30
31 if( m_brd != nullptr )
32 m_brd->AddListener( this );
33
34 m_pcbFrame->Connect( EDA_EVT_UNITS_CHANGED,
35 wxCommandEventHandler( PCB_SEARCH_PANE::onUnitsChanged ),
36 nullptr, this );
37
38 m_pcbFrame->Connect( EDA_EVT_BOARD_CHANGED,
39 wxCommandEventHandler( PCB_SEARCH_PANE::onBoardChanged ),
40 nullptr, this );
41
42 wxFont infoFont = KIUI::GetDockedPaneFont( this );
43 SetFont( infoFont );
44 m_notebook->SetFont( infoFont );
45
47 AddSearcher( new ZONE_SEARCH_HANDLER( aFrame ) );
48 AddSearcher( new NETS_SEARCH_HANDLER( aFrame ) );
49 AddSearcher( new RATSNEST_SEARCH_HANDLER( aFrame ) );
50 AddSearcher( new TEXT_SEARCH_HANDLER( aFrame ) );
51}
52
53
55{
56 m_pcbFrame->Disconnect( EDA_EVT_UNITS_CHANGED,
57 wxCommandEventHandler( PCB_SEARCH_PANE::onUnitsChanged ),
58 nullptr, this );
59 m_pcbFrame->Disconnect( EDA_EVT_BOARD_CHANGED,
60 wxCommandEventHandler( PCB_SEARCH_PANE::onBoardChanged ),
61 nullptr, this );
62}
63
64
65void PCB_SEARCH_PANE::onUnitsChanged( wxCommandEvent& event )
66{
67 event.Skip();
68}
69
70
71void PCB_SEARCH_PANE::onBoardChanged( wxCommandEvent& event )
72{
74
75 if( m_brd != nullptr )
76 m_brd->AddListener( this );
77
80
81 event.Skip();
82}
83
84
86{
87 if( !IsShownOnScreen() )
88 return;
89
91}
92
93
94void PCB_SEARCH_PANE::OnBoardItemsAdded( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems )
95{
96 if( !IsShownOnScreen() )
97 return;
98
100}
101
102
104{
105 if( !IsShownOnScreen() )
106 return;
107
109}
110
111
112void PCB_SEARCH_PANE::OnBoardItemsRemoved( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems )
113{
114 if( !IsShownOnScreen() )
115 return;
116
118}
119
120
122{
123}
124
125
127{
128 if( !IsShownOnScreen() )
129 return;
130
132}
133
134
135void PCB_SEARCH_PANE::OnBoardItemsChanged( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems )
136{
137 if( !IsShownOnScreen() )
138 return;
139
141}
142
143
145{
146}
147
148
150{
151 if( !IsShownOnScreen() )
152 return;
153
155}
156
157void PCB_SEARCH_PANE::OnBoardCompositeUpdate( BOARD& aBoard, std::vector<BOARD_ITEM*>& aAddedItems,
158 std::vector<BOARD_ITEM*>& aRemovedItems,
159 std::vector<BOARD_ITEM*>& aDeletedItems )
160{
161 if( !IsShownOnScreen() )
162 return;
163
165}
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:79
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:290
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:2669
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 OnBoardRatsnestChanged(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 OnBoardCompositeUpdate(BOARD &aBoard, std::vector< BOARD_ITEM * > &aAddedItems, std::vector< BOARD_ITEM * > &aRemovedItems, std::vector< BOARD_ITEM * > &aDeletedItems) override
virtual void OnBoardItemsAdded(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItems) override
PCB_EDIT_FRAME * m_pcbFrame
wxNotebook * m_notebook
void RefreshSearch()
void AddSearcher(SEARCH_HANDLER *aHandler)
void ClearAllResults()
KICOMMON_API wxFont GetDockedPaneFont(wxWindow *aWindow)
Definition: ui_common.cpp:142