KiCad PCB EDA Suite
SCH_EDITOR_CONTROL Class Reference

Class SCH_EDITOR_CONTROL. More...

#include <sch_editor_control.h>

Inheritance diagram for SCH_EDITOR_CONTROL:
EE_TOOL_BASE< SCH_EDIT_FRAME > TOOL_INTERACTIVE TOOL_BASE

Public Types

enum  RESET_REASON { RUN, MODEL_RELOAD, GAL_SWITCH }
 

Determines the reason of reset for a tool

More...
 

Public Member Functions

 SCH_EDITOR_CONTROL ()
 
 ~SCH_EDITOR_CONTROL ()
 
int New (const TOOL_EVENT &aEvent)
 
int Open (const TOOL_EVENT &aEvent)
 
int Save (const TOOL_EVENT &aEvent)
 
int SaveAs (const TOOL_EVENT &aEvent)
 
int PageSetup (const TOOL_EVENT &aEvent)
 
int Print (const TOOL_EVENT &aEvent)
 
int Plot (const TOOL_EVENT &aEvent)
 
int Quit (const TOOL_EVENT &aEvent)
 
int FindAndReplace (const TOOL_EVENT &aEvent)
 
int FindNext (const TOOL_EVENT &aEvent)
 
bool HasMatch ()
 
int ReplaceAndFindNext (const TOOL_EVENT &aEvent)
 
int ReplaceAll (const TOOL_EVENT &aEvent)
 
int UpdateFind (const TOOL_EVENT &aEvent)
 
int CrossProbeToPcb (const TOOL_EVENT &aEvent)
 

Notifies pcbnew about the selected item.

More...
 
int ExplicitCrossProbeToPcb (const TOOL_EVENT &aEvent)
 

Equivalent to the above, but initiated by the user.

More...
 
int HighlightNet (const TOOL_EVENT &aEvent)
 

Highlights net under the cursor.

More...
 
int ClearHighlight (const TOOL_EVENT &aEvent)
 

Removes any net highlighting

More...
 
int UpdateNetHighlighting (const TOOL_EVENT &aEvent)
 

Updates net highlighting after an edit

More...
 
int HighlightNetCursor (const TOOL_EVENT &aEvent)
 

Launches a tool to highlight nets.

More...
 
int Undo (const TOOL_EVENT &aEvent)
 
int Redo (const TOOL_EVENT &aEvent)
 
int Cut (const TOOL_EVENT &aEvent)
 

Clipboard support.

More...
 
int Copy (const TOOL_EVENT &aEvent)
 
int Paste (const TOOL_EVENT &aEvent)
 
int EditWithLibEdit (const TOOL_EVENT &aEvent)
 
int ShowCvpcb (const TOOL_EVENT &aEvent)
 
int Annotate (const TOOL_EVENT &aEvent)
 
int EditSymbolFields (const TOOL_EVENT &aEvent)
 
int EditSymbolLibraryLinks (const TOOL_EVENT &aEvent)
 
int ShowPcbNew (const TOOL_EVENT &aEvent)
 
int UpdatePCB (const TOOL_EVENT &aEvent)
 
int ImportFPAssignments (const TOOL_EVENT &aEvent)
 
int ExportNetlist (const TOOL_EVENT &aEvent)
 
int GenerateBOM (const TOOL_EVENT &aEvent)
 
int DrawSheetOnClipboard (const TOOL_EVENT &aEvent)
 
int ShowBusManager (const TOOL_EVENT &aEvent)
 
int EnterSheet (const TOOL_EVENT &aEvent)
 
int LeaveSheet (const TOOL_EVENT &aEvent)
 
int NavigateHierarchy (const TOOL_EVENT &aEvent)
 
int ToggleHiddenPins (const TOOL_EVENT &aEvent)
 
int ToggleForceHV (const TOOL_EVENT &aEvent)
 
void BackAnnotateFootprints (const std::string &aChangedSetOfReferences)
 
SCH_ITEMFindComponentAndItem (const wxString &aReference, bool aSearchHierarchy, SCH_SEARCH_T aSearchType, const wxString &aSearchText)
 Finds a component in the schematic and an item in this component. More...
 
bool Init () override
 Function Init() Init() is called once upon a registration of the tool. More...
 
void Reset (RESET_REASON aReason) override
 Function Reset() Brings the tool to a known, initial state. More...
 
void Activate ()
 Function Activate() Runs the tool. More...
 
TOOL_MENUGetToolMenu ()
 
void SetContextMenu (ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger=CMENU_BUTTON)
 Function SetContextMenu() More...
 
void RunMainStack (std::function< void()> aFunc)
 Function RunMainStack() More...
 
template<class T >
void Go (int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
 Function Go() More...
 
TOOL_EVENTWait (const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
 Function Wait() More...
 
TOOL_TYPE GetType () const
 Function GetType() Returns the type of the tool. More...
 
TOOL_ID GetId () const
 Function GetId() Returns the unique identifier of the tool. More...
 
const std::string & GetName () const
 Function GetName() Returns the name of the tool. More...
 
TOOL_MANAGERGetManager () const
 Function GetManager() Returns the instance of TOOL_MANAGER that takes care of the tool. More...
 
TOOL_SETTINGSGetSettings ()
 
bool IsToolActive () const
 

Protected Member Functions

void updateView (EDA_ITEM *aItem) const
 

Similar to getView()->Update(), but handles items that are redrawn by their parents.

More...
 
void saveCopyInUndoList (EDA_ITEM *aItem, UNDO_REDO_T aType, bool aAppend=false)
 

Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.

More...
 
void attachManager (TOOL_MANAGER *aManager)
 Function attachManager() More...
 
KIGFX::VIEWgetView () const
 Function getView() More...
 
KIGFX::VIEW_CONTROLSgetViewControls () const
 Function getViewControls() More...
 
template<typename T >
T * getEditFrame () const
 Function getEditFrame() More...
 
template<typename T >
T * getModel () const
 Function getModel() More...
 

Protected Attributes

SCH_EDIT_FRAMEm_frame
 
KIGFX::SCH_VIEWm_view
 
EE_SELECTION_TOOLm_selectionTool
 
bool m_isLibEdit
 
TOOL_MENU m_menu
 functions below are not yet implemented - their interface may change More...
 
TOOL_TYPE m_type
 

Stores the type of the tool.

More...
 
TOOL_ID m_toolId
 

Unique identifier for the tool, assigned by a TOOL_MANAGER instance.

More...
 
std::string m_toolName
 

Name of the tool.

More...
 
TOOL_MANAGERm_toolMgr
 
TOOL_SETTINGS m_toolSettings
 

Private Member Functions

bool doCopy ()
 

copy selection to clipboard

More...
 
bool searchSupplementaryClipboard (const wxString &aSheetFilename, SCH_SCREEN **aScreen)
 
void doCrossProbeSchToPcb (const TOOL_EVENT &aEvent, bool aForce)
 
bool loadCmpToFootprintLinkFile ()
 Loads a .cmp file from CvPcb and update the footprint field of components. More...
 
bool processCmpToFootprintLinkFile (const wxString &aFullFilename, bool aForceVisibilityState, bool aVisibilityState)
 Read the footprint info from each line in the stuff file by reference designator. More...
 
void setTransitions () override
 

Sets up handlers for various events.

More...
 

Private Attributes

bool m_probingPcbToSch
 
EDA_ITEMm_pickerItem
 
std::map< wxString, SCH_SCREEN * > m_supplementaryClipboard
 

Detailed Description

Class SCH_EDITOR_CONTROL.

Handles actions specific to the schematic editor in eeschema.

Definition at line 40 of file sch_editor_control.h.

Member Enumeration Documentation

◆ RESET_REASON

enum TOOL_BASE::RESET_REASON
inherited

Determines the reason of reset for a tool

Enumerator
RUN 

Tool is invoked after being inactive.

MODEL_RELOAD 

Model changes (required full reload)

GAL_SWITCH 

Rendering engine changes.

Definition at line 79 of file tool_base.h.

80  {
81  RUN,
82  MODEL_RELOAD,
83  GAL_SWITCH
84  };
Model changes (required full reload)
Definition: tool_base.h:82
Tool is invoked after being inactive.
Definition: tool_base.h:81
Rendering engine changes.
Definition: tool_base.h:83

Constructor & Destructor Documentation

◆ SCH_EDITOR_CONTROL()

SCH_EDITOR_CONTROL::SCH_EDITOR_CONTROL ( )
inline

Definition at line 43 of file sch_editor_control.h.

43  :
44  EE_TOOL_BASE<SCH_EDIT_FRAME>( "eeschema.EditorControl" ),
45  m_probingPcbToSch( false ),
46  m_pickerItem( nullptr )
47  { }

◆ ~SCH_EDITOR_CONTROL()

SCH_EDITOR_CONTROL::~SCH_EDITOR_CONTROL ( )
inline

Definition at line 49 of file sch_editor_control.h.

49 { }

Member Function Documentation

◆ Activate()

void TOOL_INTERACTIVE::Activate ( )
inherited

Function Activate() Runs the tool.

After activation, the tool starts receiving events until it is finished.

Definition at line 51 of file tool_interactive.cpp.

52 {
54 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
TOOL_ID m_toolId
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:214
bool InvokeTool(TOOL_ID aToolId)
Function InvokeTool() Calls a tool by sending a tool activation event to tool of given ID.

References TOOL_MANAGER::InvokeTool(), TOOL_BASE::m_toolId, and TOOL_BASE::m_toolMgr.

Referenced by AUTOPLACE_TOOL::autoplace(), EDIT_TOOL::copyToClipboard(), LIB_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PCB_EDITOR_CONTROL::DrillOrigin(), PAD_TOOL::EnumeratePads(), PCBNEW_CONTROL::GridSetOrigin(), HighlightNetCursor(), PCB_INSPECTION_TOOL::HighlightNetTool(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), PCB_INSPECTION_TOOL::LocalRatsnestTool(), PL_EDIT_TOOL::Main(), SCH_MOVE_TOOL::Main(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), EDIT_TOOL::Move(), LIB_TREE::onContextMenu(), POINT_EDITOR::OnSelectionChange(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), DRAWING_TOOL::SetAnchor(), DRC::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ Annotate()

int SCH_EDITOR_CONTROL::Annotate ( const TOOL_EVENT aEvent)

Definition at line 1180 of file sch_editor_control.cpp.

1181 {
1182  wxCommandEvent dummy;
1183  m_frame->OnAnnotate( dummy );
1184  return 0;
1185 }
void OnAnnotate(wxCommandEvent &event)
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.

References dummy(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, and SCH_EDIT_FRAME::OnAnnotate().

Referenced by setTransitions().

◆ attachManager()

void TOOL_BASE::attachManager ( TOOL_MANAGER aManager)
protectedinherited

Function attachManager()

Sets the TOOL_MANAGER the tool will belong to. Called by TOOL_MANAGER::RegisterTool()

Definition at line 60 of file tool_base.cpp.

61 {
62  m_toolMgr = aManager;
63  m_toolSettings = TOOL_SETTINGS( this );
64 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
TOOL_SETTINGS m_toolSettings
Definition: tool_base.h:220
friend class TOOL_SETTINGS
Definition: tool_base.h:154

References TOOL_BASE::m_toolMgr, TOOL_BASE::m_toolSettings, and TOOL_BASE::TOOL_SETTINGS.

Referenced by TOOL_MANAGER::RegisterTool().

◆ BackAnnotateFootprints()

void SCH_EDITOR_CONTROL::BackAnnotateFootprints ( const std::string &  aChangedSetOfReferences)

Definition at line 45 of file backanno.cpp.

46 {
47  // Build a flat list of components in schematic:
48  SCH_REFERENCE_LIST refs;
49  SCH_SHEET_LIST sheets( g_RootSheet );
50  bool isChanged = false;
51 
52  sheets.GetComponents( refs, false );
53 
54  DSNLEXER lexer( aChangedSetOfReferences, FROM_UTF8( __func__ ) );
55  PTREE doc;
56 
57  try
58  {
59  Scan( &doc, &lexer );
60 
61 #if defined(DEBUG) && 0
63  Format( &sf, 0, 0, doc );
64  printf( "%s: '%s'\n", __func__, sf.GetString().c_str() );
65 #endif
66 
67  CPTREE& back_anno = doc.get_child( "back_annotation" );
68  wxString footprint;
69 
70  for( PTREE::const_iterator ref = back_anno.begin(); ref != back_anno.end(); ++ref )
71  {
72  wxASSERT( ref->first == "ref" );
73 
74  wxString reference = (UTF8&) ref->second.front().first;
75 
76  // Ensure the "fpid" node contains a footprint name,
77  // and get it if exists
78  if( ref->second.get_child( "fpid" ).size() )
79  {
80  wxString tmp = (UTF8&) ref->second.get_child( "fpid" ).front().first;
81  footprint = tmp;
82  }
83  else
84  footprint.Empty();
85 
86  // Search the component in the flat list
87  for( unsigned ii = 0; ii < refs.GetCount(); ++ii )
88  {
89  if( reference == refs[ii].GetRef() )
90  {
91  // We have found a candidate.
92  // Note: it can be not unique (multiple parts per package)
93  // So we *do not* stop the search here
94  SCH_COMPONENT* component = refs[ii].GetComp();
95  SCH_FIELD* fpfield = component->GetField( FOOTPRINT );
96  const wxString& oldfp = fpfield->GetText();
97 
98  if( !oldfp && fpfield->IsVisible() )
99  fpfield->SetVisible( false );
100 
101  if( oldfp != footprint )
102  isChanged = true;
103 
104  fpfield->SetText( footprint );
105  }
106  }
107  }
108  }
109  catch( const PTREE_ERROR& ex )
110  {
111  // remap the exception to something the caller is likely to understand.
112  THROW_IO_ERROR( ex.what() );
113  }
114 
115  if( isChanged )
116  {
117  m_frame->SyncView();
118  m_frame->GetCanvas()->Refresh();
119  m_frame->OnModify();
120  }
121 }
Class UTF8 is an 8 bit string that is assuredly encoded in UTF8, and supplies special conversion supp...
Definition: utf8.h:73
Class SCH_SHEET_LIST.
Class SCH_FIELD instances are attached to a component and provide a place for the component's value,...
Definition: sch_field.h:52
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:62
void Scan(PTREE *aTree, DSNLEXER *aLexer)
Function Scan fills an empty PTREE with information from a KiCad s-expresion stream.
Definition: ptree.cpp:90
bool IsVisible() const
Definition: eda_text.h:170
void SetVisible(bool aVisible)
Definition: eda_text.h:169
Field Name Module PCB, i.e. "16DIP300".
Class SCH_REFERENCE_LIST is used to create a flattened list of components because in a complex hierar...
SCH_FIELD * GetField(int aFieldNdx) const
Returns a field in this symbol.
boost::property_tree::ptree PTREE
Definition: ptree.h:54
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:126
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:47
const PTREE CPTREE
Definition: ptree.h:55
void SyncView()
Mark all items for refresh.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
#define THROW_IO_ERROR(msg)
const std::string & GetString()
Definition: richio.h:475
boost::property_tree::ptree_error PTREE_ERROR
Definition: ptree.h:56
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:73
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
unsigned GetCount()
Function GetCount.
Class STRING_FORMATTER implements OUTPUTFORMATTER to a memory buffer.
Definition: richio.h:445
Class DSNLEXER implements a lexical analyzer for the SPECCTRA DSN file format.
Definition: dsnlexer.h:79
virtual const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:124

References FOOTPRINT, Format(), FROM_UTF8(), g_RootSheet, SCH_BASE_FRAME::GetCanvas(), SCH_SHEET_LIST::GetComponents(), SCH_REFERENCE_LIST::GetCount(), SCH_COMPONENT::GetField(), STRING_FORMATTER::GetString(), EDA_TEXT::GetText(), EDA_TEXT::IsVisible(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, SCH_EDIT_FRAME::OnModify(), EDA_DRAW_PANEL_GAL::Refresh(), Scan(), EDA_TEXT::SetText(), EDA_TEXT::SetVisible(), SCH_BASE_FRAME::SyncView(), and THROW_IO_ERROR.

Referenced by SCH_EDIT_FRAME::KiwayMailIn().

◆ ClearHighlight()

int SCH_EDITOR_CONTROL::ClearHighlight ( const TOOL_EVENT aEvent)

Removes any net highlighting

Definition at line 696 of file sch_editor_control.cpp.

697 {
699 
700  return 0;
701 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
static bool highlightNet(TOOL_MANAGER *aToolMgr, const VECTOR2D &aPosition)
static VECTOR2D CLEAR

References CLEAR, highlightNet(), and TOOL_BASE::m_toolMgr.

Referenced by setTransitions().

◆ Copy()

int SCH_EDITOR_CONTROL::Copy ( const TOOL_EVENT aEvent)

Definition at line 929 of file sch_editor_control.cpp.

930 {
931  wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( wxWindow::FindFocus() );
932 
933  if( textEntry )
934  {
935  textEntry->Copy();
936  return 0;
937  }
938 
939  doCopy();
940 
941  return 0;
942 }
bool doCopy()
copy selection to clipboard

References doCopy().

Referenced by setTransitions().

◆ CrossProbeToPcb()

int SCH_EDITOR_CONTROL::CrossProbeToPcb ( const TOOL_EVENT aEvent)

Notifies pcbnew about the selected item.

Definition at line 348 of file sch_editor_control.cpp.

349 {
350  doCrossProbeSchToPcb( aEvent, false );
351  return 0;
352 }
void doCrossProbeSchToPcb(const TOOL_EVENT &aEvent, bool aForce)

References doCrossProbeSchToPcb().

Referenced by setTransitions().

◆ Cut()

int SCH_EDITOR_CONTROL::Cut ( const TOOL_EVENT aEvent)

Clipboard support.

Definition at line 912 of file sch_editor_control.cpp.

913 {
914  wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( wxWindow::FindFocus() );
915 
916  if( textEntry )
917  {
918  textEntry->Cut();
919  return 0;
920  }
921 
922  if( doCopy() )
924 
925  return 0;
926 }
static TOOL_ACTION doDelete
Definition: actions.h:74
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:109
bool doCopy()
copy selection to clipboard

References doCopy(), ACTIONS::doDelete, TOOL_BASE::m_toolMgr, and TOOL_MANAGER::RunAction().

Referenced by setTransitions().

◆ doCopy()

bool SCH_EDITOR_CONTROL::doCopy ( )
private

copy selection to clipboard

Definition at line 871 of file sch_editor_control.cpp.

872 {
874  EE_SELECTION& selection = selTool->RequestSelection();
875 
876  if( !selection.GetSize() )
877  return false;
878 
879  m_supplementaryClipboard.clear();
880 
881  for( EDA_ITEM* item : selection )
882  {
883  if( item->Type() == SCH_SHEET_T )
884  {
885  SCH_SHEET* sheet = (SCH_SHEET*) item;
886  m_supplementaryClipboard[ sheet->GetFileName() ] = sheet->GetScreen();
887  }
888  }
889 
890  STRING_FORMATTER formatter;
891  SCH_LEGACY_PLUGIN plugin;
892 
893  plugin.Format( &selection, &formatter );
894 
895  return m_toolMgr->SaveClipboard( formatter.GetString() );
896 }
bool SaveClipboard(const std::string &aText)
Stores an information to the system clipboard.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
void Format(SCH_SCREEN *aScreen)
SCH_SCREEN * GetScreen()
Definition: sch_sheet.h:281
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
std::map< wxString, SCH_SCREEN * > m_supplementaryClipboard
const std::string & GetString()
Definition: richio.h:475
A SCH_PLUGIN derivation for loading schematic files created before the new s-expression file format.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:209
wxString GetFileName(void) const
Return the filename corresponding to this sheet.
Definition: sch_sheet.cpp:646
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:163
Class STRING_FORMATTER implements OUTPUTFORMATTER to a memory buffer.
Definition: richio.h:445

References SCH_LEGACY_PLUGIN::Format(), SCH_SHEET::GetFileName(), SCH_SHEET::GetScreen(), STRING_FORMATTER::GetString(), TOOL_MANAGER::GetTool(), m_supplementaryClipboard, TOOL_BASE::m_toolMgr, EE_SELECTION_TOOL::RequestSelection(), TOOL_MANAGER::SaveClipboard(), SCH_SHEET_T, and EDA_ITEM::Type().

Referenced by Copy(), and Cut().

◆ doCrossProbeSchToPcb()

void SCH_EDITOR_CONTROL::doCrossProbeSchToPcb ( const TOOL_EVENT aEvent,
bool  aForce 
)
private

Definition at line 362 of file sch_editor_control.cpp.

363 {
364  // Don't get in an infinite loop SCH -> PCB -> SCH -> PCB -> SCH -> ...
365  if( m_probingPcbToSch )
366  return;
367 
369  SCH_ITEM* item = nullptr;
370  SCH_COMPONENT* component = nullptr;
371 
372  if( aForce )
373  {
374  EE_SELECTION& selection = selTool->RequestSelection();
375 
376  if( selection.GetSize() >= 1 )
377  item = (SCH_ITEM*) selection.Front();
378  }
379  else
380  {
381  EE_SELECTION& selection = selTool->GetSelection();
382 
383  if( selection.GetSize() >= 1 )
384  item = (SCH_ITEM*) selection.Front();
385  }
386 
387  if( !item )
388  {
389  if( aForce )
390  m_frame->SendMessageToPCBNEW( nullptr, nullptr );
391 
392  return;
393  }
394 
395 
396  switch( item->Type() )
397  {
398  case SCH_FIELD_T:
399  case LIB_FIELD_T:
400  component = (SCH_COMPONENT*) item->GetParent();
401  m_frame->SendMessageToPCBNEW( item, component );
402  break;
403 
404  case SCH_COMPONENT_T:
405  component = (SCH_COMPONENT*) item;
406  m_frame->SendMessageToPCBNEW( item, component );
407  break;
408 
409  case SCH_PIN_T:
410  component = (SCH_COMPONENT*) item->GetParent();
411  m_frame->SendMessageToPCBNEW( static_cast<SCH_PIN*>( item ), component );
412  break;
413 
414  case SCH_SHEET_T:
415  if( aForce )
416  m_frame->SendMessageToPCBNEW( item, nullptr );
417  break;
418 
419  default:
420  break;
421  }
422 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
EE_SELECTION & GetSelection()
Function GetSelection()
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
void SendMessageToPCBNEW(EDA_ITEM *aObjectToSync, SCH_COMPONENT *aPart)
Send a message to Pcbnew via a socket connection.
EDA_ITEM * GetParent() const
Definition: base_struct.h:220
virtual unsigned int GetSize() const override
Function GetSize() Returns the number of stored items.
Definition: selection.h:98
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:73
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
Definition: sch_item.h:114
EDA_ITEM * Front() const
Definition: selection.h:182

References SELECTION::Front(), EDA_ITEM::GetParent(), EE_SELECTION_TOOL::GetSelection(), SELECTION::GetSize(), TOOL_MANAGER::GetTool(), LIB_FIELD_T, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, m_probingPcbToSch, TOOL_BASE::m_toolMgr, EE_SELECTION_TOOL::RequestSelection(), SCH_COMPONENT_T, SCH_FIELD_T, SCH_PIN_T, SCH_SHEET_T, and SCH_EDIT_FRAME::SendMessageToPCBNEW().

Referenced by CrossProbeToPcb(), and ExplicitCrossProbeToPcb().

◆ DrawSheetOnClipboard()

int SCH_EDITOR_CONTROL::DrawSheetOnClipboard ( const TOOL_EVENT aEvent)

Definition at line 1248 of file sch_editor_control.cpp.

1249 {
1251  return 0;
1252 }
void DrawCurrentSheetToClipboard()
Use the wxWidgets print code to draw an image of the current sheet onto the clipboard.
Definition: sheet.cpp:840

References SCH_EDIT_FRAME::DrawCurrentSheetToClipboard(), and EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame.

Referenced by setTransitions().

◆ EditSymbolFields()

int SCH_EDITOR_CONTROL::EditSymbolFields ( const TOOL_EVENT aEvent)

Definition at line 1196 of file sch_editor_control.cpp.

1197 {
1199  dlg.ShowQuasiModal();
1200  return 0;
1201 }

References EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, and DIALOG_SHIM::ShowQuasiModal().

Referenced by setTransitions().

◆ EditSymbolLibraryLinks()

int SCH_EDITOR_CONTROL::EditSymbolLibraryLinks ( const TOOL_EVENT aEvent)

Definition at line 1204 of file sch_editor_control.cpp.

1205 {
1207  m_frame->HardRedraw();
1208 
1209  return 0;
1210 }
void HardRedraw() override
Rebuild the GAL and redraw the screen.
bool InvokeDialogEditComponentsLibId(SCH_EDIT_FRAME *aCaller)
Run a dialog to modify the LIB_ID of components for instance when a symbol has moved from a symbol li...

References SCH_EDIT_FRAME::HardRedraw(), InvokeDialogEditComponentsLibId(), and EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame.

Referenced by setTransitions().

◆ EditWithLibEdit()

int SCH_EDITOR_CONTROL::EditWithLibEdit ( const TOOL_EVENT aEvent)

Definition at line 1157 of file sch_editor_control.cpp.

1158 {
1161  SCH_COMPONENT* sym = nullptr;
1162  LIB_EDIT_FRAME* libEdit;
1163 
1164  if( selection.GetSize() >= 1 )
1165  sym = (SCH_COMPONENT*) selection.Front();
1166 
1167  if( !sym || sym->GetEditFlags() != 0 )
1168  return 0;
1169 
1171  libEdit = (LIB_EDIT_FRAME*) m_frame->Kiway().Player( FRAME_SCH_LIB_EDITOR, false );
1172 
1173  if( libEdit )
1174  libEdit->LoadComponentAndSelectLib( sym->GetLibId(), sym->GetUnit(), sym->GetConvert() );
1175 
1176  return 0;
1177 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_holder.h:56
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:109
static const KICAD_T ComponentsOnly[]
Definition: ee_collectors.h:44
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
int GetUnit() const
VTBL_ENTRY KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=NULL)
Function Player returns the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:328
STATUS_FLAGS GetEditFlags() const
Definition: base_struct.h:270
bool LoadComponentAndSelectLib(const LIB_ID &aLibId, int aUnit, int aConvert)
Selects the currently active library and loads the symbol from aLibId.
Definition: libedit.cpp:141
The symbol library editor main window.
static TOOL_ACTION showSymbolEditor
Definition: actions.h:150
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:73
int GetConvert() const
const LIB_ID & GetLibId() const

References EE_COLLECTOR::ComponentsOnly, FRAME_SCH_LIB_EDITOR, SCH_COMPONENT::GetConvert(), EDA_ITEM::GetEditFlags(), SCH_COMPONENT::GetLibId(), TOOL_MANAGER::GetTool(), SCH_COMPONENT::GetUnit(), KIWAY_HOLDER::Kiway(), LIB_EDIT_FRAME::LoadComponentAndSelectLib(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, TOOL_BASE::m_toolMgr, KIWAY::Player(), EE_SELECTION_TOOL::RequestSelection(), TOOL_MANAGER::RunAction(), and ACTIONS::showSymbolEditor.

Referenced by setTransitions().

◆ EnterSheet()

int SCH_EDITOR_CONTROL::EnterSheet ( const TOOL_EVENT aEvent)

Definition at line 1262 of file sch_editor_control.cpp.

1263 {
1265  const EE_SELECTION& selection = selTool->RequestSelection( EE_COLLECTOR::SheetsOnly );
1266 
1267  if( selection.GetSize() == 1 )
1268  {
1269  SCH_SHEET* sheet = (SCH_SHEET*) selection.Front();
1270 
1273 
1274  g_CurrentSheet->push_back( sheet );
1276  }
1277 
1278  return 0;
1279 }
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
static TOOL_ACTION cancelInteractive
Definition: actions.h:65
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:109
void DisplayCurrentSheet()
Draw the current sheet on the display.
Definition: hierarch.cpp:261
static const KICAD_T SheetsOnly[]
Definition: ee_collectors.h:45
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
SCH_SHEET_PATH * g_CurrentSheet
With the new connectivity algorithm, many more places than before want to know what the current sheet...
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:58
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:209

References ACTIONS::cancelInteractive, EE_ACTIONS::clearSelection, SCH_EDIT_FRAME::DisplayCurrentSheet(), g_CurrentSheet, TOOL_MANAGER::GetTool(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, TOOL_BASE::m_toolMgr, SCH_SHEET_PATH::push_back(), EE_SELECTION_TOOL::RequestSelection(), TOOL_MANAGER::RunAction(), and EE_COLLECTOR::SheetsOnly.

Referenced by setTransitions().

◆ ExplicitCrossProbeToPcb()

int SCH_EDITOR_CONTROL::ExplicitCrossProbeToPcb ( const TOOL_EVENT aEvent)

Equivalent to the above, but initiated by the user.

We also do SCH_SHEETs on this one (they're too slow on big projects for the auto version above).

Definition at line 355 of file sch_editor_control.cpp.

356 {
357  doCrossProbeSchToPcb( aEvent, true );
358  return 0;
359 }
void doCrossProbeSchToPcb(const TOOL_EVENT &aEvent, bool aForce)

References doCrossProbeSchToPcb().

Referenced by setTransitions().

◆ ExportNetlist()

int SCH_EDITOR_CONTROL::ExportNetlist ( const TOOL_EVENT aEvent)

Definition at line 1229 of file sch_editor_control.cpp.

1230 {
1231  int result = NET_PLUGIN_CHANGE;
1232 
1233  // If a plugin is removed or added, rebuild and reopen the new dialog
1234  while( result == NET_PLUGIN_CHANGE )
1235  result = InvokeDialogNetList( m_frame );
1236 
1237  return 0;
1238 }
#define NET_PLUGIN_CHANGE
Create and shows NETLIST_DIALOG and returns whatever NETLIST_DIALOG::ShowModal() returns.
int InvokeDialogNetList(SCH_EDIT_FRAME *aCaller)

References InvokeDialogNetList(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, and NET_PLUGIN_CHANGE.

Referenced by setTransitions().

◆ FindAndReplace()

int SCH_EDITOR_CONTROL::FindAndReplace ( const TOOL_EVENT aEvent)

Definition at line 128 of file sch_editor_control.cpp.

129 {
131  return UpdateFind( aEvent );
132 }
static TOOL_ACTION findAndReplace
Definition: actions.h:79
bool IsAction(const TOOL_ACTION *aAction) const
Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_AC...
Definition: tool_event.cpp:67
int UpdateFind(const TOOL_EVENT &aEvent)
void ShowFindReplaceDialog(bool aReplace)
Run the Find or Find & Replace dialog.

References ACTIONS::findAndReplace, TOOL_EVENT::IsAction(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, SCH_EDIT_FRAME::ShowFindReplaceDialog(), and UpdateFind().

Referenced by FindNext(), ReplaceAll(), ReplaceAndFindNext(), and setTransitions().

◆ FindComponentAndItem()

SCH_ITEM * SCH_EDITOR_CONTROL::FindComponentAndItem ( const wxString &  aReference,
bool  aSearchHierarchy,
SCH_SEARCH_T  aSearchType,
const wxString &  aSearchText 
)

Finds a component in the schematic and an item in this component.

Parameters
aReferenceThe component reference designator to find.
aSearchHierarchyIf false, search the current sheet only. Otherwise, the entire hierarchy
aSearchTypeA SCH_SEARCH_T value used to determine what to search for.
aSearchTextThe text to search for, either in value, reference or elsewhere.

Definition at line 46 of file eeschema/cross-probing.cpp.

50 {
51  SCH_SHEET_PATH* sheetWithComponentFound = NULL;
52  SCH_ITEM* item = NULL;
53  SCH_COMPONENT* Component = NULL;
54  wxPoint pos;
55  bool notFound = true;
56  LIB_PIN* pin = nullptr;
57  SCH_SHEET_LIST sheetList( g_RootSheet );
58  EDA_ITEM* foundItem = nullptr;
59 
60  if( !aSearchHierarchy )
61  sheetList.push_back( *g_CurrentSheet );
62  else
63  sheetList.BuildSheetList( g_RootSheet );
64 
65  for( SCH_SHEET_PATH& sheet : sheetList)
66  {
67  for( item = sheet.LastDrawList(); item && notFound; item = item->Next() )
68  {
69  if( item->Type() != SCH_COMPONENT_T )
70  continue;
71 
72  SCH_COMPONENT* pSch = (SCH_COMPONENT*) item;
73 
74  if( aReference.CmpNoCase( pSch->GetRef( &sheet ) ) == 0 )
75  {
76  Component = pSch;
77  sheetWithComponentFound = &sheet;
78 
79  if( aSearchType == HIGHLIGHT_PIN )
80  {
81  pos = pSch->GetPosition(); // temporary: will be changed if the pin is found.
82  pin = pSch->GetPin( aSearchText );
83 
84  if( pin )
85  {
86  notFound = false;
87  pos += pin->GetPosition();
88  foundItem = Component;
89  }
90  }
91  else
92  {
93  notFound = false;
94  pos = pSch->GetPosition();
95  foundItem = Component;
96  }
97  }
98  }
99 
100  if( notFound == false )
101  break;
102  }
103 
104  if( Component )
105  {
106  if( *sheetWithComponentFound != *g_CurrentSheet )
107  {
108  sheetWithComponentFound->LastScreen()->SetZoom( m_frame->GetScreen()->GetZoom() );
109  *g_CurrentSheet = *sheetWithComponentFound;
111  }
112 
113  wxPoint delta;
114  pos -= Component->GetPosition();
115  delta = Component->GetTransform().TransformCoordinate( pos );
116  pos = delta + Component->GetPosition();
117 
119  m_frame->CenterScreen( pos, false );
120  }
121 
122  /* Print diag */
123  wxString msg_item;
124  wxString msg;
125 
126  if( aSearchType == HIGHLIGHT_PIN )
127  msg_item.Printf( _( "pin %s" ), aSearchText );
128  else
129  msg_item = _( "component" );
130 
131  if( Component )
132  {
133  if( !notFound )
134  msg.Printf( _( "%s %s found" ), aReference, msg_item );
135  else
136  msg.Printf( _( "%s found but %s not found" ), aReference, msg_item );
137  }
138  else
139  msg.Printf( _( "Component %s not found" ), aReference );
140 
141  m_frame->SetStatusText( msg );
142 
143  m_probingPcbToSch = true; // recursion guard
144  {
145  // Clear any existing highlighting
147  m_frame->GetCanvas()->GetView()->HighlightItem( nullptr, nullptr );
148 
149  if( foundItem )
150  m_frame->GetCanvas()->GetView()->HighlightItem( foundItem, pin );
151  }
152  m_probingPcbToSch = false;
153 
154  m_frame->GetCanvas()->Refresh();
155 
156  return item;
157 }
Class SCH_SHEET_LIST.
KIGFX::SCH_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
KIGFX::VIEW_CONTROLS * GetViewControls() const
Function GetViewControls() Returns a pointer to the VIEW_CONTROLS instance used in the panel.
SCH_ITEM * Next() const
Definition: sch_item.h:153
double GetZoom() const
Function GetZoom returns the current "zoom factor", which is a measure of "internal units per device ...
Definition: base_screen.h:240
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:109
LIB_PIN * GetPin(const wxString &number)
Find a symbol pin by number.
void DisplayCurrentSheet()
Draw the current sheet on the display.
Definition: hierarch.cpp:261
void HighlightItem(EDA_ITEM *aItem, LIB_PIN *aPin=nullptr)
Definition: sch_view.cpp:187
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
Return a pointer to a BASE_SCREEN or one of its derivatives.
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:47
SCH_SHEET_PATH * g_CurrentSheet
With the new connectivity algorithm, many more places than before want to know what the current sheet...
TRANSFORM & GetTransform() const
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:58
virtual bool SetZoom(double iu_per_du)
Function SetZoom adjusts the current zoom factor.
Definition: base_screen.cpp:86
virtual void SetCrossHairCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true)=0
Moves the graphic crosshair cursor to the requested position expressed in world coordinates.
Class SCH_SHEET_PATH.
const wxString GetRef(const SCH_SHEET_PATH *aSheet)
Return the reference for the given sheet path.
#define _(s)
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
wxPoint GetPosition() const override
Definition: lib_pin.h:427
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:73
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:163
virtual void CenterScreen(const wxPoint &aCenterPoint, bool aWarpPointer)
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
Definition: sch_item.h:114
SCH_SCREEN * LastScreen() const
Function LastScreen.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:210

References _, SCH_SHEET_LIST::BuildSheetList(), SCH_BASE_FRAME::CenterScreen(), EE_ACTIONS::clearSelection, SCH_EDIT_FRAME::DisplayCurrentSheet(), g_CurrentSheet, g_RootSheet, SCH_BASE_FRAME::GetCanvas(), SCH_COMPONENT::GetPin(), LIB_PIN::GetPosition(), SCH_COMPONENT::GetPosition(), SCH_COMPONENT::GetRef(), SCH_EDIT_FRAME::GetScreen(), SCH_COMPONENT::GetTransform(), SCH_DRAW_PANEL::GetView(), EDA_DRAW_PANEL_GAL::GetViewControls(), BASE_SCREEN::GetZoom(), HIGHLIGHT_PIN, KIGFX::SCH_VIEW::HighlightItem(), SCH_SHEET_PATH::LastScreen(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, m_probingPcbToSch, TOOL_BASE::m_toolMgr, SCH_ITEM::Next(), EDA_DRAW_PANEL_GAL::Refresh(), TOOL_MANAGER::RunAction(), SCH_COMPONENT_T, KIGFX::VIEW_CONTROLS::SetCrossHairCursorPosition(), BASE_SCREEN::SetZoom(), TRANSFORM::TransformCoordinate(), and EDA_ITEM::Type().

Referenced by SCH_EDIT_FRAME::ExecuteRemoteCommand(), and DIALOG_FIELDS_EDITOR_GLOBAL::OnTableCellClick().

◆ FindNext()

int SCH_EDITOR_CONTROL::FindNext ( const TOOL_EVENT aEvent)

Definition at line 205 of file sch_editor_control.cpp.

206 {
207  // A timer during which a subsequent FindNext will result in a wrap-around
208  static wxTimer wrapAroundTimer;
209 
210  wxFindReplaceData* data = m_frame->GetFindReplaceData();
211 
212  if( aEvent.IsAction( &ACTIONS::findNextMarker ) )
213  {
214  if( data )
215  g_markersOnly.SetFlags( data->GetFlags() );
216 
217  data = &g_markersOnly;
218  }
219  else if( !data )
220  {
221  return FindAndReplace( ACTIONS::find.MakeEvent() );
222  }
223 
224  bool searchAllSheets = !( data->GetFlags() & FR_CURRENT_SHEET_ONLY );
225  EE_SELECTION& selection = m_selectionTool->GetSelection();
226  SCH_SCREEN* afterScreen = m_frame->GetScreen();
227  EDA_ITEM* afterItem = selection.Front();
228  EDA_ITEM* item = nullptr;
229 
230  if( wrapAroundTimer.IsRunning() )
231  {
232  afterScreen = nullptr;
233  afterItem = nullptr;
234  wrapAroundTimer.Stop();
236  }
237 
239 
240  if( afterScreen || !searchAllSheets )
241  item = nextMatch( m_frame->GetScreen(), afterItem, data );
242 
243  if( !item && searchAllSheets )
244  {
245  SCH_SHEET_LIST schematic( g_RootSheet );
246  SCH_SCREENS screens;
247 
248  for( SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
249  {
250  if( afterScreen )
251  {
252  if( afterScreen == screen )
253  afterScreen = nullptr;
254 
255  continue;
256  }
257 
258  item = nextMatch( screen, nullptr, data );
259 
260  if( item )
261  {
262  SCH_SHEET_PATH* sheet = schematic.FindSheetForScreen( screen );
263  wxCHECK_MSG( sheet, 0, "Sheet not found for " + screen->GetFileName() );
264 
265  *g_CurrentSheet = *sheet;
267 
268  screen->SetZoom( m_frame->GetScreen()->GetZoom() );
269  screen->TestDanglingEnds();
270 
271  m_frame->SetScreen( screen );
272  UpdateFind( ACTIONS::updateFind.MakeEvent() );
273 
274  break;
275  }
276  }
277  }
278 
279  if( item )
280  {
281  m_selectionTool->AddItemToSel( item );
282  m_frame->FocusOnLocation( item->GetBoundingBox().GetCenter(), true );
283  m_frame->GetCanvas()->Refresh();
284  }
285  else
286  {
287  wxString msg = searchAllSheets ? _( "Reached end of schematic." )
288  : _( "Reached end of sheet." );
289 
290  m_frame->ShowFindReplaceStatus( msg + _( "\nFind again to wrap around to the start." ) );
291  wrapAroundTimer.StartOnce( 4000 );
292  }
293 
294  return 0;
295 }
Class SCH_SHEET_LIST.
int FindAndReplace(const TOOL_EVENT &aEvent)
SCH_SCREEN * GetNext()
Definition: sch_screen.cpp:994
wxFindReplaceData * GetFindReplaceData()
Get the find criteria (as set by the dialog).
void SetScreen(BASE_SCREEN *aScreen) override
static wxFindReplaceData g_markersOnly
double GetZoom() const
Function GetZoom returns the current "zoom factor", which is a measure of "internal units per device ...
Definition: base_screen.h:240
void UpdateAllScreenReferences()
Function UpdateAllScreenReferences updates the reference and the m_Multi parameter (part selection) f...
static TOOL_ACTION find
Definition: actions.h:78
bool IsAction(const TOOL_ACTION *aAction) const
Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_AC...
Definition: tool_event.cpp:67
EE_SELECTION & GetSelection()
Function GetSelection()
static TOOL_ACTION updateFind
Definition: actions.h:84
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:47
SCH_SHEET_PATH * g_CurrentSheet
With the new connectivity algorithm, many more places than before want to know what the current sheet...
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
int UpdateFind(const TOOL_EVENT &aEvent)
EDA_ITEM * nextMatch(SCH_SCREEN *aScreen, EDA_ITEM *after, wxFindReplaceData *data)
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:140
Class SCH_SHEET_PATH.
#define _(s)
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
static TOOL_ACTION findNextMarker
Definition: actions.h:81
void ClearFindReplaceStatus()
void FocusOnLocation(const wxPoint &aPos, bool aCenterView=false)
Useful to focus on a particular location, in find functions Move the graphic cursor (crosshair cursor...
int AddItemToSel(const TOOL_EVENT &aEvent)
int ClearSelection(const TOOL_EVENT &aEvent)
Clear current selection event handler.
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:163
SCH_SCREEN * GetFirst()
Definition: sch_screen.cpp:983
virtual const EDA_RECT GetBoundingBox() const
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
const wxPoint GetCenter() const
Definition: eda_rect.h:117
void ShowFindReplaceStatus(const wxString &aMsg)
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:491
EDA_ITEM * Front() const
Definition: selection.h:182

References _, EE_SELECTION_TOOL::AddItemToSel(), SCH_EDIT_FRAME::ClearFindReplaceStatus(), EE_SELECTION_TOOL::ClearSelection(), ACTIONS::find, FindAndReplace(), ACTIONS::findNextMarker, SCH_SHEET_LIST::FindSheetForScreen(), EDA_DRAW_FRAME::FocusOnLocation(), FR_CURRENT_SHEET_ONLY, SELECTION::Front(), g_CurrentSheet, g_markersOnly, g_RootSheet, EDA_ITEM::GetBoundingBox(), SCH_BASE_FRAME::GetCanvas(), EDA_RECT::GetCenter(), SCH_EDIT_FRAME::GetFindReplaceData(), SCH_SCREENS::GetFirst(), SCH_SCREENS::GetNext(), SCH_EDIT_FRAME::GetScreen(), EE_SELECTION_TOOL::GetSelection(), BASE_SCREEN::GetZoom(), TOOL_EVENT::IsAction(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, nextMatch(), EDA_DRAW_PANEL_GAL::Refresh(), SCH_EDIT_FRAME::SetScreen(), SCH_EDIT_FRAME::ShowFindReplaceStatus(), SCH_SHEET_PATH::UpdateAllScreenReferences(), UpdateFind(), and ACTIONS::updateFind.

Referenced by DIALOG_SCH_FIND::OnFind(), DIALOG_SCH_FIND::OnReplace(), ReplaceAndFindNext(), and setTransitions().

◆ GenerateBOM()

int SCH_EDITOR_CONTROL::GenerateBOM ( const TOOL_EVENT aEvent)

Definition at line 1241 of file sch_editor_control.cpp.

1242 {
1244  return 0;
1245 }
int InvokeDialogCreateBOM(SCH_EDIT_FRAME *aCaller)
Create and show DIALOG_BOM and return whatever DIALOG_BOM::ShowModal() returns.
Definition: dialog_bom.cpp:216

References InvokeDialogCreateBOM(), and EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame.

Referenced by setTransitions().

◆ getEditFrame()

template<typename T >
T* TOOL_BASE::getEditFrame ( ) const
inlineprotectedinherited

Function getEditFrame()

Returns the application window object, casted to requested user type.

Definition at line 187 of file tool_base.h.

188  {
189 #if !defined( QA_TEST ) // Dynamic casts give the linker a siezure in the test framework
190  wxASSERT( dynamic_cast<T*>( getEditFrameInt() ) );
191 #endif
192  return static_cast<T*>( getEditFrameInt() );
193  }
EDA_BASE_FRAME * getEditFrameInt() const
Definition: tool_base.cpp:48

References TOOL_BASE::getEditFrameInt().

Referenced by ZONE_CREATE_HELPER::createNewZone(), and TOOL_SETTINGS::getConfigBase().

◆ GetId()

TOOL_ID TOOL_BASE::GetId ( ) const
inlineinherited

Function GetId() Returns the unique identifier of the tool.

The identifier is set by an instance of TOOL_MANAGER.

Returns
Identifier of the tool.

Definition at line 121 of file tool_base.h.

122  {
123  return m_toolId;
124  }
TOOL_ID m_toolId
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:214

References TOOL_BASE::m_toolId.

Referenced by TOOL_MANAGER::finishTool(), TOOL_MANAGER::InitTools(), TOOL_MANAGER::isActive(), TOOL_MANAGER::RegisterTool(), ACTION_MANAGER::RunHotKey(), TOOL_MANAGER::runTool(), and TOOL_MANAGER::saveViewControls().

◆ GetManager()

TOOL_MANAGER* TOOL_BASE::GetManager ( ) const
inlineinherited

Function GetManager() Returns the instance of TOOL_MANAGER that takes care of the tool.

Returns
Instance of the TOOL_MANAGER. If there is no TOOL_MANAGER associated, it returns NULL.

Definition at line 143 of file tool_base.h.

144  {
145  return m_toolMgr;
146  }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219

References TOOL_BASE::m_toolMgr.

Referenced by BOARD_COMMIT::BOARD_COMMIT(), ZONE_CREATE_HELPER::commitZone(), ZONE_CREATE_HELPER::createNewZone(), PCB_TOOL_BASE::doInteractiveItemPlacement(), ACTION_MENU::getToolManager(), LIB_TREE::onContextMenu(), ZONE_CREATE_HELPER::OnFirstPoint(), ACTION_MENU::OnMenuEvent(), and ZONE_CREATE_HELPER::performZoneCutout().

◆ getModel()

template<typename T >
T* TOOL_BASE::getModel ( ) const
inlineprotectedinherited

Function getModel()

Returns the model object if it matches the requested type.

Definition at line 201 of file tool_base.h.

202  {
203  EDA_ITEM* m = getModelInt();
204 #if !defined( QA_TEST ) // Dynamic casts give the linker a siezure in the test framework
205  wxASSERT( dynamic_cast<T*>( m ) );
206 #endif
207  return static_cast<T*>( m );
208  }
EDA_ITEM * getModelInt() const
Definition: tool_base.cpp:54
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:163

References TOOL_BASE::getModelInt().

Referenced by ZONE_CREATE_HELPER::commitZone(), ZONE_CREATE_HELPER::createNewZone(), ZONE_CREATE_HELPER::createZoneFromExisting(), and ZONE_CREATE_HELPER::performZoneCutout().

◆ GetName()

const std::string& TOOL_BASE::GetName ( void  ) const
inlineinherited

Function GetName() Returns the name of the tool.

Tool names are expected to obey the format: application.ToolName (eg. pcbnew.InteractiveSelection).

Returns
The name of the tool.

Definition at line 132 of file tool_base.h.

133  {
134  return m_toolName;
135  }
std::string m_toolName
Name of the tool.
Definition: tool_base.h:218

References TOOL_BASE::m_toolName.

Referenced by TOOL_MANAGER::dispatchInternal(), TOOL_SETTINGS::getKeyName(), TOOL_MANAGER::InitTools(), TOOL_MANAGER::invokeTool(), and TOOL_MANAGER::RegisterTool().

◆ GetSettings()

TOOL_SETTINGS & TOOL_BASE::GetSettings ( )
inherited

Definition at line 78 of file tool_base.cpp.

79 {
80  return m_toolSettings;
81 }
TOOL_SETTINGS m_toolSettings
Definition: tool_base.h:220

References TOOL_BASE::m_toolSettings.

Referenced by ROUTER_TOOL::Init(), GERBVIEW_SELECTION_TOOL::selectable(), and ROUTER_TOOL::~ROUTER_TOOL().

◆ GetToolMenu()

◆ GetType()

TOOL_TYPE TOOL_BASE::GetType ( ) const
inlineinherited

Function GetType() Returns the type of the tool.

Returns
The type of the tool.

Definition at line 110 of file tool_base.h.

111  {
112  return m_type;
113  }
TOOL_TYPE m_type
Stores the type of the tool.
Definition: tool_base.h:211

References TOOL_BASE::m_type.

Referenced by TOOL_MANAGER::finishTool(), TOOL_MANAGER::InvokeTool(), TOOL_MANAGER::ResetTools(), and TOOL_MANAGER::runTool().

◆ getView()

KIGFX::VIEW * TOOL_BASE::getView ( ) const
protectedinherited

Function getView()

Returns the instance of VIEW object used in the application. It allows tools to draw.

Returns
The instance of VIEW.

Definition at line 36 of file tool_base.cpp.

37 {
38  return m_toolMgr->GetView();
39 }
KIGFX::VIEW * GetView() const
Definition: tool_manager.h:250
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219

References TOOL_MANAGER::GetView(), and TOOL_BASE::m_toolMgr.

Referenced by EE_POINT_EDITOR::addCornerCondition(), ALIGN_DISTRIBUTE_TOOL::AlignLeft(), ALIGN_DISTRIBUTE_TOOL::AlignRight(), COMMON_TOOLS::CenterContents(), PL_SELECTION_TOOL::ClearSelection(), EE_SELECTION_TOOL::ClearSelection(), COMMON_TOOLS::CursorControl(), LIB_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PL_EDIT_TOOL::DoDelete(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), MICROWAVE_TOOL::drawMicrowaveInductor(), PL_DRAWING_TOOLS::DrawShape(), PCB_EDITOR_CONTROL::DrillOrigin(), LIB_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), EE_SELECTION_TOOL::GetNode(), ROUTER_TOOL::getStartLayer(), COMMON_TOOLS::GridPreset(), PCBNEW_CONTROL::GridResetOrigin(), PCBNEW_CONTROL::GridSetOrigin(), SELECTION_TOOL::GuessSelectionCandidates(), PL_SELECTION_TOOL::highlight(), EE_SELECTION_TOOL::highlight(), SELECTION_TOOL::highlight(), GERBVIEW_CONTROL::HighlightControl(), PNS::TOOL_BASE::highlightNet(), PCB_INSPECTION_TOOL::highlightNet(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), PL_EDIT_TOOL::moveItem(), POINT_EDITOR::OnSelectionChange(), COMMON_TOOLS::PanControl(), LIB_EDIT_TOOL::Paste(), PL_EDIT_TOOL::Paste(), Paste(), PNS::TOOL_BASE::pickSingleItem(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Remove(), PCB_EDITOR_CONTROL::Reset(), PNS::TOOL_BASE::Reset(), PCBNEW_CONTROL::Reset(), GERBVIEW_SELECTION_TOOL::Reset(), DRAWING_TOOL::Reset(), EE_SELECTION_TOOL::Reset(), SELECTION_TOOL::Reset(), EE_TOOL_BASE< SCH_BASE_FRAME >::Reset(), SCH_EDIT_TOOL::Rotate(), GERBVIEW_SELECTION_TOOL::select(), GERBVIEW_SELECTION_TOOL::selectable(), SELECTION_TOOL::Selectable(), PL_SELECTION_TOOL::selectionContains(), EE_SELECTION_TOOL::selectionContains(), SELECTION_TOOL::selectionContains(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::SelectPoint(), EE_SELECTION_TOOL::SelectPoint(), ZOOM_TOOL::selectRegion(), GERBVIEW_SELECTION_TOOL::selectVisually(), PL_EDITOR_CONTROL::ToggleBackgroundColor(), COMMON_TOOLS::ToggleGrid(), ToggleHiddenPins(), PL_SELECTION_TOOL::unhighlight(), EE_SELECTION_TOOL::unhighlight(), SELECTION_TOOL::unhighlight(), GERBVIEW_SELECTION_TOOL::unselect(), GERBVIEW_SELECTION_TOOL::unselectVisually(), EE_POINT_EDITOR::updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), POINT_EDITOR::updateEditedPoint(), UpdateFind(), PCBNEW_CONTROL::updateGrid(), EE_POINT_EDITOR::updateItem(), PL_POINT_EDITOR::updateItem(), UpdateNetHighlighting(), EE_POINT_EDITOR::updatePoints(), PL_POINT_EDITOR::updatePoints(), POINT_EDITOR::updatePoints(), SELECTION_TOOL::updateSelection(), PNS::TOOL_BASE::updateStartItem(), EE_TOOL_BASE< SCH_BASE_FRAME >::updateView(), PCB_TOOL_BASE::view(), COMMON_TOOLS::ZoomFitScreen(), SELECTION_TOOL::zoomFitSelection(), EE_SELECTION_TOOL::~EE_SELECTION_TOOL(), GERBVIEW_SELECTION_TOOL::~GERBVIEW_SELECTION_TOOL(), and SELECTION_TOOL::~SELECTION_TOOL().

◆ getViewControls()

KIGFX::VIEW_CONTROLS * TOOL_BASE::getViewControls ( ) const
protectedinherited

Function getViewControls()

Returns the instance of VIEW_CONTROLS object used in the application. It allows tools to read & modify user input and its settings (eg. show cursor, enable snapping to grid, etc.)

Returns
The instance of VIEW_CONTROLS.

Definition at line 42 of file tool_base.cpp.

43 {
44  return m_toolMgr->GetViewControls();
45 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
KIGFX::VIEW_CONTROLS * GetViewControls() const
Definition: tool_manager.h:255

References TOOL_MANAGER::GetViewControls(), and TOOL_BASE::m_toolMgr.

Referenced by EE_POINT_EDITOR::addCorner(), POINT_EDITOR::addCorner(), EE_POINT_EDITOR::addCornerCondition(), SCH_EDIT_TOOL::BreakWire(), PCB_TOOL_BASE::controls(), COMMON_TOOLS::CursorControl(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), COMMON_TOOLS::doZoomToPreset(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), LIB_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), COMMON_TOOLS::GridPreset(), PCB_INSPECTION_TOOL::HighlightNet(), HighlightNet(), PCB_INSPECTION_TOOL::HighlightNetTool(), MODULE_EDITOR_TOOLS::ImportFootprint(), PL_EDIT_TOOL::Main(), SCH_MOVE_TOOL::Main(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), PICKER_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), ROUTER_TOOL::MainLoop(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), EDIT_TOOL::Move(), POINT_EDITOR::OnSelectionChange(), LIB_EDIT_TOOL::Paste(), ROUTER_TOOL::performDragging(), LIB_DRAWING_TOOLS::PlaceAnchor(), PCBNEW_CONTROL::placeBoardItems(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), SCH_EDIT_TOOL::RepeatDrawItem(), PL_SELECTION_TOOL::RequestSelection(), EE_SELECTION_TOOL::RequestSelection(), POINT_EDITOR::Reset(), DRAWING_TOOL::Reset(), COMMON_TOOLS::ResetLocalCoords(), GERBVIEW_SELECTION_TOOL::selectCursor(), SELECTION_TOOL::selectCursor(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::SelectNode(), ZOOM_TOOL::selectRegion(), ALIGN_DISTRIBUTE_TOOL::selectTarget(), PICKER_TOOL::setControls(), PCBNEW_PICKER_TOOL::setControls(), EE_POINT_EDITOR::setEditedPoint(), PL_POINT_EDITOR::setEditedPoint(), POINT_EDITOR::setEditedPoint(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), EE_POINT_EDITOR::updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), POINT_EDITOR::updateEditedPoint(), LIB_MOVE_TOOL::updateModificationPoint(), PL_EDIT_TOOL::updateModificationPoint(), EDIT_TOOL::updateModificationPoint(), and COMMON_TOOLS::ZoomCenter().

◆ Go()

template<class T >
void TOOL_INTERACTIVE::Go ( int(T::*)(const TOOL_EVENT &)  aStateFunc,
const TOOL_EVENT_LIST aConditions = TOOL_EVENTTC_ANYTA_ANY ) 
)
inherited

Function Go()

Defines which state (aStateFunc) to go when a certain event arrives (aConditions). No conditions means any event.

Definition at line 129 of file tool_interactive.h.

131 {
132  TOOL_STATE_FUNC sptr = std::bind( aStateFunc, static_cast<T*>( this ), std::placeholders::_1 );
133 
134  goInternal( sptr, aConditions );
135 }
std::function< int(const TOOL_EVENT &)> TOOL_STATE_FUNC
Definition: tool_base.h:58
void goInternal(TOOL_STATE_FUNC &aState, const TOOL_EVENT_LIST &aConditions)

References TOOL_INTERACTIVE::goInternal().

Referenced by LENGTH_TUNER_TOOL::setTransitions(), ZOOM_TOOL::setTransitions(), AUTOPLACE_TOOL::setTransitions(), MICROWAVE_TOOL::setTransitions(), ROUTER_TOOL::setTransitions(), CVPCB_FOOTPRINT_VIEWER_CONTROL::setTransitions(), LIB_PIN_TOOL::setTransitions(), PAD_TOOL::setTransitions(), EE_INSPECTION_TOOL::setTransitions(), PL_DRAWING_TOOLS::setTransitions(), COMMON_CONTROL::setTransitions(), LIB_DRAWING_TOOLS::setTransitions(), ZONE_FILLER_TOOL::setTransitions(), EE_POINT_EDITOR::setTransitions(), SCH_MOVE_TOOL::setTransitions(), PL_POINT_EDITOR::setTransitions(), KICAD_MANAGER_CONTROL::setTransitions(), LIB_MOVE_TOOL::setTransitions(), GERBVIEW_CONTROL::setTransitions(), SCH_DRAWING_TOOLS::setTransitions(), GLOBAL_EDIT_TOOL::setTransitions(), POINT_EDITOR::setTransitions(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::setTransitions(), LIB_CONTROL::setTransitions(), LIB_EDIT_TOOL::setTransitions(), PL_EDITOR_CONTROL::setTransitions(), SCH_EDIT_TOOL::setTransitions(), PL_EDIT_TOOL::setTransitions(), POSITION_RELATIVE_TOOL::setTransitions(), GERBVIEW_SELECTION_TOOL::setTransitions(), COMMON_TOOLS::setTransitions(), SCH_LINE_WIRE_BUS_TOOL::setTransitions(), PCB_INSPECTION_TOOL::setTransitions(), PCBNEW_CONTROL::setTransitions(), ALIGN_DISTRIBUTE_TOOL::setTransitions(), MODULE_EDITOR_TOOLS::setTransitions(), CVPCB_CONTROL::setTransitions(), CVPCB_ASSOCIATION_TOOL::setTransitions(), PCBNEW_PICKER_TOOL::setTransitions(), PICKER_TOOL::setTransitions(), PCB_EDITOR_CONTROL::setTransitions(), DRAWING_TOOL::setTransitions(), EDIT_TOOL::setTransitions(), SELECTION_TOOL::setTransitions(), setTransitions(), PL_SELECTION_TOOL::setTransitions(), EE_SELECTION_TOOL::setTransitions(), and DRC::setTransitions().

◆ HasMatch()

bool SCH_EDITOR_CONTROL::HasMatch ( )

Definition at line 298 of file sch_editor_control.cpp.

299 {
300  wxFindReplaceData* data = m_frame->GetFindReplaceData();
302 
303  return data && item && item->Matches( *data, nullptr );
304 }
wxFindReplaceData * GetFindReplaceData()
Get the find criteria (as set by the dialog).
EE_SELECTION & GetSelection()
Function GetSelection()
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:140
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:163
virtual bool Matches(wxFindReplaceData &aSearchData, void *aAuxData)
Function Matches compares the item against the search criteria in aSearchData.
Definition: base_struct.h:512
EDA_ITEM * Front() const
Definition: selection.h:182

References SELECTION::Front(), SCH_EDIT_FRAME::GetFindReplaceData(), EE_SELECTION_TOOL::GetSelection(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, and EDA_ITEM::Matches().

Referenced by DIALOG_SCH_FIND::OnUpdateReplaceUI().

◆ HighlightNet()

int SCH_EDITOR_CONTROL::HighlightNet ( const TOOL_EVENT aEvent)

Highlights net under the cursor.

Definition at line 685 of file sch_editor_control.cpp.

686 {
688  VECTOR2D cursorPos = controls->GetCursorPosition( !aEvent.Modifier( MD_ALT ) );
689 
690  highlightNet( m_toolMgr, cursorPos );
691 
692  return 0;
693 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
Class VIEW_CONTROLS is an interface for classes handling user events controlling the view behaviour (...
static bool highlightNet(TOOL_MANAGER *aToolMgr, const VECTOR2D &aPosition)
int Modifier(int aMask=MD_MODIFIER_MASK) const
Returns information about key modifiers state (Ctrl, Alt, etc.)
Definition: tool_event.h:342
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:42
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.

References KIGFX::VIEW_CONTROLS::GetCursorPosition(), TOOL_BASE::getViewControls(), highlightNet(), TOOL_BASE::m_toolMgr, MD_ALT, and TOOL_EVENT::Modifier().

Referenced by setTransitions().

◆ HighlightNetCursor()

int SCH_EDITOR_CONTROL::HighlightNetCursor ( const TOOL_EVENT aEvent)

Launches a tool to highlight nets.

Definition at line 781 of file sch_editor_control.cpp.

782 {
783  // TODO(JE) remove once real-time connectivity is a given
784  if( !ADVANCED_CFG::GetCfg().m_realTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime )
786 
787  std::string tool = aEvent.GetCommandStr().get();
789 
790  // Deactivate other tools; particularly important if another PICKER is currently running
791  Activate();
792 
793  picker->SetCursor( wxStockCursor( wxCURSOR_BULLSEYE ) );
794 
795  picker->SetClickHandler(
796  [this] ( const VECTOR2D& aPos )
797  {
798  return highlightNet( m_toolMgr, aPos );
799  } );
800 
801  m_toolMgr->RunAction( ACTIONS::pickerTool, true, &tool );
802 
803  return 0;
804 }
void SetCursor(const wxCursor &aCursor)
Definition: picker_tool.h:65
void RecalculateConnections(SCH_CLEANUP_FLAGS aCleanupFlags)
Generates the connection data for the entire schematic hierarchy.
void SetClickHandler(CLICK_HANDLER aHandler)
Function SetClickHandler() Sets a handler for mouse click event.
Definition: picker_tool.h:72
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:109
static TOOL_ACTION pickerTool
Definition: actions.h:145
static bool highlightNet(TOOL_MANAGER *aToolMgr, const VECTOR2D &aPosition)
static bool m_allowRealTime
OPT< std::string > GetCommandStr() const
Definition: tool_event.h:463
void Activate()
Function Activate() Runs the tool.
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers of advanced config.

References TOOL_INTERACTIVE::Activate(), ADVANCED_CFG::GetCfg(), TOOL_EVENT::GetCommandStr(), TOOL_MANAGER::GetTool(), highlightNet(), CONNECTION_GRAPH::m_allowRealTime, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, TOOL_BASE::m_toolMgr, NO_CLEANUP, ACTIONS::pickerTool, SCH_EDIT_FRAME::RecalculateConnections(), TOOL_MANAGER::RunAction(), PICKER_TOOL::SetClickHandler(), and PICKER_TOOL::SetCursor().

Referenced by setTransitions().

◆ ImportFPAssignments()

int SCH_EDITOR_CONTROL::ImportFPAssignments ( const TOOL_EVENT aEvent)

Definition at line 207 of file backanno.cpp.

208 {
209  wxString path = wxPathOnly( m_frame->Prj().GetProjectFullName() );
210 
211  wxFileDialog dlg( m_frame, _( "Load Symbol Footprint Link File" ),
212  path, wxEmptyString,
214  wxFD_OPEN | wxFD_FILE_MUST_EXIST );
215 
216  if( dlg.ShowModal() == wxID_CANCEL )
217  return 0;
218 
219  wxString filename = dlg.GetPath();
220 
221  wxArrayString choices;
222  choices.Add( _( "Keep existing footprint field visibility" ) );
223  choices.Add( _( "Show all footprint fields" ) );
224  choices.Add( _( "Hide all footprint fields" ) );
225 
226  wxSingleChoiceDialog choiceDlg( m_frame, _( "Select the footprint field visibility setting." ),
227  _( "Change Visibility" ), choices );
228 
229  if( choiceDlg.ShowModal() == wxID_CANCEL )
230  return 0;
231 
232  bool forceVisibility = (choiceDlg.GetSelection() != 0 );
233  bool visibilityState = (choiceDlg.GetSelection() == 1 );
234 
235  if( !processCmpToFootprintLinkFile( filename, forceVisibility, visibilityState ) )
236  {
237  wxString msg = wxString::Format( _( "Failed to open component-footprint link file \"%s\"" ),
238  filename.GetData() );
239 
240  DisplayError( m_frame, msg );
241  return 0;
242  }
243 
244  m_frame->SyncView();
245  m_frame->GetCanvas()->Refresh();
246  m_frame->OnModify();
247  return 0;
248 }
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:236
wxString ComponentFileWildcard()
void SyncView()
Mark all items for refresh.
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
bool processCmpToFootprintLinkFile(const wxString &aFullFilename, bool aForceVisibilityState, bool aVisibilityState)
Read the footprint info from each line in the stuff file by reference designator.
Definition: backanno.cpp:124
VTBL_ENTRY const wxString GetProjectFullName() const
Function GetProjectFullName returns the full path and name of the project.
Definition: project.cpp:96
#define _(s)
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...

References _, ComponentFileWildcard(), DisplayError(), Format(), SCH_BASE_FRAME::GetCanvas(), PROJECT::GetProjectFullName(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, SCH_EDIT_FRAME::OnModify(), KIWAY_HOLDER::Prj(), processCmpToFootprintLinkFile(), EDA_DRAW_PANEL_GAL::Refresh(), and SCH_BASE_FRAME::SyncView().

Referenced by setTransitions().

◆ Init()

bool EE_TOOL_BASE< SCH_EDIT_FRAME >::Init ( )
inlineoverridevirtualinherited

Function Init() Init() is called once upon a registration of the tool.

Returns
True if the initialization went fine, false - otherwise.

Reimplemented from TOOL_BASE.

Definition at line 69 of file ee_tool_base.h.

70  {
71  m_frame = getEditFrame<T>();
74 
75  // A basic context manu. Many (but not all) tools will choose to override this.
76 
77  auto& ctxMenu = m_menu.GetMenu();
78 
79  // cancel current tool goes in main context menu at the top if present
81  ctxMenu.AddSeparator( 1 );
82 
83  // Finally, add the standard zoom/grid items
85 
86  return true;
87  }
static bool ShowAlways(const SELECTION &aSelection)
Function ShowAlways The default condition function (always returns true).
void AddStandardSubMenus(TOOL_MENU &aMenu)
Function CreateBasicMenu.
TOOL_MENU m_menu
functions below are not yet implemented - their interface may change
CONDITIONAL_MENU & GetMenu()
Function GetMenu.
Definition: tool_menu.cpp:46
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
static TOOL_ACTION cancelInteractive
Definition: actions.h:65
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:140
bool IsType(FRAME_T aType) const
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Function AddItem()

◆ IsToolActive()

bool TOOL_BASE::IsToolActive ( ) const
inherited

Definition at line 31 of file tool_base.cpp.

32 {
33  return m_toolMgr->IsToolActive( m_toolId );
34 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
TOOL_ID m_toolId
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:214
bool IsToolActive(TOOL_ID aId) const
Function IsToolActive() Returns true if a tool with given id is active (executing)

References TOOL_MANAGER::IsToolActive(), TOOL_BASE::m_toolId, and TOOL_BASE::m_toolMgr.

◆ LeaveSheet()

int SCH_EDITOR_CONTROL::LeaveSheet ( const TOOL_EVENT aEvent)

Definition at line 1282 of file sch_editor_control.cpp.

1283 {
1284  if( g_CurrentSheet->Last() != g_RootSheet )
1285  {
1288 
1291  }
1292 
1293  return 0;
1294 }
SCH_SHEET * Last() const
Function Last returns a pointer to the last sheet of the list One can see the others sheet as the "pa...
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
static TOOL_ACTION cancelInteractive
Definition: actions.h:65
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:109
void DisplayCurrentSheet()
Draw the current sheet on the display.
Definition: hierarch.cpp:261
void pop_back()
Forwarded method from std::vector.
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:47
SCH_SHEET_PATH * g_CurrentSheet
With the new connectivity algorithm, many more places than before want to know what the current sheet...
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:58

References ACTIONS::cancelInteractive, EE_ACTIONS::clearSelection, SCH_EDIT_FRAME::DisplayCurrentSheet(), g_CurrentSheet, g_RootSheet, SCH_SHEET_PATH::Last(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, TOOL_BASE::m_toolMgr, SCH_SHEET_PATH::pop_back(), and TOOL_MANAGER::RunAction().

Referenced by setTransitions().

◆ loadCmpToFootprintLinkFile()

bool SCH_EDITOR_CONTROL::loadCmpToFootprintLinkFile ( )
private

Loads a .cmp file from CvPcb and update the footprint field of components.

Prepares parameters and calls ProcessCmpToFootprintLinkFileto actually read the file and update the footprint fields

◆ NavigateHierarchy()

int SCH_EDITOR_CONTROL::NavigateHierarchy ( const TOOL_EVENT aEvent)

Definition at line 132 of file hierarch.cpp.

133 {
134  HIERARCHY_NAVIG_DLG* treeframe = new HIERARCHY_NAVIG_DLG( m_frame );
135 
136  treeframe->ShowQuasiModal();
137  treeframe->Destroy();
138 
139  return 0;
140 }
int ShowQuasiModal()

References EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, and DIALOG_SHIM::ShowQuasiModal().

Referenced by setTransitions().

◆ New()

int SCH_EDITOR_CONTROL::New ( const TOOL_EVENT aEvent)

Definition at line 56 of file sch_editor_control.cpp.

57 {
59  return 0;
60 }

References EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, and SCH_EDIT_FRAME::NewProject().

Referenced by setTransitions().

◆ Open()

int SCH_EDITOR_CONTROL::Open ( const TOOL_EVENT aEvent)

Definition at line 63 of file sch_editor_control.cpp.

64 {
66  return 0;
67 }

References SCH_EDIT_FRAME::LoadProject(), and EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame.

Referenced by setTransitions().

◆ PageSetup()

int SCH_EDITOR_CONTROL::PageSetup ( const TOOL_EVENT aEvent)

Definition at line 84 of file sch_editor_control.cpp.

85 {
86  PICKED_ITEMS_LIST undoCmd;
88  ITEM_PICKER wrapper( undoItem, UR_PAGESETTINGS );
89 
90  undoCmd.PushItem( wrapper );
92 
94  dlg.SetWksFileName( BASE_SCREEN::m_PageLayoutDescrFileName );
95 
96  if( dlg.ShowModal() != wxID_OK )
98 
99  return 0;
100 }
void PushItem(const ITEM_PICKER &aItem)
Function PushItem pushes aItem to the top of the list.
static wxString m_PageLayoutDescrFileName
the name of the page layout descr file, or emty to used the default pagelayout
Definition: base_screen.h:109
void SaveCopyInUndoList(SCH_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, bool aAppend=false, const wxPoint &aTransformPoint=wxPoint(0, 0))
Create a copy of the current schematic item, and put it in the undo list.
Class PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
void RollbackSchematicFromUndo()
Performs an undo of the last edit WITHOUT logging a corresponding redo.
#define MAX_PAGE_SIZE_MILS
Definition: page_info.h:41

References EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, BASE_SCREEN::m_PageLayoutDescrFileName, MAX_PAGE_SIZE_MILS, PICKED_ITEMS_LIST::PushItem(), SCH_EDIT_FRAME::RollbackSchematicFromUndo(), SCH_EDIT_FRAME::SaveCopyInUndoList(), DIALOG_PAGES_SETTINGS::SetWksFileName(), and UR_PAGESETTINGS.

Referenced by setTransitions().

◆ Paste()

int SCH_EDITOR_CONTROL::Paste ( const TOOL_EVENT aEvent)

Definition at line 945 of file sch_editor_control.cpp.

946 {
947  wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( wxWindow::FindFocus() );
948 
949  if( textEntry )
950  {
951  textEntry->Paste();
952  return 0;
953  }
954 
956 
958  SCH_ITEM* lastExisting = dlist.GetLast();
959 
960  std::string text = m_toolMgr->GetClipboard();
961 
962  if( text.empty() )
963  return 0;
964 
965  STRING_LINE_READER reader( text, "Clipboard" );
966  SCH_LEGACY_PLUGIN plugin;
967 
968  try
969  {
970  plugin.LoadContent( reader, m_frame->GetScreen() );
971  }
972  catch( IO_ERROR& e )
973  {
974  // If it wasn't content, then paste as text
975  dlist.Append( new SCH_TEXT( wxPoint( 0, 0 ), text ) );
976  }
977 
978  bool forceKeepAnnotations = false;
979  bool forceDropAnnotations = false;
980  bool dropAnnotations = false;
981 
982  if( aEvent.IsAction( &ACTIONS::pasteSpecial ) )
983  {
984  DIALOG_PASTE_SPECIAL dlg( m_frame, &forceKeepAnnotations, &forceDropAnnotations );
985 
986  if( dlg.ShowModal() == wxID_CANCEL )
987  return 0;
988  }
989 
990  if( forceDropAnnotations )
991  dropAnnotations = true;
992 
993  // SCH_LEGACY_PLUGIN added the items to the DLIST, but not to the view or anything
994  // else. Pull them back out to start with.
995  //
996  SCH_ITEM* firstNew = lastExisting ? lastExisting->Next() : dlist.GetFirst();
997  EDA_ITEMS loadedItems;
998  SCH_ITEM* next = nullptr;
999 
1000  bool sheetsPasted = false;
1001  SCH_SHEET_LIST hierarchy( g_RootSheet );
1002  wxFileName destFn = g_CurrentSheet->Last()->GetFileName();
1003 
1004  if( destFn.IsRelative() )
1005  destFn.MakeAbsolute( m_frame->Prj().GetProjectPath() );
1006 
1007  for( SCH_ITEM* item = firstNew; item; item = next )
1008  {
1009  next = item->Next();
1010  dlist.Remove( item );
1011 
1012  loadedItems.push_back( item );
1013 
1014  if( item->Type() == SCH_COMPONENT_T )
1015  {
1016  if( !dropAnnotations && !forceKeepAnnotations )
1017  {
1018  for( SCH_ITEM* temp = dlist.GetFirst(); temp != lastExisting; temp = temp->Next() )
1019  {
1020  if( item->GetTimeStamp() == temp->GetTimeStamp() )
1021  dropAnnotations = true;
1022  }
1023  }
1024  }
1025  else if( item->Type() == SCH_SHEET_T )
1026  {
1027  SCH_SHEET* sheet = (SCH_SHEET*) item;
1028  wxFileName srcFn = sheet->GetFileName();
1029 
1030  if( srcFn.IsRelative() )
1031  srcFn.MakeAbsolute( m_frame->Prj().GetProjectPath() );
1032 
1033  SCH_SHEET_LIST sheetHierarchy( sheet );
1034 
1035  if( hierarchy.TestForRecursion( sheetHierarchy, destFn.GetFullPath( wxPATH_UNIX ) ) )
1036  {
1037  auto msg = wxString::Format( _( "The pasted sheet \"%s\"\n"
1038  "was dropped because the destination already has "
1039  "the sheet or one of its subsheets as a parent." ),
1040  sheet->GetFileName() );
1041  DisplayError( m_frame, msg );
1042  loadedItems.pop_back();
1043  }
1044  }
1045  }
1046 
1047  // Now we can resolve the components and add everything to the screen, view, etc.
1048  //
1049  SYMBOL_LIB_TABLE* symLibTable = m_frame->Prj().SchSymbolLibTable();
1050  PART_LIB* partLib = m_frame->Prj().SchLibs()->GetCacheLibrary();
1051 
1052  for( unsigned i = 0; i < loadedItems.size(); ++i )
1053  {
1054  EDA_ITEM* item = loadedItems[i];
1055 
1056  if( item->Type() == SCH_COMPONENT_T )
1057  {
1058  SCH_COMPONENT* component = (SCH_COMPONENT*) item;
1059 
1060  if( dropAnnotations )
1061  {
1062  component->SetTimeStamp( GetNewTimeStamp() );
1063 
1064  // clear the annotation, but preserve the selected unit
1065  int unit = component->GetUnit();
1066  component->ClearAnnotation( nullptr );
1067  component->SetUnit( unit );
1068  }
1069 
1070  component->Resolve( *symLibTable, partLib );
1071  component->UpdatePins();
1072  }
1073  else if( item->Type() == SCH_SHEET_T )
1074  {
1075  SCH_SHEET* sheet = (SCH_SHEET*) item;
1076  wxFileName fn = sheet->GetFileName();
1077  SCH_SCREEN* existingScreen = nullptr;
1078  bool dropSheetAnnotations = false;
1079 
1080  // Duplicate sheet names and timestamps are not valid. Generate new timestamps
1081  // and timestamp-based sheet names.
1082  timestamp_t uid = GetNewTimeStamp();
1083 
1084  sheet->SetName( wxString::Format( wxT( "sheet%8.8lX" ), (unsigned long)uid ) );
1085  sheet->SetTimeStamp( uid );
1086  sheet->SetParent( g_CurrentSheet->Last() );
1087  sheet->SetScreen( nullptr );
1088  sheetsPasted = true;
1089 
1090  if( !fn.IsAbsolute() )
1091  {
1092  wxFileName currentSheetFileName = g_CurrentSheet->LastScreen()->GetFileName();
1093  fn.Normalize( wxPATH_NORM_ALL, currentSheetFileName.GetPath() );
1094  }
1095 
1096  if( g_RootSheet->SearchHierarchy( fn.GetFullPath( wxPATH_UNIX ), &existingScreen ) )
1097  dropSheetAnnotations = true;
1098  else
1099  searchSupplementaryClipboard( sheet->GetFileName(), &existingScreen );
1100 
1101  if( existingScreen )
1102  {
1103  sheet->SetScreen( existingScreen );
1104 
1105  SCH_SHEET_PATH sheetpath = *g_CurrentSheet;
1106  sheetpath.push_back( sheet );
1107 
1108  // Clear annotation and create the AR for this path, if not exists,
1109  // when the screen is shared by sheet paths.
1110  // Otherwise ClearAnnotation do nothing, because the F1 field is used as
1111  // reference default value and takes the latest displayed value
1112  existingScreen->EnsureAlternateReferencesExist();
1113 
1114  if( forceDropAnnotations || dropSheetAnnotations )
1115  existingScreen->ClearAnnotation( &sheetpath );
1116  }
1117  else
1118  {
1119  if( !m_frame->LoadSheetFromFile( sheet, g_CurrentSheet, fn.GetFullPath() ) )
1120  m_frame->InitSheet( sheet, sheet->GetFileName() );
1121  }
1122  }
1123 
1124  item->SetFlags( IS_NEW | IS_PASTED | IS_MOVED );
1125  m_frame->AddItemToScreenAndUndoList( (SCH_ITEM*) item, i > 0 );
1126 
1127  // Reset flags for subsequent move operation
1128  item->SetFlags( IS_NEW | IS_PASTED | IS_MOVED );
1129  // Start out hidden so the pasted items aren't "ghosted" in their original location
1130  // before being moved to the current location.
1131  getView()->Hide( item, true );
1132  }
1133 
1134  if( sheetsPasted )
1136 
1137  // Now clear the previous selection, select the pasted items, and fire up the "move"
1138  // tool.
1139  //
1141  m_toolMgr->RunAction( EE_ACTIONS::addItemsToSel, true, &loadedItems );
1142 
1143  EE_SELECTION& selection = selTool->GetSelection();
1144 
1145  if( !selection.Empty() )
1146  {
1147  SCH_ITEM* item = (SCH_ITEM*) selection.GetTopLeftItem();
1148 
1149  selection.SetReferencePoint( item->GetPosition() );
1151  }
1152 
1153  return 0;
1154 }
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:236
CITER next(CITER it)
Definition: ptree.cpp:130
void Hide(VIEW_ITEM *aItem, bool aHide=true)
Temporarily hides the item in the view (e.g.
Definition: view.cpp:1507
Class SCH_SHEET_LIST.
void LoadContent(LINE_READER &aReader, SCH_SCREEN *aScreen, int version=EESCHEMA_VERSION)
static void UpdatePins(const EE_COLLECTOR &aComponents)
Update the pin cache for all components in aComponents.
void SetTimeStamp(timestamp_t aNewTimeStamp)
Change the time stamp to aNewTimeStamp and updates the reference path.
const wxString & GetFileName() const
Definition: sch_screen.h:123
bool SearchHierarchy(const wxString &aFilename, SCH_SCREEN **aScreen)
Search the existing hierarchy for an instance of screen loaded from aFileName.
Definition: sch_sheet.cpp:559
SCH_SHEET * Last() const
Function Last returns a pointer to the last sheet of the list One can see the others sheet as the "pa...
SCH_ITEM * Next() const
Definition: sch_item.h:153
static TOOL_ACTION addItemsToSel
Selects a list of items (specified as the event parameter)
Definition: ee_actions.h:65
bool Resolve(PART_LIBS *aLibs)
Assigns the current LIB_PART from aLibs which this symbol is based on.
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
Definition: sch_sheet.cpp:104
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:109
void InitSheet(SCH_SHEET *aSheet, const wxString &aNewFilename)
Definition: sheet.cpp:93
void EnsureAlternateReferencesExist()
For screens shared by many sheetpaths (complex hierarchies): to be able to clear or modify any refere...
Definition: sch_screen.cpp:748
bool searchSupplementaryClipboard(const wxString &aSheetFilename, SCH_SCREEN **aScreen)
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:102
bool IsAction(const TOOL_ACTION *aAction) const
Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_AC...
Definition: tool_event.cpp:67
EE_SELECTION & GetSelection()
Function GetSelection()
#define IS_NEW
New item, just created.
Definition: base_struct.h:120
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void SetReferencePoint(const VECTOR2I &aP)
Definition: selection.h:243
timestamp_t GetNewTimeStamp()
Definition: common.cpp:217
int GetUnit() const
virtual wxPoint GetPosition() const =0
Function GetPosition.
bool LoadSheetFromFile(SCH_SHEET *aSheet, SCH_SHEET_PATH *aHierarchy, const wxString &aFileName)
Load a the KiCad schematic file aFileName into the sheet aSheet.
Definition: sheet.cpp:102
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:265
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:47
SCH_SHEET_PATH * g_CurrentSheet
With the new connectivity algorithm, many more places than before want to know what the current sheet...
void SetName(const wxString &aName)
Definition: sch_sheet.h:273
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:225
std::vector< EDA_ITEM * > EDA_ITEMS
Define list of drawing items for screens.
Definition: base_struct.h:642
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
void SetUnit(int aUnit)
Change the unit number to aUnit.
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:58
Class SCH_SHEET_PATH.
void ClearAnnotation(SCH_SHEET_PATH *aSheetPath)
Clear exiting component annotation.
#define _(s)
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:119
A SCH_PLUGIN derivation for loading schematic files created before the new s-expression file format.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:209
static TOOL_ACTION pasteSpecial
Definition: actions.h:72
wxString GetFileName(void) const
Return the filename corresponding to this sheet.
Definition: sch_sheet.cpp:646
EDA_ITEM * GetTopLeftItem(bool onlyModules=false) const override
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
size_t i
Definition: json11.cpp:649
std::string GetClipboard() const
Returns the information currently stored in the system clipboard.
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:73
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:163
void ClearAnnotation(SCH_SHEET_PATH *aSheetPath)
Clear the annotation for the components in aSheetPath on the screen.
Definition: sch_screen.cpp:729
static TOOL_ACTION move
Definition: ee_actions.h:115
uint32_t timestamp_t
timestamp_t is our type to represent unique IDs for all kinds of elements; historically simply the ti...
Definition: common.h:53
Class STRING_LINE_READER is a LINE_READER that reads from a multiline 8 bit wide std::string.
Definition: richio.h:254
DLIST< SCH_ITEM > & GetDrawList()
Definition: sch_screen.h:106
Object used to load, save, search, and otherwise manipulate symbol library files.
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
Definition: sch_item.h:114
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
Definition: base_struct.h:133
SCH_SCREEN * LastScreen() const
Function LastScreen.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:210
void SetTimeStamp(timestamp_t aNewTimeStamp)
Definition: base_struct.h:215
void AddItemToScreenAndUndoList(SCH_ITEM *aItem, bool aUndoAppend=false)
Add an item to the schematic and adds the changes to the undo/redo container.
#define IS_MOVED
Item being moved.
Definition: base_struct.h:119

References _, EE_ACTIONS::addItemsToSel, SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_COMPONENT::ClearAnnotation(), SCH_SCREEN::ClearAnnotation(), EE_ACTIONS::clearSelection, DisplayError(), SELECTION::Empty(), SCH_SCREEN::EnsureAlternateReferencesExist(), Format(), g_CurrentSheet, g_RootSheet, TOOL_MANAGER::GetClipboard(), SCH_SCREEN::GetDrawList(), SCH_SCREEN::GetFileName(), SCH_SHEET::GetFileName(), GetNewTimeStamp(), SCH_ITEM::GetPosition(), PROJECT::GetProjectPath(), SCH_EDIT_FRAME::GetScreen(), EE_SELECTION_TOOL::GetSelection(), EDA_ITEM::GetTimeStamp(), TOOL_MANAGER::GetTool(), EE_SELECTION::GetTopLeftItem(), SCH_COMPONENT::GetUnit(), TOOL_BASE::getView(), KIGFX::VIEW::Hide(), i, SCH_EDIT_FRAME::InitSheet(), IS_MOVED, IS_NEW, IS_PASTED, TOOL_EVENT::IsAction(), SCH_SHEET_PATH::Last(), SCH_SHEET_PATH::LastScreen(), SCH_LEGACY_PLUGIN::LoadContent(), SCH_EDIT_FRAME::LoadSheetFromFile(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, TOOL_BASE::m_toolMgr, EE_ACTIONS::move, next(), SCH_ITEM::Next(), EDA_ITEM::Next(), ACTIONS::pasteSpecial, KIWAY_HOLDER::Prj(), SCH_SHEET_PATH::push_back(), SCH_COMPONENT::Resolve(), TOOL_MANAGER::RunAction(), SCH_COMPONENT_T, SCH_SHEET_T, SCH_SHEET::SearchHierarchy(), searchSupplementaryClipboard(), EDA_ITEM::SetFlags(), SCH_SHEET::SetName(), EDA_ITEM::SetParent(), SELECTION::SetReferencePoint(), SCH_SHEET::SetScreen(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), EDA_ITEM::SetTimeStamp(), SCH_COMPONENT::SetTimeStamp(), SCH_COMPONENT::SetUnit(), SCH_SHEET_LIST::TestForRecursion(), EDA_ITEM::Type(), and SCH_COMPONENT::UpdatePins().

Referenced by setTransitions().

◆ Plot()

int SCH_EDITOR_CONTROL::Plot ( const TOOL_EVENT aEvent)

Definition at line 110 of file sch_editor_control.cpp.

111 {
113  return 0;
114 }

References EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, and SCH_EDIT_FRAME::PlotSchematic().

Referenced by setTransitions().

◆ Print()

int SCH_EDITOR_CONTROL::Print ( const TOOL_EVENT aEvent)

Definition at line 103 of file sch_editor_control.cpp.

104 {
105  m_frame->Print();
106  return 0;
107 }
void Print()
Show the print dialog.

References EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, and SCH_EDIT_FRAME::Print().

Referenced by setTransitions().

◆ processCmpToFootprintLinkFile()

bool SCH_EDITOR_CONTROL::processCmpToFootprintLinkFile ( const wxString &  aFullFilename,
bool  aForceVisibilityState,
bool  aVisibilityState 
)
private

Read the footprint info from each line in the stuff file by reference designator.

The footprint link file (.cmp) entries created by CvPcb:

BeginCmp TimeStamp = /32307DE2/AA450F67; Reference = C1; ValeurCmp = 47uF; IdModule = CP6; EndCmp

Parameters
aFullFilename= the full filename to read
aForceVisibilityState= Set to true to change the footprint field visibility state to aVisibilityState. False retains the current footprint field visibility state.
aVisibilityStateTrue to show the footprint field or false to hide the footprint field if aForceVisibilityState is true.
Returns
bool = true if success.

Definition at line 124 of file backanno.cpp.

127 {
128  // Build a flat list of components in schematic:
129  SCH_REFERENCE_LIST referencesList;
130  SCH_SHEET_LIST sheetList( g_RootSheet );
131 
132  sheetList.GetComponents( referencesList, false );
133 
134  FILE* cmpFile = wxFopen( aFullFilename, wxT( "rt" ) );
135 
136  if( cmpFile == NULL )
137  return false;
138 
139  // cmpFileReader dtor will close cmpFile
140  FILE_LINE_READER cmpFileReader( cmpFile, aFullFilename );
141 
142  // Now, for each component found in file,
143  // replace footprint field value by the new value:
144  wxString reference;
145  wxString footprint;
146  wxString buffer;
147  wxString value;
148 
149  while( cmpFileReader.ReadLine() )
150  {
151  buffer = FROM_UTF8( cmpFileReader.Line() );
152 
153  if( !buffer.StartsWith( wxT( "BeginCmp" ) ) )
154  continue;
155 
156  // Begin component description.
157  reference.Empty();
158  footprint.Empty();
159 
160  while( cmpFileReader.ReadLine() )
161  {
162  buffer = FROM_UTF8( cmpFileReader.Line() );
163 
164  if( buffer.StartsWith( wxT( "EndCmp" ) ) )
165  break;
166 
167  // store string value, stored between '=' and ';' delimiters.
168  value = buffer.AfterFirst( '=' );
169  value = value.BeforeLast( ';' );
170  value.Trim(true);
171  value.Trim(false);
172 
173  if( buffer.StartsWith( wxT( "Reference" ) ) )
174  reference = value;
175  else if( buffer.StartsWith( wxT( "IdModule" ) ) )
176  footprint = value;
177  }
178 
179  // A block is read: initialize the footprint field of the corresponding component
180  // if the footprint name is not empty
181  if( reference.IsEmpty() )
182  continue;
183 
184  // Search the component in the flat list
185  for( unsigned ii = 0; ii < referencesList.GetCount(); ii++ )
186  {
187  if( reference == referencesList[ii].GetRef() )
188  {
189  // We have found a candidate.
190  // Note: it can be not unique (multiple units per part)
191  // So we *do not* stop the search here
192  SCH_COMPONENT* component = referencesList[ii].GetComp();
193  SCH_FIELD* fpfield = component->GetField( FOOTPRINT );
194 
195  fpfield->SetText( footprint );
196 
197  if( aForceVisibilityState )
198  component->GetField( FOOTPRINT )->SetVisible( aVisibilityState );
199  }
200  }
201  }
202 
203  return true;
204 }
Class SCH_SHEET_LIST.
Class SCH_FIELD instances are attached to a component and provide a place for the component's value,...
Definition: sch_field.h:52
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:62
void SetVisible(bool aVisible)
Definition: eda_text.h:169
Field Name Module PCB, i.e. "16DIP300".
Class SCH_REFERENCE_LIST is used to create a flattened list of components because in a complex hierar...
SCH_FIELD * GetField(int aFieldNdx) const
Returns a field in this symbol.
Class FILE_LINE_READER is a LINE_READER that reads from an open file.
Definition: richio.h:180
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:126
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:47
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:73
unsigned GetCount()
Function GetCount.

References FOOTPRINT, FROM_UTF8(), g_RootSheet, SCH_SHEET_LIST::GetComponents(), SCH_REFERENCE_LIST::GetCount(), SCH_COMPONENT::GetField(), LINE_READER::Line(), FILE_LINE_READER::ReadLine(), EDA_TEXT::SetText(), and EDA_TEXT::SetVisible().

Referenced by ImportFPAssignments().

◆ Quit()

int SCH_EDITOR_CONTROL::Quit ( const TOOL_EVENT aEvent)

Definition at line 117 of file sch_editor_control.cpp.

118 {
119  m_frame->Close( false );
120  return 0;
121 }

References EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame.

Referenced by setTransitions().

◆ Redo()

int SCH_EDITOR_CONTROL::Redo ( const TOOL_EVENT aEvent)

Definition at line 839 of file sch_editor_control.cpp.

840 {
841  if( m_frame->GetScreen()->GetRedoCommandCount() == 0 )
842  return 0;
843 
844  // Inform tools that undo command was issued
846 
847  /* Get the old list */
849 
850  /* Redo the command: */
851  m_frame->PutDataInPreviousState( List, true );
852 
853  /* Put the old list in UndoList */
854  List->ReversePickersListOrder();
856 
858  selTool->RebuildSelection();
859 
862 
863  m_frame->SyncView();
864  m_frame->GetCanvas()->Refresh();
865  m_frame->OnModify();
866 
867  return 0;
868 }
virtual void PushCommandToUndoList(PICKED_ITEMS_LIST *aItem)
Function PushCommandToUndoList add a command to undo in undo list delete the very old commands when t...
void ReversePickersListOrder()
Function ReversePickersListOrder reverses the order of pickers stored in this list.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
bool TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
bool ProcessEvent(const TOOL_EVENT &aEvent)
Propagates an event to tools that requested events of matching type(s).
void SyncView()
Mark all items for refresh.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual PICKED_ITEMS_LIST * PopCommandFromRedoList()
PopCommandFromRedoList return the last command to undo and remove it from list nothing is deleted.
Class PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
All active tools
Definition: tool_event.h:147
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void PutDataInPreviousState(PICKED_ITEMS_LIST *aList, bool aRedoCommand)
Restore an undo or redo command to put data pointed by aList in the previous state.
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
void RebuildSelection()
Rebuilds the selection from the EDA_ITEMs' selection flags.
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
int GetRedoCommandCount() const
Definition: base_screen.h:206

References AS_GLOBAL, SCH_BASE_FRAME::GetCanvas(), BASE_SCREEN::GetRedoCommandCount(), SCH_EDIT_FRAME::GetScreen(), TOOL_MANAGER::GetTool(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, TOOL_BASE::m_toolMgr, SCH_EDIT_FRAME::OnModify(), BASE_SCREEN::PopCommandFromRedoList(), TOOL_MANAGER::ProcessEvent(), BASE_SCREEN::PushCommandToUndoList(), SCH_EDIT_FRAME::PutDataInPreviousState(), EE_SELECTION_TOOL::RebuildSelection(), EDA_DRAW_PANEL_GAL::Refresh(), PICKED_ITEMS_LIST::ReversePickersListOrder(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), SCH_BASE_FRAME::SyncView(), TA_UNDO_REDO_PRE, TC_MESSAGE, and SCH_EDIT_FRAME::TestDanglingEnds().

Referenced by setTransitions().

◆ ReplaceAll()

int SCH_EDITOR_CONTROL::ReplaceAll ( const TOOL_EVENT aEvent)

Definition at line 325 of file sch_editor_control.cpp.

326 {
327  wxFindReplaceData* data = m_frame->GetFindReplaceData();
328 
329  if( !data )
330  return FindAndReplace( ACTIONS::find.MakeEvent() );
331 
332  SCH_SHEET_LIST schematic( g_RootSheet );
333  SCH_SCREENS screens;
334 
335  for( SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
336  {
337  for( EDA_ITEM* item = nextMatch( screen, nullptr, data ); item;
338  item = nextMatch( screen, item, data ) )
339  {
340  item->Replace( *data, schematic.FindSheetForScreen( screen ) );
341  }
342  }
343 
344  return 0;
345 }
Class SCH_SHEET_LIST.
int FindAndReplace(const TOOL_EVENT &aEvent)
SCH_SCREEN * GetNext()
Definition: sch_screen.cpp:994
wxFindReplaceData * GetFindReplaceData()
Get the find criteria (as set by the dialog).
static TOOL_ACTION find
Definition: actions.h:78
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:47
EDA_ITEM * nextMatch(SCH_SCREEN *aScreen, EDA_ITEM *after, wxFindReplaceData *data)
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:163
SCH_SCREEN * GetFirst()
Definition: sch_screen.cpp:983
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:491

References ACTIONS::find, FindAndReplace(), SCH_SHEET_LIST::FindSheetForScreen(), g_RootSheet, SCH_EDIT_FRAME::GetFindReplaceData(), SCH_SCREENS::GetFirst(), SCH_SCREENS::GetNext(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, and nextMatch().

Referenced by setTransitions().

◆ ReplaceAndFindNext()

int SCH_EDITOR_CONTROL::ReplaceAndFindNext ( const TOOL_EVENT aEvent)

Definition at line 307 of file sch_editor_control.cpp.

308 {
309  wxFindReplaceData* data = m_frame->GetFindReplaceData();
311 
312  if( !data )
313  return FindAndReplace( ACTIONS::find.MakeEvent() );
314 
315  if( item && item->Matches( *data, nullptr ) )
316  {
317  item->Replace( *data, g_CurrentSheet );
318  FindNext( ACTIONS::findNext.MakeEvent() );
319  }
320 
321  return 0;
322 }
int FindAndReplace(const TOOL_EVENT &aEvent)
wxFindReplaceData * GetFindReplaceData()
Get the find criteria (as set by the dialog).
static bool Replace(wxFindReplaceData &aSearchData, wxString &aText)
Helper function used in search and replace dialog Function Replace performs a text replace on aText u...
int FindNext(const TOOL_EVENT &aEvent)
static TOOL_ACTION find
Definition: actions.h:78
EE_SELECTION & GetSelection()
Function GetSelection()
SCH_SHEET_PATH * g_CurrentSheet
With the new connectivity algorithm, many more places than before want to know what the current sheet...
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:140
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:163
virtual bool Matches(wxFindReplaceData &aSearchData, void *aAuxData)
Function Matches compares the item against the search criteria in aSearchData.
Definition: base_struct.h:512
static TOOL_ACTION findNext
Definition: actions.h:80
EDA_ITEM * Front() const
Definition: selection.h:182

References ACTIONS::find, FindAndReplace(), FindNext(), ACTIONS::findNext, SELECTION::Front(), g_CurrentSheet, SCH_EDIT_FRAME::GetFindReplaceData(), EE_SELECTION_TOOL::GetSelection(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, EDA_ITEM::Matches(), and EDA_ITEM::Replace().

Referenced by setTransitions().

◆ Reset()

void EE_TOOL_BASE< SCH_EDIT_FRAME >::Reset ( RESET_REASON  aReason)
inlineoverridevirtualinherited

Function Reset() Brings the tool to a known, initial state.

If the tool claimed anything from the model or the view, it must release it when its reset.

Parameters
aReasoncontains information about the reason of tool reset.

Implements TOOL_BASE.

Definition at line 90 of file ee_tool_base.h.

91  {
92  if( aReason == MODEL_RELOAD )
93  {
94  // Init variables used by every drawing tool
95  m_frame = getEditFrame<T>();
96  m_isLibEdit = dynamic_cast<LIB_EDIT_FRAME*>( m_frame ) != nullptr;
97  }
98 
99  m_view = static_cast<KIGFX::SCH_VIEW*>( getView() );
100  }
Model changes (required full reload)
Definition: tool_base.h:82
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36

◆ RunMainStack()

void TOOL_INTERACTIVE::RunMainStack ( std::function< void()>  aFunc)
inherited

Function RunMainStack()

Calls a function using the main stack.

Parameters
aFuncis the function to be calls.

Definition at line 87 of file tool_interactive.cpp.

88 {
89  m_toolMgr->RunMainStack( this, std::move( aFunc ) );
90 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
void RunMainStack(TOOL_BASE *aTool, std::function< void()> aFunc)

References TOOL_BASE::m_toolMgr, and TOOL_MANAGER::RunMainStack().

Referenced by DRAWING_TOOL::PlaceText().

◆ Save()

int SCH_EDITOR_CONTROL::Save ( const TOOL_EVENT aEvent)

Definition at line 70 of file sch_editor_control.cpp.

71 {
73  return 0;
74 }

References EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, and SCH_EDIT_FRAME::SaveProject().

Referenced by setTransitions().

◆ SaveAs()

int SCH_EDITOR_CONTROL::SaveAs ( const TOOL_EVENT aEvent)

Definition at line 77 of file sch_editor_control.cpp.

78 {
79  m_frame->Save_File( true );
80  return 0;
81 }
void Save_File(bool doSaveAs=false)

References EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, and SCH_EDIT_FRAME::Save_File().

Referenced by setTransitions().

◆ saveCopyInUndoList()

void EE_TOOL_BASE< SCH_EDIT_FRAME >::saveCopyInUndoList ( EDA_ITEM aItem,
UNDO_REDO_T  aType,
bool  aAppend = false 
)
inlineprotectedinherited

Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.

Definition at line 117 of file ee_tool_base.h.

118  {
119  KICAD_T itemType = aItem->Type();
120 
121  if( m_isLibEdit )
122  {
123  LIB_EDIT_FRAME* editFrame = dynamic_cast<LIB_EDIT_FRAME*>( m_frame );
124  editFrame->SaveCopyInUndoList( (LIB_ITEM*) aItem, aType, aAppend );
125  }
126  else
127  {
128  SCH_EDIT_FRAME* editFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
129 
130  if( itemType == SCH_PIN_T || itemType == SCH_FIELD_T || itemType == SCH_SHEET_PIN_T )
131  editFrame->SaveCopyInUndoList( (SCH_ITEM*) aItem->GetParent(), UR_CHANGED, aAppend );
132  else
133  editFrame->SaveCopyInUndoList( (SCH_ITEM*) aItem, aType, aAppend );
134  }
135  }
Schematic editor (Eeschema) main window.
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
void SaveCopyInUndoList(SCH_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, bool aAppend=false, const wxPoint &aTransformPoint=wxPoint(0, 0))
Create a copy of the current schematic item, and put it in the undo list.
EDA_ITEM * GetParent() const
Definition: base_struct.h:220
The symbol library editor main window.
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
Definition: sch_item.h:114
void SaveCopyInUndoList(EDA_ITEM *ItemToCopy, UNDO_REDO_T undoType=UR_LIBEDIT, bool aAppend=false)
Create a copy of the current component, and save it in the undo list.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:210

◆ searchSupplementaryClipboard()

bool SCH_EDITOR_CONTROL::searchSupplementaryClipboard ( const wxString &  aSheetFilename,
SCH_SCREEN **  aScreen 
)
private

Definition at line 899 of file sch_editor_control.cpp.

901 {
902  if( m_supplementaryClipboard.count( aSheetFilename ) > 0 )
903  {
904  *aScreen = m_supplementaryClipboard[ aSheetFilename ];
905  return true;
906  }
907 
908  return false;
909 }
std::map< wxString, SCH_SCREEN * > m_supplementaryClipboard

References m_supplementaryClipboard.

Referenced by Paste().

◆ SetContextMenu()

void TOOL_INTERACTIVE::SetContextMenu ( ACTION_MENU aMenu,
CONTEXT_MENU_TRIGGER  aTrigger = CMENU_BUTTON 
)
inherited

Function SetContextMenu()

Assigns a context menu and tells when it should be activated.

Parameters
aMenuis the menu to be assigned.
aTriggerdetermines conditions upon which the context menu is activated.

Definition at line 76 of file tool_interactive.cpp.

77 {
78  if( aMenu )
79  aMenu->SetTool( this );
80  else
81  aTrigger = CMENU_OFF;
82 
83  m_toolMgr->ScheduleContextMenu( this, aMenu, aTrigger );
84 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
void SetTool(TOOL_INTERACTIVE *aTool)
Function SetTool() Sets a tool that is the creator of the menu.
void ScheduleContextMenu(TOOL_BASE *aTool, ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger)
Sets behaviour of the tool's context popup menu.

References CMENU_OFF, TOOL_BASE::m_toolMgr, TOOL_MANAGER::ScheduleContextMenu(), and ACTION_MENU::SetTool().

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), TOOL_MENU::ShowContextMenu(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ setTransitions()

void SCH_EDITOR_CONTROL::setTransitions ( )
overrideprivatevirtual

Sets up handlers for various events.

Implements TOOL_INTERACTIVE.

Definition at line 1319 of file sch_editor_control.cpp.

1320 {
1321  Go( &SCH_EDITOR_CONTROL::New, ACTIONS::doNew.MakeEvent() );
1322  Go( &SCH_EDITOR_CONTROL::Open, ACTIONS::open.MakeEvent() );
1323  Go( &SCH_EDITOR_CONTROL::Save, ACTIONS::save.MakeEvent() );
1326  Go( &SCH_EDITOR_CONTROL::Print, ACTIONS::print.MakeEvent() );
1327  Go( &SCH_EDITOR_CONTROL::Plot, ACTIONS::plot.MakeEvent() );
1328  Go( &SCH_EDITOR_CONTROL::Quit, ACTIONS::quit.MakeEvent() );
1329 
1338 
1343 
1344 #ifdef KICAD_SPICE
1345  Go( &SCH_EDITOR_CONTROL::SimProbe, EE_ACTIONS::simProbe.MakeEvent() );
1346  Go( &SCH_EDITOR_CONTROL::SimTune, EE_ACTIONS::simTune.MakeEvent() );
1347 #endif /* KICAD_SPICE */
1348 
1355 
1356  Go( &SCH_EDITOR_CONTROL::Undo, ACTIONS::undo.MakeEvent() );
1357  Go( &SCH_EDITOR_CONTROL::Redo, ACTIONS::redo.MakeEvent() );
1358  Go( &SCH_EDITOR_CONTROL::Cut, ACTIONS::cut.MakeEvent() );
1359  Go( &SCH_EDITOR_CONTROL::Copy, ACTIONS::copy.MakeEvent() );
1360  Go( &SCH_EDITOR_CONTROL::Paste, ACTIONS::paste.MakeEvent() );
1362 
1374 
1376 
1380 
1383 }
int Save(const TOOL_EVENT &aEvent)
int FindAndReplace(const TOOL_EVENT &aEvent)
int Copy(const TOOL_EVENT &aEvent)
static const TOOL_EVENT SelectedEvent
Definition: actions.h:197
static TOOL_ACTION findAndReplace
Definition: actions.h:79
static TOOL_ACTION exportNetlist
Definition: ee_actions.h:159
static TOOL_ACTION navigateHierarchy
Definition: ee_actions.h:178
int HighlightNetCursor(const TOOL_EVENT &aEvent)
Launches a tool to highlight nets.
static TOOL_ACTION assignFootprints
Definition: ee_actions.h:152
static TOOL_ACTION pageSettings
Definition: actions.h:59
static const TOOL_EVENT UnselectedEvent
Definition: actions.h:198
int Redo(const TOOL_EVENT &aEvent)
int NavigateHierarchy(const TOOL_EVENT &aEvent)
Definition: hierarch.cpp:132
int EditSymbolFields(const TOOL_EVENT &aEvent)
static TOOL_ACTION replaceAll
Definition: actions.h:83
int ReplaceAndFindNext(const TOOL_EVENT &aEvent)
static TOOL_ACTION cancelInteractive
Definition: actions.h:65
int New(const TOOL_EVENT &aEvent)
int FindNext(const TOOL_EVENT &aEvent)
static TOOL_ACTION updatePcbFromSchematic
Definition: actions.h:153
int ExplicitCrossProbeToPcb(const TOOL_EVENT &aEvent)
Equivalent to the above, but initiated by the user.
static TOOL_ACTION print
Definition: actions.h:60
int Annotate(const TOOL_EVENT &aEvent)
int GenerateBOM(const TOOL_EVENT &aEvent)
static TOOL_ACTION find
Definition: actions.h:78
int EditSymbolLibraryLinks(const TOOL_EVENT &aEvent)
int CrossProbeToPcb(const TOOL_EVENT &aEvent)
Notifies pcbnew about the selected item.
static TOOL_ACTION updateNetHighlighting
Definition: ee_actions.h:204
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Function Go()
int DrawSheetOnClipboard(const TOOL_EVENT &aEvent)
static const TOOL_EVENT SelectedItemsModified
Definition: actions.h:201
int SaveAs(const TOOL_EVENT &aEvent)
int ToggleForceHV(const TOOL_EVENT &aEvent)
int HighlightNet(const TOOL_EVENT &aEvent)
Highlights net under the cursor.
static TOOL_ACTION leaveSheet
Definition: ee_actions.h:177
static TOOL_ACTION updateFind
Definition: actions.h:84
static TOOL_ACTION annotate
Definition: ee_actions.h:146
int EnterSheet(const TOOL_EVENT &aEvent)
int ShowPcbNew(const TOOL_EVENT &aEvent)
int Paste(const TOOL_EVENT &aEvent)
static TOOL_ACTION showPcbNew
Definition: ee_actions.h:157
static TOOL_ACTION copy
Definition: actions.h:70
int UpdatePCB(const TOOL_EVENT &aEvent)
int ShowCvpcb(const TOOL_EVENT &aEvent)
static TOOL_ACTION highlightNetTool
Definition: ee_actions.h:205
static TOOL_ACTION showBusManager
Definition: ee_actions.h:153
static TOOL_ACTION editSymbolFields
Definition: ee_actions.h:147
int LeaveSheet(const TOOL_EVENT &aEvent)
static TOOL_ACTION simTune
Definition: ee_actions.h:199
int Print(const TOOL_EVENT &aEvent)
int ReplaceAll(const TOOL_EVENT &aEvent)
static TOOL_ACTION open
Definition: actions.h:53
static TOOL_ACTION explicitCrossProbe
Definition: ee_actions.h:186
static TOOL_ACTION save
Definition: actions.h:54
static TOOL_ACTION doNew
Definition: actions.h:47
int UpdateFind(const TOOL_EVENT &aEvent)
int EditWithLibEdit(const TOOL_EVENT &aEvent)
int Plot(const TOOL_EVENT &aEvent)
static TOOL_ACTION cut
Definition: actions.h:69
int ImportFPAssignments(const TOOL_EVENT &aEvent)
Definition: backanno.cpp:207
static TOOL_ACTION quit
Definition: actions.h:62
static const TOOL_EVENT ClearedEvent
Definition: actions.h:199
static TOOL_ACTION replaceAndFindNext
Definition: actions.h:82
static TOOL_ACTION plot
Definition: actions.h:61
int ToggleHiddenPins(const TOOL_EVENT &aEvent)
int UpdateNetHighlighting(const TOOL_EVENT &aEvent)
Updates net highlighting after an edit
static TOOL_ACTION pasteSpecial
Definition: actions.h:72
int Open(const TOOL_EVENT &aEvent)
static TOOL_ACTION findNextMarker
Definition: actions.h:81
static TOOL_ACTION redo
Definition: actions.h:68
int PageSetup(const TOOL_EVENT &aEvent)
int Quit(const TOOL_EVENT &aEvent)
static TOOL_ACTION saveAs
Definition: actions.h:55
static TOOL_ACTION toggleHiddenPins
Definition: ee_actions.h:183
int ShowBusManager(const TOOL_EVENT &aEvent)
int Cut(const TOOL_EVENT &aEvent)
Clipboard support.
static TOOL_ACTION importFPAssignments
Definition: ee_actions.h:158
int ClearHighlight(const TOOL_EVENT &aEvent)
Removes any net highlighting
static TOOL_ACTION drawSheetOnClipboard
Definition: ee_actions.h:193
int Undo(const TOOL_EVENT &aEvent)
static TOOL_ACTION enterSheet
Definition: ee_actions.h:176
static TOOL_ACTION clearHighlight
Definition: ee_actions.h:203
static TOOL_ACTION editWithLibEdit
Definition: ee_actions.h:156
static TOOL_ACTION simProbe
Definition: ee_actions.h:198
static TOOL_ACTION undo
Definition: actions.h:67
static TOOL_ACTION generateBOM
Definition: ee_actions.h:160
static TOOL_ACTION highlightNet
Definition: ee_actions.h:202
static TOOL_ACTION editSymbolLibraryLinks
Definition: ee_actions.h:148
static TOOL_ACTION toggleForceHV
Definition: ee_actions.h:192
static TOOL_ACTION findNext
Definition: actions.h:80
static TOOL_ACTION paste
Definition: actions.h:71
int ExportNetlist(const TOOL_EVENT &aEvent)

References Annotate(), EE_ACTIONS::annotate, EE_ACTIONS::assignFootprints, ACTIONS::cancelInteractive, EVENTS::ClearedEvent, ClearHighlight(), EE_ACTIONS::clearHighlight, ACTIONS::copy, Copy(), CrossProbeToPcb(), ACTIONS::cut, Cut(), ACTIONS::doNew, DrawSheetOnClipboard(), EE_ACTIONS::drawSheetOnClipboard, EditSymbolFields(), EE_ACTIONS::editSymbolFields, EditSymbolLibraryLinks(), EE_ACTIONS::editSymbolLibraryLinks, EditWithLibEdit(), EE_ACTIONS::editWithLibEdit, EnterSheet(), EE_ACTIONS::enterSheet, EE_ACTIONS::explicitCrossProbe, ExplicitCrossProbeToPcb(), ExportNetlist(), EE_ACTIONS::exportNetlist, ACTIONS::find, FindAndReplace(), ACTIONS::findAndReplace, FindNext(), ACTIONS::findNext, ACTIONS::findNextMarker, GenerateBOM(), EE_ACTIONS::generateBOM, TOOL_INTERACTIVE::Go(), HighlightNet(), EE_ACTIONS::highlightNet, HighlightNetCursor(), EE_ACTIONS::highlightNetTool, ImportFPAssignments(), EE_ACTIONS::importFPAssignments, LeaveSheet(), EE_ACTIONS::leaveSheet, NavigateHierarchy(), EE_ACTIONS::navigateHierarchy, New(), Open(), ACTIONS::open, ACTIONS::pageSettings, PageSetup(), ACTIONS::paste, Paste(), ACTIONS::pasteSpecial, Plot(), ACTIONS::plot, Print(), ACTIONS::print, Quit(), ACTIONS::quit, ACTIONS::redo, Redo(), ReplaceAll(), ACTIONS::replaceAll, ReplaceAndFindNext(), ACTIONS::replaceAndFindNext, Save(), ACTIONS::save, SaveAs(), ACTIONS::saveAs, EVENTS::SelectedEvent, EVENTS::SelectedItemsModified, ShowBusManager(), EE_ACTIONS::showBusManager, ShowCvpcb(), ShowPcbNew(), EE_ACTIONS::showPcbNew, EE_ACTIONS::simProbe, EE_ACTIONS::simTune, ToggleForceHV(), EE_ACTIONS::toggleForceHV, ToggleHiddenPins(), EE_ACTIONS::toggleHiddenPins, ACTIONS::undo, Undo(), EVENTS::UnselectedEvent, UpdateFind(), ACTIONS::updateFind, UpdateNetHighlighting(), EE_ACTIONS::updateNetHighlighting, UpdatePCB(), and ACTIONS::updatePcbFromSchematic.

◆ ShowBusManager()

int SCH_EDITOR_CONTROL::ShowBusManager ( const TOOL_EVENT aEvent)

Definition at line 1255 of file sch_editor_control.cpp.

1256 {
1258  return 0;
1259 }
void InvokeDialogBusManager(SCH_EDIT_FRAME *aCaller)
Create and show DIALOG_BUS_MANAGER.

References InvokeDialogBusManager(), and EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame.

Referenced by setTransitions().

◆ ShowCvpcb()

int SCH_EDITOR_CONTROL::ShowCvpcb ( const TOOL_EVENT aEvent)

Definition at line 1188 of file sch_editor_control.cpp.

1189 {
1190  wxCommandEvent dummy;
1192  return 0;
1193 }
void OnOpenCvpcb(wxCommandEvent &event)
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.

References dummy(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, and SCH_EDIT_FRAME::OnOpenCvpcb().

Referenced by setTransitions().

◆ ShowPcbNew()

int SCH_EDITOR_CONTROL::ShowPcbNew ( const TOOL_EVENT aEvent)

Definition at line 1213 of file sch_editor_control.cpp.

1214 {
1215  wxCommandEvent dummy;
1217  return 0;
1218 }
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
void OnOpenPcbnew(wxCommandEvent &event)

References dummy(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, and SCH_EDIT_FRAME::OnOpenPcbnew().

Referenced by setTransitions().

◆ ToggleForceHV()

int SCH_EDITOR_CONTROL::ToggleForceHV ( const TOOL_EVENT aEvent)

Definition at line 1311 of file sch_editor_control.cpp.

1312 {
1314 
1315  return 0;
1316 }
void SetForceHVLines(bool aForceHVdirection)
bool GetForceHVLines() const

References SCH_EDIT_FRAME::GetForceHVLines(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, and SCH_EDIT_FRAME::SetForceHVLines().

Referenced by setTransitions().

◆ ToggleHiddenPins()

int SCH_EDITOR_CONTROL::ToggleHiddenPins ( const TOOL_EVENT aEvent)

Definition at line 1297 of file sch_editor_control.cpp.

1298 {
1300 
1301  auto painter = static_cast<KIGFX::SCH_PAINTER*>( getView()->GetPainter() );
1302  painter->GetSettings()->m_ShowHiddenPins = m_frame->GetShowAllPins();
1303 
1305  m_frame->GetCanvas()->Refresh();
1306 
1307  return 0;
1308 }
void UpdateAllItems(int aUpdateFlags)
Updates all items in the view according to the given flags.
Definition: view.cpp:1444
Item is being added to the view.
Definition: view_item.h:60
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
bool GetShowAllPins() const override
Allow some frames to show/hide hidden pins.
void SetShowAllPins(bool aEnable)

References SCH_BASE_FRAME::GetCanvas(), SCH_EDIT_FRAME::GetShowAllPins(), TOOL_BASE::getView(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EDA_DRAW_PANEL_GAL::Refresh(), KIGFX::REPAINT, SCH_EDIT_FRAME::SetShowAllPins(), and KIGFX::VIEW::UpdateAllItems().

Referenced by setTransitions().

◆ Undo()

int SCH_EDITOR_CONTROL::Undo ( const TOOL_EVENT aEvent)

Definition at line 807 of file sch_editor_control.cpp.

808 {
809  if( m_frame->GetScreen()->GetUndoCommandCount() <= 0 )
810  return 0;
811 
812  // Inform tools that undo command was issued
814 
815  /* Get the old list */
817 
818  /* Undo the command */
819  m_frame->PutDataInPreviousState( List, false );
820 
821  /* Put the old list in RedoList */
822  List->ReversePickersListOrder();
824 
826  selTool->RebuildSelection();
827 
830 
831  m_frame->SyncView();
832  m_frame->GetCanvas()->Refresh();
833  m_frame->OnModify();
834 
835  return 0;
836 }
void ReversePickersListOrder()
Function ReversePickersListOrder reverses the order of pickers stored in this list.
int GetUndoCommandCount() const
Definition: base_screen.h:201
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
bool TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
virtual PICKED_ITEMS_LIST * PopCommandFromUndoList()
PopCommandFromUndoList return the last command to undo and remove it from list nothing is deleted.
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
bool ProcessEvent(const TOOL_EVENT &aEvent)
Propagates an event to tools that requested events of matching type(s).
void SyncView()
Mark all items for refresh.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
Class PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
All active tools
Definition: tool_event.h:147
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void PutDataInPreviousState(PICKED_ITEMS_LIST *aList, bool aRedoCommand)
Restore an undo or redo command to put data pointed by aList in the previous state.
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
void RebuildSelection()
Rebuilds the selection from the EDA_ITEMs' selection flags.
virtual void PushCommandToRedoList(PICKED_ITEMS_LIST *aItem)
Function PushCommandToRedoList add a command to redo in redo list delete the very old commands when t...
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...

References AS_GLOBAL, SCH_BASE_FRAME::GetCanvas(), SCH_EDIT_FRAME::GetScreen(), TOOL_MANAGER::GetTool(), BASE_SCREEN::GetUndoCommandCount(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, TOOL_BASE::m_toolMgr, SCH_EDIT_FRAME::OnModify(), BASE_SCREEN::PopCommandFromUndoList(), TOOL_MANAGER::ProcessEvent(), BASE_SCREEN::PushCommandToRedoList(), SCH_EDIT_FRAME::PutDataInPreviousState(), EE_SELECTION_TOOL::RebuildSelection(), EDA_DRAW_PANEL_GAL::Refresh(), PICKED_ITEMS_LIST::ReversePickersListOrder(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), SCH_BASE_FRAME::SyncView(), TA_UNDO_REDO_PRE, TC_MESSAGE, and SCH_EDIT_FRAME::TestDanglingEnds().

Referenced by setTransitions().

◆ UpdateFind()

int SCH_EDITOR_CONTROL::UpdateFind ( const TOOL_EVENT aEvent)

Definition at line 135 of file sch_editor_control.cpp.

136 {
137  wxFindReplaceData* data = m_frame->GetFindReplaceData();
138 
139  if( aEvent.IsAction( &ACTIONS::find ) || aEvent.IsAction( &ACTIONS::findAndReplace )
140  || aEvent.IsAction( &ACTIONS::updateFind ) )
141  {
143 
144  INSPECTOR_FUNC inspector = [&] ( EDA_ITEM* item, void* )
145  {
146  if( data && item->Matches( *data, nullptr ) )
147  m_selectionTool->BrightenItem( item );
148  else if( item->IsBrightened() )
150 
151  return SEARCH_CONTINUE;
152  };
153 
154  EDA_ITEM* start = m_frame->GetScreen()->GetDrawItems();
155  EDA_ITEM::IterateForward( start, inspector, nullptr, EE_COLLECTOR::AllItems );
156  }
157  else if( aEvent.Matches( EVENTS::SelectedItemsModified ) )
158  {
159  for( EDA_ITEM* item : m_selectionTool->GetSelection() )
160  {
161  if( data && item->Matches( *data, nullptr ) )
162  m_selectionTool->BrightenItem( item );
163  else if( item->IsBrightened() )
165  }
166  }
167 
168  getView()->UpdateItems();
169  m_frame->GetCanvas()->Refresh();
170 
171  return 0;
172 }
static TOOL_ACTION findAndReplace
Definition: actions.h:79
std::function< SEARCH_RESULT(EDA_ITEM *aItem, void *aTestData) > INSPECTOR_FUNC
Typedef INSPECTOR is used to inspect and possibly collect the (search) results of iterating over a li...
Definition: base_struct.h:83
wxFindReplaceData * GetFindReplaceData()
Get the find criteria (as set by the dialog).
bool IsBrightened() const
Definition: base_struct.h:236
static TOOL_ACTION find
Definition: actions.h:78
static const TOOL_EVENT SelectedItemsModified
Definition: actions.h:201
bool IsAction(const TOOL_ACTION *aAction) const
Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_AC...
Definition: tool_event.cpp:67
EE_SELECTION & GetSelection()
Function GetSelection()
static TOOL_ACTION updateFind
Definition: actions.h:84
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void BrightenItem(EDA_ITEM *aItem)
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
static SEARCH_RESULT IterateForward(EDA_ITEM *listStart, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
Function IterateForward walks through the object tree calling the inspector() on each object type req...
Definition: base_struct.h:418
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:140
void UpdateItems()
Function UpdateItems() Iterates through the list of items that asked for updating and updates them.
Definition: view.cpp:1421
bool Matches(const TOOL_EVENT &aEvent) const
Function Matches() Tests whether two events match in terms of category & action or command.
Definition: tool_event.h:364
void UnbrightenItem(EDA_ITEM *aItem)
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
int ClearSelection(const TOOL_EVENT &aEvent)
Clear current selection event handler.
static const KICAD_T AllItems[]
Definition: ee_collectors.h:42
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:163
virtual bool Matches(wxFindReplaceData &aSearchData, void *aAuxData)
Function Matches compares the item against the search criteria in aSearchData.
Definition: base_struct.h:512
SCH_ITEM * GetDrawItems() const
Definition: sch_screen.h:152

References EE_COLLECTOR::AllItems, EE_SELECTION_TOOL::BrightenItem(), EE_SELECTION_TOOL::ClearSelection(), ACTIONS::find, ACTIONS::findAndReplace, SCH_BASE_FRAME::GetCanvas(), SCH_SCREEN::GetDrawItems(), SCH_EDIT_FRAME::GetFindReplaceData(), SCH_EDIT_FRAME::GetScreen(), EE_SELECTION_TOOL::GetSelection(), TOOL_BASE::getView(), TOOL_EVENT::IsAction(), EDA_ITEM::IsBrightened(), EDA_ITEM::IterateForward(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_EVENT::Matches(), EDA_ITEM::Matches(), EDA_DRAW_PANEL_GAL::Refresh(), SEARCH_CONTINUE, EVENTS::SelectedItemsModified, EE_SELECTION_TOOL::UnbrightenItem(), ACTIONS::updateFind, and KIGFX::VIEW::UpdateItems().

Referenced by FindAndReplace(), FindNext(), DIALOG_SCH_FIND::OnClose(), DIALOG_SCH_FIND::OnOptions(), DIALOG_SCH_FIND::OnSearchForText(), and setTransitions().

◆ UpdateNetHighlighting()

int SCH_EDITOR_CONTROL::UpdateNetHighlighting ( const TOOL_EVENT aEvent)

Updates net highlighting after an edit

Definition at line 704 of file sch_editor_control.cpp.

705 {
706  SCH_SCREEN* screen = g_CurrentSheet->LastScreen();
707  std::vector<EDA_ITEM*> itemsToRedraw;
708  wxString selectedNetName = m_frame->GetSelectedNetName();
709 
710  if( !screen )
711  return 0;
712 
713  for( SCH_ITEM* item = screen->GetDrawItems(); item; item = item->Next() )
714  {
715  SCH_CONNECTION* conn = item->Connection( *g_CurrentSheet );
716  bool redraw = item->IsBrightened();
717 
718  if( conn && conn->Name() == selectedNetName )
719  item->SetBrightened();
720  else
721  item->ClearBrightened();
722 
723  redraw |= item->IsBrightened();
724 
725  if( item->Type() == SCH_COMPONENT_T )
726  {
727  SCH_COMPONENT* comp = static_cast<SCH_COMPONENT*>( item );
728 
729  redraw |= comp->HasBrightenedPins();
730 
731  comp->ClearBrightenedPins();
732  std::vector<LIB_PIN*> pins;
733  comp->GetPins( pins );
734 
735  for( LIB_PIN* pin : pins )
736  {
737  auto pin_conn = comp->GetConnectionForPin( pin, *g_CurrentSheet );
738 
739  if( pin_conn && pin_conn->Name( false ) == selectedNetName )
740  {
741  comp->BrightenPin( pin );
742  redraw = true;
743  }
744  }
745  }
746  else if( item->Type() == SCH_SHEET_T )
747  {
748  for( SCH_SHEET_PIN& pin : static_cast<SCH_SHEET*>( item )->GetPins() )
749  {
750  auto pin_conn = pin.Connection( *g_CurrentSheet );
751  bool redrawPin = pin.IsBrightened();
752 
753  if( pin_conn && pin_conn->Name() == selectedNetName )
754  pin.SetBrightened();
755  else
756  pin.ClearBrightened();
757 
758  redrawPin |= pin.IsBrightened();
759 
760  if( redrawPin )
761  itemsToRedraw.push_back( &pin );
762  }
763  }
764 
765  if( redraw )
766  itemsToRedraw.push_back( item );
767  }
768 
769  // Be sure highlight change will be redrawn
770  KIGFX::VIEW* view = getView();
771 
772  for( auto redrawItem : itemsToRedraw )
774 
775  m_frame->GetCanvas()->Refresh();
776 
777  return 0;
778 }
const wxString & GetSelectedNetName() const
SCH_ITEM * Next() const
Definition: sch_item.h:153
void ClearBrightenedPins()
Class VIEW_ITEM - is an abstract base class for deriving all objects that can be added to a VIEW.
Definition: view_item.h:84
void BrightenPin(LIB_PIN *aPin)
Item is being added to the view.
Definition: view_item.h:60
wxString Name(bool aIgnoreSheet=false) const
SCH_SHEET_PATH * g_CurrentSheet
With the new connectivity algorithm, many more places than before want to know what the current sheet...
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
SCH_CONNECTION * GetConnectionForPin(LIB_PIN *aPin, const SCH_SHEET_PATH &aSheet)
Retrieves the connection for a given pin of the component.
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:75
virtual void Update(VIEW_ITEM *aItem, int aUpdateFlags)
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1540
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void GetPins(std::vector< LIB_PIN * > &aPinsList)
Populate a vector with all the pins from the library object.
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
bool HasBrightenedPins()
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:73
Class VIEW.
Definition: view.h:61
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
Definition: sch_item.h:114
SCH_SCREEN * LastScreen() const
Function LastScreen.
SCH_ITEM * GetDrawItems() const
Definition: sch_screen.h:152

References SCH_COMPONENT::BrightenPin(), EDA_ITEM::ClearBrightened(), SCH_COMPONENT::ClearBrightenedPins(), SCH_ITEM::Connection(), g_CurrentSheet, SCH_BASE_FRAME::GetCanvas(), SCH_COMPONENT::GetConnectionForPin(), SCH_SCREEN::GetDrawItems(), SCH_COMPONENT::GetPins(), SCH_EDIT_FRAME::GetSelectedNetName(), TOOL_BASE::getView(), SCH_COMPONENT::HasBrightenedPins(), EDA_ITEM::IsBrightened(), SCH_SHEET_PATH::LastScreen(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, SCH_CONNECTION::Name(), EDA_ITEM::Next(), EDA_DRAW_PANEL_GAL::Refresh(), KIGFX::REPAINT, SCH_COMPONENT_T, SCH_SHEET_T, EDA_ITEM::SetBrightened(), EDA_ITEM::Type(), and KIGFX::VIEW::Update().

Referenced by setTransitions().

◆ UpdatePCB()

int SCH_EDITOR_CONTROL::UpdatePCB ( const TOOL_EVENT aEvent)

Definition at line 1221 of file sch_editor_control.cpp.

1222 {
1223  wxCommandEvent dummy;
1225  return 0;
1226 }
void OnUpdatePCB(wxCommandEvent &event)
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.

References dummy(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, and SCH_EDIT_FRAME::OnUpdatePCB().

Referenced by setTransitions().

◆ updateView()

void EE_TOOL_BASE< SCH_EDIT_FRAME >::updateView ( EDA_ITEM aItem) const
inlineprotectedinherited

Similar to getView()->Update(), but handles items that are redrawn by their parents.

Definition at line 104 of file ee_tool_base.h.

105  {
106  KICAD_T itemType = aItem->Type();
107 
108  if( itemType == SCH_PIN_T || itemType == SCH_FIELD_T || itemType == SCH_SHEET_PIN_T )
109  getView()->Update( aItem->GetParent() );
110 
111  getView()->Update( aItem );
112  }
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
EDA_ITEM * GetParent() const
Definition: base_struct.h:220
virtual void Update(VIEW_ITEM *aItem, int aUpdateFlags)
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1540
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
KICAD_T Type() const
Function Type()
Definition: base_struct.h:210

◆ Wait()

TOOL_EVENT * TOOL_INTERACTIVE::Wait ( const TOOL_EVENT_LIST aEventList = TOOL_EVENTTC_ANYTA_ANY ))
inherited

Function Wait()

Suspends execution of the tool until an event specified in aEventList arrives. No parameters means waiting for any event.

Definition at line 57 of file tool_interactive.cpp.

58 {
59  return m_toolMgr->ScheduleWait( this, aEventList );
60 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
TOOL_EVENT * ScheduleWait(TOOL_BASE *aTool, const TOOL_EVENT_LIST &aConditions)
Pauses execution of a given tool until one or more events matching aConditions arrives.

References TOOL_BASE::m_toolMgr, and TOOL_MANAGER::ScheduleWait().

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), ROUTER_TOOL::InlineDrag(), ZOOM_TOOL::Main(), PL_EDIT_TOOL::Main(), CVPCB_CONTROL::Main(), SCH_MOVE_TOOL::Main(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), PICKER_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), PL_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), SELECTION_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), EDIT_TOOL::Move(), POINT_EDITOR::OnSelectionChange(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), EDIT_TOOL::pickCopyReferencePoint(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), GERBVIEW_SELECTION_TOOL::selectPoint(), SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), ZOOM_TOOL::selectRegion(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

Member Data Documentation

◆ m_frame

SCH_EDIT_FRAME * EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame
protectedinherited

Definition at line 138 of file ee_tool_base.h.

◆ m_isLibEdit

bool EE_TOOL_BASE< SCH_EDIT_FRAME >::m_isLibEdit
protectedinherited

Definition at line 141 of file ee_tool_base.h.

◆ m_menu

TOOL_MENU TOOL_INTERACTIVE::m_menu
protectedinherited

functions below are not yet implemented - their interface may change

Definition at line 108 of file tool_interactive.h.

Referenced by SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), TOOL_INTERACTIVE::GetToolMenu(), PICKER_TOOL::Init(), SCH_EDIT_TOOL::Init(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Init(), PL_EDIT_TOOL::Init(), LIB_DRAWING_TOOLS::Init(), MODULE_EDITOR_TOOLS::Init(), PL_DRAWING_TOOLS::Init(), LIB_CONTROL::Init(), PCB_EDITOR_CONTROL::Init(), SCH_DRAWING_TOOLS::Init(), GERBVIEW_SELECTION_TOOL::Init(), DRAWING_TOOL::Init(), PL_SELECTION_TOOL::Init(), EE_SELECTION_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), SELECTION_TOOL::Init(), EDIT_TOOL::Init(), PCB_TOOL_BASE::Init(), PL_EDIT_TOOL::Main(), SCH_MOVE_TOOL::Main(), LIB_MOVE_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), PICKER_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), PL_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), SELECTION_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ m_pickerItem

EDA_ITEM* SCH_EDITOR_CONTROL::m_pickerItem
private

Definition at line 183 of file sch_editor_control.h.

◆ m_probingPcbToSch

bool SCH_EDITOR_CONTROL::m_probingPcbToSch
private

Definition at line 182 of file sch_editor_control.h.

Referenced by doCrossProbeSchToPcb(), and FindComponentAndItem().

◆ m_selectionTool

EE_SELECTION_TOOL* EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool
protectedinherited

Definition at line 140 of file ee_tool_base.h.

◆ m_supplementaryClipboard

std::map<wxString, SCH_SCREEN*> SCH_EDITOR_CONTROL::m_supplementaryClipboard
private

Definition at line 187 of file sch_editor_control.h.

Referenced by doCopy(), and searchSupplementaryClipboard().

◆ m_toolId

TOOL_ID TOOL_BASE::m_toolId
protectedinherited

Unique identifier for the tool, assigned by a TOOL_MANAGER instance.

Definition at line 214 of file tool_base.h.

Referenced by TOOL_INTERACTIVE::Activate(), TOOL_BASE::GetId(), and TOOL_BASE::IsToolActive().

◆ m_toolMgr

TOOL_MANAGER* TOOL_BASE::m_toolMgr
protectedinherited

Definition at line 219 of file tool_base.h.

Referenced by TOOL_INTERACTIVE::Activate(), PL_SELECTION_TOOL::AddItemsToSel(), EE_SELECTION_TOOL::AddItemsToSel(), PL_SELECTION_TOOL::AddItemToSel(), EE_SELECTION_TOOL::AddItemToSel(), SELECTION_TOOL::AddItemToSel(), CVPCB_ASSOCIATION_TOOL::Associate(), TOOL_BASE::attachManager(), PCB_INSPECTION_TOOL::calculateSelectionRatsnest(), ROUTER_TOOL::CanInlineDrag(), EDIT_TOOL::ChangeTrackWidth(), PCB_INSPECTION_TOOL::ClearHighlight(), ClearHighlight(), SELECTION_TOOL::ClearSelection(), PL_SELECTION_TOOL::ClearSelection(), GERBVIEW_SELECTION_TOOL::clearSelection(), EE_SELECTION_TOOL::ClearSelection(), SCH_EDIT_TOOL::ConvertDeMorgan(), LIB_EDIT_TOOL::Copy(), PL_EDIT_TOOL::Copy(), PAD_TOOL::copyPadSettings(), MICROWAVE_TOOL::createInductorBetween(), MODULE_EDITOR_TOOLS::CreatePadFromShapes(), PCB_INSPECTION_TOOL::CrossProbePcbToSch(), COMMON_TOOLS::CursorControl(), ROUTER_TOOL::CustomTrackWidthDialog(), Cut(), LIB_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), doCopy(), doCrossProbeSchToPcb(), LIB_EDIT_TOOL::DoDelete(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PCB_EDITOR_CONTROL::DrillOrigin(), LIB_EDIT_TOOL::Duplicate(), SCH_EDIT_TOOL::Duplicate(), EDIT_TOOL::Duplicate(), SCH_EDIT_TOOL::editComponentFieldText(), EDIT_TOOL::EditFpInFpEditor(), LIB_EDIT_TOOL::editSymbolProperties(), EditWithLibEdit(), EnterSheet(), PAD_TOOL::EnumeratePads(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), SELECTION_TOOL::expandConnection(), MODULE_EDITOR_TOOLS::ExplodePadToShapes(), SELECTION_TOOL::filterSelection(), SELECTION_TOOL::findCallback(), FindComponentAndItem(), POINT_EDITOR::finishItem(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), EDIT_TOOL::Flip(), EDIT_TOOL::GetAndPlace(), TOOL_BASE::getEditFrameInt(), TOOL_BASE::GetManager(), TOOL_BASE::getModelInt(), DRAWING_TOOL::getSourceZoneForAction(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), TOOL_INTERACTIVE::goInternal(), PCBNEW_CONTROL::GridSetOrigin(), GERBVIEW_CONTROL::HighlightControl(), PCB_INSPECTION_TOOL::HighlightItem(), PCB_INSPECTION_TOOL::HighlightNet(), HighlightNet(), PCB_INSPECTION_TOOL::highlightNet(), HighlightNetCursor(), PCB_INSPECTION_TOOL::HighlightNetTool(), MODULE_EDITOR_TOOLS::ImportFootprint(), PL_EDIT_TOOL::ImportWorksheetContent(), LIB_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), PL_EDIT_TOOL::Init(), PAD_TOOL::Init(), GLOBAL_EDIT_TOOL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), LIB_CONTROL::Init(), PL_DRAWING_TOOLS::Init(), PL_POINT_EDITOR::Init(), POINT_EDITOR::Init(), PCB_EDITOR_CONTROL::Init(), POSITION_RELATIVE_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), EDIT_TOOL::invokeInlineRouter(), EDIT_TOOL::isInteractiveDragEnabled(), TOOL_BASE::IsToolActive(), LeaveSheet(), COMMON_CONTROL::ListHotKeys(), PCB_INSPECTION_TOOL::LocalRatsnestTool(), PL_EDIT_TOOL::Main(), SCH_MOVE_TOOL::Main(), CVPCB_CONTROL::Main(), LIB_MOVE_TOOL::Main(), PL_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), SELECTION_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), LIB_EDIT_TOOL::Mirror(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::Mirror(), PCB_EDITOR_CONTROL::modifyLockSelected(), EDIT_TOOL::Move(), EDIT_TOOL::MoveExact(), LIB_CONTROL::OnDeMorgan(), LIB_EDIT_TOOL::Paste(), PL_EDIT_TOOL::Paste(), Paste(), PAD_TOOL::pastePadProperties(), EDIT_TOOL::pickCopyReferencePoint(), LIB_EDIT_TOOL::PinTable(), PCBNEW_CONTROL::placeBoardItems(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), PCBNEW_CONTROL::Print(), GERBVIEW_CONTROL::Print(), LIB_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), PAD_TOOL::pushPadSettings(), EE_SELECTION_TOOL::RebuildSelection(), LIB_EDIT_TOOL::Redo(), Redo(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), EDIT_TOOL::Remove(), POINT_EDITOR::removeCorner(), PL_SELECTION_TOOL::RemoveItemFromSel(), EE_SELECTION_TOOL::RemoveItemFromSel(), SELECTION_TOOL::RemoveItemFromSel(), PL_SELECTION_TOOL::RemoveItemsFromSel(), EE_SELECTION_TOOL::RemoveItemsFromSel(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_DRAWING_TOOLS::RepeatDrawItem(), EE_SELECTION_TOOL::RequestSelection(), SELECTION_TOOL::RequestSelection(), COMMON_TOOLS::ResetLocalCoords(), TOOL_INTERACTIVE::resetTransitions(), LIB_EDIT_TOOL::Rotate(), SCH_EDIT_TOOL::Rotate(), EDIT_TOOL::Rotate(), TOOL_INTERACTIVE::RunMainStack(), DRC::RunTests(), EE_SELECTION_TOOL::SelectConnection(), SELECTION_TOOL::selectCopper(), PCB_TOOL_BASE::selection(), COMMON_TOOLS::SelectionTool(), GERBVIEW_SELECTION_TOOL::SelectItem(), GERBVIEW_SELECTION_TOOL::SelectItems(), SELECTION_TOOL::SelectItems(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectNet(), PL_SELECTION_TOOL::SelectPoint(), GERBVIEW_SELECTION_TOOL::selectPoint(), EE_SELECTION_TOOL::SelectPoint(), SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), SELECTION_TOOL::selectSameSheet(), SELECTION_TOOL::selectSheetContents(), DRAWING_TOOL::SetAnchor(), TOOL_INTERACTIVE::SetContextMenu(), DRC::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), PCB_EDITOR_CONTROL::TrackWidthDec(), PCB_EDITOR_CONTROL::TrackWidthInc(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), LIB_EDIT_TOOL::Undo(), Undo(), GERBVIEW_SELECTION_TOOL::UnselectItem(), GERBVIEW_SELECTION_TOOL::UnselectItems(), SELECTION_TOOL::UnselectItems(), EE_INSPECTION_TOOL::UpdateMessagePanel(), GERBVIEW_CONTROL::UpdateMessagePanel(), PL_EDITOR_CONTROL::UpdateMessagePanel(), PCBNEW_CONTROL::UpdateMessagePanel(), PCB_INSPECTION_TOOL::UpdateSelectionRatsnest(), PCB_EDITOR_CONTROL::ViaSizeDec(), PCB_EDITOR_CONTROL::ViaSizeInc(), TOOL_INTERACTIVE::Wait(), PCB_EDITOR_CONTROL::ZoneDuplicate(), and PCB_EDITOR_CONTROL::ZoneMerge().

◆ m_toolName

std::string TOOL_BASE::m_toolName
protectedinherited

Name of the tool.

Names are expected to obey the format application.ToolName (eg. pcbnew.InteractiveSelection).

Definition at line 218 of file tool_base.h.

Referenced by TOOL_BASE::GetName().

◆ m_toolSettings

TOOL_SETTINGS TOOL_BASE::m_toolSettings
protectedinherited

Definition at line 220 of file tool_base.h.

Referenced by TOOL_BASE::attachManager(), and TOOL_BASE::GetSettings().

◆ m_type

TOOL_TYPE TOOL_BASE::m_type
protectedinherited

Stores the type of the tool.

Definition at line 211 of file tool_base.h.

Referenced by TOOL_BASE::GetType(), and BOARD_COMMIT::Push().

◆ m_view

KIGFX::SCH_VIEW* EE_TOOL_BASE< SCH_EDIT_FRAME >::m_view
protectedinherited

Definition at line 139 of file ee_tool_base.h.


The documentation for this class was generated from the following files: