KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
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 The 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, wxCommandEventHandler( PCB_SEARCH_PANE::onUnitsChanged ),
35 nullptr, this );
36
37 m_pcbFrame->Connect( EDA_EVT_BOARD_CHANGED, wxCommandEventHandler( PCB_SEARCH_PANE::onBoardChanged ),
38 nullptr, this );
39
40 wxFont infoFont = KIUI::GetDockedPaneFont( this );
41 SetFont( infoFont );
42 m_notebook->SetFont( infoFont );
43
45 AddSearcher( new ZONE_SEARCH_HANDLER( aFrame ) );
46 AddSearcher( new NETS_SEARCH_HANDLER( aFrame ) );
47 AddSearcher( new RATSNEST_SEARCH_HANDLER( aFrame ) );
48 AddSearcher( new TEXT_SEARCH_HANDLER( aFrame ) );
49}
50
51
53{
54 m_pcbFrame->Disconnect( EDA_EVT_UNITS_CHANGED, wxCommandEventHandler( PCB_SEARCH_PANE::onUnitsChanged ),
55 nullptr, this );
56 m_pcbFrame->Disconnect( EDA_EVT_BOARD_CHANGED, wxCommandEventHandler( PCB_SEARCH_PANE::onBoardChanged ),
57 nullptr, this );
58}
59
60
61void PCB_SEARCH_PANE::onUnitsChanged( wxCommandEvent& event )
62{
63 event.Skip();
64}
65
66
67void PCB_SEARCH_PANE::onBoardChanged( wxCommandEvent& event )
68{
70
71 if( m_brd != nullptr )
72 m_brd->AddListener( this );
73
76
77 event.Skip();
78}
79
80
82{
83 if( !IsShownOnScreen() )
84 return;
85
87}
88
89
90void PCB_SEARCH_PANE::OnBoardItemsAdded( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems )
91{
92 if( !IsShownOnScreen() )
93 return;
94
96}
97
98
100{
101 if( !IsShownOnScreen() )
102 return;
103
105}
106
107
108void PCB_SEARCH_PANE::OnBoardItemsRemoved( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems )
109{
110 if( !IsShownOnScreen() )
111 return;
112
114}
115
116
118{
119}
120
121
123{
124 if( !IsShownOnScreen() )
125 return;
126
128}
129
130
131void PCB_SEARCH_PANE::OnBoardItemsChanged( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems )
132{
133 if( !IsShownOnScreen() )
134 return;
135
137}
138
139
141{
142}
143
144
146{
147 if( !IsShownOnScreen() )
148 return;
149
151}
152
153void PCB_SEARCH_PANE::OnBoardCompositeUpdate( BOARD& aBoard, std::vector<BOARD_ITEM*>& aAddedItems,
154 std::vector<BOARD_ITEM*>& aRemovedItems,
155 std::vector<BOARD_ITEM*>& aChangedItems )
156{
157 if( !IsShownOnScreen() )
158 return;
159
161}
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:78
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:297
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:2711
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 OnBoardItemsAdded(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItems) override
virtual void OnBoardCompositeUpdate(BOARD &aBoard, std::vector< BOARD_ITEM * > &aAddedItems, std::vector< BOARD_ITEM * > &aRemovedItems, std::vector< BOARD_ITEM * > &aChangedItems) 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:144