53 && aItem->
Matches( data, aSheet )
106 else if( selectedOnly )
134 bool past_item = !aAfter;
135 std::vector<SCH_ITEM*> sorted_items;
140 sorted_items.push_back( item );
147 sorted_items.push_back( &field );
150 sorted_items.push_back(
pin );
157 sorted_items.push_back( &field );
160 sorted_items.push_back(
pin );
167 sorted_items.push_back( &field );
172 for(
EDA_ITEM* item : m_selectionTool->GetSelection() )
173 addItem(
static_cast<SCH_ITEM*
>( item ) );
175 for(
SCH_ITEM* item : aScreen->Items() )
178 std::sort( sorted_items.begin(), sorted_items.end(),
181 if( a->GetPosition().x == b->GetPosition().x )
184 if( a->GetPosition().y == b->GetPosition().y )
185 return a->m_Uuid < b->m_Uuid;
187 return a->GetPosition().y < b->GetPosition().y;
194 std::reverse( sorted_items.begin(), sorted_items.end() );
196 for(
SCH_ITEM* item : sorted_items )
207 if( item->Matches( aData, aSheet ) )
219 bool searchAllSheets =
false;
220 bool selectedOnly =
false;
231 catch(
const std::bad_cast& )
242 afterSheet =
nullptr;
248 if( afterSheet || !searchAllSheets )
254 if( !item && searchAllSheets )
264 paths.push_back( sheet );
270 std::reverse( paths.begin(), paths.end() );
277 afterSheet =
nullptr;
282 item =
nextMatch( sheet.LastScreen(), &sheet,
nullptr, data, isReversed );
326 wxString msg = searchAllSheets ?
_(
"Reached end of schematic." )
327 :
_(
"Reached end of sheet." );
331 _(
"Find again to wrap around to the start." ), 4000 );
373 if( item->
Replace( data, sheet ) )
390 bool currentSheetOnly =
false;
391 bool selectedOnly =
false;
399 catch(
const std::bad_cast& )
403 bool modified =
false;
414 if( aItem->
Replace( aData, aSheet ) )
421 if( currentSheetOnly || selectedOnly )
430 doReplace( item, currentSheet, data );
444 for(
unsigned ii = 0; ii < sheets.size(); ++ii )
452 doReplace( item, &sheets[0], data );
460 switch( field->
GetId() )
466 doReplace( field, &sheets[ii], data );
476 item =
nextMatch( screen, &sheets[ii], item, data,
false );
static TOOL_ACTION replaceAll
static TOOL_ACTION updateFind
static TOOL_ACTION findPrevious
static TOOL_ACTION findAndReplace
static TOOL_ACTION replaceAndFindNext
static TOOL_ACTION findNext
static TOOL_ACTION findNextMarker
constexpr const Vec GetCenter() const
void FocusOnLocation(const VECTOR2I &aPos)
Useful to focus on a particular location, in find functions.
EDA_SEARCH_DATA & GetFindReplaceData()
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
A base class for most all the KiCad significant classes used in schematics and boards.
virtual VECTOR2I GetPosition() const
virtual const BOX2I GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
KICAD_T Type() const
Returns the type of object.
void SetForceVisible(bool aEnable)
Set and clear force visible flag used to force the item to be drawn even if it's draw attribute is se...
virtual bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
EDA_ITEM * GetParent() const
bool IsBrightened() const
static bool Replace(const EDA_SEARCH_DATA &aSearchData, wxString &aText)
Perform a text replace on aText using the find and replace criteria in aSearchData on items that supp...
static const TOOL_EVENT ClearedEvent
static const TOOL_EVENT SelectedEvent
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
static const TOOL_EVENT PointSelectedEvent
static const TOOL_EVENT UnselectedEvent
void UpdateItems()
Iterate through the list of items that asked for updating and updates them.
SCH_SHEET_PATH & CurrentSheet() const override
void SetCurrentSheet(const SCH_SHEET_PATH &aPath) override
SCH_SHEET_LIST Hierarchy() const override
Return the full schematic flattened hierarchical sheet list.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
KIGFX::SCH_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag and update other data struc...
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void ShowFindReplaceDialog(bool aReplace)
Run the Find or Find & Replace dialog.
void SaveCopyInUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItemToCopy, UNDO_REDO aTypeCommand, bool aAppend, bool aDirtyConnectivity=true)
Create a copy of the current schematic item, and put it in the undo list.
void ClearFindReplaceStatus()
SCH_SHEET_PATH & GetCurrentSheet() const
SCHEMATIC & Schematic() const
void updateTitle()
Set the main window title bar text.
void ShowFindReplaceStatus(const wxString &aMsg, int aStatusTime)
void DisplayCurrentSheet()
Draw the current sheet on the display.
void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false, bool aUpdateRtree=false) override
Mark an item for refresh.
DIALOG_SCH_FIND * m_findReplaceDialog
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Base class for any item which can be embedded within the SCHEMATIC container class,...
std::vector< SCH_FIELD > & GetFields()
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
void BuildClientSheetPathList()
built the list of sheet paths sharing a screen for each screen in use
double m_LastZoomLevel
last value for the zoom level, useful in Eeschema when changing the current displayed sheet to reuse ...
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void SortByPageNumbers(bool aUpdateVirtualPageNums=true)
Sort the list of sheets by page number.
SCH_SHEET_LIST FindAllSheetsForScreen(const SCH_SCREEN *aScreen) const
Return a SCH_SHEET_LIST with a copy of all the SCH_SHEET_PATH using a particular screen.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
size_t GetCurrentHash() const
void UpdateAllScreenReferences() const
Update all the symbol references for this sheet path.
SCH_SCREEN * LastScreen()
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
std::vector< SCH_FIELD > & GetFields()
std::vector< SCH_SHEET_PIN * > & GetPins()
std::vector< SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve a list of the SCH_PINs for the given sheet path.
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly)
Populate a std::vector with SCH_FIELDs.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
bool searchCurrentSheetOnly
@ FOOTPRINT_FIELD
Field Name Module PCB, i.e. "16DIP300".
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".