KiCad PCB EDA Suite
SCH_EDITOR_CONTROL Class Reference

SCH_EDITOR_CONTROL. More...

#include <sch_editor_control.h>

Inheritance diagram for SCH_EDITOR_CONTROL:
EE_TOOL_BASE< SCH_EDIT_FRAME > TOOL_INTERACTIVE TOOL_BASE

Public Types

enum  RESET_REASON { RUN, MODEL_RELOAD, GAL_SWITCH }
 

Determines the reason of reset for a tool

More...
 

Public Member Functions

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

Notifies pcbnew about the selected item.

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

Equivalent to the above, but initiated by the user.

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

Highlights net under the cursor.

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

Removes any net highlighting

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

Updates net highlighting after an edit

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

Launches a tool to highlight nets.

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

Clipboard support.

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

Protected Member Functions

void updateView (EDA_ITEM *aItem) const
 

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

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

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

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

Protected Attributes

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

Stores the type of the tool.

More...
 
TOOL_ID m_toolId
 

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

More...
 
std::string m_toolName
 

Name of the tool.

More...
 
TOOL_MANAGERm_toolMgr
 
TOOL_SETTINGS m_toolSettings
 

Private Member Functions

bool doCopy ()
 

copy selection to clipboard

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

Sets up handlers for various events.

More...
 
SCH_ITEMnextMatch (SCH_SCREEN *aScreen, SCH_ITEM *aAfter, wxFindReplaceData *aData)
 Advances the search and returns the next matching item after aAfter. More...
 

Private Attributes

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

Detailed Description

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(), 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(), 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(), SCH_MOVE_TOOL::Main(), EE_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(), 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 1174 of file sch_editor_control.cpp.

1175 {
1176  wxCommandEvent dummy;
1177  m_frame->OnAnnotate( dummy );
1178  return 0;
1179 }
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 }
UTF8 is an 8 bit string that is assuredly encoded in UTF8, and supplies special conversion support to...
Definition: utf8.h:73
SCH_SHEET_LIST.
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".
SCH_REFERENCE_LIST is used to create a flattened list of components because in a complex hierarchy,...
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:111
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
SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:89
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
SCH_SHEET * g_RootSheet
unsigned GetCount()
Function GetCount.
STRING_FORMATTER implements OUTPUTFORMATTER to a memory buffer.
Definition: richio.h:445
DSNLEXER implements a lexical analyzer for the SPECCTRA DSN file format.
Definition: dsnlexer.h:79
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:123

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

690 {
692 
693  return 0;
694 }
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 922 of file sch_editor_control.cpp.

923 {
924  wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( wxWindow::FindFocus() );
925 
926  if( textEntry )
927  {
928  textEntry->Copy();
929  return 0;
930  }
931 
932  doCopy();
933 
934  return 0;
935 }
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 341 of file sch_editor_control.cpp.

342 {
343  doCrossProbeSchToPcb( aEvent, false );
344  return 0;
345 }
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 905 of file sch_editor_control.cpp.

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

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

Referenced by setTransitions().

◆ doCopy()

bool SCH_EDITOR_CONTROL::doCopy ( )
private

copy selection to clipboard

Definition at line 864 of file sch_editor_control.cpp.

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

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

Referenced by Copy(), and Cut().

◆ doCrossProbeSchToPcb()

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

Definition at line 355 of file sch_editor_control.cpp.

356 {
357  // Don't get in an infinite loop SCH -> PCB -> SCH -> PCB -> SCH -> ...
358  if( m_probingPcbToSch )
359  return;
360 
362  SCH_ITEM* item = nullptr;
363  SCH_COMPONENT* component = nullptr;
364 
365  if( aForce )
366  {
367  EE_SELECTION& selection = selTool->RequestSelection();
368 
369  if( selection.GetSize() >= 1 )
370  item = (SCH_ITEM*) selection.Front();
371  }
372  else
373  {
374  EE_SELECTION& selection = selTool->GetSelection();
375 
376  if( selection.GetSize() >= 1 )
377  item = (SCH_ITEM*) selection.Front();
378  }
379 
380  if( !item )
381  {
382  if( aForce )
383  m_frame->SendMessageToPCBNEW( nullptr, nullptr );
384 
385  return;
386  }
387 
388 
389  switch( item->Type() )
390  {
391  case SCH_FIELD_T:
392  case LIB_FIELD_T:
393  component = (SCH_COMPONENT*) item->GetParent();
394  m_frame->SendMessageToPCBNEW( item, component );
395  break;
396 
397  case SCH_COMPONENT_T:
398  component = (SCH_COMPONENT*) item;
399  m_frame->SendMessageToPCBNEW( item, component );
400  break;
401 
402  case SCH_PIN_T:
403  component = (SCH_COMPONENT*) item->GetParent();
404  m_frame->SendMessageToPCBNEW( static_cast<SCH_PIN*>( item ), component );
405  break;
406 
407  case SCH_SHEET_T:
408  if( aForce )
409  m_frame->SendMessageToPCBNEW( item, nullptr );
410  break;
411 
412  default:
413  break;
414  }
415 }
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:215
virtual unsigned int GetSize() const override
Function GetSize() Returns the number of stored items.
Definition: selection.h:99
SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:89
SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:136
EDA_ITEM * Front() const
Definition: selection.h:183

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

1243 {
1245  return 0;
1246 }
void DrawCurrentSheetToClipboard()
Use the wxWidgets print code to draw an image of the current sheet onto the clipboard.
Definition: sheet.cpp:833

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

1191 {
1193  dlg.ShowQuasiModal();
1194  return 0;
1195 }

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

1199 {
1201  m_frame->HardRedraw();
1202 
1203  return 0;
1204 }
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 1151 of file sch_editor_control.cpp.

1152 {
1155  SCH_COMPONENT* sym = nullptr;
1156  LIB_EDIT_FRAME* libEdit;
1157 
1158  if( selection.GetSize() >= 1 )
1159  sym = (SCH_COMPONENT*) selection.Front();
1160 
1161  if( !sym || sym->GetEditFlags() != 0 )
1162  return 0;
1163 
1165  libEdit = (LIB_EDIT_FRAME*) m_frame->Kiway().Player( FRAME_SCH_LIB_EDITOR, false );
1166 
1167  if( libEdit )
1168  libEdit->LoadComponentAndSelectLib( sym->GetLibId(), sym->GetUnit(), sym->GetConvert() );
1169 
1170  return 0;
1171 }
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:341
STATUS_FLAGS GetEditFlags() const
Definition: base_struct.h:260
bool LoadComponentAndSelectLib(const LIB_ID &aLibId, int aUnit, int aConvert)
Selects the currently active library and loads the symbol from aLibId.
The symbol library editor main window.
static TOOL_ACTION showSymbolEditor
Definition: actions.h:150
SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:89
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 1256 of file sch_editor_control.cpp.

1257 {
1259  const EE_SELECTION& selection = selTool->RequestSelection( EE_COLLECTOR::SheetsOnly );
1260 
1261  if( selection.GetSize() == 1 )
1262  {
1263  SCH_SHEET* sheet = (SCH_SHEET*) selection.Front();
1264 
1267 
1268  g_CurrentSheet->push_back( sheet );
1271  }
1272 
1273  return 0;
1274 }
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:218
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...
void UpdateHierarchyNavigator(bool aForceUpdate=false)
Run the Hierarchy Navigator dialog.
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:206

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(), EE_COLLECTOR::SheetsOnly, and SCH_EDIT_FRAME::UpdateHierarchyNavigator().

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

349 {
350  doCrossProbeSchToPcb( aEvent, true );
351  return 0;
352 }
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 1223 of file sch_editor_control.cpp.

1224 {
1225  int result = NET_PLUGIN_CHANGE;
1226 
1227  // If a plugin is removed or added, rebuild and reopen the new dialog
1228  while( result == NET_PLUGIN_CHANGE )
1229  result = InvokeDialogNetList( m_frame );
1230 
1231  return 0;
1232 }
#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 129 of file sch_editor_control.cpp.

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

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

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

◆ FindComponentAndItem()

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

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

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

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

49 {
50  SCH_SHEET_PATH* sheetWithComponentFound = NULL;
51  SCH_COMPONENT* Component = NULL;
52  wxPoint pos;
53  LIB_PIN* pin = nullptr;
54  SCH_SHEET_LIST sheetList( g_RootSheet );
55  SCH_ITEM* foundItem = nullptr;
56 
57  if( !aSearchHierarchy )
58  sheetList.push_back( *g_CurrentSheet );
59  else
60  sheetList.BuildSheetList( g_RootSheet );
61 
62  for( SCH_SHEET_PATH& sheet : sheetList)
63  {
64  SCH_SCREEN* screen = sheet.LastScreen();
65 
66  for( auto item : screen->Items().OfType( SCH_COMPONENT_T ) )
67  {
68  SCH_COMPONENT* pSch = static_cast<SCH_COMPONENT*>( item );
69 
70  if( aReference.CmpNoCase( pSch->GetRef( &sheet ) ) == 0 )
71  {
72  Component = pSch;
73  sheetWithComponentFound = &sheet;
74 
75  if( aSearchType == HIGHLIGHT_PIN )
76  {
77  pos = pSch->GetPosition(); // temporary: will be changed if the pin is found.
78  pin = pSch->GetPin( aSearchText );
79 
80  if( pin )
81  {
82  pos += pin->GetPosition();
83  foundItem = Component;
84  break;
85  }
86  }
87  else
88  {
89  pos = pSch->GetPosition();
90  foundItem = Component;
91  break;
92  }
93  }
94  }
95 
96  if( foundItem )
97  break;
98  }
99 
100  if( Component )
101  {
102  if( *sheetWithComponentFound != *g_CurrentSheet )
103  {
104  sheetWithComponentFound->LastScreen()->SetZoom( m_frame->GetScreen()->GetZoom() );
105  *g_CurrentSheet = *sheetWithComponentFound;
107  }
108 
109  wxPoint delta;
110  pos -= Component->GetPosition();
111  delta = Component->GetTransform().TransformCoordinate( pos );
112  pos = delta + Component->GetPosition();
113 
115  m_frame->CenterScreen( pos, false );
116  }
117 
118  /* Print diag */
119  wxString msg_item;
120  wxString msg;
121 
122  if( aSearchType == HIGHLIGHT_PIN )
123  msg_item.Printf( _( "pin %s" ), aSearchText );
124  else
125  msg_item = _( "component" );
126 
127  if( Component )
128  {
129  if( foundItem )
130  msg.Printf( _( "%s %s found" ), aReference, msg_item );
131  else
132  msg.Printf( _( "%s found but %s not found" ), aReference, msg_item );
133  }
134  else
135  msg.Printf( _( "Component %s not found" ), aReference );
136 
137  m_frame->SetStatusText( msg );
138 
139  m_probingPcbToSch = true; // recursion guard
140  {
141  // Clear any existing highlighting
143  m_frame->GetCanvas()->GetView()->HighlightItem( nullptr, nullptr );
144 
145  if( foundItem )
146  m_frame->GetCanvas()->GetView()->HighlightItem( foundItem, pin );
147  }
148  m_probingPcbToSch = false;
149 
150  m_frame->GetCanvas()->Refresh();
151 
152  return foundItem;
153 }
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.
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
EE_TYPE OfType(KICAD_T aType)
Definition: sch_rtree.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:218
void HighlightItem(EDA_ITEM *aItem, LIB_PIN *aPin=nullptr)
Definition: sch_view.cpp:225
wxPoint TransformCoordinate(const wxPoint &aPoint) const
Calculate a new coordinate according to the mirror/rotation transform.
Definition: transform.cpp:42
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
#define NULL
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:88
virtual void SetCrossHairCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true)=0
Moves the graphic crosshair cursor to the requested position expressed in world coordinates.
SCH_SHEET_PATH.
const wxString GetRef(const SCH_SHEET_PATH *aSheet)
Return the reference for the given sheet path.
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:429
SCH_SCREEN * LastScreen()
Function LastScreen.
#define _(s)
Definition: 3d_actions.cpp:31
EE_RTREE & Items()
Definition: sch_screen.h:127
SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:89
wxPoint GetPosition() const override
Function GetPosition.
virtual void CenterScreen(const wxPoint &aCenterPoint, bool aWarpPointer)
SCH_SHEET * g_RootSheet
SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:136

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_SCREEN::Items(), SCH_SHEET_PATH::LastScreen(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, m_probingPcbToSch, TOOL_BASE::m_toolMgr, NULL, EE_RTREE::OfType(), EDA_DRAW_PANEL_GAL::Refresh(), TOOL_MANAGER::RunAction(), SCH_COMPONENT_T, KIGFX::VIEW_CONTROLS::SetCrossHairCursorPosition(), BASE_SCREEN::SetZoom(), and TRANSFORM::TransformCoordinate().

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

198 {
199  // A timer during which a subsequent FindNext will result in a wrap-around
200  static wxTimer wrapAroundTimer;
201 
202  wxFindReplaceData* data = m_frame->GetFindReplaceData();
203 
204  if( aEvent.IsAction( &ACTIONS::findNextMarker ) )
205  {
206  if( data )
207  g_markersOnly.SetFlags( data->GetFlags() );
208 
209  data = &g_markersOnly;
210  }
211  else if( !data )
212  {
213  return FindAndReplace( ACTIONS::find.MakeEvent() );
214  }
215 
216  bool searchAllSheets = !( data->GetFlags() & FR_CURRENT_SHEET_ONLY );
217  EE_SELECTION& selection = m_selectionTool->GetSelection();
218  SCH_SCREEN* afterScreen = m_frame->GetScreen();
219  SCH_ITEM* afterItem = dynamic_cast<SCH_ITEM*>( selection.Front() );
220  SCH_ITEM* item = nullptr;
221 
222  if( wrapAroundTimer.IsRunning() )
223  {
224  afterScreen = nullptr;
225  afterItem = nullptr;
226  wrapAroundTimer.Stop();
228  }
229 
231 
232  if( afterScreen || !searchAllSheets )
233  item = nextMatch( m_frame->GetScreen(), afterItem, data );
234 
235  if( !item && searchAllSheets )
236  {
237  SCH_SHEET_LIST schematic( g_RootSheet );
238  SCH_SCREENS screens;
239 
240  for( SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
241  {
242  if( afterScreen )
243  {
244  if( afterScreen == screen )
245  afterScreen = nullptr;
246 
247  continue;
248  }
249 
250  item = nextMatch( screen, nullptr, data );
251 
252  if( item )
253  {
254  SCH_SHEET_PATH* sheet = schematic.FindSheetForScreen( screen );
255  wxCHECK_MSG( sheet, 0, "Sheet not found for " + screen->GetFileName() );
256 
257  *g_CurrentSheet = *sheet;
259 
260  screen->SetZoom( m_frame->GetScreen()->GetZoom() );
261  screen->TestDanglingEnds();
262 
263  m_frame->SetScreen( screen );
264  UpdateFind( ACTIONS::updateFind.MakeEvent() );
265 
266  break;
267  }
268  }
269  }
270 
271  if( item )
272  {
273  m_selectionTool->AddItemToSel( item );
274  m_frame->FocusOnLocation( item->GetBoundingBox().GetCenter(), true );
275  m_frame->GetCanvas()->Refresh();
276  }
277  else
278  {
279  wxString msg = searchAllSheets ? _( "Reached end of schematic." )
280  : _( "Reached end of sheet." );
281 
282  m_frame->ShowFindReplaceStatus( msg + _( "\nFind again to wrap around to the start." ) );
283  wrapAroundTimer.StartOnce( 4000 );
284  }
285 
286  return 0;
287 }
SCH_SHEET_LIST.
SCH_ITEM * nextMatch(SCH_SCREEN *aScreen, SCH_ITEM *aAfter, wxFindReplaceData *aData)
Advances the search and returns the next matching item after aAfter.
int FindAndReplace(const TOOL_EVENT &aEvent)
SCH_SCREEN * GetNext()
Definition: sch_screen.cpp:981
wxFindReplaceData * GetFindReplaceData()
Get the find criteria (as set by the dialog).
void SetScreen(BASE_SCREEN *aScreen) override
static wxFindReplaceData g_markersOnly
double GetZoom() const
Function GetZoom returns the current "zoom factor", which is a measure of "internal units per device ...
Definition: base_screen.h:240
void UpdateAllScreenReferences()
Function UpdateAllScreenReferences updates the reference and the m_Multi parameter (part selection) f...
static TOOL_ACTION find
Definition: actions.h:78
bool IsAction(const TOOL_ACTION *aAction) const
Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_AC...
Definition: tool_event.cpp:67
EE_SELECTION & GetSelection()
Function GetSelection()
static TOOL_ACTION updateFind
Definition: actions.h:84
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
SCH_SHEET_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)
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:153
SCH_SHEET_PATH.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
static TOOL_ACTION findNextMarker
Definition: actions.h:81
void ClearFindReplaceStatus()
void FocusOnLocation(const wxPoint &aPos, bool aCenterView=false)
Useful to focus on a particular location, in find functions Move the graphic cursor (crosshair cursor...
int AddItemToSel(const TOOL_EVENT &aEvent)
int ClearSelection(const TOOL_EVENT &aEvent)
Clear current selection event handler.
#define _(s)
Definition: 3d_actions.cpp:31
SCH_SCREEN * GetFirst()
Definition: sch_screen.cpp:970
SCH_SHEET * g_RootSheet
void ShowFindReplaceStatus(const wxString &aMsg)
SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:136
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:498
EDA_ITEM * Front() const
Definition: selection.h:183

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, SCH_BASE_FRAME::GetCanvas(), 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 1235 of file sch_editor_control.cpp.

1236 {
1238  return 0;
1239 }
int InvokeDialogCreateBOM(SCH_EDIT_FRAME *aCaller)
Create and show DIALOG_BOM and return whatever DIALOG_BOM::ShowModal() returns.
Definition: dialog_bom.cpp:217

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
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:163

References TOOL_BASE::getModelInt().

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

◆ GetName()

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

Function GetName() Returns the name of the tool.

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

Returns
The name of the tool.

Definition at line 132 of file tool_base.h.

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

References TOOL_BASE::m_toolName.

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

◆ GetSettings()

TOOL_SETTINGS & TOOL_BASE::GetSettings ( )
inherited

Definition at line 78 of file tool_base.cpp.

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

References TOOL_BASE::m_toolSettings.

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

◆ GetToolMenu()

◆ GetType()

TOOL_TYPE TOOL_BASE::GetType ( ) const
inlineinherited

Function GetType() Returns the type of the tool.

Returns
The type of the tool.

Definition at line 110 of file tool_base.h.

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

References TOOL_BASE::m_type.

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

◆ getView()

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

Function getView()

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

Returns
The instance of VIEW.

Definition at line 36 of file tool_base.cpp.

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

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

Referenced by EE_POINT_EDITOR::addCornerCondition(), ALIGN_DISTRIBUTE_TOOL::AlignLeft(), ALIGN_DISTRIBUTE_TOOL::AlignRight(), COMMON_TOOLS::CenterContents(), EE_SELECTION_TOOL::ClearSelection(), COMMON_TOOLS::CursorControl(), LIB_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), MICROWAVE_TOOL::drawMicrowaveInductor(), 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(), EE_SELECTION_TOOL::highlight(), SELECTION_TOOL::highlight(), GERBVIEW_CONTROL::HighlightControl(), PNS::TOOL_BASE::highlightNet(), PCB_INSPECTION_TOOL::highlightNet(), EE_POINT_EDITOR::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), POINT_EDITOR::OnSelectionChange(), COMMON_TOOLS::PanControl(), LIB_EDIT_TOOL::Paste(), Paste(), PNS::TOOL_BASE::pickSingleItem(), 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(), EE_SELECTION_TOOL::selectionContains(), SELECTION_TOOL::selectionContains(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::SelectPoint(), ZOOM_TOOL::selectRegion(), GERBVIEW_SELECTION_TOOL::selectVisually(), COMMON_TOOLS::ToggleGrid(), ToggleHiddenPins(), EE_SELECTION_TOOL::unhighlight(), SELECTION_TOOL::unhighlight(), GERBVIEW_SELECTION_TOOL::unselect(), GERBVIEW_SELECTION_TOOL::unselectVisually(), EE_POINT_EDITOR::updateEditedPoint(), POINT_EDITOR::updateEditedPoint(), UpdateFind(), PCBNEW_CONTROL::updateGrid(), EE_POINT_EDITOR::updateItem(), UpdateNetHighlighting(), EE_POINT_EDITOR::updatePoints(), POINT_EDITOR::updatePoints(), SELECTION_TOOL::updateSelection(), PNS::TOOL_BASE::updateStartItem(), EE_TOOL_BASE< SCH_BASE_FRAME >::updateView(), PCB_TOOL_BASE::view(), COMMON_TOOLS::ZoomFitScreen(), SELECTION_TOOL::zoomFitSelection(), EE_SELECTION_TOOL::~EE_SELECTION_TOOL(), GERBVIEW_SELECTION_TOOL::~GERBVIEW_SELECTION_TOOL(), and SELECTION_TOOL::~SELECTION_TOOL().

◆ getViewControls()

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

Function getViewControls()

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

Returns
The instance of VIEW_CONTROLS.

Definition at line 42 of file tool_base.cpp.

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

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

Referenced by EE_POINT_EDITOR::addCorner(), POINT_EDITOR::addCorner(), EE_POINT_EDITOR::addCornerCondition(), SCH_EDIT_TOOL::BreakWire(), PCB_TOOL_BASE::controls(), COMMON_TOOLS::CursorControl(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), COMMON_TOOLS::doZoomToPreset(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), LIB_DRAWING_TOOLS::DrawShape(), 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(), SCH_MOVE_TOOL::Main(), EE_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(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), SCH_EDIT_TOOL::RepeatDrawItem(), EE_SELECTION_TOOL::RequestSelection(), POINT_EDITOR::Reset(), DRAWING_TOOL::Reset(), COMMON_TOOLS::ResetLocalCoords(), GERBVIEW_SELECTION_TOOL::selectCursor(), SELECTION_TOOL::selectCursor(), 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(), POINT_EDITOR::setEditedPoint(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), EE_POINT_EDITOR::updateEditedPoint(), POINT_EDITOR::updateEditedPoint(), LIB_MOVE_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(), ZONE_FILLER_TOOL::setTransitions(), COMMON_CONTROL::setTransitions(), LIB_DRAWING_TOOLS::setTransitions(), EE_POINT_EDITOR::setTransitions(), KICAD_MANAGER_CONTROL::setTransitions(), SCH_MOVE_TOOL::setTransitions(), LIB_MOVE_TOOL::setTransitions(), GERBVIEW_CONTROL::setTransitions(), SCH_DRAWING_TOOLS::setTransitions(), POINT_EDITOR::setTransitions(), GLOBAL_EDIT_TOOL::setTransitions(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::setTransitions(), LIB_CONTROL::setTransitions(), LIB_EDIT_TOOL::setTransitions(), SCH_EDIT_TOOL::setTransitions(), POSITION_RELATIVE_TOOL::setTransitions(), GERBVIEW_SELECTION_TOOL::setTransitions(), COMMON_TOOLS::setTransitions(), PCB_INSPECTION_TOOL::setTransitions(), PCBNEW_CONTROL::setTransitions(), ALIGN_DISTRIBUTE_TOOL::setTransitions(), MODULE_EDITOR_TOOLS::setTransitions(), SCH_LINE_WIRE_BUS_TOOL::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(), EE_SELECTION_TOOL::setTransitions(), and DRC::setTransitions().

◆ HasMatch()

bool SCH_EDITOR_CONTROL::HasMatch ( )

Definition at line 290 of file sch_editor_control.cpp.

291 {
292  wxFindReplaceData* data = m_frame->GetFindReplaceData();
294 
295  return data && item && item->Matches( *data, nullptr );
296 }
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:153
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
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:471
EDA_ITEM * Front() const
Definition: selection.h:183

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

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

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

Referenced by setTransitions().

◆ HighlightNetCursor()

int SCH_EDITOR_CONTROL::HighlightNetCursor ( const TOOL_EVENT aEvent)

Launches a tool to highlight nets.

Definition at line 774 of file sch_editor_control.cpp.

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

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

Referenced by setTransitions().

◆ ImportFPAssignments()

int SCH_EDITOR_CONTROL::ImportFPAssignments ( const TOOL_EVENT aEvent)

Definition at line 207 of file backanno.cpp.

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

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

Referenced by setTransitions().

◆ Init()

bool EE_TOOL_BASE< SCH_EDIT_FRAME >::Init ( )
inlineoverridevirtualinherited

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

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

Reimplemented from TOOL_BASE.

Definition at line 69 of file ee_tool_base.h.

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

1278 {
1279  if( g_CurrentSheet->Last() != g_RootSheet )
1280  {
1283 
1287  }
1288 
1289  return 0;
1290 }
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:218
void pop_back()
Forwarded method from std::vector.
SCH_SHEET_PATH * g_CurrentSheet
With the new connectivity algorithm, many more places than before want to know what the current sheet...
void UpdateHierarchyNavigator(bool aForceUpdate=false)
Run the Hierarchy Navigator dialog.
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:58
SCH_SHEET * g_RootSheet

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(), TOOL_MANAGER::RunAction(), and SCH_EDIT_FRAME::UpdateHierarchyNavigator().

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

136 {
138  return 0;
139 }
void UpdateHierarchyNavigator(bool aForceUpdate=false)
Run the Hierarchy Navigator dialog.

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

Referenced by setTransitions().

◆ New()

int SCH_EDITOR_CONTROL::New ( const TOOL_EVENT aEvent)

Definition at line 57 of file sch_editor_control.cpp.

58 {
60  return 0;
61 }

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

Referenced by setTransitions().

◆ nextMatch()

SCH_ITEM * SCH_EDITOR_CONTROL::nextMatch ( SCH_SCREEN aScreen,
SCH_ITEM aAfter,
wxFindReplaceData *  aData 
)
private

Advances the search and returns the next matching item after aAfter.

Parameters
aScreenPointer to the screen used for searching
aAfterStarting match to compare
aDataSearch data to compare against or NULL to match the first item found
Returns
pointer to the next search item found or NULL if nothing found

Definition at line 177 of file sch_editor_control.cpp.

179 {
180  bool past_item = ( aAfter == nullptr );
181 
182  for( auto item : aScreen->Items() )
183  {
184  if( item == aAfter )
185  past_item = true;
186 
187  if( past_item
188  && ( ( aData == &g_markersOnly && item->Type() == SCH_MARKER_T )
189  || item->Matches( *aData, nullptr ) ) )
190  return item;
191  }
192 
193  return nullptr;
194 }
static wxFindReplaceData g_markersOnly
EE_RTREE & Items()
Definition: sch_screen.h:127

References g_markersOnly, SCH_SCREEN::Items(), and SCH_MARKER_T.

Referenced by FindNext().

◆ Open()

int SCH_EDITOR_CONTROL::Open ( const TOOL_EVENT aEvent)

Definition at line 64 of file sch_editor_control.cpp.

65 {
67  return 0;
68 }

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

86 {
87  PICKED_ITEMS_LIST undoCmd;
89  ITEM_PICKER wrapper( undoItem, UR_PAGESETTINGS );
90 
91  undoCmd.PushItem( wrapper );
93 
95  dlg.SetWksFileName( BASE_SCREEN::m_PageLayoutDescrFileName );
96 
97  if( dlg.ShowModal() != wxID_OK )
99 
100  return 0;
101 }
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.
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 938 of file sch_editor_control.cpp.

939 {
940  wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( wxWindow::FindFocus() );
941 
942  if( textEntry )
943  {
944  textEntry->Paste();
945  return 0;
946  }
947 
949  std::string text = m_toolMgr->GetClipboard();
950 
951  if( text.empty() )
952  return 0;
953 
954  STRING_LINE_READER reader( text, "Clipboard" );
955  SCH_LEGACY_PLUGIN plugin;
956 
957  SCH_SCREEN paste_screen( &m_frame->GetScreen()->Kiway() );
958 
959  try
960  {
961  plugin.LoadContent( reader, &paste_screen );
962  }
963  catch( IO_ERROR& e )
964  {
965  // If it wasn't content, then paste as text
966  paste_screen.Append( new SCH_TEXT( wxPoint( 0, 0 ), text ) );
967  }
968 
969  bool forceKeepAnnotations = false;
970  bool forceDropAnnotations = false;
971  bool dropAnnotations = false;
972 
973  if( aEvent.IsAction( &ACTIONS::pasteSpecial ) )
974  {
975  DIALOG_PASTE_SPECIAL dlg( m_frame, &forceKeepAnnotations, &forceDropAnnotations );
976 
977  if( dlg.ShowModal() == wxID_CANCEL )
978  return 0;
979  }
980 
981  if( forceDropAnnotations )
982  dropAnnotations = true;
983 
984  // SCH_LEGACY_PLUGIN added the items to the paste screen, but not to the view or anything
985  // else. Pull them back out to start with.
986  //
987  EDA_ITEMS loadedItems;
988  bool sheetsPasted = false;
989  SCH_SHEET_LIST hierarchy( g_RootSheet );
990  wxFileName destFn = g_CurrentSheet->Last()->GetFileName();
991 
992  if( destFn.IsRelative() )
993  destFn.MakeAbsolute( m_frame->Prj().GetProjectPath() );
994 
995  for( auto item : paste_screen.Items() )
996  {
997  loadedItems.push_back( item );
998 
999  if( item->Type() == SCH_COMPONENT_T )
1000  {
1001  if( !dropAnnotations && !forceKeepAnnotations )
1002  {
1003  for( auto existingItem : m_frame->GetScreen()->Items() )
1004  {
1005  if( item->GetTimeStamp() == existingItem->GetTimeStamp() )
1006  {
1007  dropAnnotations = true;
1008  break;
1009  }
1010  }
1011  }
1012  }
1013  else if( item->Type() == SCH_SHEET_T )
1014  {
1015  SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
1016  wxFileName srcFn = sheet->GetFileName();
1017 
1018  if( srcFn.IsRelative() )
1019  srcFn.MakeAbsolute( m_frame->Prj().GetProjectPath() );
1020 
1021  SCH_SHEET_LIST sheetHierarchy( sheet );
1022 
1023  if( hierarchy.TestForRecursion( sheetHierarchy, destFn.GetFullPath( wxPATH_UNIX ) ) )
1024  {
1025  auto msg = wxString::Format( _( "The pasted sheet \"%s\"\n"
1026  "was dropped because the destination already has "
1027  "the sheet or one of its subsheets as a parent." ),
1028  sheet->GetFileName() );
1029  DisplayError( m_frame, msg );
1030  loadedItems.pop_back();
1031  }
1032  }
1033  }
1034 
1035  // Remove the references from our temporary screen to prevent freeing on the DTOR
1036  paste_screen.Clear( false );
1037 
1038  // Now we can resolve the components and add everything to the screen, view, etc.
1039  //
1040  SYMBOL_LIB_TABLE* symLibTable = m_frame->Prj().SchSymbolLibTable();
1041  PART_LIB* partLib = m_frame->Prj().SchLibs()->GetCacheLibrary();
1042 
1043  for( unsigned i = 0; i < loadedItems.size(); ++i )
1044  {
1045  EDA_ITEM* item = loadedItems[i];
1046 
1047  if( item->Type() == SCH_COMPONENT_T )
1048  {
1049  SCH_COMPONENT* component = (SCH_COMPONENT*) item;
1050 
1051  if( dropAnnotations )
1052  {
1053  component->SetTimeStamp( GetNewTimeStamp() );
1054 
1055  // clear the annotation, but preserve the selected unit
1056  int unit = component->GetUnit();
1057  component->ClearAnnotation( nullptr );
1058  component->SetUnit( unit );
1059  }
1060 
1061  component->Resolve( *symLibTable, partLib );
1062  component->UpdatePins();
1063  }
1064  else if( item->Type() == SCH_SHEET_T )
1065  {
1066  SCH_SHEET* sheet = (SCH_SHEET*) item;
1067  wxFileName fn = sheet->GetFileName();
1068  SCH_SCREEN* existingScreen = nullptr;
1069  bool dropSheetAnnotations = false;
1070 
1071  // Duplicate sheet names and timestamps are not valid. Generate new timestamps
1072  // and timestamp-based sheet names.
1073  timestamp_t uid = GetNewTimeStamp();
1074 
1075  sheet->SetName( wxString::Format( wxT( "sheet%8.8lX" ), (unsigned long)uid ) );
1076  sheet->SetTimeStamp( uid );
1077  sheet->SetParent( g_CurrentSheet->Last() );
1078  sheet->SetScreen( nullptr );
1079  sheetsPasted = true;
1080 
1081  if( !fn.IsAbsolute() )
1082  {
1083  wxFileName currentSheetFileName = g_CurrentSheet->LastScreen()->GetFileName();
1084  fn.Normalize( wxPATH_NORM_ALL, currentSheetFileName.GetPath() );
1085  }
1086 
1087  if( g_RootSheet->SearchHierarchy( fn.GetFullPath( wxPATH_UNIX ), &existingScreen ) )
1088  dropSheetAnnotations = true;
1089  else
1090  searchSupplementaryClipboard( sheet->GetFileName(), &existingScreen );
1091 
1092  if( existingScreen )
1093  {
1094  sheet->SetScreen( existingScreen );
1095 
1096  SCH_SHEET_PATH sheetpath = *g_CurrentSheet;
1097  sheetpath.push_back( sheet );
1098 
1099  // Clear annotation and create the AR for this path, if not exists,
1100  // when the screen is shared by sheet paths.
1101  // Otherwise ClearAnnotation do nothing, because the F1 field is used as
1102  // reference default value and takes the latest displayed value
1103  existingScreen->EnsureAlternateReferencesExist();
1104 
1105  if( forceDropAnnotations || dropSheetAnnotations )
1106  existingScreen->ClearAnnotation( &sheetpath );
1107  }
1108  else
1109  {
1110  if( !m_frame->LoadSheetFromFile( sheet, g_CurrentSheet, fn.GetFullPath() ) )
1111  m_frame->InitSheet( sheet, sheet->GetFileName() );
1112  }
1113  }
1114 
1115  item->SetFlags( IS_NEW | IS_PASTED | IS_MOVED );
1116  m_frame->AddItemToScreenAndUndoList( (SCH_ITEM*) item, i > 0 );
1117 
1118  // Reset flags for subsequent move operation
1119  item->SetFlags( IS_NEW | IS_PASTED | IS_MOVED );
1120  // Start out hidden so the pasted items aren't "ghosted" in their original location
1121  // before being moved to the current location.
1122  getView()->Hide( item, true );
1123  }
1124 
1125  if( sheetsPasted )
1126  {
1129  }
1130 
1131  // Now clear the previous selection, select the pasted items, and fire up the "move"
1132  // tool.
1133  //
1135  m_toolMgr->RunAction( EE_ACTIONS::addItemsToSel, true, &loadedItems );
1136 
1137  EE_SELECTION& selection = selTool->GetSelection();
1138 
1139  if( !selection.Empty() )
1140  {
1141  SCH_ITEM* item = (SCH_ITEM*) selection.GetTopLeftItem();
1142 
1143  selection.SetReferencePoint( item->GetPosition() );
1145  }
1146 
1147  return 0;
1148 }
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:236
void Hide(VIEW_ITEM *aItem, bool aHide=true)
Temporarily hides the item in the view (e.g.
Definition: view.cpp:1507
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:157
bool SearchHierarchy(const wxString &aFilename, SCH_SCREEN **aScreen)
Search the existing hierarchy for an instance of screen loaded from aFileName.
Definition: sch_sheet.cpp:540
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
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...
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:111
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:109
void InitSheet(SCH_SHEET *aSheet, const wxString &aNewFilename)
Definition: sheet.cpp:93
void EnsureAlternateReferencesExist()
For screens shared by many sheetpaths (complex hierarchies): to be able to clear or modify any refere...
Definition: sch_screen.cpp:759
bool searchSupplementaryClipboard(const wxString &aSheetFilename, SCH_SCREEN **aScreen)
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:102
bool IsAction(const TOOL_ACTION *aAction) const
Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_AC...
Definition: tool_event.cpp:67
EE_SELECTION & GetSelection()
Function GetSelection()
#define IS_NEW
New item, just created.
Definition: base_struct.h:120
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void SetReferencePoint(const VECTOR2I &aP)
Definition: selection.h:244
timestamp_t GetNewTimeStamp()
Definition: common.cpp:215
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:255
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:270
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:216
std::vector< EDA_ITEM * > EDA_ITEMS
Define list of drawing items for screens.
Definition: base_struct.h:601
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
void UpdatePins(SCH_SHEET_PATH *aSheet=nullptr)
Updates the local cache of SCH_PIN_CONNECTION objects for each pin.
void UpdateHierarchyNavigator(bool aForceUpdate=false)
Run the Hierarchy Navigator dialog.
void SetUnit(int aUnit)
Change the unit number to aUnit.
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:58
SCH_SHEET_PATH.
void ClearAnnotation(SCH_SHEET_PATH *aSheetPath)
Clear exiting component annotation.
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:120
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:206
static TOOL_ACTION pasteSpecial
Definition: actions.h:72
wxString GetFileName(void) const
Return the filename corresponding to this sheet.
Definition: sch_sheet.cpp:616
EDA_ITEM * GetTopLeftItem(bool onlyModules=false) const override
SCH_SCREEN * LastScreen()
Function LastScreen.
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.
#define _(s)
Definition: 3d_actions.cpp:31
std::string GetClipboard() const
Returns the information currently stored in the system clipboard.
EE_RTREE & Items()
Definition: sch_screen.h:127
SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:89
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
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:742
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:52
SCH_SHEET * g_RootSheet
STRING_LINE_READER is a LINE_READER that reads from a multiline 8 bit wide std::string.
Definition: richio.h:254
Object used to load, save, search, and otherwise manipulate symbol library files.
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:136
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
Definition: base_struct.h:133
KICAD_T Type() const
Function Type()
Definition: base_struct.h:207
void SetTimeStamp(timestamp_t aNewTimeStamp)
Definition: base_struct.h:212
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::GetFileName(), SCH_SHEET::GetFileName(), GetNewTimeStamp(), SCH_ITEM::GetPosition(), PROJECT::GetProjectPath(), SCH_EDIT_FRAME::GetScreen(), EE_SELECTION_TOOL::GetSelection(), EDA_ITEM::GetTimeStamp(), TOOL_MANAGER::GetTool(), EE_SELECTION::GetTopLeftItem(), SCH_COMPONENT::GetUnit(), TOOL_BASE::getView(), KIGFX::VIEW::Hide(), SCH_EDIT_FRAME::InitSheet(), IS_MOVED, IS_NEW, IS_PASTED, TOOL_EVENT::IsAction(), SCH_SCREEN::Items(), KIWAY_HOLDER::Kiway(), 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, ACTIONS::pasteSpecial, KIWAY_HOLDER::Prj(), SCH_SHEET_PATH::push_back(), SCH_COMPONENT::Resolve(), TOOL_MANAGER::RunAction(), SCH_COMPONENT_T, SCH_SHEET_T, SCH_SHEET::SearchHierarchy(), searchSupplementaryClipboard(), EDA_ITEM::SetFlags(), SCH_SHEET::SetName(), EDA_ITEM::SetParent(), SELECTION::SetReferencePoint(), SCH_SHEET::SetScreen(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), EDA_ITEM::SetTimeStamp(), SCH_COMPONENT::SetTimeStamp(), SCH_COMPONENT::SetUnit(), SCH_SHEET_LIST::TestForRecursion(), EDA_ITEM::Type(), SCH_EDIT_FRAME::UpdateHierarchyNavigator(), and SCH_COMPONENT::UpdatePins().

Referenced by setTransitions().

◆ Plot()

int SCH_EDITOR_CONTROL::Plot ( const TOOL_EVENT aEvent)

Definition at line 111 of file sch_editor_control.cpp.

112 {
114  return 0;
115 }

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

105 {
106  m_frame->Print();
107  return 0;
108 }
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 }
SCH_SHEET_LIST.
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".
SCH_REFERENCE_LIST is used to create a flattened list of components because in a complex hierarchy,...
SCH_FIELD * GetField(int aFieldNdx) const
Returns a field in this symbol.
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:111
#define NULL
SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:89
SCH_SHEET * g_RootSheet
unsigned GetCount()
Function GetCount.

References FOOTPRINT, FROM_UTF8(), g_RootSheet, SCH_SHEET_LIST::GetComponents(), SCH_REFERENCE_LIST::GetCount(), SCH_COMPONENT::GetField(), LINE_READER::Line(), NULL, 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 118 of file sch_editor_control.cpp.

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

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

833 {
834  if( m_frame->GetScreen()->GetRedoCommandCount() == 0 )
835  return 0;
836 
837  // Inform tools that undo command was issued
839 
840  /* Get the old list */
842 
843  /* Redo the command: */
844  m_frame->PutDataInPreviousState( List, true );
845 
846  /* Put the old list in UndoList */
847  List->ReversePickersListOrder();
849 
851  selTool->RebuildSelection();
852 
855 
856  m_frame->SyncView();
857  m_frame->GetCanvas()->Refresh();
858  m_frame->OnModify();
859 
860  return 0;
861 }
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.
PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
All active tools
Definition: tool_event.h:147
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void PutDataInPreviousState(PICKED_ITEMS_LIST *aList, bool aRedoCommand)
Restore an undo or redo command to put data pointed by aList in the previous state.
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
void RebuildSelection()
Rebuilds the selection from the EDA_ITEMs' selection flags.
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
int GetRedoCommandCount() const
Definition: base_screen.h:206

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

Referenced by setTransitions().

◆ ReplaceAll()

int SCH_EDITOR_CONTROL::ReplaceAll ( const TOOL_EVENT aEvent)

Definition at line 317 of file sch_editor_control.cpp.

318 {
319  wxFindReplaceData* data = m_frame->GetFindReplaceData();
320 
321  if( !data )
322  return FindAndReplace( ACTIONS::find.MakeEvent() );
323 
324  SCH_SHEET_LIST schematic( g_RootSheet );
325  SCH_SCREENS screens;
326 
327  for( SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
328  {
329  //TODO(snh): Fix ReplaceAll
330  // screen->ForEachItem() for( EDA_ITEM* item = nextMatch( screen, nullptr, data ); item;
331  // item = nextMatch( screen, item, data ) )
332  // {
333  // item->Replace( *data, schematic.FindSheetForScreen( screen ) );
334  // }
335  }
336 
337  return 0;
338 }
SCH_SHEET_LIST.
int FindAndReplace(const TOOL_EVENT &aEvent)
SCH_SCREEN * GetNext()
Definition: sch_screen.cpp:981
wxFindReplaceData * GetFindReplaceData()
Get the find criteria (as set by the dialog).
static TOOL_ACTION find
Definition: actions.h:78
SCH_SCREEN * GetFirst()
Definition: sch_screen.cpp:970
SCH_SHEET * g_RootSheet
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:498

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

Referenced by setTransitions().

◆ ReplaceAndFindNext()

int SCH_EDITOR_CONTROL::ReplaceAndFindNext ( const TOOL_EVENT aEvent)

Definition at line 299 of file sch_editor_control.cpp.

300 {
301  wxFindReplaceData* data = m_frame->GetFindReplaceData();
303 
304  if( !data )
305  return FindAndReplace( ACTIONS::find.MakeEvent() );
306 
307  if( item && item->Matches( *data, nullptr ) )
308  {
309  item->Replace( *data, g_CurrentSheet );
310  FindNext( ACTIONS::findNext.MakeEvent() );
311  }
312 
313  return 0;
314 }
int FindAndReplace(const TOOL_EVENT &aEvent)
wxFindReplaceData * GetFindReplaceData()
Get the find criteria (as set by the dialog).
static bool Replace(wxFindReplaceData &aSearchData, wxString &aText)
Helper function used in search and replace dialog Function Replace performs a text replace on aText u...
int FindNext(const TOOL_EVENT &aEvent)
static TOOL_ACTION find
Definition: actions.h:78
EE_SELECTION & GetSelection()
Function GetSelection()
SCH_SHEET_PATH * g_CurrentSheet
With the new connectivity algorithm, many more places than before want to know what the current sheet...
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:153
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
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:471
static TOOL_ACTION findNext
Definition: actions.h:80
EDA_ITEM * Front() const
Definition: selection.h:183

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

72 {
74  return 0;
75 }

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

79 {
80  m_frame->Save_File( true );
81  return 0;
82 }
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  bool selected = aItem->IsSelected();
121 
122  // IS_SELECTED flag should not be set on undo items which were added for
123  // a drag operation.
124  if( selected && aItem->HasFlag( TEMP_SELECTED ))
125  aItem->ClearSelected();
126 
127  if( m_isLibEdit )
128  {
129  LIB_EDIT_FRAME* editFrame = dynamic_cast<LIB_EDIT_FRAME*>( m_frame );
130  wxASSERT( editFrame );
131 
132  editFrame->SaveCopyInUndoList( static_cast<LIB_ITEM*>( aItem ), aType, aAppend );
133  }
134  else
135  {
136  SCH_EDIT_FRAME* editFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
137  wxASSERT( editFrame );
138 
139  if( itemType == SCH_PIN_T || itemType == SCH_FIELD_T || itemType == SCH_SHEET_PIN_T )
140  editFrame->SaveCopyInUndoList(
141  static_cast<SCH_ITEM*>( aItem->GetParent() ), UR_CHANGED, aAppend );
142  else
143  editFrame->SaveCopyInUndoList( static_cast<SCH_ITEM*>( aItem ), aType, aAppend );
144  }
145 
146  if( selected && aItem->HasFlag( TEMP_SELECTED ) )
147  aItem->SetSelected();
148  }
#define TEMP_SELECTED
flag indicating that the structure has already selected
Definition: base_struct.h:128
bool IsSelected() const
Definition: base_struct.h:223
void ClearSelected()
Definition: base_struct.h:233
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
void SetSelected()
Definition: base_struct.h:229
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:215
The symbol library editor main window.
bool HasFlag(STATUS_FLAGS aFlag)
Definition: base_struct.h:258
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:207

◆ searchSupplementaryClipboard()

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

Definition at line 892 of file sch_editor_control.cpp.

894 {
895  if( m_supplementaryClipboard.count( aSheetFilename ) > 0 )
896  {
897  *aScreen = m_supplementaryClipboard[ aSheetFilename ];
898  return true;
899  }
900 
901  return false;
902 }
std::map< wxString, SCH_SCREEN * > m_supplementaryClipboard

References m_supplementaryClipboard.

Referenced by Paste().

◆ SetContextMenu()

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

Function SetContextMenu()

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

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

Definition at line 76 of file tool_interactive.cpp.

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

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

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), 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 1315 of file sch_editor_control.cpp.

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

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

◆ ShowBusManager()

int SCH_EDITOR_CONTROL::ShowBusManager ( const TOOL_EVENT aEvent)

Definition at line 1249 of file sch_editor_control.cpp.

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

1183 {
1184  wxCommandEvent dummy;
1186  return 0;
1187 }
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 1207 of file sch_editor_control.cpp.

1208 {
1209  wxCommandEvent dummy;
1211  return 0;
1212 }
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 1307 of file sch_editor_control.cpp.

1308 {
1310 
1311  return 0;
1312 }
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 1293 of file sch_editor_control.cpp.

1294 {
1296 
1297  auto painter = static_cast<KIGFX::SCH_PAINTER*>( getView()->GetPainter() );
1298  painter->GetSettings()->m_ShowHiddenPins = m_frame->GetShowAllPins();
1299 
1301  m_frame->GetCanvas()->Refresh();
1302 
1303  return 0;
1304 }
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 800 of file sch_editor_control.cpp.

801 {
802  if( m_frame->GetScreen()->GetUndoCommandCount() <= 0 )
803  return 0;
804 
805  // Inform tools that undo command was issued
807 
808  /* Get the old list */
810 
811  /* Undo the command */
812  m_frame->PutDataInPreviousState( List, false );
813 
814  /* Put the old list in RedoList */
815  List->ReversePickersListOrder();
817 
819  selTool->RebuildSelection();
820 
823 
824  m_frame->SyncView();
825  m_frame->GetCanvas()->Refresh();
826  m_frame->OnModify();
827 
828  return 0;
829 }
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.
PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
All active tools
Definition: tool_event.h:147
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void PutDataInPreviousState(PICKED_ITEMS_LIST *aList, bool aRedoCommand)
Restore an undo or redo command to put data pointed by aList in the previous state.
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
void RebuildSelection()
Rebuilds the selection from the EDA_ITEMs' selection flags.
virtual void PushCommandToRedoList(PICKED_ITEMS_LIST *aItem)
Function PushCommandToRedoList add a command to redo in redo list delete the very old commands when t...
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...

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

Referenced by setTransitions().

◆ UpdateFind()

int SCH_EDITOR_CONTROL::UpdateFind ( const TOOL_EVENT aEvent)

Definition at line 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  for( auto item : m_frame->GetScreen()->Items() )
151  {
152  if( data && item->Matches( *data, nullptr ) )
153  m_selectionTool->BrightenItem( item );
154  else if( item->IsBrightened() )
156  }
157  }
158  else if( aEvent.Matches( EVENTS::SelectedItemsModified ) )
159  {
160  for( EDA_ITEM* item : m_selectionTool->GetSelection() )
161  {
162  if( data && item->Matches( *data, nullptr ) )
163  m_selectionTool->BrightenItem( item );
164  else if( item->IsBrightened() )
166  }
167  }
168 
169  getView()->UpdateItems();
170  m_frame->GetCanvas()->Refresh();
171  m_frame->UpdateTitle();
172 
173  return 0;
174 }
static TOOL_ACTION findAndReplace
Definition: actions.h:79
wxFindReplaceData * GetFindReplaceData()
Get the find criteria (as set by the dialog).
void UpdateTitle()
Set the main window title bar text.
static TOOL_ACTION find
Definition: actions.h:78
static const TOOL_EVENT SelectedItemsModified
Definition: actions.h:201
bool IsAction(const TOOL_ACTION *aAction) const
Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_AC...
Definition: tool_event.cpp:67
EE_SELECTION & GetSelection()
Function GetSelection()
static TOOL_ACTION updateFind
Definition: actions.h:84
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void BrightenItem(EDA_ITEM *aItem)
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:153
void UpdateItems()
Function UpdateItems() Iterates through the list of items that asked for updating and updates them.
Definition: view.cpp:1421
bool Matches(const TOOL_EVENT &aEvent) const
Function Matches() Tests whether two events match in terms of category & action or command.
Definition: tool_event.h:364
void UnbrightenItem(EDA_ITEM *aItem)
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
int ClearSelection(const TOOL_EVENT &aEvent)
Clear current selection event handler.
EE_RTREE & Items()
Definition: sch_screen.h:127
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:163

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

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

698 {
699  SCH_SCREEN* screen = g_CurrentSheet->LastScreen();
700  std::vector<EDA_ITEM*> itemsToRedraw;
701  wxString selectedNetName = m_frame->GetSelectedNetName();
702 
703  if( !screen )
704  return 0;
705 
706  for( auto item : screen->Items() )
707  {
708  SCH_CONNECTION* conn = item->Connection( *g_CurrentSheet );
709  bool redraw = item->IsBrightened();
710 
711  if( conn && conn->Name() == selectedNetName )
712  item->SetBrightened();
713  else
714  item->ClearBrightened();
715 
716  redraw |= item->IsBrightened();
717 
718  if( item->Type() == SCH_COMPONENT_T )
719  {
720  SCH_COMPONENT* comp = static_cast<SCH_COMPONENT*>( item );
721 
722  redraw |= comp->HasBrightenedPins();
723 
724  comp->ClearBrightenedPins();
725  std::vector<LIB_PIN*> pins;
726  comp->GetPins( pins );
727 
728  for( LIB_PIN* pin : pins )
729  {
730  auto pin_conn = comp->GetConnectionForPin( pin, *g_CurrentSheet );
731 
732  if( pin_conn && pin_conn->Name( false ) == selectedNetName )
733  {
734  comp->BrightenPin( pin );
735  redraw = true;
736  }
737  }
738  }
739  else if( item->Type() == SCH_SHEET_T )
740  {
741  for( SCH_SHEET_PIN* pin : static_cast<SCH_SHEET*>( item )->GetPins() )
742  {
743  auto pin_conn = pin->Connection( *g_CurrentSheet );
744  bool redrawPin = pin->IsBrightened();
745 
746  if( pin_conn && pin_conn->Name() == selectedNetName )
747  pin->SetBrightened();
748  else
749  pin->ClearBrightened();
750 
751  redrawPin |= pin->IsBrightened();
752 
753  if( redrawPin )
754  itemsToRedraw.push_back( pin );
755  }
756  }
757 
758  if( redraw )
759  itemsToRedraw.push_back( item );
760  }
761 
762  // Be sure highlight change will be redrawn
763  KIGFX::VIEW* view = getView();
764 
765  for( auto redrawItem : itemsToRedraw )
767 
768  m_frame->GetCanvas()->Refresh();
769 
770  return 0;
771 }
const wxString & GetSelectedNetName() const
void ClearBrightenedPins()
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.
SCH_SCREEN * LastScreen()
Function LastScreen.
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
bool HasBrightenedPins()
EE_RTREE & Items()
Definition: sch_screen.h:127
SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:89
VIEW.
Definition: view.h:61

References SCH_COMPONENT::BrightenPin(), EDA_ITEM::ClearBrightened(), SCH_COMPONENT::ClearBrightenedPins(), SCH_ITEM::Connection(), g_CurrentSheet, SCH_BASE_FRAME::GetCanvas(), SCH_COMPONENT::GetConnectionForPin(), SCH_COMPONENT::GetPins(), SCH_EDIT_FRAME::GetSelectedNetName(), TOOL_BASE::getView(), SCH_COMPONENT::HasBrightenedPins(), EDA_ITEM::IsBrightened(), SCH_SCREEN::Items(), SCH_SHEET_PATH::LastScreen(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, SCH_CONNECTION::Name(), 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 SCH_EDIT_FRAME::DisplayCurrentSheet(), and setTransitions().

◆ UpdatePCB()

int SCH_EDITOR_CONTROL::UpdatePCB ( const TOOL_EVENT aEvent)

Definition at line 1215 of file sch_editor_control.cpp.

1216 {
1217  wxCommandEvent dummy;
1219  return 0;
1220 }
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:215
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:207

◆ 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(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), ROUTER_TOOL::InlineDrag(), ZOOM_TOOL::Main(), CVPCB_CONTROL::Main(), SCH_MOVE_TOOL::Main(), EE_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), PICKER_TOOL::Main(), GERBVIEW_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(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), 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 151 of file ee_tool_base.h.

