KiCad PCB EDA Suite
Loading...
Searching...
No Matches
eeschema/widgets/search_handlers.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
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#include <sch_actions.h>
21#include <sch_edit_frame.h>
22#include <sch_painter.h>
23#include <sch_symbol.h>
24#include <sch_group.h>
25#include <sch_label.h>
26#include <sch_text.h>
27#include <sch_textbox.h>
28#include <schematic.h>
29#include <string_utils.h>
30#include <tool/tool_manager.h>
31#include "search_handlers.h"
32
33
35{
36 if( !m_resultsValid || aItemRow < 0 || aItemRow >= static_cast<long>( m_hitlist.size() ) )
37 return;
38
39 std::vector<long> item = { aItemRow };
40 SelectItems( item );
41
42 m_frame->GetToolManager()->RunAction( SCH_ACTIONS::properties, true );
43}
44
45
46void SCH_SEARCH_HANDLER::FindAll( const std::function<bool( SCH_ITEM*, SCH_SHEET_PATH* )>& aCollector )
47{
48 SCH_SCREENS screens( m_frame->Schematic().Root() );
49 std::vector<SCH_SHEET_PATH*> paths;
50
51 m_hitlist.clear();
52
53 m_resultsValid = false;
55
56 for( SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
57 {
58 for( SCH_SHEET_PATH& sheet : screen->GetClientSheetPaths() )
59 paths.push_back( &sheet );
60 }
61
62 for( SCH_SHEET_PATH* sheet : paths )
63 {
64 for( SCH_ITEM* item : sheet->LastScreen()->Items() )
65 {
66 if( aCollector( item, sheet ) )
67 m_hitlist.push_back( { item, sheet } );
68 }
69 }
70
71 m_resultsValid = true;
72}
73
74
75void SCH_SEARCH_HANDLER::Sort( int aCol, bool aAscending, std::vector<long>* aSelection )
76{
77 std::vector<SCH_ITEM*> selection;
78
79 for( long i = 0; i < (long) m_hitlist.size(); ++i )
80 {
81 if( alg::contains( *aSelection, i ) )
82 selection.push_back( m_hitlist[i].item );
83 }
84
85 int col = std::max( 0, aCol ); // Provide a stable order by sorting on first column if no
86 // sort column provided.
87
88 std::sort( m_hitlist.begin(), m_hitlist.end(),
89 [&]( const SCH_SEARCH_HIT& a, const SCH_SEARCH_HIT& b ) -> bool
90 {
91 // N.B. To meet the iterator sort conditions, we cannot simply invert the truth
92 // to get the opposite sort. i.e. ~(a<b) != (a>b)
93 if( aAscending )
94 return StrNumCmp( getResultCell( a, col ), getResultCell( b, col ), true ) < 0;
95 else
96 return StrNumCmp( getResultCell( b, col ), getResultCell( a, col ), true ) < 0;
97 } );
98
99 aSelection->clear();
100
101 for( long i = 0; i < (long) m_hitlist.size(); ++i )
102 {
103 if( alg::contains( selection, m_hitlist[i].item ) )
104 aSelection->push_back( i );
105 }
106}
107
108
109void SCH_SEARCH_HANDLER::SelectItems( std::vector<long>& aItemRows )
110{
111 // Queued list events must not select items from an invalidated search.
112 if( !m_resultsValid )
113 return;
114
115 EDA_ITEMS selectedItems;
116 std::vector<SCH_SEARCH_HIT> selectedHits;
117
118 m_frame->GetToolManager()->RunAction( ACTIONS::selectionClear );
119
120 for( long row : aItemRows )
121 {
122 if( row >= 0 && row < (long) m_hitlist.size() )
123 {
124 selectedHits.emplace_back( m_hitlist[row] );
125 selectedItems.emplace_back( m_hitlist[row].item );
126 }
127 }
128
129 if( selectedHits.empty() )
130 return;
131
132 bool allHitsOnSamePage = std::all_of( selectedHits.begin() + 1, selectedHits.end(),
133 [&]( const SCH_SEARCH_HIT& r )
134 {
135 return r.sheetPath == selectedHits.front().sheetPath;
136 } );
137
138 APP_SETTINGS_BASE::SEARCH_PANE& settings = m_frame->config()->m_SearchPane;
139
140 if( allHitsOnSamePage && !selectedHits.empty() )
141 {
142 SCH_SHEET_PATH* sheet = selectedHits.front().sheetPath;
143
144 if( m_frame->GetCurrentSheet() != *sheet )
145 m_frame->GetToolManager()->RunAction<SCH_SHEET_PATH*>( SCH_ACTIONS::changeSheet, sheet );
146
147 if( selectedItems.size() )
148 m_frame->GetToolManager()->RunAction<EDA_ITEMS*>( ACTIONS::selectItems, &selectedItems );
149
150 switch( settings.selection_zoom )
151 {
153 m_frame->GetToolManager()->RunAction( ACTIONS::centerSelection );
154 break;
156 m_frame->GetToolManager()->RunAction( ACTIONS::zoomFitSelection );
157 break;
159 break;
160 }
161
162 m_frame->GetCanvas()->Refresh( false );
163 }
164}
165
166
168 SCH_SEARCH_HANDLER( _HKI( "Symbols" ), aFrame )
169{
170 m_columns.emplace_back( _HKI( "Reference" ), 2, wxLIST_FORMAT_LEFT );
171 m_columns.emplace_back( _HKI( "Value" ), 6, wxLIST_FORMAT_LEFT );
172 m_columns.emplace_back( _HKI( "Footprint" ), 10, wxLIST_FORMAT_LEFT );
173 m_columns.emplace_back( _HKI( "Page" ), 1, wxLIST_FORMAT_CENTER );
174 m_columns.emplace_back( wxT( "X" ), 3, wxLIST_FORMAT_CENTER );
175 m_columns.emplace_back( wxT( "Y" ), 3, wxLIST_FORMAT_CENTER );
176 m_columns.emplace_back( _HKI( "Excl. Sim" ), 2, wxLIST_FORMAT_CENTER );
177 m_columns.emplace_back( _HKI( "Excl. BOM" ), 2, wxLIST_FORMAT_CENTER );
178 m_columns.emplace_back( _HKI( "Excl. Board" ), 2, wxLIST_FORMAT_CENTER );
179 m_columns.emplace_back( _HKI( "Excl. Pos Files" ), 2, wxLIST_FORMAT_CENTER );
180 m_columns.emplace_back( _HKI( "DNP" ), 2, wxLIST_FORMAT_CENTER );
181 m_columns.emplace_back( _HKI( "Library Link" ), 8, wxLIST_FORMAT_LEFT );
182 m_columns.emplace_back( _HKI( "Library Description" ), 10, wxLIST_FORMAT_LEFT );
183}
184
185
186int SYMBOL_SEARCH_HANDLER::Search( const wxString& aQuery )
187{
188 m_hitlist.clear();
189
190 APP_SETTINGS_BASE::SEARCH_PANE& settings = m_frame->config()->m_SearchPane;
191 SCH_SEARCH_DATA frp;
192
194 frp.searchMetadata = settings.search_metadata;
195 frp.findString = aQuery;
196
197 // Try to handle whatever the user throws at us (substring, wildcards, regex, etc.)
199 frp.searchCurrentSheetOnly = false;
200
201 auto search =
202 [&frp]( SCH_ITEM* item, SCH_SHEET_PATH* sheet )
203 {
204 if( item && item->Type() == SCH_SYMBOL_T )
205 {
206 SCH_SYMBOL* sym = static_cast<SCH_SYMBOL*>( item );
207
208 // IsPower depends on non-missing lib symbol association
209 if( !sym->IsMissingLibSymbol() && sym->IsPower() )
210 return false;
211
212 for( SCH_FIELD& field : sym->GetFields() )
213 {
214 if( frp.findString.IsEmpty() || field.Matches( frp, sheet ) )
215 return true;
216 }
217 }
218
219 return false;
220 };
221
222 FindAll( search );
223
224 return (int) m_hitlist.size();
225}
226
227
229{
230 SCH_SYMBOL*sym = dynamic_cast<SCH_SYMBOL*>( aHit.item );
231
232 if( !sym )
233 return wxEmptyString;
234
235 const wxString variant = m_frame->Schematic().GetCurrentVariant();
236
237 if( aCol == 0 )
238 return sym->GetRef( aHit.sheetPath, true );
239 else if( aCol == 1 )
240 return sym->GetField( FIELD_T::VALUE )->GetShownText( aHit.sheetPath, FOR_GUI );
241 else if( aCol == 2 )
243 else if( aCol == 3 )
244 return aHit.sheetPath->GetPageNumber();
245 else if( aCol == 4 )
246 return m_frame->MessageTextFromValue( sym->GetPosition().x );
247 else if( aCol == 5 )
248 return m_frame->MessageTextFromValue( sym->GetPosition().y );
249 else if( aCol == 6 )
250 return sym->ResolveExcludedFromSim( aHit.sheetPath, variant ) ? wxS( "X" ) : wxS( " " );
251 else if( aCol == 7 )
252 return sym->ResolveExcludedFromBOM( aHit.sheetPath, variant ) ? wxS( "X" ) : wxS( " " );
253 else if( aCol == 8 )
254 return sym->ResolveExcludedFromBoard( aHit.sheetPath, variant ) ? wxS( "X" ) : wxS( " " );
255 else if( aCol == 9 )
256 return sym->ResolveExcludedFromPosFiles( aHit.sheetPath, variant ) ? wxS( "X" ) : wxS( " " );
257 else if( aCol == 10 )
258 return sym->ResolveDNP( aHit.sheetPath, variant ) ? wxS( "X" ) : wxS( " " );
259 else if( aCol == 11 )
260 return sym->GetLibId().Format();
261 else if( aCol == 12 )
262 return sym->GetShownDescription( FOR_GUI );
263
264 return wxEmptyString;
265}
266
267
269 SCH_SEARCH_HANDLER( _HKI( "Power" ), aFrame )
270{
271 m_columns.emplace_back( _HKI( "Reference" ), 2, wxLIST_FORMAT_LEFT );
272 m_columns.emplace_back( _HKI( "Value" ), 6, wxLIST_FORMAT_LEFT );
273 m_columns.emplace_back( _HKI( "Page" ), 1, wxLIST_FORMAT_CENTER );
274 m_columns.emplace_back( wxT( "X" ), 3, wxLIST_FORMAT_CENTER );
275 m_columns.emplace_back( wxT( "Y" ), 3, wxLIST_FORMAT_CENTER );
276}
277
278
279int POWER_SEARCH_HANDLER::Search( const wxString& aQuery )
280{
281 m_hitlist.clear();
282
283 APP_SETTINGS_BASE::SEARCH_PANE& settings = m_frame->config()->m_SearchPane;
284 SCH_SEARCH_DATA frp;
285
287 frp.searchMetadata = settings.search_metadata;
288 frp.findString = aQuery;
289
290 // Try to handle whatever the user throws at us (substring, wildcards, regex, etc.)
292 frp.searchCurrentSheetOnly = false;
293
294 auto search =
295 [&frp]( SCH_ITEM* item, SCH_SHEET_PATH* sheet )
296 {
297 if( item && item->Type() == SCH_SYMBOL_T )
298 {
299 SCH_SYMBOL* sym = static_cast<SCH_SYMBOL*>( item );
300
301 // IsPower depends on non-missing lib symbol association
302 if( sym->IsMissingLibSymbol() || !sym->IsPower() )
303 return false;
304
305 for( SCH_FIELD& field : sym->GetFields() )
306 {
307 if( frp.findString.IsEmpty() || field.Matches( frp, sheet ) )
308 return true;
309 }
310 }
311
312 return false;
313 };
314
315 FindAll( search );
316
317 return (int) m_hitlist.size();
318}
319
320
322{
323 SCH_SYMBOL* sym = dynamic_cast<SCH_SYMBOL*>( aHit.item );
324
325 if( !sym )
326 return wxEmptyString;
327
328 if( aCol == 0 )
329 return sym->GetRef( aHit.sheetPath, true );
330 else if( aCol == 1 )
331 return sym->GetField( FIELD_T::VALUE )->GetShownText( aHit.sheetPath, FOR_GUI );
332 else if( aCol == 2 )
333 return aHit.sheetPath->GetPageNumber();
334 else if( aCol == 3 )
335 return m_frame->MessageTextFromValue( sym->GetPosition().x );
336 else if( aCol == 4 )
337 return m_frame->MessageTextFromValue( sym->GetPosition().y );
338
339 return wxEmptyString;
340}
341
342
344 SCH_SEARCH_HANDLER( _HKI( "Text" ), aFrame )
345{
346 m_columns.emplace_back( _HKI( "Type" ), 2, wxLIST_FORMAT_LEFT );
347 m_columns.emplace_back( _HKI( "Text" ), 12, wxLIST_FORMAT_LEFT );
348 m_columns.emplace_back( _HKI( "Page" ), 1, wxLIST_FORMAT_CENTER );
349 m_columns.emplace_back( wxT( "X" ), 3, wxLIST_FORMAT_CENTER );
350 m_columns.emplace_back( wxT( "Y" ), 3, wxLIST_FORMAT_CENTER );
351}
352
353
354int TEXT_SEARCH_HANDLER::Search( const wxString& aQuery )
355{
356 m_hitlist.clear();
357
358 APP_SETTINGS_BASE::SEARCH_PANE& settings = m_frame->config()->m_SearchPane;
359 SCH_SEARCH_DATA frp;
360
362 frp.searchMetadata = settings.search_metadata;
363 frp.findString = aQuery;
364
365 // Try to handle whatever the user throws at us (substring, wildcards, regex, etc.)
367 frp.searchCurrentSheetOnly = false;
368
369 auto search =
370 [&frp]( SCH_ITEM* item, SCH_SHEET_PATH* sheet )
371 {
372 if( item->Type() == SCH_TEXT_T || item->Type() == SCH_TEXTBOX_T )
373 {
374 if( frp.findString.IsEmpty() || item->Matches( frp, sheet ) )
375 return true;
376 }
377
378 return false;
379 };
380
381 FindAll( search );
382
383 return (int) m_hitlist.size();
384}
385
386
387wxString TEXT_SEARCH_HANDLER::getResultCell( const SCH_SEARCH_HIT& aHit, int aCol )
388{
389 if( aHit.item->Type() == SCH_TEXT_T )
390 {
391 SCH_TEXT* txt = dynamic_cast<SCH_TEXT*>( aHit.item );
392
393 if( !txt )
394 return wxEmptyString;
395
396 if( aCol == 0 )
397 return _( "Text" );
398 else if( aCol == 1 )
399 return txt->GetShownText( FOR_GUI );
400 else if( aCol == 2 )
401 return aHit.sheetPath->GetPageNumber();
402 else if( aCol == 3 )
403 return m_frame->MessageTextFromValue( txt->GetPosition().x );
404 else if( aCol == 4 )
405 return m_frame->MessageTextFromValue( txt->GetPosition().y );
406 }
407 else if( aHit.item->Type() == SCH_TEXTBOX_T )
408 {
409 SCH_TEXTBOX* txt = dynamic_cast<SCH_TEXTBOX*>( aHit.item );
410
411 if( !txt )
412 return wxEmptyString;
413
414 if( aCol == 0 )
415 return _( "Text Box" );
416 else if( aCol == 1 )
417 return txt->GetShownText( FOR_GUI );
418 else if( aCol == 2 )
419 return aHit.sheetPath->GetPageNumber();
420 else if( aCol == 3 )
421 return m_frame->MessageTextFromValue( txt->GetPosition().x );
422 else if( aCol == 4 )
423 return m_frame->MessageTextFromValue( txt->GetPosition().y );
424 }
425
426
427 return wxEmptyString;
428}
429
430
432 SCH_SEARCH_HANDLER( _HKI( "Labels" ), aFrame )
433{
434 m_columns.emplace_back( _HKI( "Type" ), 2, wxLIST_FORMAT_LEFT );
435 m_columns.emplace_back( _HKI( "Name" ), 6, wxLIST_FORMAT_LEFT );
436 m_columns.emplace_back( _HKI( "Page" ), 2, wxLIST_FORMAT_CENTER );
437 m_columns.emplace_back( wxT( "X" ), 3, wxLIST_FORMAT_CENTER );
438 m_columns.emplace_back( wxT( "Y" ), 3 , wxLIST_FORMAT_CENTER);
439}
440
441
442int LABEL_SEARCH_HANDLER::Search( const wxString& aQuery )
443{
444 m_hitlist.clear();
445
446 APP_SETTINGS_BASE::SEARCH_PANE& settings = m_frame->config()->m_SearchPane;
447 SCH_SEARCH_DATA frp;
448
450 frp.searchMetadata = settings.search_metadata;
451 frp.findString = aQuery;
452
453 // Try to handle whatever the user throws at us (substring, wildcards, regex, etc.)
455 frp.searchCurrentSheetOnly = false;
456
457 auto search =
458 [&frp]( SCH_ITEM* item, SCH_SHEET_PATH* sheet )
459 {
460 if( item->IsType( { SCH_LABEL_LOCATE_ANY_T } ) )
461 {
462 SCH_LABEL_BASE* lbl = dynamic_cast<SCH_LABEL_BASE*>( item );
463
464 wxCHECK( lbl, false );
465
466 if( frp.findString.IsEmpty() || lbl->Matches( frp, sheet ) )
467 return true;
468 }
469
470 return false;
471 };
472
473 FindAll( search );
474
475 return (int) m_hitlist.size();
476}
477
478
480{
481 SCH_LABEL_BASE* lbl = dynamic_cast<SCH_LABEL_BASE*>( aHit.item );
482
483 if( !lbl )
484 return wxEmptyString;
485
486 if (aCol == 0)
487 {
488 if(lbl->Type() == SCH_LABEL_T)
489 return _HKI( "Local" );
490 else if( lbl->Type() == SCH_GLOBAL_LABEL_T )
491 return _HKI( "Global" );
492 else if( lbl->Type() == SCH_HIER_LABEL_T )
493 return _HKI( "Hierarchical" );
494 else if( lbl->Type() == SCH_DIRECTIVE_LABEL_T )
495 return _HKI( "Directive" );
496 }
497 else if( aCol == 1 )
498 return lbl->GetShownText( FOR_GUI );
499 else if( aCol == 2 )
500 return aHit.sheetPath->GetPageNumber();
501 else if( aCol == 3 )
502 return m_frame->MessageTextFromValue( lbl->GetPosition().x );
503 else if( aCol == 4 )
504 return m_frame->MessageTextFromValue( lbl->GetPosition().y );
505
506 return wxEmptyString;
507}
508
509
511 SCH_SEARCH_HANDLER( _HKI( "Groups" ), aFrame )
512{
513 m_columns.emplace_back( _HKI( "Name" ), 6, wxLIST_FORMAT_LEFT );
514 m_columns.emplace_back( _HKI( "Page" ), 2, wxLIST_FORMAT_CENTER );
515 m_columns.emplace_back( wxT( "X" ), 3, wxLIST_FORMAT_CENTER );
516 m_columns.emplace_back( wxT( "Y" ), 3, wxLIST_FORMAT_CENTER);
517}
518
519
520int GROUP_SEARCH_HANDLER::Search( const wxString& aQuery )
521{
522 m_hitlist.clear();
523
524 APP_SETTINGS_BASE::SEARCH_PANE& settings = m_frame->config()->m_SearchPane;
525 SCH_SEARCH_DATA frp;
526
528 frp.searchMetadata = settings.search_metadata;
529 frp.findString = aQuery;
530
531 // Try to handle whatever the user throws at us (substring, wildcards, regex, etc.)
533 frp.searchCurrentSheetOnly = false;
534
535 auto search =
536 [&frp]( SCH_ITEM* item, SCH_SHEET_PATH* sheet )
537 {
538 if( item->IsType( { SCH_GROUP_T } ) )
539 {
540 SCH_GROUP* group = static_cast<SCH_GROUP*>( item );
541
542 if( frp.findString.IsEmpty() || group->Matches( frp, sheet ) )
543 return true;
544 }
545
546 return false;
547 };
548
549 FindAll( search );
550
551 return (int) m_hitlist.size();
552}
553
554
556{
557 SCH_GROUP* group = dynamic_cast<SCH_GROUP*>( aHit.item );
558
559 if( !group )
560 return wxEmptyString;
561
562 if( aCol == 0 )
563 return group->GetName();
564 else if( aCol == 1 )
565 return aHit.sheetPath->GetPageNumber();
566 else if( aCol == 2 )
567 return m_frame->MessageTextFromValue( group->GetPosition().x );
568 else if( aCol == 3 )
569 return m_frame->MessageTextFromValue( group->GetPosition().y );
570
571 return wxEmptyString;
572}
static TOOL_ACTION zoomFitSelection
Definition actions.h:140
static TOOL_ACTION centerSelection
Definition actions.h:146
static TOOL_ACTION selectionClear
Clear the current selection.
Definition actions.h:220
static TOOL_ACTION selectItems
Select a list of items (specified as the event parameter)
Definition actions.h:228
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:110
virtual bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
Definition eda_item.h:482
wxString getResultCell(const SCH_SEARCH_HIT &hit, int aCol) override
int Search(const wxString &aQuery) override
GROUP_SEARCH_HANDLER(SCH_EDIT_FRAME *aFrame)
LABEL_SEARCH_HANDLER(SCH_EDIT_FRAME *aFrame)
int Search(const wxString &aQuery) override
wxString getResultCell(const SCH_SEARCH_HIT &hit, int aCol) override
UTF8 Format() const
Definition lib_id.cpp:132
int Search(const wxString &aQuery) override
POWER_SEARCH_HANDLER(SCH_EDIT_FRAME *aFrame)
wxString getResultCell(const SCH_SEARCH_HIT &aHit, int aCol) override
static TOOL_ACTION properties
static TOOL_ACTION changeSheet
Schematic editor (Eeschema) main window.
wxString GetShownText(const SCH_SHEET_PATH *aPath, RESOLUTION_CONTEXT aContext, const wxString &aVariantName=wxEmptyString, int aDepth=0) const
A set of SCH_ITEMs (i.e., without duplicates).
Definition sch_group.h:48
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:165
bool ResolveExcludedFromPosFiles(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const
Definition sch_item.cpp:359
bool ResolveExcludedFromBOM(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const
Definition sch_item.cpp:327
bool ResolveExcludedFromBoard(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const
Definition sch_item.cpp:343
bool ResolveDNP(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const
Definition sch_item.cpp:375
bool ResolveExcludedFromSim(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const
Definition sch_item.cpp:311
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
Definition sch_item.h:180
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
wxString GetShownText(const SCH_SHEET_PATH *aPath, RESOLUTION_CONTEXT aContext, int aDepth=0) const override
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition sch_screen.h:758
SCH_SCREEN * GetNext()
SCH_SCREEN * GetFirst()
void BuildClientSheetPathList()
Build the list of sheet paths sharing a screen for each screen in use.
std::vector< SCH_SEARCH_HIT > m_hitlist
void SelectItems(std::vector< long > &aItemRows) override
void FindAll(const std::function< bool(SCH_ITEM *, SCH_SHEET_PATH *)> &aCollector)
void Sort(int aCol, bool aAscending, std::vector< long > *aSelection) override
void ActivateItem(long aItemRow) override
SCH_SEARCH_HANDLER(const wxString &aName, SCH_EDIT_FRAME *aFrame)
VECTOR2I GetPosition() const override
Definition sch_shape.h:86
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
wxString GetPageNumber() const
Schematic symbol object.
Definition sch_symbol.h:75
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly) const override
Populate a std::vector with SCH_FIELDs, sorted in ordinal order.
wxString GetShownDescription(RESOLUTION_CONTEXT aContext, int aDepth=0) const override
bool IsMissingLibSymbol() const
Check to see if the library symbol is set to the dummy library symbol.
VECTOR2I GetPosition() const override
Definition sch_symbol.h:934
const LIB_ID & GetLibId() const override
Definition sch_symbol.h:164
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
bool IsPower() const override
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this symbol.
virtual wxString GetShownText(const RENDER_SETTINGS *aSettings, const SCH_SHEET_PATH *aPath, RESOLUTION_CONTEXT aContext, int aDepth=0) const
VECTOR2I GetPosition() const override
Definition sch_text.h:143
virtual wxString GetShownText(const SCH_SHEET_PATH *aPath, RESOLUTION_CONTEXT aContext, int aDepth=0) const
Definition sch_text.cpp:359
std::vector< std::tuple< wxString, int, wxListColumnFormat > > m_columns
Definition search_pane.h:61
wxString getResultCell(const SCH_SEARCH_HIT &aHit, int aCol) override
SYMBOL_SEARCH_HANDLER(SCH_EDIT_FRAME *aFrame)
int Search(const wxString &aQuery) override
TEXT_SEARCH_HANDLER(SCH_EDIT_FRAME *aFrame)
int Search(const wxString &aQuery) override
wxString getResultCell(const SCH_SEARCH_HIT &hit, int aCol) override
@ FOR_GUI
Definition common.h:89
#define _(s)
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
Definition kicad_algo.h:96
#define _HKI(x)
Definition page_info.cpp:40
Class to handle a set of SCH_ITEMs.
std::vector< EDA_ITEM * > EDA_ITEMS
EDA_SEARCH_MATCH_MODE matchMode
@ FOOTPRINT
Field Name Module PCB, i.e. "16DIP300".
@ VALUE
Field Value of part, i.e. "3.3K".
@ SCH_SYMBOL_T
Definition typeinfo.h:168
@ SCH_DIRECTIVE_LABEL_T
Definition typeinfo.h:167
@ SCH_LABEL_T
Definition typeinfo.h:163
@ SCH_HIER_LABEL_T
Definition typeinfo.h:165
@ SCH_TEXT_T
Definition typeinfo.h:147
@ SCH_TEXTBOX_T
Definition typeinfo.h:148
@ SCH_GLOBAL_LABEL_T
Definition typeinfo.h:164