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 SaveAll (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...
 
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
 
wxString m_pickerNet
 

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 1117 of file sch_editor_control.cpp.

1118 {
1119  wxCommandEvent dummy;
1120  m_frame->OnAnnotate( dummy );
1121  return 0;
1122 }
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:112
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 691 of file sch_editor_control.cpp.

692 {
694 
695  return 0;
696 }
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 900 of file sch_editor_control.cpp.

901 {
902  wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( wxWindow::FindFocus() );
903 
904  if( textEntry )
905  {
906  textEntry->Copy();
907  return 0;
908  }
909 
910  doCopy();
911 
912  return 0;
913 }
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 354 of file sch_editor_control.cpp.

355 {
356  doCrossProbeSchToPcb( aEvent, false );
357  return 0;
358 }
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 883 of file sch_editor_control.cpp.

884 {
885  wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( wxWindow::FindFocus() );
886 
887  if( textEntry )
888  {
889  textEntry->Cut();
890  return 0;
891  }
892 
893  if( doCopy() )
895 
896  return 0;
897 }
static TOOL_ACTION doDelete
Definition: actions.h:73
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 866 of file sch_editor_control.cpp.

867 {
869  EE_SELECTION& selection = selTool->RequestSelection();
870 
871  if( !selection.GetSize() )
872  return false;
873 
874  STRING_FORMATTER formatter;
875  SCH_LEGACY_PLUGIN plugin;
876 
877  plugin.Format( &selection, &formatter );
878 
879  return m_toolMgr->SaveClipboard( formatter.GetString() );
880 }
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)
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
const std::string & GetString()
Definition: richio.h:475
A SCH_PLUGIN derivation for loading schematic files created before the new s-expression file format.
Class STRING_FORMATTER implements OUTPUTFORMATTER to a memory buffer.
Definition: richio.h:445

References SCH_LEGACY_PLUGIN::Format(), STRING_FORMATTER::GetString(), TOOL_MANAGER::GetTool(), TOOL_BASE::m_toolMgr, EE_SELECTION_TOOL::RequestSelection(), and TOOL_MANAGER::SaveClipboard().

Referenced by Copy(), and Cut().

◆ doCrossProbeSchToPcb()

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

Definition at line 368 of file sch_editor_control.cpp.

369 {
370  // Don't get in an infinite loop SCH -> PCB -> SCH -> PCB -> SCH -> ...
371  if( m_probingPcbToSch )
372  return;
373 
375  SCH_ITEM* item = nullptr;
376  SCH_COMPONENT* component = nullptr;
377 
378  if( aForce )
379  {
380  EE_SELECTION& selection = selTool->RequestSelection();
381 
382  if( selection.GetSize() >= 1 )
383  item = (SCH_ITEM*) selection.Front();
384  }
385  else
386  {
387  EE_SELECTION& selection = selTool->GetSelection();
388 
389  if( selection.GetSize() >= 1 )
390  item = (SCH_ITEM*) selection.Front();
391  }
392 
393  if( !item )
394  {
395  if( aForce )
396  m_frame->SendMessageToPCBNEW( nullptr, nullptr );
397 
398  return;
399  }
400 
401 
402  switch( item->Type() )
403  {
404  case SCH_FIELD_T:
405  case LIB_FIELD_T:
406  component = (SCH_COMPONENT*) item->GetParent();
407  m_frame->SendMessageToPCBNEW( item, component );
408  break;
409 
410  case SCH_COMPONENT_T:
411  component = (SCH_COMPONENT*) item;
412  m_frame->SendMessageToPCBNEW( item, component );
413  break;
414 
415  case SCH_PIN_T:
416  component = (SCH_COMPONENT*) item->GetParent();
417  m_frame->SendMessageToPCBNEW( static_cast<SCH_PIN*>( item ), component );
418  break;
419 
420  case SCH_SHEET_T:
421  if( aForce )
422  m_frame->SendMessageToPCBNEW( item, nullptr );
423  break;
424 
425  default:
426  break;
427  }
428 }
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 1185 of file sch_editor_control.cpp.

1186 {
1188  return 0;
1189 }
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 1133 of file sch_editor_control.cpp.

1134 {
1136  dlg.ShowQuasiModal();
1137  return 0;
1138 }

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 1141 of file sch_editor_control.cpp.