◆ m_isLibEdit

bool EE_TOOL_BASE< SCH_EDIT_FRAME >::m_isLibEdit
protectedinherited

Definition at line 154 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(), 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(), LIB_DRAWING_TOOLS::Init(), MODULE_EDITOR_TOOLS::Init(), LIB_CONTROL::Init(), PCB_EDITOR_CONTROL::Init(), SCH_DRAWING_TOOLS::Init(), GERBVIEW_SELECTION_TOOL::Init(), DRAWING_TOOL::Init(), EE_SELECTION_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), SELECTION_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), EDIT_TOOL::Init(), PCB_TOOL_BASE::Init(), 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(), 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(), 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 192 of file sch_editor_control.h.

◆ m_probingPcbToSch

bool SCH_EDITOR_CONTROL::m_probingPcbToSch
private

Definition at line 191 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 153 of file ee_tool_base.h.

◆ m_supplementaryClipboard

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

Definition at line 196 of file sch_editor_control.h.

Referenced by doCopy(), and searchSupplementaryClipboard().

◆ m_toolId

TOOL_ID TOOL_BASE::m_toolId
protectedinherited

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

Definition at line 214 of file tool_base.h.

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

◆ m_toolMgr

TOOL_MANAGER* TOOL_BASE::m_toolMgr
protectedinherited

Definition at line 219 of file tool_base.h.

Referenced by TOOL_INTERACTIVE::Activate(), EE_SELECTION_TOOL::AddItemsToSel(), EE_SELECTION_TOOL::AddItemToSel(), SELECTION_TOOL::AddItemToSel(), CVPCB_ASSOCIATION_TOOL::Associate(), TOOL_BASE::attachManager(), PCB_INSPECTION_TOOL::calculateSelectionRatsnest(), ROUTER_TOOL::CanInlineDrag(), EDIT_TOOL::ChangeTrackWidth(), PCB_INSPECTION_TOOL::ClearHighlight(), ClearHighlight(), SELECTION_TOOL::ClearSelection(), GERBVIEW_SELECTION_TOOL::clearSelection(), EE_SELECTION_TOOL::ClearSelection(), SCH_EDIT_TOOL::ConvertDeMorgan(), LIB_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(), SCH_EDIT_TOOL::DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), doCopy(), doCrossProbeSchToPcb(), LIB_EDIT_TOOL::DoDelete(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PCB_EDITOR_CONTROL::DrillOrigin(), LIB_EDIT_TOOL::Duplicate(), SCH_EDIT_TOOL::Duplicate(), EDIT_TOOL::Duplicate(), SCH_EDIT_TOOL::editComponentFieldText(), EDIT_TOOL::EditFpInFpEditor(), LIB_EDIT_TOOL::editSymbolProperties(), EditWithLibEdit(), EnterSheet(), PAD_TOOL::EnumeratePads(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), SELECTION_TOOL::expandConnection(), MODULE_EDITOR_TOOLS::ExplodePadToShapes(), SELECTION_TOOL::filterSelection(), SELECTION_TOOL::findCallback(), FindComponentAndItem(), POINT_EDITOR::finishItem(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), EDIT_TOOL::Flip(), EDIT_TOOL::GetAndPlace(), TOOL_BASE::getEditFrameInt(), TOOL_BASE::GetManager(), TOOL_BASE::getModelInt(), DRAWING_TOOL::getSourceZoneForAction(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), TOOL_INTERACTIVE::goInternal(), PCBNEW_CONTROL::GridSetOrigin(), GERBVIEW_CONTROL::HighlightControl(), PCB_INSPECTION_TOOL::HighlightItem(), PCB_INSPECTION_TOOL::HighlightNet(), HighlightNet(), PCB_INSPECTION_TOOL::highlightNet(), HighlightNetCursor(), PCB_INSPECTION_TOOL::HighlightNetTool(), MODULE_EDITOR_TOOLS::ImportFootprint(), LIB_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), PAD_TOOL::Init(), GLOBAL_EDIT_TOOL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), LIB_CONTROL::Init(), PCB_EDITOR_CONTROL::Init(), POINT_EDITOR::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(), SCH_MOVE_TOOL::Main(), CVPCB_CONTROL::Main(), LIB_MOVE_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(), 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(), 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(), EE_SELECTION_TOOL::RemoveItemFromSel(), SELECTION_TOOL::RemoveItemFromSel(), 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(), PCB_TOOL_BASE::selection(), COMMON_TOOLS::SelectionTool(), GERBVIEW_SELECTION_TOOL::SelectItem(), GERBVIEW_SELECTION_TOOL::SelectItems(), SELECTION_TOOL::SelectItems(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectNet(), GERBVIEW_SELECTION_TOOL::selectPoint(), EE_SELECTION_TOOL::SelectPoint(), SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), SELECTION_TOOL::selectSameSheet(), SELECTION_TOOL::selectSheetContents(), DRAWING_TOOL::SetAnchor(), TOOL_INTERACTIVE::SetContextMenu(), DRC::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), PCB_EDITOR_CONTROL::TrackWidthDec(), PCB_EDITOR_CONTROL::TrackWidthInc(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), LIB_EDIT_TOOL::Undo(), Undo(), GERBVIEW_SELECTION_TOOL::UnselectItem(), GERBVIEW_SELECTION_TOOL::UnselectItems(), SELECTION_TOOL::UnselectItems(), EE_INSPECTION_TOOL::UpdateMessagePanel(), GERBVIEW_CONTROL::UpdateMessagePanel(), PCBNEW_CONTROL::UpdateMessagePanel(), PCB_INSPECTION_TOOL::UpdateSelectionRatsnest(), PCB_EDITOR_CONTROL::ViaSizeDec(), PCB_EDITOR_CONTROL::ViaSizeInc(), TOOL_INTERACTIVE::Wait(), PCB_EDITOR_CONTROL::ZoneDuplicate(), and PCB_EDITOR_CONTROL::ZoneMerge().

◆ m_toolName

std::string TOOL_BASE::m_toolName
protectedinherited

Name of the tool.

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

Definition at line 218 of file tool_base.h.

Referenced by TOOL_BASE::GetName().

◆ m_toolSettings

TOOL_SETTINGS TOOL_BASE::m_toolSettings
protectedinherited

Definition at line 220 of file tool_base.h.

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

◆ m_type

TOOL_TYPE TOOL_BASE::m_type
protectedinherited

Stores the type of the tool.

Definition at line 211 of file tool_base.h.

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

◆ m_view

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

Definition at line 152 of file ee_tool_base.h.


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