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 Wayne Stambaugh <stambaughw@gmail.com>
6  * Copyright (C) 2004-2017 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 #include <symbol_lib_table.h>
53 
54 #include <kicad_device_context.h>
55 
57 
58 
59 void SCH_EDIT_FRAME::OnFindDrcMarker( wxFindDialogEvent& event )
60 {
61  static SCH_MARKER* lastMarker = NULL;
62 
63  wxString msg;
64  SCH_SHEET_LIST schematic( g_RootSheet );
65  SCH_SHEET_PATH* sheetFoundIn = NULL;
66  bool wrap = ( event.GetFlags() & FR_SEARCH_WRAP ) != 0;
67  bool warpCursor = ( ( event.GetId() == wxEVT_COMMAND_FIND_CLOSE ) ||
68  !( event.GetFlags() & FR_NO_WARP_CURSOR ) );
69 
70  if( event.GetFlags() & FR_CURRENT_SHEET_ONLY )
71  {
72  sheetFoundIn = m_CurrentSheet;
73  lastMarker = (SCH_MARKER*) m_CurrentSheet->FindNextItem( SCH_MARKER_T, lastMarker, wrap );
74  }
75  else
76  {
77  lastMarker = (SCH_MARKER*) schematic.FindNextItem( SCH_MARKER_T, &sheetFoundIn,
78  lastMarker, wrap );
79  }
80 
81  if( lastMarker != NULL )
82  {
83  if( *sheetFoundIn != *m_CurrentSheet )
84  {
85  sheetFoundIn->LastScreen()->SetZoom( GetScreen()->GetZoom() );
86  *m_CurrentSheet = *sheetFoundIn;
88  }
89 
90  SetCrossHairPosition( lastMarker->GetPosition() );
91 
92  RedrawScreen( lastMarker->GetPosition(), warpCursor );
93 
94  wxString path = sheetFoundIn->Path();
95  wxString units = GetAbbreviatedUnitsLabel();
96  double x = To_User_Unit( g_UserUnit, (double) lastMarker->GetPosition().x );
97  double y = To_User_Unit( g_UserUnit, (double) lastMarker->GetPosition().y );
98  msg.Printf( _( "Design rule check marker found in sheet %s at %0.3f%s, %0.3f%s" ),
99  GetChars( path ), x, GetChars( units ), y, GetChars( units) );
100  SetStatusText( msg );
101  }
102  else
103  {
104  SetStatusText( _( "No more markers were found." ) );
105  }
106 }
107 
108 
109 SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference,
110  bool aSearchHierarchy,
111  SCH_SEARCH_T aSearchType,
112  const wxString& aSearchText,
113  bool aWarpMouse )
114 {
115  SCH_SHEET_PATH* sheet = NULL;
116  SCH_SHEET_PATH* sheetWithComponentFound = NULL;
117  SCH_ITEM* item = NULL;
118  SCH_COMPONENT* Component = NULL;
119  wxPoint pos;
120  bool centerAndRedraw = false;
121  bool notFound = true;
122  LIB_PIN* pin;
123  SCH_SHEET_LIST sheetList( g_RootSheet );
124 
125  if( !aSearchHierarchy )
126  sheetList.push_back( *m_CurrentSheet );
127  else
128  sheetList.BuildSheetList( g_RootSheet );
129 
130  for( SCH_SHEET_PATHS_ITER it = sheetList.begin(); it != sheetList.end(); ++it )
131  {
132  sheet = &(*it);
133  item = (*it).LastDrawList();
134 
135  for( ; ( item != NULL ) && ( notFound == true ); item = item->Next() )
136  {
137  if( item->Type() != SCH_COMPONENT_T )
138  continue;
139 
140  SCH_COMPONENT* pSch = (SCH_COMPONENT*) item;
141 
142  if( aReference.CmpNoCase( pSch->GetRef( sheet ) ) == 0 )
143  {
144  Component = pSch;
145  sheetWithComponentFound = sheet;
146 
147  switch( aSearchType )
148  {
149  default:
150  case FIND_COMPONENT_ONLY: // Find component only
151  notFound = false;
152  pos = pSch->GetPosition();
153  break;
154 
155  case FIND_PIN: // find a pin
156  pos = pSch->GetPosition(); // temporary: will be changed if the pin is found.
157  pin = pSch->GetPin( aSearchText );
158 
159  if( pin == NULL )
160  break;
161 
162  notFound = false;
163  pos += pin->GetPosition();
164  break;
165 
166  case FIND_REFERENCE: // find reference
167  notFound = false;
168  pos = pSch->GetField( REFERENCE )->GetPosition();
169  break;
170 
171  case FIND_VALUE: // find value
172  pos = pSch->GetPosition();
173 
174  if( aSearchText.CmpNoCase( pSch->GetField( VALUE )->GetShownText() ) != 0 )
175  break;
176 
177  notFound = false;
178  pos = pSch->GetField( VALUE )->GetPosition();
179  break;
180  }
181  }
182  }
183 
184  if( notFound == false )
185  break;
186  }
187 
188  if( Component )
189  {
190  sheet = sheetWithComponentFound;
191 
192  if( *sheet != *m_CurrentSheet )
193  {
194  sheet->LastScreen()->SetZoom( GetScreen()->GetZoom() );
195  *m_CurrentSheet = *sheet;
197  sheet->LastScreen()->TestDanglingEnds();
198  centerAndRedraw = true;
199  }
200 
201  wxPoint delta;
202  pos -= Component->GetPosition();
203  delta = Component->GetTransform().TransformCoordinate( pos );
204  pos = delta + Component->GetPosition();
205 
206 
207  /* There may be need to reframe the drawing */
208  if( ! m_canvas->IsPointOnDisplay( pos ) )
209  {
210  centerAndRedraw = true;
211  }
212 
213  if( centerAndRedraw )
214  {
215  SetCrossHairPosition( pos );
216  RedrawScreen( pos, aWarpMouse );
217  }
218 
219  else
220  {
222 
223  m_canvas->CrossHairOff( &dc );
224 
225  if( aWarpMouse )
226  m_canvas->MoveCursor( pos );
227 
228  SetCrossHairPosition( pos );
229 
230  m_canvas->CrossHairOn( &dc );
231  }
232  }
233 
234 
235  /* Print diag */
236  wxString msg_item;
237  wxString msg;
238 
239  switch( aSearchType )
240  {
241  default:
242  case FIND_COMPONENT_ONLY: // Find component only
243  msg_item = _( "component" );
244  break;
245 
246  case FIND_PIN: // find a pin
247  msg_item.Printf( _( "pin %s" ), GetChars( aSearchText ) );
248  break;
249 
250  case FIND_REFERENCE: // find reference
251  msg_item.Printf( _( "reference %s" ), GetChars( aSearchText ) );
252  break;
253 
254  case FIND_VALUE: // find value
255  msg_item.Printf( _( "value %s" ), GetChars( aSearchText ) );
256  break;
257 
258  case FIND_FIELD: // find field. todo
259  msg_item.Printf( _( "field %s" ), GetChars( aSearchText ) );
260  break;
261  }
262 
263  if( Component )
264  {
265  if( !notFound )
266  {
267  msg.Printf( _( "%s %s found" ),
268  GetChars( aReference ), GetChars( msg_item ) );
269  }
270  else
271  {
272  msg.Printf( _( "%s found but %s not found" ),
273  GetChars( aReference ), GetChars( msg_item ) );
274  }
275  }
276  else
277  {
278  msg.Printf( _( "Component %s not found" ),
279  GetChars( aReference ) );
280  }
281 
282  SetStatusText( msg );
283 
284  return item;
285 }
286 
287 
289 {
290  int mod_hash = Prj().SchSymbolLibTable()->GetModifyHash();
291 
292  // the cache is obsolete whenever any library changes.
293  if( mod_hash != m_foundItems.GetLibHash() )
294  {
296  m_foundItems.SetLibHash( mod_hash );
297  return true;
298  }
299  else if( m_foundItems.IsSearchRequired( aSearchCriteria ) )
300  return true;
301  else
302  return false;
303 }
304 
305 
306 void SCH_EDIT_FRAME::OnFindSchematicItem( wxFindDialogEvent& aEvent )
307 {
308  SCH_FIND_REPLACE_DATA searchCriteria;
310 
311  searchCriteria.SetFlags( aEvent.GetFlags() );
312  searchCriteria.SetFindString( aEvent.GetFindString() );
313  searchCriteria.SetReplaceString( aEvent.GetReplaceString() );
314 
315  if( aEvent.GetEventType() == wxEVT_COMMAND_FIND_CLOSE )
316  {
317  if( m_foundItems.GetCount() == 0 )
318  return;
319 
320  // Refresh the search cache in case something has changed. This prevents any stale
321  // pointers from crashing Eeschema when the wxEVT_FIND_CLOSE event is handled.
322  if( IsSearchCacheObsolete( searchCriteria ) )
323  {
324  if( aEvent.GetFlags() & FR_CURRENT_SHEET_ONLY && g_RootSheet->CountSheets() > 1 )
325  {
326  m_foundItems.Collect( searchCriteria, m_CurrentSheet );
327  }
328  else
329  {
330  m_foundItems.Collect( searchCriteria );
331  }
332  }
333  }
334  else if( IsSearchCacheObsolete( searchCriteria ) )
335  {
336  if( aEvent.GetFlags() & FR_CURRENT_SHEET_ONLY && g_RootSheet->CountSheets() > 1 )
337  {
338  m_foundItems.Collect( searchCriteria, m_CurrentSheet );
339  }
340  else
341  {
342  m_foundItems.Collect( searchCriteria );
343  }
344  }
345  else
346  {
347  EDA_ITEM* currentItem = m_foundItems.GetItem( data );
348 
349  if( currentItem != NULL )
350  currentItem->SetForceVisible( false );
351 
353  }
354 
355  updateFindReplaceView( aEvent );
356 }
357 
358 
359 void SCH_EDIT_FRAME::OnFindReplace( wxFindDialogEvent& aEvent )
360 {
361  static int nextFoundIndex = 0;
362  SCH_ITEM* item;
363  SCH_SHEET_PATH* sheet;
364  SCH_SHEET_LIST schematic( g_RootSheet );
366  SCH_FIND_REPLACE_DATA searchCriteria;
367 
368  searchCriteria.SetFlags( aEvent.GetFlags() );
369  searchCriteria.SetFindString( aEvent.GetFindString() );
370  searchCriteria.SetReplaceString( aEvent.GetReplaceString() );
371  m_foundItems.SetReplaceString( aEvent.GetReplaceString() );
372 
373  if( IsSearchCacheObsolete( searchCriteria ) )
374  {
375  if( aEvent.GetFlags() & FR_CURRENT_SHEET_ONLY && g_RootSheet->CountSheets() > 1 )
376  {
377  m_foundItems.Collect( searchCriteria, m_CurrentSheet );
378  }
379  else
380  {
381  m_foundItems.Collect( searchCriteria );
382  }
383 
384  // Restore the next found index on cache refresh. Prevents single replace events
385  // from starting back at the beginning of the cache.
386  m_foundItems.SetFoundIndex( nextFoundIndex );
387  }
388 
389  if( aEvent.GetEventType() == wxEVT_COMMAND_FIND_REPLACE_ALL )
390  {
391  while( ( item = (SCH_ITEM*) m_foundItems.GetItem( data ) ) != NULL )
392  {
393  SCH_ITEM* undoItem = data.GetParent();
394 
395  // Don't save child items in undo list.
396  if( undoItem == NULL )
397  undoItem = item;
398 
399  SetUndoItem( undoItem );
400 
401  sheet = schematic.GetSheetByPath( data.GetSheetPath() );
402 
403  wxCHECK_RET( sheet != NULL, wxT( "Could not find sheet path " ) + data.GetSheetPath() );
404 
405  if( m_foundItems.ReplaceItem( sheet ) )
406  {
407  OnModify();
408  SaveUndoItemInUndoList( undoItem );
409  updateFindReplaceView( aEvent );
410  }
411 
413 
414  if( m_foundItems.PassedEnd() )
415  break;
416  }
417  }
418  else
419  {
420  item = (SCH_ITEM*) m_foundItems.GetItem( data );
421 
422  wxCHECK_RET( item != NULL, wxT( "Invalid replace item in find collector list." ) );
423 
424  SCH_ITEM* undoItem = data.GetParent();
425 
426  if( undoItem == NULL )
427  undoItem = item;
428 
429  SetUndoItem( undoItem );
430 
431  sheet = schematic.GetSheetByPath( data.GetSheetPath() );
432 
433  wxCHECK_RET( sheet != NULL, wxT( "Could not find sheet path " ) + data.GetSheetPath() );
434 
435  if( m_foundItems.ReplaceItem( sheet ) )
436  {
437  OnModify();
438  SaveUndoItemInUndoList( undoItem );
439  updateFindReplaceView( aEvent );
440  }
441 
443  nextFoundIndex = m_foundItems.GetFoundIndex();
444  }
445 
446  // End the replace if we are at the end if the list. This prevents an infinite loop if
447  // wrap search is selected and all of the items have been replaced with a value that
448  // still satisfies the search criteria.
449  if( m_foundItems.PassedEnd() )
450  aEvent.SetFlags( aEvent.GetFlags() & ~FR_REPLACE_ITEM_FOUND );
451 }
452 
453 
454 void SCH_EDIT_FRAME::updateFindReplaceView( wxFindDialogEvent& aEvent )
455 {
456  wxString msg;
457  SCH_SHEET_LIST schematic( g_RootSheet );
459  SCH_FIND_REPLACE_DATA searchCriteria;
460  bool warpCursor = !( aEvent.GetFlags() & FR_NO_WARP_CURSOR );
461 
462  searchCriteria.SetFlags( aEvent.GetFlags() );
463  searchCriteria.SetFindString( aEvent.GetFindString() );
464  searchCriteria.SetReplaceString( aEvent.GetReplaceString() );
465 
466  if( m_foundItems.GetItem( data ) != NULL )
467  {
468  wxLogTrace( traceFindReplace, wxT( "Found " ) + m_foundItems.GetText() );
469 
470  SCH_SHEET_PATH* sheet = schematic.GetSheetByPath( data.GetSheetPath() );
471 
472  wxCHECK_RET( sheet != NULL, wxT( "Could not find sheet path " ) +
473  data.GetSheetPath() );
474 
475  SCH_ITEM* item = (SCH_ITEM*)m_foundItems.GetItem( data );
476 
477  // Make the item temporarily visible just in case it's hide flag is set. This
478  // has no effect on objects that don't support hiding. If this is a close find
479  // dialog event, clear the temporary visibility flag.
480  if( item )
481  {
482  if( aEvent.GetEventType() == wxEVT_COMMAND_FIND_CLOSE )
483  item->SetForceVisible( false );
484  else if( item->Type() == SCH_FIELD_T && !( (SCH_FIELD*) item )->IsVisible() )
485  item->SetForceVisible( true );
486  }
487 
488  if( sheet->PathHumanReadable() != m_CurrentSheet->PathHumanReadable() )
489  {
490  sheet->LastScreen()->SetZoom( GetScreen()->GetZoom() );
491  *m_CurrentSheet = *sheet;
493  SetScreen( sheet->LastScreen() );
494  }
495 
496  // careful here
498 
499  RedrawScreen( data.GetPosition(), warpCursor );
500 
501  msg = m_foundItems.GetText();
502 
503  if( aEvent.GetFlags() & FR_SEARCH_REPLACE )
504  aEvent.SetFlags( aEvent.GetFlags() | FR_REPLACE_ITEM_FOUND );
505  }
506  else
507  {
508  if( aEvent.GetFlags() & FR_SEARCH_REPLACE )
509  aEvent.SetFlags( aEvent.GetFlags() & ~FR_REPLACE_ITEM_FOUND );
510 
511  msg.Printf( _( "No item found matching %s." ), GetChars( aEvent.GetFindString() ) );
512  }
513 
514  SetStatusText( msg );
515 }
Definition of the SCH_SHEET class for Eeschema.
void OnFindDrcMarker(wxFindDialogEvent &event)
Definition: find.cpp:59
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:225
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:107
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()
Must be called after a schematic change in order to set the "modify" flag of the current screen* and ...
Definition: schframe.cpp:773
void SetFoundIndex(int aIndex)
wxPoint GetPosition() const override
Function GetPosition.
Definition: sch_marker.h:101
void SetScreen(BASE_SCREEN *aScreen)
Definition: draw_frame.h:141
int CountSheets()
Count the number of sheets found in "this" sheet includeing all of the subsheets. ...
Definition: sch_sheet.cpp:624
wxString GetSheetPath() const
wxPoint GetPosition() const override
Function GetPosition.
Definition: sch_field.cpp:548
SCH_FIND_COLLECTOR m_foundItems
List of find/replace items.
Definition: schframe.h:144
Find a component field.
Definition: schframe.h:109
Used by the search event handler to let the dialog know that a replaceable item has been found...
LIB_PIN * GetPin(const wxString &number)
Find a symbol pin by number.
SCH_SCREEN * LastScreen() const
Function LastScreen.
const wxString traceFindReplace
Flag to enable find and replace debug tracing.
Definition: base_struct.cpp:58
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:353
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)
Swap the cloned item in member variable m_undoItem with aItem and saves it to the undo list then swap...
Definition: schframe.cpp:609
void updateFindReplaceView(wxFindDialogEvent &aEvent)
Definition: find.cpp:454
Find a component pin in the schematic.
Definition: schframe.h:106
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:532
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:121
void SetLibHash(int aHash)
void OnFindSchematicItem(wxFindDialogEvent &aEvent)
Find an item in the schematic matching the search criteria in aEvent.
Definition: find.cpp:306
wxPoint GetPosition() const
bool IsPointOnDisplay(const wxPoint &aPosition)
Function IsPointOnDisplay.
Definition: draw_panel.cpp:287
SCH_ITEM * GetParent() const
a helper to handle the real device context used in KiCad
void SetForceSearch(bool doSearch=true)
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:55
SCH_FIELD * GetField(int aFieldNdx) const
Returns a field in this symbol.
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:292
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:484
double GetZoom()
Function GetZoom.
Definition: draw_frame.cpp:491
SCH_ITEM * FindComponentAndItem(const wxString &aReference, bool aSearchHierarchy, SCH_SEARCH_T aSearchType, const wxString &aSearchText, bool aWarpMouse)
Finds a component in the schematic and an item in this component.
Definition: find.cpp:109
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:288
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:252
const wxString GetRef(const SCH_SHEET_PATH *aSheet)
Return the reference for the given sheet path.
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
Return the current draw object position.
Definition: lib_pin.h:450
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:93
Find an item by it's value field.
Definition: schframe.h:108
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
Definition the SCH_COMPONENT class for Eeschema.
void CrossHairOn(wxDC *DC)
Definition: draw_panel.cpp:259
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:105
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.
bool TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
Definition: sch_screen.cpp:879
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:104
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:178
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:91
wxString GetText()
Function GetText()
void SetUndoItem(const SCH_ITEM *aItem)
Clone aItem which can be used to restore the state of the item being edited when the user cancels the...
Definition: schframe.cpp:591
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...
#define VALUE
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)
Perform a search and replace of text in an item in the schematic matching the search and replace crit...
Definition: find.cpp:359