KiCad PCB EDA Suite
find.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 (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
5  * Copyright (C) 2008-2016 Wayne Stambaugh <stambaughw@verizon.net>
6  * Copyright (C) 2004-2016 KiCad Developers, see change_log.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
31 /*
32  * Search a text (text, value, reference) within a component or
33  * search a component in libraries, a marker ...,
34  * in current sheet or whole the project
35  */
36 #include <fctsys.h>
37 #include <pgm_base.h>
38 #include <class_drawpanel.h>
39 #include <confirm.h>
40 #include <kicad_string.h>
41 #include <gestfich.h>
42 #include <schframe.h>
43 #include <base_units.h>
44 
45 #include <general.h>
46 #include <class_library.h>
47 #include <lib_pin.h>
48 #include <sch_marker.h>
49 #include <sch_component.h>
50 #include <sch_sheet.h>
51 #include <sch_sheet_path.h>
52 
53 #include <kicad_device_context.h>
54 
56 
57 
58 void SCH_EDIT_FRAME::OnFindDrcMarker( wxFindDialogEvent& event )
59 {
60  static SCH_MARKER* lastMarker = NULL;
61 
62  wxString msg;
63  SCH_SHEET_LIST schematic( g_RootSheet );
64  SCH_SHEET_PATH* sheetFoundIn = NULL;
65  bool wrap = ( event.GetFlags() & FR_SEARCH_WRAP ) != 0;
66  bool warpCursor = ( ( event.GetId() == wxEVT_COMMAND_FIND_CLOSE ) ||
67  !( event.GetFlags() & FR_NO_WARP_CURSOR ) );
68 
69  if( event.GetFlags() & FR_CURRENT_SHEET_ONLY )
70  {
71  sheetFoundIn = m_CurrentSheet;
72  lastMarker = (SCH_MARKER*) m_CurrentSheet->FindNextItem( SCH_MARKER_T, lastMarker, wrap );
73  }
74  else
75  {
76  lastMarker = (SCH_MARKER*) schematic.FindNextItem( SCH_MARKER_T, &sheetFoundIn,
77  lastMarker, wrap );
78  }
79 
80  if( lastMarker != NULL )
81  {
82  if( *sheetFoundIn != *m_CurrentSheet )
83  {
84  sheetFoundIn->LastScreen()->SetZoom( GetScreen()->GetZoom() );
85  *m_CurrentSheet = *sheetFoundIn;
87  }
88 
89  SetCrossHairPosition( lastMarker->GetPosition() );
90 
91  RedrawScreen( lastMarker->GetPosition(), warpCursor );
92 
93  wxString path = sheetFoundIn->Path();
94  wxString units = GetAbbreviatedUnitsLabel();
95  double x = To_User_Unit( g_UserUnit, (double) lastMarker->GetPosition().x );
96  double y = To_User_Unit( g_UserUnit, (double) lastMarker->GetPosition().y );
97  msg.Printf( _( "Design rule check marker found in sheet %s at %0.3f%s, %0.3f%s" ),
98  GetChars( path ), x, GetChars( units ), y, GetChars( units) );
99  SetStatusText( msg );
100  }
101  else
102  {
103  SetStatusText( _( "No more markers were found." ) );
104  }
105 }
106 
107 
108 SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference,
109  bool aSearchHierarchy,
110  SCH_SEARCH_T aSearchType,
111  const wxString& aSearchText,
112  bool aWarpMouse )
113 {
114  SCH_SHEET_PATH* sheet = NULL;
115  SCH_SHEET_PATH* sheetWithComponentFound = NULL;
116  SCH_ITEM* item = NULL;
117  SCH_COMPONENT* Component = NULL;
118  wxPoint pos;
119  bool centerAndRedraw = false;
120  bool notFound = true;
121  LIB_PIN* pin;
122  SCH_SHEET_LIST sheetList( g_RootSheet );
123 
124  if( !aSearchHierarchy )
125  sheetList.push_back( *m_CurrentSheet );
126  else
127  sheetList.BuildSheetList( g_RootSheet );
128 
129  for( SCH_SHEET_PATHS_ITER it = sheetList.begin(); it != sheetList.end(); ++it )
130  {
131  sheet = &(*it);
132  item = (*it).LastDrawList();
133 
134  for( ; ( item != NULL ) && ( notFound == true ); item = item->Next() )
135  {
136  if( item->Type() != SCH_COMPONENT_T )
137  continue;
138 
139  SCH_COMPONENT* pSch = (SCH_COMPONENT*) item;
140 
141  if( aReference.CmpNoCase( pSch->GetRef( sheet ) ) == 0 )
142  {
143  Component = pSch;
144  sheetWithComponentFound = sheet;
145 
146  switch( aSearchType )
147  {
148  default:
149  case FIND_COMPONENT_ONLY: // Find component only
150  notFound = false;
151  pos = pSch->GetPosition();
152  break;
153 
154  case FIND_PIN: // find a pin
155  pos = pSch->GetPosition(); // temporary: will be changed if the pin is found.
156  pin = pSch->GetPin( aSearchText );
157 
158  if( pin == NULL )
159  break;
160 
161  notFound = false;
162  pos += pin->GetPosition();
163  break;
164 
165  case FIND_REFERENCE: // find reference
166  notFound = false;
167  pos = pSch->GetField( REFERENCE )->GetPosition();
168  break;
169 
170  case FIND_VALUE: // find value
171  pos = pSch->GetPosition();
172 
173  if( aSearchText.CmpNoCase( pSch->GetField( VALUE )->GetShownText() ) != 0 )
174  break;
175 
176  notFound = false;
177  pos = pSch->GetField( VALUE )->GetPosition();
178  break;
179  }
180  }
181  }
182 
183  if( notFound == false )
184  break;
185  }
186 
187  if( Component )
188  {
189  sheet = sheetWithComponentFound;
190 
191  if( *sheet != *m_CurrentSheet )
192  {
193  sheet->LastScreen()->SetZoom( GetScreen()->GetZoom() );
194  *m_CurrentSheet = *sheet;
196  centerAndRedraw = true;
197  }
198 
199  wxPoint delta;
200  pos -= Component->GetPosition();
201  delta = Component->GetTransform().TransformCoordinate( pos );
202  pos = delta + Component->GetPosition();
203 
204 
205  /* There may be need to reframe the drawing */
206  if( ! m_canvas->IsPointOnDisplay( pos ) )
207  {
208  centerAndRedraw = true;
209  }
210 
211  if( centerAndRedraw )
212  {
213  SetCrossHairPosition( pos );
214  RedrawScreen( pos, aWarpMouse );
215  }
216 
217  else
218  {
220 
221  m_canvas->CrossHairOff( &dc );
222 
223  if( aWarpMouse )
224  m_canvas->MoveCursor( pos );
225 
226  SetCrossHairPosition( pos );
227 
228  m_canvas->CrossHairOn( &dc );
229  }
230  }
231 
232 
233  /* Print diag */
234  wxString msg_item;
235  wxString msg;
236 
237  switch( aSearchType )
238  {
239  default:
240  case FIND_COMPONENT_ONLY: // Find component only
241  msg_item = _( "component" );
242  break;
243 
244  case FIND_PIN: // find a pin
245  msg_item.Printf( _( "pin %s" ), GetChars( aSearchText ) );
246  break;
247 
248  case FIND_REFERENCE: // find reference
249  msg_item.Printf( _( "reference %s" ), GetChars( aSearchText ) );
250  break;
251 
252  case FIND_VALUE: // find value
253  msg_item.Printf( _( "value %s" ), GetChars( aSearchText ) );
254  break;
255 
256  case FIND_FIELD: // find field. todo
257  msg_item.Printf( _( "field %s" ), GetChars( aSearchText ) );
258  break;
259  }
260 
261  if( Component )
262  {
263  if( !notFound )
264  {
265  msg.Printf( _( "%s %s found" ),
266  GetChars( aReference ), GetChars( msg_item ) );
267  }
268  else
269  {
270  msg.Printf( _( "%s found but %s not found" ),
271  GetChars( aReference ), GetChars( msg_item ) );
272  }
273  }
274  else
275  {
276  msg.Printf( _( "Component %s not found" ),
277  GetChars( aReference ) );
278  }
279 
280  SetStatusText( msg );
281 
282  return item;
283 }
284 
285 
287 {
288  PART_LIBS* libs = Prj().SchLibs();
289  int mod_hash = libs->GetModifyHash();
290 
291  // the cache is obsolete whenever any library changes.
292  if( mod_hash != m_foundItems.GetLibHash() )
293  {
295  m_foundItems.SetLibHash( mod_hash );
296  return true;
297  }
298  else if( m_foundItems.IsSearchRequired( aSearchCriteria ) )
299  return true;
300  else
301  return false;
302 }
303 
304 
305 void SCH_EDIT_FRAME::OnFindSchematicItem( wxFindDialogEvent& aEvent )
306 {
307  SCH_FIND_REPLACE_DATA searchCriteria;
309 
310  searchCriteria.SetFlags( aEvent.GetFlags() );
311  searchCriteria.SetFindString( aEvent.GetFindString() );
312  searchCriteria.SetReplaceString( aEvent.GetReplaceString() );
313 
314  if( aEvent.GetEventType() == wxEVT_COMMAND_FIND_CLOSE )
315  {
316  if( m_foundItems.GetCount() == 0 )
317  return;
318 
319  // Refresh the search cache in case something has changed. This prevents any stale
320  // pointers from crashing Eeschema when the wxEVT_FIND_CLOSE event is handled.
321  if( IsSearchCacheObsolete( searchCriteria ) )
322  {
323  if( aEvent.GetFlags() & FR_CURRENT_SHEET_ONLY && g_RootSheet->CountSheets() > 1 )
324  {
325  m_foundItems.Collect( searchCriteria, m_CurrentSheet );
326  }
327  else
328  {
329  m_foundItems.Collect( searchCriteria );
330  }
331  }
332  }
333  else if( IsSearchCacheObsolete( searchCriteria ) )
334  {
335  if( aEvent.GetFlags() & FR_CURRENT_SHEET_ONLY && g_RootSheet->CountSheets() > 1 )
336  {
337  m_foundItems.Collect( searchCriteria, m_CurrentSheet );
338  }
339  else
340  {
341  m_foundItems.Collect( searchCriteria );
342  }
343  }
344  else
345  {
346  EDA_ITEM* currentItem = m_foundItems.GetItem( data );
347 
348  if( currentItem != NULL )
349  currentItem->SetForceVisible( false );
350 
352  }
353 
354  updateFindReplaceView( aEvent );
355 }
356 
357 
358 void SCH_EDIT_FRAME::OnFindReplace( wxFindDialogEvent& aEvent )
359 {
360  static int nextFoundIndex = 0;
361  SCH_ITEM* item;
362  SCH_SHEET_PATH* sheet;
363  SCH_SHEET_LIST schematic( g_RootSheet );
365  SCH_FIND_REPLACE_DATA searchCriteria;
366 
367  searchCriteria.SetFlags( aEvent.GetFlags() );
368  searchCriteria.SetFindString( aEvent.GetFindString() );
369  searchCriteria.SetReplaceString( aEvent.GetReplaceString() );
370  m_foundItems.SetReplaceString( aEvent.GetReplaceString() );
371 
372  if( IsSearchCacheObsolete( searchCriteria ) )
373  {
374  if( aEvent.GetFlags() & FR_CURRENT_SHEET_ONLY && g_RootSheet->CountSheets() > 1 )
375  {
376  m_foundItems.Collect( searchCriteria, m_CurrentSheet );
377  }
378  else
379  {
380  m_foundItems.Collect( searchCriteria );
381  }
382 
383  // Restore the next found index on cache refresh. Prevents single replace events
384  // from starting back at the beginning of the cache.
385  m_foundItems.SetFoundIndex( nextFoundIndex );
386  }
387 
388  if( aEvent.GetEventType() == wxEVT_COMMAND_FIND_REPLACE_ALL )
389  {
390  while( ( item = (SCH_ITEM*) m_foundItems.GetItem( data ) ) != NULL )
391  {
392  SCH_ITEM* undoItem = data.GetParent();
393 
394  // Don't save child items in undo list.
395  if( undoItem == NULL )
396  undoItem = item;
397 
398  SetUndoItem( undoItem );
399 
400  sheet = schematic.GetSheetByPath( data.GetSheetPath() );
401 
402  wxCHECK_RET( sheet != NULL, wxT( "Could not find sheet path " ) + data.GetSheetPath() );
403 
404  if( m_foundItems.ReplaceItem( sheet ) )
405  {
406  OnModify();
407  SaveUndoItemInUndoList( undoItem );
408  updateFindReplaceView( aEvent );
409  }
410 
412 
413  if( m_foundItems.PassedEnd() )
414  break;
415  }
416  }
417  else
418  {
419  item = (SCH_ITEM*) m_foundItems.GetItem( data );
420 
421  wxCHECK_RET( item != NULL, wxT( "Invalid replace item in find collector list." ) );
422 
423  SCH_ITEM* undoItem = data.GetParent();
424 
425  if( undoItem == NULL )
426  undoItem = item;
427 
428  SetUndoItem( undoItem );
429 
430  sheet = schematic.GetSheetByPath( data.GetSheetPath() );
431 
432  wxCHECK_RET( sheet != NULL, wxT( "Could not find sheet path " ) + data.GetSheetPath() );
433 
434  if( m_foundItems.ReplaceItem( sheet ) )
435  {
436  OnModify();
437  SaveUndoItemInUndoList( undoItem );
438  updateFindReplaceView( aEvent );
439  }
440 
442  nextFoundIndex = m_foundItems.GetFoundIndex();
443  }
444 
445  // End the replace if we are at the end if the list. This prevents an infinite loop if
446  // wrap search is selected and all of the items have been replaced with a value that
447  // still satisfies the search criteria.
448  if( m_foundItems.PassedEnd() )
449  aEvent.SetFlags( aEvent.GetFlags() & ~FR_REPLACE_ITEM_FOUND );
450 }
451 
452 
453 void SCH_EDIT_FRAME::updateFindReplaceView( wxFindDialogEvent& aEvent )
454 {
455  wxString msg;
456  SCH_SHEET_LIST schematic( g_RootSheet );
458  SCH_FIND_REPLACE_DATA searchCriteria;
459  bool warpCursor = !( aEvent.GetFlags() & FR_NO_WARP_CURSOR );
460 
461  searchCriteria.SetFlags( aEvent.GetFlags() );
462  searchCriteria.SetFindString( aEvent.GetFindString() );
463  searchCriteria.SetReplaceString( aEvent.GetReplaceString() );
464 
465  if( m_foundItems.GetItem( data ) != NULL )
466  {
467  wxLogTrace( traceFindReplace, wxT( "Found " ) + m_foundItems.GetText() );
468 
469  SCH_SHEET_PATH* sheet = schematic.GetSheetByPath( data.GetSheetPath() );
470 
471  wxCHECK_RET( sheet != NULL, wxT( "Could not find sheet path " ) +
472  data.GetSheetPath() );
473 
474  SCH_ITEM* item = (SCH_ITEM*)m_foundItems.GetItem( data );
475 
476  // Make the item temporarily visible just in case it's hide flag is set. This
477  // has no effect on objects that don't support hiding. If this is a close find
478  // dialog event, clear the temporary visibility flag.
479  if( item )
480  {
481  if( aEvent.GetEventType() == wxEVT_COMMAND_FIND_CLOSE )
482  item->SetForceVisible( false );
483  else if( item->Type() == SCH_FIELD_T && !( (SCH_FIELD*) item )->IsVisible() )
484  item->SetForceVisible( true );
485  }
486 
487  if( sheet->PathHumanReadable() != m_CurrentSheet->PathHumanReadable() )
488  {
489  sheet->LastScreen()->SetZoom( GetScreen()->GetZoom() );
490  *m_CurrentSheet = *sheet;
492  SetScreen( sheet->LastScreen() );
493  }
494 
495  // careful here
497 
498  RedrawScreen( data.GetPosition(), warpCursor );
499 
500  msg = m_foundItems.GetText();
501 
502  if( aEvent.GetFlags() & FR_SEARCH_REPLACE )
503  aEvent.SetFlags( aEvent.GetFlags() | FR_REPLACE_ITEM_FOUND );
504  }
505  else
506  {
507  if( aEvent.GetFlags() & FR_SEARCH_REPLACE )
508  aEvent.SetFlags( aEvent.GetFlags() & ~FR_REPLACE_ITEM_FOUND );
509 
510  msg.Printf( _( "No item found matching %s." ), GetChars( aEvent.GetFindString() ) );
511  }
512 
513  SetStatusText( msg );
514 }
Definition of the SCH_SHEET class for Eeschema.
void OnFindDrcMarker(wxFindDialogEvent &event)
Definition: find.cpp:58
Class SCH_SHEET_LIST.
int GetCount() const
Function GetCount returns the number of objects in the list.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:198
Class SCH_FIELD instances are attached to a component and provide a place for the component's value...
Definition: sch_field.h:56
TRANSFORM & GetTransform() const
bool IsSearchRequired(const SCH_FIND_REPLACE_DATA &aFindReplaceData)
Function IsSearchRequired checks the current collector state against aFindReplaceData to see if a new...
Find an item by it's reference designator.
Definition: schframe.h:106
SCH_SHEET_PATHS::iterator SCH_SHEET_PATHS_ITER
This file is part of the common library TODO brief description.
SCH_ITEM * FindNextItem(KICAD_T aType, SCH_SHEET_PATH **aSheetFound=NULL, SCH_ITEM *aLastItem=NULL, bool aWrap=true)
Function FindNextItem searches the entire schematic for the next schematic object.
Implementation of conversion functions that require both schematic and board internal units...
This file is part of the common library.
void OnModify()
Function OnModify Must be called after a schematic change in order to set the "modify" flag of the cu...
Definition: schframe.cpp:762
void SetFoundIndex(int aIndex)
wxPoint GetPosition() const override
Function GetPosition.
Definition: sch_marker.h:104
void SetScreen(BASE_SCREEN *aScreen)
Definition: draw_frame.h:140
int CountSheets()
Function CountSheets calculates the number of sheets found in "this" this number includes the full su...
Definition: sch_sheet.cpp:828
wxString GetSheetPath() const
wxPoint GetPosition() const override
Function GetPosition.
Definition: sch_field.cpp:596
SCH_FIND_COLLECTOR m_foundItems
List of find/replace items.
Definition: schframe.h:143
Find a component field.
Definition: schframe.h:108
int GetModifyHash()
Return the modification hash for all libraries.
Used by the search event handler to let the dialog know that a replaceable item has been found...
LIB_PIN * GetPin(const wxString &number)
Function GetPin finds a component pin by number.
SCH_SCREEN * LastScreen() const
Function LastScreen.
Wrap around the beginning or end of search list.
void MoveCursor(const wxPoint &aPosition)
Function MoveCursor moves the mouse pointer to aPosition in logical (drawing) units.
Definition: draw_panel.cpp:354
void UpdateAllScreenReferences()
Function UpdateAllScreenReferences updates the reference and the m_Multi parameter (part selection) f...
Class SCH_FIND_COLLECTOR_DATA is used as a data container for the associated item found by the SCH_FI...
int GetLibHash() const
SCH_ITEM * Next() const
Field Reference of part, i.e. "IC21".
static const int delta[8][2]
Definition: solve.cpp:112
void SaveUndoItemInUndoList(SCH_ITEM *aItem)
Function SaveUndoItemInUndoList swaps the cloned item in member variable m_undoItem with aItem and sa...
Definition: schframe.cpp:598
void updateFindReplaceView(wxFindDialogEvent &aEvent)
Definition: find.cpp:453
Find a component pin in the schematic.
Definition: schframe.h:105
wxString Path() const
Function Path the path uses the time stamps which do not changes even when editing sheet parameters a...
virtual wxString GetShownText() const
Returns the string actually shown after processing of the base text.
Definition: eda_text.h:135
wxPoint TransformCoordinate(const wxPoint &aPoint) const
Calculate a new coordinate according to the mirror/rotation transform.
Definition: transform.cpp:41
SCH_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: schframe.cpp:521
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
SCH_SHEET_PATH * m_CurrentSheet
which sheet we are presently working on.
Definition: schframe.h:120
void SetLibHash(int aHash)
void OnFindSchematicItem(wxFindDialogEvent &aEvent)
Function OnFindSchematicItem finds an item in the schematic matching the search criteria in aEvent...
Definition: find.cpp:305
wxPoint GetPosition() const
bool IsPointOnDisplay(const wxPoint &aPosition)
Function IsPointOnDisplay.
Definition: draw_panel.cpp:288
SCH_ITEM * GetParent() const
const wxString traceFindReplace
Flag to enable find and replace tracing using the WXTRACE environment variable.
a helper to handle the real device context used in KiCad
void SetForceSearch(bool doSearch=true)
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:54
SCH_FIELD * GetField(int aFieldNdx) const
Function GetField returns a field.
void UpdateIndex()
Function UpdateIndex updates the list index according to the current find and replace criteria...
bool ReplaceItem(SCH_SHEET_PATH *aSheetPath=NULL)
Function ReplaceItem performs a string replace of the item at the current index.
Subclass of DIALOG_SCH_FIND_BASE, which is generated by wxFormBuilder.
void SetForceVisible(bool aEnable)
Function SetForceVisible is used to set and cleag force visible flag used to force the item to be dra...
Definition: base_struct.h:265
wxString PathHumanReadable() const
Function PathHumanReadable returns the sheet path in a human readable form, i.e.
wxString GetAbbreviatedUnitsLabel(EDA_UNITS_T aUnit)
Definition: base_units.cpp:479
double GetZoom()
Function GetZoom.
Definition: draw_frame.cpp:480
SCH_ITEM * FindComponentAndItem(const wxString &aReference, bool aSearchHierarchy, SCH_SEARCH_T aSearchType, const wxString &aSearchText, bool aWarpMouse)
Function FindComponentAndItem finds a component in the schematic and an item in this component...
Definition: find.cpp:108
bool SetZoom(double iu_per_du)
Function SetZoom adjusts the current zoom factor.
Class SCH_SHEET_PATH.
bool IsSearchCacheObsolete(const SCH_FIND_REPLACE_DATA &aSearchCriteria)
Definition: find.cpp:286
Search the current sheet only.
void BuildSheetList(SCH_SHEET *aSheet)
Function BuildSheetList builds the list of sheets and their sheet path from aSheet.
void CrossHairOff(wxDC *DC)
Definition: draw_panel.cpp:253
SCH_ITEM * FindNextItem(KICAD_T aType, SCH_ITEM *aLastItem=NULL, bool aWrap=false) const
Find the next schematic item in this sheet object.
wxPoint GetPosition() const override
Function GetPosition returns the current draw object position.
Definition: lib_pin.h:471
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
Class PART_LIBS is a collection of PART_LIBs.
Field Value of part, i.e. "3.3K".
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
Find an item by it's value field.
Definition: schframe.h:107
void RedrawScreen(const wxPoint &aCenterPoint, bool aWarpPointer)
Function RedrawScreen redraws the entire screen area by updating the scroll bars and mouse pointer in...
Definition: zoom.cpp:46
const wxString GetRef(const SCH_SHEET_PATH *sheet)
Function GetRef returns the reference, for the given sheet path.
Definition the SCH_COMPONENT class for Eeschema.
void CrossHairOn(wxDC *DC)
Definition: draw_panel.cpp:260
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
see class PGM_BASE
void SetReplaceString(const wxString &aReplaceString)
Update the replace string without changing anything else.
Don't warp cursor to found item until the dialog is closed.
Find a component in the schematic.
Definition: schframe.h:104
int GetFoundIndex() const
SCH_SHEET_PATH * GetSheetByPath(const wxString aPath, bool aHumanReadable=true)
Function GetSheetByPath returns a sheet matching the path name in aPath.
#define INSTALL_UNBUFFERED_DC(name, parent)
void Collect(SCH_FIND_REPLACE_DATA &aFindReplaceData, SCH_SHEET_PATH *aSheetPath=NULL)
Function Collect scans aSheetPath using this class's Inspector method for items matching aFindReplace...
EDA_ITEM * GetItem(SCH_FIND_COLLECTOR_DATA &aFindData)
Function GetItem returns the item and associated data of the current index.
Class SCH_FIND_REPLACE_DATA adds missing useful comparison and assignment operators to the wxFindRepl...
SCH_SEARCH_T
Schematic search type used by the socket link with Pcbnew.
Definition: schframe.h:103
Perform a search for a item that has replaceable text.
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:69
wxPoint GetPosition() const override
Function GetPosition.
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:151
double To_User_Unit(EDA_UNITS_T aUnit, double aValue)
Function To_User_Unit convert aValue in internal units to the appropriate user units defined by aUnit...
Definition: base_units.cpp:90
wxString GetText()
Function GetText()
void SetUndoItem(const SCH_ITEM *aItem)
Function SetUndoItem clones aItem which can be used to restore the state of the item being edited whe...
Definition: schframe.cpp:580
Definition for part library class.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
void SetCrossHairPosition(const wxPoint &aPosition, bool aSnapToGrid=true)
Function SetCrossHairPosition sets the screen cross hair position to aPosition in logical (drawing) u...
bool PassedEnd() const
Function PassedEnd tests if m_foundIndex is beyond the end of the list give the current find/replace ...
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
void OnFindReplace(wxFindDialogEvent &aEvent)
Function OnReplace performs a search and replace of text in an item in the schematic matching the sea...
Definition: find.cpp:358