36 std::vector<long> item = { aItemRow };
46 std::vector<SCH_SHEET_PATH*> paths;
55 paths.push_back( &sheet );
60 for(
SCH_ITEM* item : sheet->LastScreen()->Items() )
62 if( aCollector( item, sheet ) )
71 std::vector<SCH_ITEM*> selection;
73 for(
long i = 0; i < (long)
m_hitlist.size(); ++i )
79 int col = std::max( 0, aCol );
88 return StrNumCmp( getResultCell( a, col ), getResultCell( b, col ), true ) < 0;
90 return StrNumCmp( getResultCell( b, col ), getResultCell( a, col ), true ) < 0;
95 for(
long i = 0; i < (long)
m_hitlist.size(); ++i )
98 aSelection->push_back( i );
106 std::vector<SCH_SEARCH_HIT> selectedHits;
110 for(
long row : aItemRows )
112 if( row >= 0 && row < (
long)
m_hitlist.size() )
114 selectedHits.emplace_back(
m_hitlist[row] );
115 selectedItems.emplace_back(
m_hitlist[row].item );
119 if( selectedHits.empty() )
122 bool allHitsOnSamePage = std::all_of( selectedHits.begin() + 1, selectedHits.end(),
125 return r.sheetPath == selectedHits.front().sheetPath;
130 if( allHitsOnSamePage && !selectedHits.empty() )
137 if( selectedItems.size() )
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(
"DNP" ), 2, wxLIST_FORMAT_CENTER );
170 m_columns.emplace_back(
_HKI(
"Library Link" ), 8, wxLIST_FORMAT_LEFT );
171 m_columns.emplace_back(
_HKI(
"Library Description" ), 10, wxLIST_FORMAT_LEFT );
187 frp.
matchMode = EDA_SEARCH_MATCH_MODE::PERMISSIVE;
203 if( frp.
findString.IsEmpty() || field.Matches( frp, sheet ) )
222 return wxEmptyString;
243 return sym->
ResolveDNP() ? wxS(
"X" ) : wxS(
" " );
244 else if( aCol == 10 )
246 else if( aCol == 11 )
249 return wxEmptyString;
256 m_columns.emplace_back(
_HKI(
"Reference" ), 2, wxLIST_FORMAT_LEFT );
257 m_columns.emplace_back(
_HKI(
"Value" ), 6, wxLIST_FORMAT_LEFT );
258 m_columns.emplace_back(
_HKI(
"Page" ), 1, wxLIST_FORMAT_CENTER );
259 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
260 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER );
276 frp.
matchMode = EDA_SEARCH_MATCH_MODE::PERMISSIVE;
292 if( frp.
findString.IsEmpty() || field.Matches( frp, sheet ) )
311 return wxEmptyString;
324 return wxEmptyString;
331 m_columns.emplace_back(
_HKI(
"Type" ), 2, wxLIST_FORMAT_LEFT );
332 m_columns.emplace_back(
_HKI(
"Text" ), 12, wxLIST_FORMAT_LEFT );
333 m_columns.emplace_back(
_HKI(
"Page" ), 1, wxLIST_FORMAT_CENTER );
334 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
335 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER );
351 frp.
matchMode = EDA_SEARCH_MATCH_MODE::PERMISSIVE;
379 return wxEmptyString;
397 return wxEmptyString;
400 return _(
"Text Box" );
412 return wxEmptyString;
419 m_columns.emplace_back(
_HKI(
"Type" ), 2, wxLIST_FORMAT_LEFT );
420 m_columns.emplace_back(
_HKI(
"Name" ), 6, wxLIST_FORMAT_LEFT );
421 m_columns.emplace_back(
_HKI(
"Page" ), 2, wxLIST_FORMAT_CENTER );
422 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
423 m_columns.emplace_back( wxT(
"Y" ), 3 , wxLIST_FORMAT_CENTER);
439 frp.
matchMode = EDA_SEARCH_MATCH_MODE::PERMISSIVE;
445 if( item->
IsType( { SCH_LABEL_LOCATE_ANY_T } ) )
449 wxCHECK( lbl,
false );
469 return wxEmptyString;
474 return _HKI(
"Local" );
476 return _HKI(
"Global" );
478 return _HKI(
"Hierarchical" );
480 return _HKI(
"Directive" );
491 return wxEmptyString;
498 m_columns.emplace_back(
_HKI(
"Name" ), 6, wxLIST_FORMAT_LEFT );
499 m_columns.emplace_back(
_HKI(
"Page" ), 2, wxLIST_FORMAT_CENTER );
500 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
501 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER);
517 frp.
matchMode = EDA_SEARCH_MATCH_MODE::PERMISSIVE;
523 if( item->
IsType( { SCH_GROUP_T } ) )
545 return wxEmptyString;
548 return group->GetName();
556 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)
virtual APP_SETTINGS_BASE * config() const
Return the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
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
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
Schematic editor (Eeschema) main window.
SCH_SHEET_PATH & GetCurrentSheet() const
SCHEMATIC & Schematic() const
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, 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 ResolveExcludedFromBOM() const
bool ResolveExcludedFromBoard() const
bool ResolveExcludedFromSim() const
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
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.
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
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
wxString GetDescription() const override
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
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, bool aAllowExtraText, int aDepth=0) const
VECTOR2I GetPosition() const override
virtual wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, 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
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
std::vector< EDA_ITEM * > EDA_ITEMS
Define list of drawing items for screens.
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
Class to handle a set of SCH_ITEMs.
SELECTION_ZOOM selection_zoom
bool search_hidden_fields
EDA_SEARCH_MATCH_MODE matchMode
bool searchCurrentSheetOnly
SCH_SHEET_PATH * sheetPath