1142 {
1144  m_frame->HardRedraw();
1145 
1146  return 0;
1147 }
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 1094 of file sch_editor_control.cpp.

1095 {
1098  SCH_COMPONENT* sym = nullptr;
1099  LIB_EDIT_FRAME* libEdit;
1100 
1101  if( selection.GetSize() >= 1 )
1102  sym = (SCH_COMPONENT*) selection.Front();
1103 
1104  if( !sym || sym->GetEditFlags() != 0 )
1105  return 0;
1106 
1108  libEdit = (LIB_EDIT_FRAME*) m_frame->Kiway().Player( FRAME_SCH_LIB_EDITOR, false );
1109 
1110  if( libEdit )
1111  libEdit->LoadComponentAndSelectLib( sym->GetLibId(), sym->GetUnit(), sym->GetConvert() );
1112 
1113  return 0;
1114 }
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:321
STATUS_FLAGS GetEditFlags() const
Definition: base_struct.h:269
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:149
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 1199 of file sch_editor_control.cpp.

1200 {
1202  const EE_SELECTION& selection = selTool->RequestSelection( EE_COLLECTOR::SheetsOnly );
1203 
1204  if( selection.GetSize() == 1 )
1205  {
1206  SCH_SHEET* sheet = (SCH_SHEET*) selection.Front();
1207 
1210 
1211  g_CurrentSheet->push_back( sheet );
1213  }
1214 
1215  return 0;
1216 }
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:204

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 361 of file sch_editor_control.cpp.

362 {
363  doCrossProbeSchToPcb( aEvent, true );
364  return 0;
365 }
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 1166 of file sch_editor_control.cpp.

1167 {
1168  int result = NET_PLUGIN_CHANGE;
1169 
1170  // If a plugin is removed or added, rebuild and reopen the new dialog
1171  while( result == NET_PLUGIN_CHANGE )
1172  result = InvokeDialogNetList( m_frame );
1173 
1174  return 0;
1175 }
#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 134 of file sch_editor_control.cpp.

135 {
137  return UpdateFind( aEvent );
138 }
static TOOL_ACTION findAndReplace
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:63
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 211 of file sch_editor_control.cpp.

