39 std::vector<long> item = { aItemRow };
49 std::vector<SCH_SHEET_PATH*> paths;
59 paths.push_back( &sheet );
64 for(
SCH_ITEM* item : sheet->LastScreen()->Items() )
66 if( aCollector( item, sheet ) )
77 std::vector<SCH_ITEM*> selection;
79 for(
long i = 0; i < (long)
m_hitlist.size(); ++i )
85 int col = std::max( 0, aCol );
94 return StrNumCmp( getResultCell( a, col ), getResultCell( b, col ), true ) < 0;
96 return StrNumCmp( getResultCell( b, col ), getResultCell( a, col ), true ) < 0;
101 for(
long i = 0; i < (long)
m_hitlist.size(); ++i )
104 aSelection->push_back( i );
116 std::vector<SCH_SEARCH_HIT> selectedHits;
120 for(
long row : aItemRows )
122 if( row >= 0 && row < (
long)
m_hitlist.size() )
124 selectedHits.emplace_back(
m_hitlist[row] );
125 selectedItems.emplace_back(
m_hitlist[row].item );
129 if( selectedHits.empty() )
132 bool allHitsOnSamePage = std::all_of( selectedHits.begin() + 1, selectedHits.end(),
135 return r.sheetPath == selectedHits.front().sheetPath;
140 if( allHitsOnSamePage && !selectedHits.empty() )
144 if(
m_frame->GetCurrentSheet() != *sheet )
147 if( selectedItems.size() )
162 m_frame->GetCanvas()->Refresh(
false );
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 );
214 if( frp.
findString.IsEmpty() || field.Matches( frp, sheet ) )
233 return wxEmptyString;
235 const wxString variant =
m_frame->Schematic().GetCurrentVariant();
257 else if( aCol == 10 )
259 else if( aCol == 11 )
261 else if( aCol == 12 )
264 return wxEmptyString;
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 );
307 if( frp.
findString.IsEmpty() || field.Matches( frp, sheet ) )
326 return wxEmptyString;
339 return wxEmptyString;
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 );
394 return wxEmptyString;
412 return wxEmptyString;
415 return _(
"Text Box" );
427 return wxEmptyString;
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);
460 if( item->
IsType( { SCH_LABEL_LOCATE_ANY_T } ) )
464 wxCHECK( lbl,
false );
484 return wxEmptyString;
489 return _HKI(
"Local" );
491 return _HKI(
"Global" );
493 return _HKI(
"Hierarchical" );
495 return _HKI(
"Directive" );
506 return wxEmptyString;
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);
538 if( item->
IsType( { SCH_GROUP_T } ) )
560 return wxEmptyString;
563 return group->GetName();
567 return m_frame->MessageTextFromValue(
group->GetPosition().x );
569 return m_frame->MessageTextFromValue(
group->GetPosition().y );
571 return wxEmptyString;
static TOOL_ACTION zoomFitSelection
static TOOL_ACTION centerSelection
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION selectItems
Select a list of items (specified as the event parameter)
KICAD_T Type() const
Returns the type of object.
virtual bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
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
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).
Base class for any item which can be embedded within the SCHEMATIC container class,...
bool ResolveExcludedFromPosFiles(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const
bool ResolveExcludedFromBOM(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const
bool ResolveExcludedFromBoard(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const
bool ResolveDNP(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const
bool ResolveExcludedFromSim(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
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.
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
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
wxString GetPageNumber() const
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
const LIB_ID & GetLibId() const override
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
virtual wxString GetShownText(const SCH_SHEET_PATH *aPath, RESOLUTION_CONTEXT aContext, int aDepth=0) const
std::vector< std::tuple< wxString, int, wxListColumnFormat > > m_columns
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
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
Class to handle a set of SCH_ITEMs.
std::vector< EDA_ITEM * > EDA_ITEMS
SELECTION_ZOOM selection_zoom
bool search_hidden_fields
EDA_SEARCH_MATCH_MODE matchMode
bool searchCurrentSheetOnly
SCH_SHEET_PATH * sheetPath
@ FOOTPRINT
Field Name Module PCB, i.e. "16DIP300".
@ VALUE
Field Value of part, i.e. "3.3K".