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 std::vector<long> item = { aItemRow };
37 SelectItems( item );
38
39 m_frame->GetToolManager()->RunAction( SCH_ACTIONS::properties, true );
40}
41
42
43void SCH_SEARCH_HANDLER::FindAll( const std::function<bool( SCH_ITEM*, SCH_SHEET_PATH* )>& aCollector )
44{
45 SCH_SCREENS screens( m_frame->Schematic().Root() );
46 std::vector<SCH_SHEET_PATH*> paths;
47
48 m_hitlist.clear();
49
51
52 for( SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
53 {
54 for( SCH_SHEET_PATH& sheet : screen->GetClientSheetPaths() )
55 paths.push_back( &sheet );
56 }
57
58 for( SCH_SHEET_PATH* sheet : paths )
59 {
60 for( SCH_ITEM* item : sheet->LastScreen()->Items() )
61 {
62 if( aCollector( item, sheet ) )
63 m_hitlist.push_back( { item, sheet } );
64 }
65 }
66}
67
68
69void SCH_SEARCH_HANDLER::Sort( int aCol, bool aAscending, std::vector<long>* aSelection )
70{
71 std::vector<SCH_ITEM*> selection;
72
73 for( long i = 0; i < (long) m_hitlist.size(); ++i )
74 {
75 if( alg::contains( *aSelection, i ) )
76 selection.push_back( m_hitlist[i].item );
77 }
78
79 int col = std::max( 0, aCol ); // Provide a stable order by sorting on first column if no
80 // sort column provided.
81
82 std::sort( m_hitlist.begin(), m_hitlist.end(),
83 [&]( const SCH_SEARCH_HIT& a, const SCH_SEARCH_HIT& b ) -> bool
84 {
85 // N.B. To meet the iterator sort conditions, we cannot simply invert the truth
86 // to get the opposite sort. i.e. ~(a<b) != (a>b)
87 if( aAscending )
88 return StrNumCmp( getResultCell( a, col ), getResultCell( b, col ), true ) < 0;
89 else
90 return StrNumCmp( getResultCell( b, col ), getResultCell( a, col ), true ) < 0;
91 } );
92
93 aSelection->clear();
94
95 for( long i = 0; i < (long) m_hitlist.size(); ++i )
96 {
97 if( alg::contains( selection, m_hitlist[i].item ) )
98 aSelection->push_back( i );
99 }
100}
101
102
103void SCH_SEARCH_HANDLER::SelectItems( std::vector<long>& aItemRows )
104{
105 EDA_ITEMS selectedItems;
106 std::vector<SCH_SEARCH_HIT> selectedHits;
107
108 m_frame->GetToolManager()->RunAction( ACTIONS::selectionClear );
109
110 for( long row : aItemRows )
111 {
112 if( row >= 0 && row < (long) m_hitlist.size() )
113 {
114 selectedHits.emplace_back( m_hitlist[row] );
115 selectedItems.emplace_back( m_hitlist[row].item );
116 }
117 }
118
119 if( selectedHits.empty() )
120 return;
121
122 bool allHitsOnSamePage = std::all_of( selectedHits.begin() + 1, selectedHits.end(),
123 [&]( const SCH_SEARCH_HIT& r )
124 {
125 return r.sheetPath == selectedHits.front().sheetPath;
126 } );
127
128 APP_SETTINGS_BASE::SEARCH_PANE& settings = m_frame->config()->m_SearchPane;
129
130 if( allHitsOnSamePage && !selectedHits.empty() )
131 {
132 SCH_SHEET_PATH* sheet = selectedHits.front().sheetPath;
133
134 if( m_frame->GetCurrentSheet() != *sheet )
135 m_frame->GetToolManager()->RunAction<SCH_SHEET_PATH*>( SCH_ACTIONS::changeSheet, sheet );
136
137 if( selectedItems.size() )
138 m_frame->GetToolManager()->RunAction<EDA_ITEMS*>( ACTIONS::selectItems, &selectedItems );
139
140 switch( settings.selection_zoom )
141 {
143 m_frame->GetToolManager()->RunAction( ACTIONS::centerSelection );
144 break;
146 m_frame->GetToolManager()->RunAction( ACTIONS::zoomFitSelection );
147 break;
149 break;
150 }
151
152 m_frame->GetCanvas()->Refresh( false );
153 }
154}
155
156
158 SCH_SEARCH_HANDLER( _HKI( "Symbols" ), aFrame )
159{
160 m_columns.emplace_back( _HKI( "Reference" ), 2, wxLIST_FORMAT_LEFT );
161 m_columns.emplace_back( _HKI( "Value" ), 6, wxLIST_FORMAT_LEFT );
162 m_columns.emplace_back( _HKI( "Footprint" ), 10, wxLIST_FORMAT_LEFT );
163 m_columns.emplace_back( _HKI( "Page" ), 1, wxLIST_FORMAT_CENTER );
164 m_columns.emplace_back( wxT( "X" ), 3, wxLIST_FORMAT_CENTER );
165 m_columns.emplace_back( wxT( "Y" ), 3, wxLIST_FORMAT_CENTER );
166 m_columns.emplace_back( _HKI( "Excl. Sim" ), 2, wxLIST_FORMAT_CENTER );
167 m_columns.emplace_back( _HKI( "Excl. BOM" ), 2, wxLIST_FORMAT_CENTER );
168 m_columns.emplace_back( _HKI( "Excl. Board" ), 2, wxLIST_FORMAT_CENTER );
169 m_columns.emplace_back( _HKI( "Excl. Pos Files" ), 2, wxLIST_FORMAT_CENTER );
170 m_columns.emplace_back( _HKI( "DNP" ), 2, wxLIST_FORMAT_CENTER );
171 m_columns.emplace_back( _HKI( "Library Link" ), 8, wxLIST_FORMAT_LEFT );
172 m_columns.emplace_back( _HKI( "Library Description" ), 10, wxLIST_FORMAT_LEFT );
173}
174
175
176int SYMBOL_SEARCH_HANDLER::Search( const wxString& aQuery )
177{
178 m_hitlist.clear();
179
180 APP_SETTINGS_BASE::SEARCH_PANE& settings = m_frame->config()->m_SearchPane;
181 SCH_SEARCH_DATA frp;
182
184 frp.searchMetadata = settings.search_metadata;
185 frp.findString = aQuery;
186
187 // Try to handle whatever the user throws at us (substring, wildcards, regex, etc.)
189 frp.searchCurrentSheetOnly = false;
190
191 auto search =
192 [&frp]( SCH_ITEM* item, SCH_SHEET_PATH* sheet )
193 {
194 if( item && item->Type() == SCH_SYMBOL_T )
195 {
196 SCH_SYMBOL* sym = static_cast<SCH_SYMBOL*>( item );
197
198 // IsPower depends on non-missing lib symbol association
199 if( !sym->IsMissingLibSymbol() && sym->IsPower() )
200 return false;
201
202 for( SCH_FIELD& field : sym->GetFields() )
203 {
204 if( frp.findString.IsEmpty() || field.Matches( frp, sheet ) )
205 return true;
206 }
207 }
208
209 return false;
210 };
211
212 FindAll( search );
213
214 return (int) m_hitlist.size();
215}
216
217
219{
220 SCH_SYMBOL*sym = dynamic_cast<SCH_SYMBOL*>( aHit.item );
221
222 if( !sym )
223 return wxEmptyString;
224
225 if( aCol == 0 )
226 return sym->GetRef( aHit.sheetPath, true );
227 else if( aCol == 1 )
228 return sym->GetField( FIELD_T::VALUE )->GetShownText( aHit.sheetPath, false );
229 else if( aCol == 2 )
230 return sym->GetField( FIELD_T::FOOTPRINT )->GetShownText( aHit.sheetPath, false );
231 else if( aCol == 3 )
232 return aHit.sheetPath->GetPageNumber();
233 else if( aCol == 4 )
234 return m_frame->MessageTextFromValue( sym->GetPosition().x );
235 else if( aCol == 5 )
236 return m_frame->MessageTextFromValue( sym->GetPosition().y );
237 else if( aCol == 6 )
238 return sym->ResolveExcludedFromSim() ? wxS( "X" ) : wxS( " " );
239 else if( aCol == 7 )
240 return sym->ResolveExcludedFromBOM() ? wxS( "X" ) : wxS( " " );
241 else if( aCol == 8 )
242 return sym->ResolveExcludedFromBoard() ? wxS( "X" ) : wxS( " " );
243 else if( aCol == 9 )
244 return sym->ResolveExcludedFromPosFiles() ? wxS( "X" ) : wxS( " " );
245 else if( aCol == 10 )
246 return sym->ResolveDNP( aHit.sheetPath, m_frame->Schematic().GetCurrentVariant() ) ? wxS( "X" ) : wxS( " " );
247 else if( aCol == 11 )
248 return sym->GetLibId().Format();
249 else if( aCol == 12 )
250 return sym->GetShownDescription();
251
252 return wxEmptyString;
253}
254
255
257 SCH_SEARCH_HANDLER( _HKI( "Power" ), aFrame )
258{
259 m_columns.emplace_back( _HKI( "Reference" ), 2, wxLIST_FORMAT_LEFT );
260 m_columns.emplace_back( _HKI( "Value" ), 6, wxLIST_FORMAT_LEFT );
261 m_columns.emplace_back( _HKI( "Page" ), 1, wxLIST_FORMAT_CENTER );
262 m_columns.emplace_back( wxT( "X" ), 3, wxLIST_FORMAT_CENTER );
263 m_columns.emplace_back( wxT( "Y" ), 3, wxLIST_FORMAT_CENTER );
264}
265
266
267int POWER_SEARCH_HANDLER::Search( const wxString& aQuery )
268{
269 m_hitlist.clear();
270
271 APP_SETTINGS_BASE::SEARCH_PANE& settings = m_frame->config()->m_SearchPane;
272 SCH_SEARCH_DATA frp;
273
275 frp.searchMetadata = settings.search_metadata;
276 frp.findString = aQuery;
277
278 // Try to handle whatever the user throws at us (substring, wildcards, regex, etc.)
280 frp.searchCurrentSheetOnly = false;
281
282 auto search =
283 [&frp]( SCH_ITEM* item, SCH_SHEET_PATH* sheet )
284 {
285 if( item && item->Type() == SCH_SYMBOL_T )
286 {
287 SCH_SYMBOL* sym = static_cast<SCH_SYMBOL*>( item );
288
289 // IsPower depends on non-missing lib symbol association
290 if( sym->IsMissingLibSymbol() || !sym->IsPower() )
291 return false;
292
293 for( SCH_FIELD& field : sym->GetFields() )
294 {
295 if( frp.findString.IsEmpty() || field.Matches( frp, sheet ) )
296 return true;
297 }
298 }
299
300 return false;
301 };
302
303 FindAll( search );
304
305 return (int) m_hitlist.size();
306}
307
308
310{
311 SCH_SYMBOL* sym = dynamic_cast<SCH_SYMBOL*>( aHit.item );
312
313 if( !sym )
314 return wxEmptyString;
315
316 if( aCol == 0 )
317 return sym->GetRef( aHit.sheetPath, true );
318 else if( aCol == 1 )
319 return sym->GetField( FIELD_T::VALUE )->GetShownText( aHit.sheetPath, false );
320 else if( aCol == 2 )
321 return aHit.sheetPath->GetPageNumber();
322 else if( aCol == 3 )
323 return m_frame->MessageTextFromValue( sym->GetPosition().x );
324 else if( aCol == 4 )
325 return m_frame->MessageTextFromValue( sym->GetPosition().y );
326
327 return wxEmptyString;
328}
329
330
332 SCH_SEARCH_HANDLER( _HKI( "Text" ), aFrame )
333{
334 m_columns.emplace_back( _HKI( "Type" ), 2, wxLIST_FORMAT_LEFT );
335 m_columns.emplace_back( _HKI( "Text" ), 12, wxLIST_FORMAT_LEFT );
336 m_columns.emplace_back( _HKI( "Page" ), 1, wxLIST_FORMAT_CENTER );
337 m_columns.emplace_back( wxT( "X" ), 3, wxLIST_FORMAT_CENTER );
338 m_columns.emplace_back( wxT( "Y" ), 3, wxLIST_FORMAT_CENTER );
339}
340
341
342int TEXT_SEARCH_HANDLER::Search( const wxString& aQuery )
343{
344 m_hitlist.clear();
345
346 APP_SETTINGS_BASE::SEARCH_PANE& settings = m_frame->config()->m_SearchPane;
347 SCH_SEARCH_DATA frp;
348
350 frp.searchMetadata = settings.search_metadata;
351 frp.findString = aQuery;
352
353 // Try to handle whatever the user throws at us (substring, wildcards, regex, etc.)
355 frp.searchCurrentSheetOnly = false;
356
357 auto search =
358 [&frp]( SCH_ITEM* item, SCH_SHEET_PATH* sheet )
359 {
360 if( item->Type() == SCH_TEXT_T || item->Type() == SCH_TEXTBOX_T )
361 {
362 if( frp.findString.IsEmpty() || item->Matches( frp, sheet ) )
363 return true;
364 }
365
366 return false;
367 };
368
369 FindAll( search );
370
371 return (int) m_hitlist.size();
372}
373
374
375wxString TEXT_SEARCH_HANDLER::getResultCell( const SCH_SEARCH_HIT& aHit, int aCol )
376{
377 if( aHit.item->Type() == SCH_TEXT_T )
378 {
379 SCH_TEXT* txt = dynamic_cast<SCH_TEXT*>( aHit.item );
380
381 if( !txt )
382 return wxEmptyString;
383
384 if( aCol == 0 )
385 return _( "Text" );
386 else if( aCol == 1 )
387 return txt->GetShownText( false );
388 else if( aCol == 2 )
389 return aHit.sheetPath->GetPageNumber();
390 else if( aCol == 3 )
391 return m_frame->MessageTextFromValue( txt->GetPosition().x );
392 else if( aCol == 4 )
393 return m_frame->MessageTextFromValue( txt->GetPosition().y );
394 }
395 else if( aHit.item->Type() == SCH_TEXTBOX_T )
396 {
397 SCH_TEXTBOX* txt = dynamic_cast<SCH_TEXTBOX*>( aHit.item );
398
399 if( !txt )
400 return wxEmptyString;
401
402 if( aCol == 0 )
403 return _( "Text Box" );
404 else if( aCol == 1 )
405 return txt->GetShownText( false );
406 else if( aCol == 2 )
407 return aHit.sheetPath->GetPageNumber();
408 else if( aCol == 3 )
409 return m_frame->MessageTextFromValue( txt->GetPosition().x );
410 else if( aCol == 4 )
411 return m_frame->MessageTextFromValue( txt->GetPosition().y );
412 }
413
414
415 return wxEmptyString;
416}
417
418
420 SCH_SEARCH_HANDLER( _HKI( "Labels" ), aFrame )
421{
422 m_columns.emplace_back( _HKI( "Type" ), 2, wxLIST_FORMAT_LEFT );
423 m_columns.emplace_back( _HKI( "Name" ), 6, wxLIST_FORMAT_LEFT );
424 m_columns.emplace_back( _HKI( "Page" ), 2, wxLIST_FORMAT_CENTER );
425 m_columns.emplace_back( wxT( "X" ), 3, wxLIST_FORMAT_CENTER );
426 m_columns.emplace_back( wxT( "Y" ), 3 , wxLIST_FORMAT_CENTER);
427}
428
429
430int LABEL_SEARCH_HANDLER::Search( const wxString& aQuery )
431{
432 m_hitlist.clear();
433
434 APP_SETTINGS_BASE::SEARCH_PANE& settings = m_frame->config()->m_SearchPane;
435 SCH_SEARCH_DATA frp;
436
438 frp.searchMetadata = settings.search_metadata;
439 frp.findString = aQuery;
440
441 // Try to handle whatever the user throws at us (substring, wildcards, regex, etc.)
443 frp.searchCurrentSheetOnly = false;
444
445 auto search =
446 [&frp]( SCH_ITEM* item, SCH_SHEET_PATH* sheet )
447 {
448 if( item->IsType( { SCH_LABEL_LOCATE_ANY_T } ) )
449 {
450 SCH_LABEL_BASE* lbl = dynamic_cast<SCH_LABEL_BASE*>( item );
451
452 wxCHECK( lbl, false );
453
454 if( frp.findString.IsEmpty() || lbl->Matches( frp, sheet ) )
455 return true;
456 }
457
458 return false;
459 };
460
461 FindAll( search );
462
463 return (int) m_hitlist.size();
464}
465
466
468{
469 SCH_LABEL_BASE* lbl = dynamic_cast<SCH_LABEL_BASE*>( aHit.item );
470
471 if( !lbl )
472 return wxEmptyString;
473
474 if (aCol == 0)
475 {
476 if(lbl->Type() == SCH_LABEL_T)
477 return _HKI( "Local" );
478 else if( lbl->Type() == SCH_GLOBAL_LABEL_T )
479 return _HKI( "Global" );
480 else if( lbl->Type() == SCH_HIER_LABEL_T )
481 return _HKI( "Hierarchical" );
482 else if( lbl->Type() == SCH_DIRECTIVE_LABEL_T )
483 return _HKI( "Directive" );
484 }
485 else if( aCol == 1 )
486 return lbl->GetShownText( false );
487 else if( aCol == 2 )
488 return aHit.sheetPath->GetPageNumber();
489 else if( aCol == 3 )
490 return m_frame->MessageTextFromValue( lbl->GetPosition().x );
491 else if( aCol == 4 )
492 return m_frame->MessageTextFromValue( lbl->GetPosition().y );
493
494 return wxEmptyString;
495}
496
497
499 SCH_SEARCH_HANDLER( _HKI( "Groups" ), aFrame )
500{
501 m_columns.emplace_back( _HKI( "Name" ), 6, wxLIST_FORMAT_LEFT );
502 m_columns.emplace_back( _HKI( "Page" ), 2, wxLIST_FORMAT_CENTER );
503 m_columns.emplace_back( wxT( "X" ), 3, wxLIST_FORMAT_CENTER );
504 m_columns.emplace_back( wxT( "Y" ), 3, wxLIST_FORMAT_CENTER);
505}
506
507
508int GROUP_SEARCH_HANDLER::Search( const wxString& aQuery )
509{
510 m_hitlist.clear();
511
512 APP_SETTINGS_BASE::SEARCH_PANE& settings = m_frame->config()->m_SearchPane;
513 SCH_SEARCH_DATA frp;
514
516 frp.searchMetadata = settings.search_metadata;
517 frp.findString = aQuery;
518
519 // Try to handle whatever the user throws at us (substring, wildcards, regex, etc.)
521 frp.searchCurrentSheetOnly = false;
522
523 auto search =
524 [&frp]( SCH_ITEM* item, SCH_SHEET_PATH* sheet )
525 {
526 if( item->IsType( { SCH_GROUP_T } ) )
527 {
528 SCH_GROUP* group = static_cast<SCH_GROUP*>( item );
529
530 if( frp.findString.IsEmpty() || group->Matches( frp, sheet ) )
531 return true;
532 }
533
534 return false;
535 };
536
537 FindAll( search );
538
539 return (int) m_hitlist.size();
540}
541
542
544{
545 SCH_GROUP* group = dynamic_cast<SCH_GROUP*>( aHit.item );
546
547 if( !group )
548 return wxEmptyString;
549
550 if( aCol == 0 )
551 return group->GetName();
552 else if( aCol == 1 )
553 return aHit.sheetPath->GetPageNumber();
554 else if( aCol == 2 )
555 return m_frame->MessageTextFromValue( group->GetPosition().x );
556 else if( aCol == 3 )
557 return m_frame->MessageTextFromValue( group->GetPosition().y );
558
559 return wxEmptyString;
560}
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:108
virtual bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
Definition eda_item.h:416
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, bool aAllowExtraText, int aDepth=0, const wxString &aVariantName=wxEmptyString) 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:162
bool ResolveExcludedFromPosFiles(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const
Definition sch_item.cpp:346
bool ResolveExcludedFromBOM(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const
Definition sch_item.cpp:314
bool ResolveExcludedFromBoard(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const
Definition sch_item.cpp:330
bool ResolveDNP(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const
Definition sch_item.cpp:362
bool ResolveExcludedFromSim(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const
Definition sch_item.cpp:298
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
Definition sch_item.h:177
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const override
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition sch_screen.h:746
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:84
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:69
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly) const override
Populate a std::vector with SCH_FIELDs, sorted in ordinal order.
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:913
wxString GetShownDescription(int aDepth=0) const override
const LIB_ID & GetLibId() const override
Definition sch_symbol.h:158
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, bool aAllowExtraText, int aDepth=0) const
VECTOR2I GetPosition() const override
Definition sch_text.h:146
virtual wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const
Definition sch_text.cpp:362
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
#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:169
@ SCH_DIRECTIVE_LABEL_T
Definition typeinfo.h:168
@ SCH_LABEL_T
Definition typeinfo.h:164
@ SCH_HIER_LABEL_T
Definition typeinfo.h:166
@ SCH_TEXT_T
Definition typeinfo.h:148
@ SCH_TEXTBOX_T
Definition typeinfo.h:149
@ SCH_GLOBAL_LABEL_T
Definition typeinfo.h:165