212 {
213  // A timer during which a subsequent FindNext will result in a wrap-around
214  static wxTimer wrapAroundTimer;
215 
216  wxFindReplaceData* data = m_frame->GetFindReplaceData();
217 
218  if( aEvent.IsAction( &ACTIONS::findNextMarker ) )
219  {
220  if( data )
221  g_markersOnly.SetFlags( data->GetFlags() );
222 
223  data = &g_markersOnly;
224  }
225  else if( !data )
226  {
227  return FindAndReplace( ACTIONS::find.MakeEvent() );
228  }
229 
230  bool searchAllSheets = !( data->GetFlags() & FR_CURRENT_SHEET_ONLY );
231  EE_SELECTION& selection = m_selectionTool->GetSelection();
232  SCH_SCREEN* afterScreen = m_frame->GetScreen();
233  EDA_ITEM* afterItem = selection.Front();
234  EDA_ITEM* item = nullptr;
235 
236  if( wrapAroundTimer.IsRunning() )
237  {
238  afterScreen = nullptr;
239  afterItem = nullptr;
240  wrapAroundTimer.Stop();
242  }
243 
245 
246  if( afterScreen || !searchAllSheets )
247  item = nextMatch( m_frame->GetScreen(), afterItem, data );
248 
249  if( !item && searchAllSheets )
250  {
251  SCH_SHEET_LIST schematic( g_RootSheet );
252  SCH_SCREENS screens;
253 
254  for( SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
255  {
256  if( afterScreen )
257  {
258  if( afterScreen == screen )
259  afterScreen = nullptr;
260 
261  continue;
262  }
263 
264  item = nextMatch( screen, nullptr, data );
265 
266  if( item )
267  {
268  SCH_SHEET_PATH* sheet = schematic.FindSheetForScreen( screen );
269  wxCHECK_MSG( sheet, 0, "Sheet not found for " + screen->GetFileName() );
270 
271  *g_CurrentSheet = *sheet;
273 
274  screen->SetZoom( m_frame->GetScreen()->GetZoom() );
275  screen->TestDanglingEnds();
276 
277  m_frame->SetScreen( screen );
278  UpdateFind( ACTIONS::updateFind.MakeEvent() );
279 
280  break;
281  }
282  }
283  }
284 
285  if( item )
286  {
287  m_selectionTool->AddItemToSel( item );
288  m_frame->FocusOnLocation( item->GetBoundingBox().GetCenter(), true );
289  m_frame->GetCanvas()->Refresh();
290  }
291  else
292  {
293  wxString msg = searchAllSheets ? _( "Reached end of schematic." )
294  : _( "Reached end of sheet." );
295 
296  m_frame->ShowFindReplaceStatus( msg + _( "\nFind again to wrap around to the start." ) );
297  wrapAroundTimer.StartOnce( 4000 );
298  }
299 
300  return 0;
301 }
Class SCH_SHEET_LIST.
int FindAndReplace(const TOOL_EVENT &aEvent)
SCH_SCREEN * GetNext()
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:77
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:63
EE_SELECTION & GetSelection()
Function GetSelection()
static TOOL_ACTION updateFind
Definition: actions.h:83
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:80
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()
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:115
void ShowFindReplaceStatus(const wxString &aMsg)
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:486
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 1178 of file sch_editor_control.cpp.

1179 {
1181  return 0;
1182 }
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:241
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::Move(), EDIT_TOOL::MoveExact(), PL_EDIT_TOOL::moveItem(), POINT_EDITOR::OnSelectionChange(), COMMON_TOOLS::PanControl(), LIB_EDIT_TOOL::Paste(), PL_EDIT_TOOL::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(), SELECTION_TOOL::Selectable(), GERBVIEW_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:246

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(), KICAD_MANAGER_CONTROL::setTransitions(), COMMON_CONTROL::setTransitions(), LIB_DRAWING_TOOLS::setTransitions(), ZONE_FILLER_TOOL::setTransitions(), EE_POINT_EDITOR::setTransitions(), PL_POINT_EDITOR::setTransitions(), SCH_MOVE_TOOL::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(), PL_EDITOR_CONTROL::setTransitions(), LIB_EDIT_TOOL::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 304 of file sch_editor_control.cpp.

305 {
306  wxFindReplaceData* data = m_frame->GetFindReplaceData();
308 
309  return data && item && item->Matches( *data, nullptr );
310 }
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:492
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 680 of file sch_editor_control.cpp.

681 {
683  VECTOR2D cursorPos = controls->GetCursorPosition( !aEvent.Modifier( MD_ALT ) );
684 
685  highlightNet( m_toolMgr, cursorPos );
686 
687  return 0;
688 }
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:334
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 776 of file sch_editor_control.cpp.

777 {
778  // TODO(JE) remove once real-time connectivity is a given
779  if( !ADVANCED_CFG::GetCfg().m_realTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime )
781 
782  std::string tool = aEvent.GetCommandStr().get();
784 
785  // Deactivate other tools; particularly important if another PICKER is currently running
786  Activate();
787 
788  picker->SetCursor( wxStockCursor( wxCURSOR_BULLSEYE ) );
789 
790  picker->SetClickHandler(
791  [this] ( const VECTOR2D& aPos )
792  {
793  return highlightNet( m_toolMgr, aPos );
794  } );
795 
796  m_toolMgr->RunAction( ACTIONS::pickerTool, true, &tool );
797 
798  return 0;
799 }
void SetCursor(const wxCursor &aCursor)
Definition: picker_tool.h:65
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:144
static bool highlightNet(TOOL_MANAGER *aToolMgr, const VECTOR2D &aPosition)
static bool m_allowRealTime
OPT< std::string > GetCommandStr() const
Definition: tool_event.h:455
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.
void RecalculateConnections(bool aDoCleanup=true)
Generates the connection data for the entire schematic hierarchy.

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, 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 }
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...
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:243

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 1219 of file sch_editor_control.cpp.

1220 {
1221  if( g_CurrentSheet->Last() != g_RootSheet )
1222  {
1225 
1228  }
1229 
1230  return 0;
1231 }
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 55 of file sch_editor_control.cpp.

56 {
58  return 0;
59 }

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 62 of file sch_editor_control.cpp.

63 {
65  return 0;
66 }

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 90 of file sch_editor_control.cpp.

91 {
92  PICKED_ITEMS_LIST undoCmd;
94  ITEM_PICKER wrapper( undoItem, UR_PAGESETTINGS );
95 
96  undoCmd.PushItem( wrapper );
98 
100  dlg.SetWksFileName( BASE_SCREEN::m_PageLayoutDescrFileName );
101 
102  if( dlg.ShowModal() != wxID_OK )
104 
105  return 0;
106 }
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 916 of file sch_editor_control.cpp.

917 {
918  wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( wxWindow::FindFocus() );
919 
920  if( textEntry )
921  {
922  textEntry->Paste();
923  return 0;
924  }
925 
927 
929  SCH_ITEM* last = dlist.GetLast();
930 
931  std::string text = m_toolMgr->GetClipboard();
932 
933  if( text.empty() )
934  return 0;
935 
936  STRING_LINE_READER reader( text, "Clipboard" );
937  SCH_LEGACY_PLUGIN plugin;
938 
939  try
940  {
941  plugin.LoadContent( reader, m_frame->GetScreen() );
942  }
943  catch( IO_ERROR& e )
944  {
945  // If it wasn't content, then paste as text
946  dlist.Append( new SCH_TEXT( wxPoint( 0, 0 ), text ) );
947  }
948 
949  // SCH_LEGACY_PLUGIN added the items to the DLIST, but not to the view or anything
950  // else. Pull them back out to start with.
951  //
952  EDA_ITEMS loadedItems;
953  SCH_ITEM* next = nullptr;
954 
955  // We also make sure any pasted sheets will not cause recursion in the destination.
956  // Moreover new sheets create new sheetpaths, and component alternate references must
957  // be created and cleared
958  //
959  bool sheetsPasted = false;
960  SCH_SHEET_LIST hierarchy( g_RootSheet );
961  wxFileName destFn = g_CurrentSheet->Last()->GetFileName();
962 
963  if( destFn.IsRelative() )
964  destFn.MakeAbsolute( m_frame->Prj().GetProjectPath() );
965 
966  for( SCH_ITEM* item = last ? last->Next() : dlist.GetFirst(); item; item = next )
967  {
968  next = item->Next();
969  dlist.Remove( item );
970 
971  loadedItems.push_back( item );
972 
973  if( item->Type() == SCH_COMPONENT_T )
974  {
975  SCH_COMPONENT* component = (SCH_COMPONENT*) item;
976 
977  component->SetTimeStamp( GetNewTimeStamp() );
978 
979  // clear the annotation, but preserve the selected unit
980  int unit = component->GetUnit();
981  component->ClearAnnotation( nullptr );
982  component->SetUnit( unit );
983  }
984  if( item->Type() == SCH_SHEET_T )
985  {
986  SCH_SHEET* sheet = (SCH_SHEET*) item;
987  wxFileName srcFn = sheet->GetFileName();
988 
989  if( srcFn.IsRelative() )
990  srcFn.MakeAbsolute( m_frame->Prj().GetProjectPath() );
991 
992  SCH_SHEET_LIST sheetHierarchy( sheet );
993 
994  if( hierarchy.TestForRecursion( sheetHierarchy, destFn.GetFullPath( wxPATH_UNIX ) ) )
995  {
996  auto msg = wxString::Format( _( "The pasted sheet \"%s\"\n"
997  "was dropped because the destination already has "
998  "the sheet or one of its subsheets as a parent." ),
999  sheet->GetFileName() );
1000  DisplayError( m_frame, msg );
1001  loadedItems.pop_back();
1002  }
1003  else
1004  {
1005  // Duplicate sheet names and sheet time stamps are not valid. Use a time stamp
1006  // based sheet name and update the time stamp for each sheet in the block.
1007  timestamp_t uid = GetNewTimeStamp();
1008 
1009  sheet->SetName( wxString::Format( wxT( "sheet%8.8lX" ), (unsigned long)uid ) );
1010  sheet->SetTimeStamp( uid );
1011  sheet->SetParent( g_CurrentSheet->Last() );
1012  sheet->SetScreen( nullptr );
1013  sheetsPasted = true;
1014  }
1015  }
1016  }
1017 
1018  // Now we can resolve the components and add everything to the screen, view, etc.
1019  //
1020  SYMBOL_LIB_TABLE* symLibTable = m_frame->Prj().SchSymbolLibTable();
1021  PART_LIB* partLib = m_frame->Prj().SchLibs()->GetCacheLibrary();
1022 
1023  for( unsigned i = 0; i < loadedItems.size(); ++i )
1024  {
1025  EDA_ITEM* item = loadedItems[i];
1026 
1027  if( item->Type() == SCH_COMPONENT_T )
1028  {
1029  SCH_COMPONENT* component = (SCH_COMPONENT*) item;
1030  component->Resolve( *symLibTable, partLib );
1031  }
1032  else if( item->Type() == SCH_SHEET_T )
1033  {
1034  SCH_SHEET* sheet = (SCH_SHEET*) item;
1035  wxFileName fn = sheet->GetFileName();
1036  SCH_SCREEN* existingScreen = nullptr;
1037 
1038  if( !fn.IsAbsolute() )
1039  {
1040  wxFileName currentSheetFileName = g_CurrentSheet->LastScreen()->GetFileName();
1041  fn.Normalize( wxPATH_NORM_ALL, currentSheetFileName.GetPath() );
1042  }
1043 
1044  if( g_RootSheet->SearchHierarchy( fn.GetFullPath( wxPATH_UNIX ), &existingScreen ) )
1045  {
1046  sheet->SetScreen( existingScreen );
1047 
1048  SCH_SHEET_PATH sheetpath = *g_CurrentSheet;
1049  sheetpath.push_back( sheet );
1050 
1051  // Clear annotation and create the AR for this path, if not exists,
1052  // when the screen is shared by sheet paths.
1053  // Otherwise ClearAnnotation do nothing, because the F1 field is used as
1054  // reference default value and takes the latest displayed value
1055  existingScreen->EnsureAlternateReferencesExist();
1056  existingScreen->ClearAnnotation( &sheetpath );
1057  }
1058  else
1059  {
1060  m_frame->LoadSheetFromFile( sheet, g_CurrentSheet, sheet->GetFileName() );
1061  }
1062  }
1063 
1064  item->SetFlags( IS_NEW | IS_PASTED | IS_MOVED );
1065  m_frame->AddItemToScreenAndUndoList( (SCH_ITEM*) item, i > 0 );
1066 
1067  // Reset flags for subsequent move operation
1068  item->SetFlags( IS_NEW | IS_PASTED | IS_MOVED );
1069  }
1070 
1071  if( sheetsPasted )
1073 
1074  // Now clear the previous selection, select the pasted items, and fire up the "move"
1075  // tool.
1076  //
1078  m_toolMgr->RunAction( EE_ACTIONS::addItemsToSel, true, &loadedItems );
1079 
1080  EE_SELECTION& selection = selTool->GetSelection();
1081 
1082  if( !selection.Empty() )
1083  {
1084  SCH_ITEM* item = (SCH_ITEM*) selection.GetTopLeftItem();
1085 
1086  selection.SetReferencePoint( item->GetPosition() );
1088  }
1089 
1090  return 0;
1091 }
CITER next(CITER it)
Definition: ptree.cpp:130
Class SCH_SHEET_LIST.
void LoadContent(LINE_READER &aReader, SCH_SCREEN *aScreen, int version=EESCHEMA_VERSION)
void SetTimeStamp(timestamp_t aNewTimeStamp)
Change the time stamp to aNewTimeStamp and updates the reference path.
const wxString & GetFileName() const
Definition: sch_screen.h:118
bool SearchHierarchy(const wxString &aFilename, SCH_SCREEN **aScreen)
Search the existing hierarchy for an instance of screen loaded from aFileName.
Definition: sch_sheet.cpp:542
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 EnsureAlternateReferencesExist()
For screens shared by many sheetpaths (complex hierarchies): to be able to clear or modify any refere...
Definition: sch_screen.cpp:750
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:102
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:263
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:622
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)
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:204
wxString GetFileName(void) const
Return the filename corresponding to this sheet.
Definition: sch_sheet.cpp:629
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:597
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:731
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:50
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.
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:243
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(), TOOL_MANAGER::GetTool(), EE_SELECTION::GetTopLeftItem(), SCH_COMPONENT::GetUnit(), i, IS_MOVED, IS_NEW, IS_PASTED, 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(), KIWAY_HOLDER::Prj(), SCH_SHEET_PATH::push_back(), SCH_COMPONENT::Resolve(), TOOL_MANAGER::RunAction(), SCH_COMPONENT_T, SCH_SHEET_T, SCH_SHEET::SearchHierarchy(), 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(), and EDA_ITEM::Type().

Referenced by setTransitions().

◆ Plot()

int SCH_EDITOR_CONTROL::Plot ( const TOOL_EVENT aEvent)

Definition at line 116 of file sch_editor_control.cpp.

117 {
119  return 0;
120 }

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 109 of file sch_editor_control.cpp.

110 {
111  m_frame->Print();
112  return 0;
113 }
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:112
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 123 of file sch_editor_control.cpp.

124 {
125  m_frame->Close( false );
126  return 0;
127 }

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 834 of file sch_editor_control.cpp.

835 {
836  if( m_frame->GetScreen()->GetRedoCommandCount() == 0 )
837  return 0;
838 
839  // Inform tools that undo command was issued
841 
842  /* Get the old list */
844 
845  /* Redo the command: */
846  m_frame->PutDataInPreviousState( List, true );
847 
848  /* Put the old list in UndoList */
849  List->ReversePickersListOrder();
851 
853  selTool->RebuildSelection();
854 
857 
858  m_frame->SyncView();
859  m_frame->GetCanvas()->Refresh();
860  m_frame->OnModify();
861 
862  return 0;
863 }
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:144
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 331 of file sch_editor_control.cpp.

332 {
333  wxFindReplaceData* data = m_frame->GetFindReplaceData();
334 
335  if( !data )
336  return FindAndReplace( ACTIONS::find.MakeEvent() );
337 
338  SCH_SHEET_LIST schematic( g_RootSheet );
339  SCH_SCREENS screens;
340 
341  for( SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
342  {
343  for( EDA_ITEM* item = nextMatch( screen, nullptr, data ); item;
344  item = nextMatch( screen, item, data ) )
345  {
346  item->Replace( *data, schematic.FindSheetForScreen( screen ) );
347  }
348  }
349 
350  return 0;
351 }
Class SCH_SHEET_LIST.
int FindAndReplace(const TOOL_EVENT &aEvent)
SCH_SCREEN * GetNext()
wxFindReplaceData * GetFindReplaceData()
Get the find criteria (as set by the dialog).
static TOOL_ACTION find
Definition: actions.h:77
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()
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:486

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 313 of file sch_editor_control.cpp.

314 {
315  wxFindReplaceData* data = m_frame->GetFindReplaceData();
317 
318  if( !data )
319  return FindAndReplace( ACTIONS::find.MakeEvent() );
320 
321  if( item && item->Matches( *data, nullptr ) )
322  {
323  item->Replace( *data, g_CurrentSheet );
324  FindNext( ACTIONS::findNext.MakeEvent() );
325  }
326 
327  return 0;
328 }
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:77
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:492
static TOOL_ACTION findNext
Definition: actions.h:79
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 69 of file sch_editor_control.cpp.

70 {
71  m_frame->Save_File();
72  return 0;
73 }
void Save_File(bool doSaveAs=false)

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

Referenced by setTransitions().

◆ SaveAll()

int SCH_EDITOR_CONTROL::SaveAll ( const TOOL_EVENT aEvent)

Definition at line 83 of file sch_editor_control.cpp.

84 {
86  return 0;
87 }

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 76 of file sch_editor_control.cpp.

77 {
78  m_frame->Save_File( true );
79  return 0;
80 }
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

◆ 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 1256 of file sch_editor_control.cpp.

1257 {
1258  Go( &SCH_EDITOR_CONTROL::New, ACTIONS::doNew.MakeEvent() );
1259  Go( &SCH_EDITOR_CONTROL::Open, ACTIONS::open.MakeEvent() );
1260  Go( &SCH_EDITOR_CONTROL::Save, ACTIONS::save.MakeEvent() );
1264  Go( &SCH_EDITOR_CONTROL::Print, ACTIONS::print.MakeEvent() );
1265  Go( &SCH_EDITOR_CONTROL::Plot, ACTIONS::plot.MakeEvent() );
1266  Go( &SCH_EDITOR_CONTROL::Quit, ACTIONS::quit.MakeEvent() );
1267 
1276 
1281 
1282 #ifdef KICAD_SPICE
1283  Go( &SCH_EDITOR_CONTROL::SimProbe, EE_ACTIONS::simProbe.MakeEvent() );
1284  Go( &SCH_EDITOR_CONTROL::SimTune, EE_ACTIONS::simTune.MakeEvent() );
1285 #endif /* KICAD_SPICE */
1286 
1293 
1294  Go( &SCH_EDITOR_CONTROL::Undo, ACTIONS::undo.MakeEvent() );
1295  Go( &SCH_EDITOR_CONTROL::Redo, ACTIONS::redo.MakeEvent() );
1296  Go( &SCH_EDITOR_CONTROL::Cut, ACTIONS::cut.MakeEvent() );
1297  Go( &SCH_EDITOR_CONTROL::Copy, ACTIONS::copy.MakeEvent() );
1298  Go( &SCH_EDITOR_CONTROL::Paste, ACTIONS::paste.MakeEvent() );
1299 
1311 
1313 
1317 
1320 }
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:196
static TOOL_ACTION findAndReplace
Definition: actions.h:78
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:197
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:82
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:152
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:77
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 SaveAll(const TOOL_EVENT &aEvent)
int DrawSheetOnClipboard(const TOOL_EVENT &aEvent)
static const TOOL_EVENT SelectedItemsModified
Definition: actions.h:200
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:83
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:198
static TOOL_ACTION replaceAndFindNext
Definition: actions.h:81
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
int Open(const TOOL_EVENT &aEvent)
static TOOL_ACTION findNextMarker
Definition: actions.h:80
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 saveAll
Definition: actions.h:57
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:79
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(), Plot(), ACTIONS::plot, Print(), ACTIONS::print, Quit(), ACTIONS::quit, ACTIONS::redo, Redo(), ReplaceAll(), ACTIONS::replaceAll, ReplaceAndFindNext(), ACTIONS::replaceAndFindNext, Save(), ACTIONS::save, SaveAll(), ACTIONS::saveAll, 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 1192 of file sch_editor_control.cpp.

1193 {
1195  return 0;
1196 }
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 1125 of file sch_editor_control.cpp.

1126 {
1127  wxCommandEvent dummy;
1129  return 0;
1130 }
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 1150 of file sch_editor_control.cpp.

1151 {
1152  wxCommandEvent dummy;
1154  return 0;
1155 }
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 1248 of file sch_editor_control.cpp.

1249 {
1251 
1252  return 0;
1253 }
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 1234 of file sch_editor_control.cpp.

1235 {
1237 
1238  auto painter = static_cast<KIGFX::SCH_PAINTER*>( getView()->GetPainter() );
1239  painter->GetSettings()->m_ShowHiddenPins = m_frame->GetShowAllPins();
1240 
1242  m_frame->GetCanvas()->Refresh();
1243 
1244  return 0;
1245 }
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 802 of file sch_editor_control.cpp.

803 {
804  if( m_frame->GetScreen()->GetUndoCommandCount() <= 0 )
805  return 0;
806 
807  // Inform tools that undo command was issued
809 
810  /* Get the old list */
812 
813  /* Undo the command */
814  m_frame->PutDataInPreviousState( List, false );
815 
816  /* Put the old list in RedoList */
817  List->ReversePickersListOrder();
819 
821  selTool->RebuildSelection();
822 
825 
826  m_frame->SyncView();
827  m_frame->GetCanvas()->Refresh();
828  m_frame->OnModify();
829 
830  return 0;
831 }
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:144
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 141 of file sch_editor_control.cpp.

142 {
143  wxFindReplaceData* data = m_frame->GetFindReplaceData();
144 
145  if( aEvent.IsAction( &ACTIONS::find ) || aEvent.IsAction( &ACTIONS::findAndReplace )
146  || aEvent.IsAction( &ACTIONS::updateFind ) )
147  {
149 
150  INSPECTOR_FUNC inspector = [&] ( EDA_ITEM* item, void* )
151  {
152  if( data && item->Matches( *data, nullptr ) )
153  m_selectionTool->BrightenItem( item );
154  else if( item->IsBrightened() )
156 
157  return SEARCH_CONTINUE;
158  };
159 
160  EDA_ITEM* start = m_frame->GetScreen()->GetDrawItems();
161  EDA_ITEM::IterateForward( start, inspector, nullptr, EE_COLLECTOR::AllItems );
162  }
163  else if( aEvent.Matches( EVENTS::SelectedItemsModified ) )
164  {
165  for( EDA_ITEM* item : m_selectionTool->GetSelection() )
166  {
167  if( data && item->Matches( *data, nullptr ) )
168  m_selectionTool->BrightenItem( item );
169  else if( item->IsBrightened() )
171  }
172  }
173 
174  getView()->UpdateItems();
175  m_frame->GetCanvas()->Refresh();
176 
177  return 0;
178 }
static TOOL_ACTION findAndReplace
Definition: actions.h:78
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:77
static const TOOL_EVENT SelectedItemsModified
Definition: actions.h:200
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:63
EE_SELECTION & GetSelection()
Function GetSelection()
static TOOL_ACTION updateFind
Definition: actions.h:83
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:417
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:356
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:492
SCH_ITEM * GetDrawItems() const
Definition: sch_screen.h:147

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 699 of file sch_editor_control.cpp.

700 {
701  SCH_SCREEN* screen = g_CurrentSheet->LastScreen();
702  std::vector<EDA_ITEM*> itemsToRedraw;
703  wxString selectedNetName = m_frame->GetSelectedNetName();
704 
705  if( !screen )
706  return 0;
707 
708  for( SCH_ITEM* item = screen->GetDrawItems(); item; item = item->Next() )
709  {
710  SCH_CONNECTION* conn = item->Connection( *g_CurrentSheet );
711  bool redraw = item->IsBrightened();
712 
713  if( conn && conn->Name() == selectedNetName )
714  item->SetBrightened();
715  else
716  item->ClearBrightened();
717 
718  redraw |= item->IsBrightened();
719 
720  if( item->Type() == SCH_COMPONENT_T )
721  {
722  SCH_COMPONENT* comp = static_cast<SCH_COMPONENT*>( item );
723 
724  redraw |= comp->HasBrightenedPins();
725 
726  comp->ClearBrightenedPins();
727  std::vector<LIB_PIN*> pins;
728  comp->GetPins( pins );
729 
730  for( LIB_PIN* pin : pins )
731  {
732  auto pin_conn = comp->GetConnectionForPin( pin, *g_CurrentSheet );
733 
734  if( pin_conn && pin_conn->Name( false ) == selectedNetName )
735  {
736  comp->BrightenPin( pin );
737  redraw = true;
738  }
739  }
740  }
741  else if( item->Type() == SCH_SHEET_T )
742  {
743  for( SCH_SHEET_PIN& pin : static_cast<SCH_SHEET*>( item )->GetPins() )
744  {
745  auto pin_conn = pin.Connection( *g_CurrentSheet );
746  bool redrawPin = pin.IsBrightened();
747 
748  if( pin_conn && pin_conn->Name() == selectedNetName )
749  pin.SetBrightened();
750  else
751  pin.ClearBrightened();
752 
753  redrawPin |= pin.IsBrightened();
754 
755  if( redrawPin )
756  itemsToRedraw.push_back( &pin );
757  }
758  }
759 
760  if( redraw )
761  itemsToRedraw.push_back( item );
762  }
763 
764  // Be sure hightlight change will be redrawn
765  KIGFX::VIEW* view = getView();
766 
767  for( auto redrawItem : itemsToRedraw )
769 
770  m_frame->GetCanvas()->Refresh();
771 
772  return 0;
773 }
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:147

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 1158 of file sch_editor_control.cpp.

1159 {
1160  wxCommandEvent dummy;
1162  return 0;
1163 }
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 182 of file sch_editor_control.h.

◆ m_pickerNet

wxString SCH_EDITOR_CONTROL::m_pickerNet
private

Definition at line 183 of file sch_editor_control.h.

◆ m_probingPcbToSch

bool SCH_EDITOR_CONTROL::m_probingPcbToSch
private

Definition at line 181 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_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(), PCB_INSPECTION_TOOL::ClearHighlight(), ClearHighlight(), PL_SELECTION_TOOL::ClearSelection(), GERBVIEW_SELECTION_TOOL::clearSelection(), EE_SELECTION_TOOL::ClearSelection(), 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(), 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::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(), PL_DRAWING_TOOLS::Init(), LIB_CONTROL::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(), 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(), SCH_LINE_WIRE_BUS_TOOL::UnfoldBus(), GERBVIEW_SELECTION_TOOL::UnselectItem(), 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().

◆ 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: