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 ShowSchematicSetup (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 UpdateFromPCB (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...
 
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
 

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 78 of file tool_base.h.

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

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:218
TOOL_ID m_toolId
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:213
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 1246 of file sch_editor_control.cpp.

1247 {
1248  wxCommandEvent dummy;
1249  m_frame->OnAnnotate( dummy );
1250  return 0;
1251 }
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 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:218

References TOOL_BASE::m_toolMgr.

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
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:99
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 752 of file sch_editor_control.cpp.

753 {
755 
756  return 0;
757 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:218
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 985 of file sch_editor_control.cpp.

986 {
987  wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( wxWindow::FindFocus() );
988 
989  if( textEntry )
990  {
991  textEntry->Copy();
992  return 0;
993  }
994 
995  doCopy();
996 
997  return 0;
998 }
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 401 of file sch_editor_control.cpp.

402 {
403  doCrossProbeSchToPcb( aEvent, false );
404  return 0;
405 }
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 968 of file sch_editor_control.cpp.

969 {
970  wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( wxWindow::FindFocus() );
971 
972  if( textEntry )
973  {
974  textEntry->Cut();
975  return 0;
976  }
977 
978  if( doCopy() )
980 
981  return 0;
982 }
static TOOL_ACTION doDelete
Definition: actions.h:74
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:218
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:139
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 927 of file sch_editor_control.cpp.

928 {
930  EE_SELECTION& selection = selTool->RequestSelection();
931 
932  if( !selection.GetSize() )
933  return false;
934 
935  m_supplementaryClipboard.clear();
936 
937  for( EDA_ITEM* item : selection )
938  {
939  if( item->Type() == SCH_SHEET_T )
940  {
941  SCH_SHEET* sheet = (SCH_SHEET*) item;
942  m_supplementaryClipboard[ sheet->GetFileName() ] = sheet->GetScreen();
943  }
944  }
945 
946  STRING_FORMATTER formatter;
947  SCH_LEGACY_PLUGIN plugin;
948 
949  plugin.Format( &selection, &formatter );
950 
951  return m_toolMgr->SaveClipboard( formatter.GetString() );
952 }
bool SaveClipboard(const std::string &aText)
Stores an information to the system clipboard.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:218
void Format(SCH_SCREEN *aScreen)
SCH_SCREEN * GetScreen()
Definition: sch_sheet.h:282
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
wxString GetFileName() const
Return the filename corresponding to this sheet.
Definition: sch_sheet.h:491
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:215
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:166
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 415 of file sch_editor_control.cpp.

416 {
417  // Don't get in an infinite loop SCH -> PCB -> SCH -> PCB -> SCH -> ...
418  if( m_probingPcbToSch )
419  return;
420 
422  SCH_ITEM* item = nullptr;
423  SCH_COMPONENT* component = nullptr;
424 
425  if( aForce )
426  {
427  EE_SELECTION& selection = selTool->RequestSelection();
428 
429  if( selection.GetSize() >= 1 )
430  item = (SCH_ITEM*) selection.Front();
431  }
432  else
433  {
434  EE_SELECTION& selection = selTool->GetSelection();
435 
436  if( selection.GetSize() >= 1 )
437  item = (SCH_ITEM*) selection.Front();
438  }
439 
440  if( !item )
441  {
442  if( aForce )
443  m_frame->SendMessageToPCBNEW( nullptr, nullptr );
444 
445  return;
446  }
447 
448 
449  switch( item->Type() )
450  {
451  case SCH_FIELD_T:
452  case LIB_FIELD_T:
453  if( item->GetParent() && item->GetParent()->Type() == SCH_COMPONENT_T )
454  {
455  component = (SCH_COMPONENT*) item->GetParent();
456  m_frame->SendMessageToPCBNEW( item, component );
457  }
458  break;
459 
460  case SCH_COMPONENT_T:
461  component = (SCH_COMPONENT*) item;
462  m_frame->SendMessageToPCBNEW( item, component );
463  break;
464 
465  case SCH_PIN_T:
466  component = (SCH_COMPONENT*) item->GetParent();
467  m_frame->SendMessageToPCBNEW( static_cast<SCH_PIN*>( item ), component );
468  break;
469 
470  case SCH_SHEET_T:
471  if( aForce )
472  m_frame->SendMessageToPCBNEW( item, nullptr );
473  break;
474 
475  default:
476  break;
477  }
478 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:218
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:217
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:99
SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:147
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 1322 of file sch_editor_control.cpp.

1323 {
1325  return 0;
1326 }
void DrawCurrentSheetToClipboard()
Use the wxWidgets print code to draw an image of the current sheet onto the clipboard.
Definition: sheet.cpp:565

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

1263 {
1265  dlg.ShowQuasiModal();
1266  return 0;
1267 }

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

1271 {
1273  m_frame->HardRedraw();
1274 
1275  return 0;
1276 }
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 1223 of file sch_editor_control.cpp.

1224 {
1227  SCH_COMPONENT* sym = nullptr;
1228  LIB_EDIT_FRAME* libEdit;
1229 
1230  if( selection.GetSize() >= 1 )
1231  sym = (SCH_COMPONENT*) selection.Front();
1232 
1233  if( !sym || sym->GetEditFlags() != 0 )
1234  return 0;
1235 
1237  libEdit = (LIB_EDIT_FRAME*) m_frame->Kiway().Player( FRAME_SCH_LIB_EDITOR, false );
1238 
1239  if( libEdit )
1240  libEdit->LoadComponentAndSelectLib( sym->GetLibId(), sym->GetUnit(), sym->GetConvert() );
1241 
1242  return 0;
1243 }
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:218
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:139
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:262
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:153
SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:99
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 1336 of file sch_editor_control.cpp.

1337 {
1339  const EE_SELECTION& selection = selTool->RequestSelection( EE_COLLECTOR::SheetsOnly );
1340 
1341  if( selection.GetSize() == 1 )
1342  {
1343  SCH_SHEET* sheet = (SCH_SHEET*) selection.Front();
1344 
1347 
1348  g_CurrentSheet->push_back( sheet );
1351  }
1352 
1353  return 0;
1354 }
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:218
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:139
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:215

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

409 {
410  doCrossProbeSchToPcb( aEvent, true );
411  return 0;
412 }
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 1303 of file sch_editor_control.cpp.

1304 {
1305  int result = NET_PLUGIN_CHANGE;
1306 
1307  // If a plugin is removed or added, rebuild and reopen the new dialog
1308  while( result == NET_PLUGIN_CHANGE )
1309  result = InvokeDialogNetList( m_frame );
1310 
1311  return 0;
1312 }
#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 141 of file sch_editor_control.cpp.

142 {
144  return UpdateFind( aEvent );
145 }
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 
144  if( foundItem )
145  m_toolMgr->RunAction( EE_ACTIONS::addItemToSel, true, foundItem );
146  }
147  m_probingPcbToSch = false;
148 
149  m_frame->GetCanvas()->Refresh();
150 
151  return foundItem;
152 }
SCH_SHEET_LIST.
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:218
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:139
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
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.
static TOOL_ACTION addItemToSel
Selects an item (specified as the event parameter).
Definition: ee_actions.h:61
#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, bool aIncludeUnit=false)
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:432
SCH_SCREEN * LastScreen()
Function LastScreen.
#define _(s)
Definition: 3d_actions.cpp:33
EE_RTREE & Items()
Definition: sch_screen.h:127
SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:99
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:147

References _, EE_ACTIONS::addItemToSel, 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(), EDA_DRAW_PANEL_GAL::GetViewControls(), BASE_SCREEN::GetZoom(), HIGHLIGHT_PIN, 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 257 of file sch_editor_control.cpp.

258 {
259  // A timer during which a subsequent FindNext will result in a wrap-around
260  static wxTimer wrapAroundTimer;
261 
262  wxFindReplaceData* data = m_frame->GetFindReplaceData();
263 
264  if( aEvent.IsAction( &ACTIONS::findNextMarker ) )
265  {
266  if( data )
267  g_markersOnly.SetFlags( data->GetFlags() );
268 
269  data = &g_markersOnly;
270  }
271  else if( !data )
272  {
273  return FindAndReplace( ACTIONS::find.MakeEvent() );
274  }
275 
276  bool searchAllSheets = !( data->GetFlags() & FR_CURRENT_SHEET_ONLY );
277  EE_SELECTION& selection = m_selectionTool->GetSelection();
278  SCH_SCREEN* afterScreen = m_frame->GetScreen();
279  SCH_ITEM* afterItem = dynamic_cast<SCH_ITEM*>( selection.Front() );
280  SCH_ITEM* item = nullptr;
281 
282  if( wrapAroundTimer.IsRunning() )
283  {
284  afterScreen = nullptr;
285  afterItem = nullptr;
286  wrapAroundTimer.Stop();
288  }
289 
291 
292  if( afterScreen || !searchAllSheets )
293  item = nextMatch( m_frame->GetScreen(), afterItem, data );
294 
295  if( !item && searchAllSheets )
296  {
297  SCH_SHEET_LIST schematic( g_RootSheet );
298  SCH_SCREENS screens;
299 
300  for( SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
301  {
302  if( afterScreen )
303  {
304  if( afterScreen == screen )
305  afterScreen = nullptr;
306 
307  continue;
308  }
309 
310  item = nextMatch( screen, nullptr, data );
311 
312  if( item )
313  {
314  SCH_SHEET_PATH* sheet = schematic.FindSheetForScreen( screen );
315  wxCHECK_MSG( sheet, 0, "Sheet not found for " + screen->GetFileName() );
316 
317  *g_CurrentSheet = *sheet;
319 
320  screen->SetZoom( m_frame->GetScreen()->GetZoom() );
321  screen->TestDanglingEnds();
322 
323  m_frame->SetScreen( screen );
324  UpdateFind( ACTIONS::updateFind.MakeEvent() );
325 
326  break;
327  }
328  }
329  }
330 
331  if( item )
332  {
333  m_selectionTool->AddItemToSel( item );
334  m_frame->FocusOnLocation( item->GetBoundingBox().GetCenter() );
335  m_frame->GetCanvas()->Refresh();
336  }
337  else
338  {
339  wxString msg = searchAllSheets ? _( "Reached end of schematic." )
340  : _( "Reached end of sheet." );
341 
342  m_frame->ShowFindReplaceStatus( msg + _( "\nFind again to wrap around to the start." ) );
343  wrapAroundTimer.StartOnce( 4000 );
344  }
345 
346  return 0;
347 }
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:970
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()
int AddItemToSel(const TOOL_EVENT &aEvent)
int ClearSelection(const TOOL_EVENT &aEvent)
Clear current selection event handler.
#define _(s)
Definition: 3d_actions.cpp:33
SCH_SCREEN * GetFirst()
Definition: sch_screen.cpp:959
SCH_SHEET * g_RootSheet
void FocusOnLocation(const wxPoint &aPos)
Useful to focus on a particular location, in find functions Move the graphic cursor (crosshair cursor...
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:147
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:491
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 1315 of file sch_editor_control.cpp.

1316 {
1318  return 0;
1319 }
int InvokeDialogCreateBOM(SCH_EDIT_FRAME *aCaller)
Create and show DIALOG_BOM and return whatever DIALOG_BOM::ShowModal() returns.
Definition: dialog_bom.cpp:214

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 186 of file tool_base.h.

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

References TOOL_BASE::getEditFrameInt().

Referenced by ZONE_CREATE_HELPER::createNewZone().

◆ 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 120 of file tool_base.h.

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

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(), TOOL_MANAGER::saveViewControls(), and TOOL_MANAGER::ShutdownTool().

◆ 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 142 of file tool_base.h.

143  {
144  return m_toolMgr;
145  }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:218

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 200 of file tool_base.h.

201  {
202  EDA_ITEM* m = getModelInt();
203 #if !defined( QA_TEST ) // Dynamic casts give the linker a siezure in the test framework
204  wxASSERT( dynamic_cast<T*>( m ) );
205 #endif
206  return static_cast<T*>( m );
207  }
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:166

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 131 of file tool_base.h.

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

References TOOL_BASE::m_toolName.

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

◆ 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 109 of file tool_base.h.

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

References TOOL_BASE::m_type.

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

◆ 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:280
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:218

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(), GERBVIEW_SELECTION_TOOL::selectable(), 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:218
KIGFX::VIEW_CONTROLS * GetViewControls() const
Definition: tool_manager.h:285

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:57
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(), LIB_DRAWING_TOOLS::setTransitions(), EE_POINT_EDITOR::setTransitions(), COMMON_CONTROL::setTransitions(), SCH_MOVE_TOOL::setTransitions(), KICAD_MANAGER_CONTROL::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(), EDA_3D_VIEWER_CONTROL::setTransitions(), LIB_EDIT_TOOL::setTransitions(), LIB_CONTROL::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(), SCH_LINE_WIRE_BUS_TOOL::setTransitions(), MODULE_EDITOR_TOOLS::setTransitions(), CVPCB_CONTROL::setTransitions(), CVPCB_ASSOCIATION_TOOL::setTransitions(), PCBNEW_PICKER_TOOL::setTransitions(), PICKER_TOOL::setTransitions(), PCB_EDITOR_CONTROL::setTransitions(), DRAWING_TOOL::setTransitions(), EDIT_TOOL::setTransitions(), SELECTION_TOOL::setTransitions(), setTransitions(), DRC::setTransitions(), and EE_SELECTION_TOOL::setTransitions().

◆ HasMatch()

bool SCH_EDITOR_CONTROL::HasMatch ( )

Definition at line 350 of file sch_editor_control.cpp.

351 {
352  wxFindReplaceData* data = m_frame->GetFindReplaceData();
354 
355  return data && item && item->Matches( *data, nullptr );
356 }
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:166
virtual bool Matches(wxFindReplaceData &aSearchData, void *aAuxData)
Function Matches compares the item against the search criteria in aSearchData.
Definition: base_struct.h:473
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 741 of file sch_editor_control.cpp.

742 {
744  VECTOR2D cursorPos = controls->GetCursorPosition( !aEvent.Modifier( MD_ALT ) );
745 
746  highlightNet( m_toolMgr, cursorPos );
747 
748  return 0;
749 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:218
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 837 of file sch_editor_control.cpp.

838 {
839  // TODO(JE) remove once real-time connectivity is a given
840  if( !ADVANCED_CFG::GetCfg().m_realTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime )
842 
843  std::string tool = aEvent.GetCommandStr().get();
845 
846  // Deactivate other tools; particularly important if another PICKER is currently running
847  Activate();
848 
849  picker->SetCursor( wxStockCursor( wxCURSOR_BULLSEYE ) );
850 
851  picker->SetClickHandler(
852  [this] ( const VECTOR2D& aPos )
853  {
854  return highlightNet( m_toolMgr, aPos );
855  } );
856 
857  m_toolMgr->RunAction( ACTIONS::pickerTool, true, &tool );
858 
859  return 0;
860 }
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:218
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:139
static TOOL_ACTION pickerTool
Definition: actions.h:148
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:239
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:33
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:218
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:218
TOOL_ID m_toolId
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:213
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 1357 of file sch_editor_control.cpp.

1358 {
1359  if( g_CurrentSheet->Last() != g_RootSheet )
1360  {
1363 
1367  }
1368 
1369  return 0;
1370 }
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:218
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:139
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 147 of file sch_editor_control.cpp.

148 {
150  return 0;
151 }
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 62 of file sch_editor_control.cpp.

63 {
65  return 0;
66 }

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

191 {
192  bool past_item = true;
193 
194  if( aAfter != nullptr )
195  {
196  past_item = false;
197 
198  if( aAfter->Type() == SCH_PIN_T || aAfter->Type() == SCH_FIELD_T )
199  aAfter = static_cast<SCH_ITEM*>( aAfter->GetParent() );
200  }
201 
202 
203  for( auto item : aScreen->Items() )
204  {
205  if( item == aAfter )
206  {
207  past_item = true;
208  }
209  else if( past_item )
210  {
211  if( aData == &g_markersOnly && item->Type() == SCH_MARKER_T )
212  return item;
213 
214  if( item->Matches( *aData, nullptr ) )
215  return item;
216 
217  if( item->Type() == SCH_COMPONENT_T )
218  {
219  auto cmp = static_cast<SCH_COMPONENT*>( item );
220 
221  for( auto field : cmp->GetFields() )
222  {
223  if( field->Matches( *aData, nullptr ) )
224  return field;
225  }
226 
227  for( auto pin : cmp->GetSchPins() )
228  {
229  if( pin->Matches( *aData, nullptr ) )
230  return pin;
231  }
232  }
233 
234  if( item->Type() == SCH_SHEET_T )
235  {
236  auto sheet = static_cast<SCH_SHEET*>( item );
237 
238  for( SCH_FIELD& field : sheet->GetFields() )
239  {
240  if( field.Matches( *aData, nullptr ) )
241  return &field;
242  }
243 
244  for( SCH_SHEET_PIN* pin : sheet->GetPins() )
245  {
246  if( pin->Matches( *aData, nullptr ) )
247  return pin;
248  }
249  }
250  }
251  }
252 
253  return nullptr;
254 }
SCH_FIELD instances are attached to a component and provide a place for the component's value,...
Definition: sch_field.h:52
static wxFindReplaceData g_markersOnly
EDA_ITEM * GetParent() const
Definition: base_struct.h:217
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:84
EE_RTREE & Items()
Definition: sch_screen.h:127
KICAD_T Type() const
Function Type()
Definition: base_struct.h:212

References g_markersOnly, EDA_ITEM::GetParent(), SCH_SCREEN::Items(), SCH_COMPONENT_T, SCH_FIELD_T, SCH_MARKER_T, SCH_PIN_T, SCH_SHEET_T, and EDA_ITEM::Type().

Referenced by FindNext().

◆ Open()

int SCH_EDITOR_CONTROL::Open ( const TOOL_EVENT aEvent)

Definition at line 69 of file sch_editor_control.cpp.

70 {
72  return 0;
73 }

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

98 {
99  PICKED_ITEMS_LIST undoCmd;
100  WS_PROXY_UNDO_ITEM* undoItem = new WS_PROXY_UNDO_ITEM( m_frame );
101  ITEM_PICKER wrapper( undoItem, UR_PAGESETTINGS );
102 
103  undoCmd.PushItem( wrapper );
105 
107  dlg.SetWksFileName( BASE_SCREEN::m_PageLayoutDescrFileName );
108 
109  if( dlg.ShowModal() != wxID_OK )
111 
112  return 0;
113 }
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 1001 of file sch_editor_control.cpp.

1002 {
1003  wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( wxWindow::FindFocus() );
1004 
1005  if( textEntry )
1006  {
1007  textEntry->Paste();
1008  return 0;
1009  }
1010 
1012  std::string text = m_toolMgr->GetClipboard();
1013 
1014  if( text.empty() )
1015  return 0;
1016 
1017  STRING_LINE_READER reader( text, "Clipboard" );
1018  SCH_LEGACY_PLUGIN plugin;
1019 
1020  SCH_SCREEN paste_screen( &m_frame->GetScreen()->Kiway() );
1021 
1022  try
1023  {
1024  plugin.LoadContent( reader, &paste_screen );
1025  }
1026  catch( IO_ERROR& )
1027  {
1028  // If it wasn't content, then paste as text
1029  paste_screen.Append( new SCH_TEXT( wxPoint( 0, 0 ), text ) );
1030  }
1031 
1032  bool forceKeepAnnotations = false;
1033  bool forceDropAnnotations = false;
1034  bool dropAnnotations = false;
1035 
1036  if( aEvent.IsAction( &ACTIONS::pasteSpecial ) )
1037  {
1038  DIALOG_PASTE_SPECIAL dlg( m_frame, &forceKeepAnnotations, &forceDropAnnotations );
1039 
1040  if( dlg.ShowModal() == wxID_CANCEL )
1041  return 0;
1042  }
1043 
1044  if( forceDropAnnotations )
1045  dropAnnotations = true;
1046 
1047  // SCH_LEGACY_PLUGIN added the items to the paste screen, but not to the view or anything
1048  // else. Pull them back out to start with.
1049  //
1050  EDA_ITEMS loadedItems;
1051  bool sheetsPasted = false;
1052  SCH_SHEET_LIST hierarchy( g_RootSheet );
1053  wxFileName destFn = g_CurrentSheet->Last()->GetFileName();
1054 
1055  if( destFn.IsRelative() )
1056  destFn.MakeAbsolute( m_frame->Prj().GetProjectPath() );
1057 
1058  for( auto item : paste_screen.Items() )
1059  {
1060  loadedItems.push_back( item );
1061 
1062  if( item->Type() == SCH_COMPONENT_T )
1063  {
1064  if( !dropAnnotations && !forceKeepAnnotations )
1065  {
1066  for( auto existingItem : m_frame->GetScreen()->Items() )
1067  {
1068  if( item->m_Uuid == existingItem->m_Uuid )
1069  {
1070  dropAnnotations = true;
1071  break;
1072  }
1073  }
1074  }
1075  }
1076  else if( item->Type() == SCH_SHEET_T )
1077  {
1078  SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
1079  wxFileName srcFn = sheet->GetFileName();
1080 
1081  if( srcFn.IsRelative() )
1082  srcFn.MakeAbsolute( m_frame->Prj().GetProjectPath() );
1083 
1084  SCH_SHEET_LIST sheetHierarchy( sheet );
1085 
1086  if( hierarchy.TestForRecursion( sheetHierarchy, destFn.GetFullPath( wxPATH_UNIX ) ) )
1087  {
1088  auto msg = wxString::Format( _( "The pasted sheet \"%s\"\n"
1089  "was dropped because the destination already has "
1090  "the sheet or one of its subsheets as a parent." ),
1091  sheet->GetFileName() );
1092  DisplayError( m_frame, msg );
1093  loadedItems.pop_back();
1094  }
1095  }
1096  }
1097 
1098  // Remove the references from our temporary screen to prevent freeing on the DTOR
1099  paste_screen.Clear( false );
1100 
1101  // Now we can resolve the components and add everything to the screen, view, etc.
1102  //
1103  SYMBOL_LIB_TABLE* symLibTable = m_frame->Prj().SchSymbolLibTable();
1104  PART_LIB* partLib = m_frame->Prj().SchLibs()->GetCacheLibrary();
1105 
1106  for( unsigned i = 0; i < loadedItems.size(); ++i )
1107  {
1108  EDA_ITEM* item = loadedItems[i];
1109 
1110  if( item->Type() == SCH_COMPONENT_T )
1111  {
1112  SCH_COMPONENT* component = (SCH_COMPONENT*) item;
1113 
1114  if( dropAnnotations )
1115  {
1116  const_cast<KIID&>( component->m_Uuid ) = KIID();
1117 
1118  // clear the annotation, but preserve the selected unit
1119  int unit = component->GetUnit();
1120  component->ClearAnnotation( nullptr );
1121  component->SetUnit( unit );
1122  }
1123 
1124  component->Resolve( *symLibTable, partLib );
1125  component->UpdatePins();
1126  }
1127  else
1128  {
1129  // Everything else gets a new UUID
1130  const_cast<KIID&>( item->m_Uuid ) = KIID();
1131  }
1132 
1133  if( item->Type() == SCH_SHEET_T )
1134  {
1135  SCH_SHEET* sheet = (SCH_SHEET*) item;
1136  SCH_FIELD& nameField = sheet->GetFields()[SHEETNAME];
1137  wxFileName fn = sheet->GetFileName();
1138  SCH_SCREEN* existingScreen = nullptr;
1139  bool dropSheetAnnotations = false;
1140  wxString baseName = nameField.GetText();
1141  wxString candidateName = baseName;
1142  int uniquifier = 1;
1143 
1144  while( hierarchy.NameExists( candidateName ) )
1145  candidateName = wxString::Format( wxT( "%s%d" ), baseName, uniquifier++ );
1146 
1147  nameField.SetText( candidateName );
1148 
1149  sheet->SetParent( g_CurrentSheet->Last() );
1150  sheet->SetScreen( nullptr );
1151  sheetsPasted = true;
1152 
1153  if( !fn.IsAbsolute() )
1154  {
1155  wxFileName currentSheetFileName = g_CurrentSheet->LastScreen()->GetFileName();
1156  fn.Normalize( wxPATH_NORM_ALL, currentSheetFileName.GetPath() );
1157  }
1158 
1159  if( g_RootSheet->SearchHierarchy( fn.GetFullPath( wxPATH_UNIX ), &existingScreen ) )
1160  dropSheetAnnotations = !forceKeepAnnotations;
1161  else
1162  searchSupplementaryClipboard( sheet->GetFileName(), &existingScreen );
1163 
1164  if( existingScreen )
1165  {
1166  sheet->SetScreen( existingScreen );
1167 
1168  SCH_SHEET_PATH sheetpath = *g_CurrentSheet;
1169  sheetpath.push_back( sheet );
1170 
1171  // Clear annotation and create the AR for this path, if not exists,
1172  // when the screen is shared by sheet paths.
1173  // Otherwise ClearAnnotation do nothing, because the F1 field is used as
1174  // reference default value and takes the latest displayed value
1175  existingScreen->EnsureAlternateReferencesExist();
1176 
1177  if( forceDropAnnotations || dropSheetAnnotations )
1178  existingScreen->ClearAnnotation( &sheetpath );
1179  }
1180  else
1181  {
1182  if( !m_frame->LoadSheetFromFile( sheet, g_CurrentSheet, fn.GetFullPath() ) )
1183  m_frame->InitSheet( sheet, sheet->GetFileName() );
1184  }
1185  }
1186 
1187  item->SetFlags( IS_NEW | IS_PASTED | IS_MOVED );
1188  m_frame->AddItemToScreenAndUndoList( (SCH_ITEM*) item, i > 0 );
1189 
1190  // Reset flags for subsequent move operation
1191  item->SetFlags( IS_NEW | IS_PASTED | IS_MOVED );
1192  // Start out hidden so the pasted items aren't "ghosted" in their original location
1193  // before being moved to the current location.
1194  getView()->Hide( item, true );
1195  }
1196 
1197  if( sheetsPasted )
1198  {
1201  }
1202 
1203  // Now clear the previous selection, select the pasted items, and fire up the "move"
1204  // tool.
1205  //
1207  m_toolMgr->RunAction( EE_ACTIONS::addItemsToSel, true, &loadedItems );
1208 
1209  EE_SELECTION& selection = selTool->GetSelection();
1210 
1211  if( !selection.Empty() )
1212  {
1213  SCH_ITEM* item = (SCH_ITEM*) selection.GetTopLeftItem();
1214 
1215  selection.SetReferencePoint( item->GetPosition() );
1217  }
1218 
1219  return 0;
1220 }
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:239
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)
SCH_FIELD instances are attached to a component and provide a place for the component's value,...
Definition: sch_field.h:52
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:584
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:218
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
Definition: sch_sheet.cpp:149
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:139
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:749
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
std::vector< SCH_FIELD > & GetFields()
Definition: sch_sheet.h:268
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
Definition: common.h:65
void SetReferencePoint(const VECTOR2I &aP)
Definition: selection.h:244
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:257
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:111
SCH_SHEET_PATH * g_CurrentSheet
With the new connectivity algorithm, many more places than before want to know what the current sheet...
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:218
std::vector< EDA_ITEM * > EDA_ITEMS
Define list of drawing items for screens.
Definition: base_struct.h:603
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
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.
wxString GetFileName() const
Return the filename corresponding to this sheet.
Definition: sch_sheet.h:491
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:215
static TOOL_ACTION pasteSpecial
Definition: actions.h:72
const KIID m_Uuid
Definition: base_struct.h:169
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:33
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:99
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:166
void ClearAnnotation(SCH_SHEET_PATH *aSheetPath)
Clear the annotation for the components in aSheetPath on the screen.
Definition: sch_screen.cpp:732
static TOOL_ACTION move
Definition: ee_actions.h:115
SCH_SHEET * g_RootSheet
void UpdatePins()
Updates the cache of SCH_PIN objects for each pin.
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:147
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:123
#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: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_SHEET::GetFields(), SCH_SCREEN::GetFileName(), SCH_SHEET::GetFileName(), SCH_ITEM::GetPosition(), PROJECT::GetProjectPath(), SCH_EDIT_FRAME::GetScreen(), EE_SELECTION_TOOL::GetSelection(), EDA_TEXT::GetText(), 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, EDA_ITEM::m_Uuid, EE_ACTIONS::move, SCH_SHEET_LIST::NameExists(), 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(), EDA_ITEM::SetParent(), SELECTION::SetReferencePoint(), SCH_SHEET::SetScreen(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), EDA_TEXT::SetText(), SCH_COMPONENT::SetUnit(), SHEETNAME, 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 123 of file sch_editor_control.cpp.

124 {
126  return 0;
127 }

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

117 {
118  m_frame->Print();
119  return 0;
120 }
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
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:99
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 130 of file sch_editor_control.cpp.

131 {
132  m_frame->Close( false );
133  return 0;
134 }

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

896 {
897  if( m_frame->GetScreen()->GetRedoCommandCount() == 0 )
898  return 0;
899 
900  // Inform tools that undo command was issued
902 
903  /* Get the old list */
905 
906  /* Redo the command: */
907  m_frame->PutDataInPreviousState( List, true );
908 
909  /* Put the old list in UndoList */
910  List->ReversePickersListOrder();
912 
914  selTool->RebuildSelection();
915 
918 
919  m_frame->SyncView();
920  m_frame->GetCanvas()->Refresh();
921  m_frame->OnModify();
922 
923  return 0;
924 }
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:218
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 377 of file sch_editor_control.cpp.

378 {
379  wxFindReplaceData* data = m_frame->GetFindReplaceData();
380 
381  if( !data )
382  return FindAndReplace( ACTIONS::find.MakeEvent() );
383 
384  SCH_SHEET_LIST schematic( g_RootSheet );
385  SCH_SCREENS screens;
386 
387  for( SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
388  {
389  //TODO(snh): Fix ReplaceAll
390  // screen->ForEachItem() for( EDA_ITEM* item = nextMatch( screen, nullptr, data ); item;
391  // item = nextMatch( screen, item, data ) )
392  // {
393  // item->Replace( *data, schematic.FindSheetForScreen( screen ) );
394  // }
395  }
396 
397  return 0;
398 }
SCH_SHEET_LIST.
int FindAndReplace(const TOOL_EVENT &aEvent)
SCH_SCREEN * GetNext()
Definition: sch_screen.cpp:970
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:959
SCH_SHEET * g_RootSheet
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:491

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

360 {
361  wxFindReplaceData* data = m_frame->GetFindReplaceData();
363 
364  if( !data )
365  return FindAndReplace( ACTIONS::find.MakeEvent() );
366 
367  if( item && item->Matches( *data, nullptr ) )
368  {
369  item->Replace( *data, g_CurrentSheet );
370  FindNext( ACTIONS::findNext.MakeEvent() );
371  }
372 
373  return 0;
374 }
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:166
virtual bool Matches(wxFindReplaceData &aSearchData, void *aAuxData)
Function Matches compares the item against the search criteria in aSearchData.
Definition: base_struct.h:473
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:81
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:218
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 76 of file sch_editor_control.cpp.

77 {
79  return 0;
80 }

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

84 {
85  m_frame->Save_File( true );
86  return 0;
87 }
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:225
void ClearSelected()
Definition: base_struct.h:235
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:231
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:217
The symbol library editor main window.
bool HasFlag(STATUS_FLAGS aFlag)
Definition: base_struct.h:260
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:212

◆ searchSupplementaryClipboard()

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

Definition at line 955 of file sch_editor_control.cpp.

957 {
958  if( m_supplementaryClipboard.count( aSheetFilename ) > 0 )
959  {
960  *aScreen = m_supplementaryClipboard[ aSheetFilename ];
961  return true;
962  }
963 
964  return false;
965 }
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:218
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 1395 of file sch_editor_control.cpp.

1396 {
1397  Go( &SCH_EDITOR_CONTROL::New, ACTIONS::doNew.MakeEvent() );
1398  Go( &SCH_EDITOR_CONTROL::Open, ACTIONS::open.MakeEvent() );
1399  Go( &SCH_EDITOR_CONTROL::Save, ACTIONS::save.MakeEvent() );
1403  Go( &SCH_EDITOR_CONTROL::Print, ACTIONS::print.MakeEvent() );
1404  Go( &SCH_EDITOR_CONTROL::Plot, ACTIONS::plot.MakeEvent() );
1405  Go( &SCH_EDITOR_CONTROL::Quit, ACTIONS::quit.MakeEvent() );
1406 
1415 
1420 
1421 #ifdef KICAD_SPICE
1422  Go( &SCH_EDITOR_CONTROL::SimProbe, EE_ACTIONS::simProbe.MakeEvent() );
1423  Go( &SCH_EDITOR_CONTROL::SimTune, EE_ACTIONS::simTune.MakeEvent() );
1424 #endif /* KICAD_SPICE */
1425 
1432 
1433  Go( &SCH_EDITOR_CONTROL::Undo, ACTIONS::undo.MakeEvent() );
1434  Go( &SCH_EDITOR_CONTROL::Redo, ACTIONS::redo.MakeEvent() );
1435  Go( &SCH_EDITOR_CONTROL::Cut, ACTIONS::cut.MakeEvent() );
1436  Go( &SCH_EDITOR_CONTROL::Copy, ACTIONS::copy.MakeEvent() );
1437  Go( &SCH_EDITOR_CONTROL::Paste, ACTIONS::paste.MakeEvent() );
1439 
1452 
1454 
1458 
1461 }
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:201
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 ShowSchematicSetup(const TOOL_EVENT &aEvent)
int HighlightNetCursor(const TOOL_EVENT &aEvent)
Launches a tool to highlight nets.
static TOOL_ACTION assignFootprints
Definition: ee_actions.h:151
static TOOL_ACTION pageSettings
Definition: actions.h:59
static const TOOL_EVENT UnselectedEvent
Definition: actions.h:202
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:156
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:205
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:145
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:152
static TOOL_ACTION updateSchematicFromPcb
Definition: actions.h:157
static TOOL_ACTION editSymbolFields
Definition: ee_actions.h:146
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:203
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 schematicSetup
Definition: ee_actions.h:153
static TOOL_ACTION editSymbolLibraryLinks
Definition: ee_actions.h:147
static TOOL_ACTION toggleForceHV
Definition: ee_actions.h:192
int UpdateFromPCB(const TOOL_EVENT &aEvent)
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, EE_ACTIONS::schematicSetup, EVENTS::SelectedEvent, EVENTS::SelectedItemsModified, ShowBusManager(), EE_ACTIONS::showBusManager, ShowCvpcb(), ShowPcbNew(), EE_ACTIONS::showPcbNew, ShowSchematicSetup(), EE_ACTIONS::simProbe, EE_ACTIONS::simTune, ToggleForceHV(), EE_ACTIONS::toggleForceHV, ToggleHiddenPins(), EE_ACTIONS::toggleHiddenPins, ACTIONS::undo, Undo(), EVENTS::UnselectedEvent, UpdateFind(), ACTIONS::updateFind, UpdateFromPCB(), UpdateNetHighlighting(), EE_ACTIONS::updateNetHighlighting, UpdatePCB(), ACTIONS::updatePcbFromSchematic, and ACTIONS::updateSchematicFromPcb.

◆ ShowBusManager()

int SCH_EDITOR_CONTROL::ShowBusManager ( const TOOL_EVENT aEvent)

Definition at line 1329 of file sch_editor_control.cpp.

1330 {
1332  return 0;
1333 }
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 1254 of file sch_editor_control.cpp.

1255 {
1256  wxCommandEvent dummy;
1258  return 0;
1259 }
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 1279 of file sch_editor_control.cpp.

1280 {
1281  wxCommandEvent dummy;
1283  return 0;
1284 }
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().

◆ ShowSchematicSetup()

int SCH_EDITOR_CONTROL::ShowSchematicSetup ( const TOOL_EVENT aEvent)

Definition at line 90 of file sch_editor_control.cpp.

91 {
93  return 0;
94 }
void DoShowSchematicSetupDialog(const wxString &aInitialPage=wxEmptyString, const wxString &aInitialParentPage=wxEmptyString)

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

Referenced by setTransitions().

◆ ToggleForceHV()

int SCH_EDITOR_CONTROL::ToggleForceHV ( const TOOL_EVENT aEvent)

Definition at line 1387 of file sch_editor_control.cpp.

1388 {
1390 
1391  return 0;
1392 }
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 1373 of file sch_editor_control.cpp.

1374 {
1376 
1377  auto painter = static_cast<KIGFX::SCH_PAINTER*>( getView()->GetPainter() );
1378  painter->GetSettings()->m_ShowHiddenPins = m_frame->GetShowAllPins();
1379 
1381  m_frame->GetCanvas()->Refresh();
1382 
1383  return 0;
1384 }
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 863 of file sch_editor_control.cpp.

864 {
865  if( m_frame->GetScreen()->GetUndoCommandCount() <= 0 )
866  return 0;
867 
868  // Inform tools that undo command was issued
870 
871  /* Get the old list */
873 
874  /* Undo the command */
875  m_frame->PutDataInPreviousState( List, false );
876 
877  /* Put the old list in RedoList */
878  List->ReversePickersListOrder();
880 
882  selTool->RebuildSelection();
883 
886 
887  m_frame->SyncView();
888  m_frame->GetCanvas()->Refresh();
889  m_frame->OnModify();
890 
891  return 0;
892 }
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:218
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 153 of file sch_editor_control.cpp.

154 {
155  wxFindReplaceData* data = m_frame->GetFindReplaceData();
156 
157  if( aEvent.IsAction( &ACTIONS::find ) || aEvent.IsAction( &ACTIONS::findAndReplace )
158  || aEvent.IsAction( &ACTIONS::updateFind ) )
159  {
161 
162  for( auto item : m_frame->GetScreen()->Items() )
163  {
164  if( data && item->Matches( *data, nullptr ) )
165  m_selectionTool->BrightenItem( item );
166  else if( item->IsBrightened() )
168  }
169  }
170  else if( aEvent.Matches( EVENTS::SelectedItemsModified ) )
171  {
172  for( EDA_ITEM* item : m_selectionTool->GetSelection() )
173  {
174  if( data && item->Matches( *data, nullptr ) )
175  m_selectionTool->BrightenItem( item );
176  else if( item->IsBrightened() )
178  }
179  }
180 
181  getView()->UpdateItems();
182  m_frame->GetCanvas()->Refresh();
183  m_frame->UpdateTitle();
184 
185  return 0;
186 }
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:205
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:166

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().

◆ UpdateFromPCB()

int SCH_EDITOR_CONTROL::UpdateFromPCB ( const TOOL_EVENT aEvent)

Definition at line 1295 of file sch_editor_control.cpp.

1296 {
1298  dlg.ShowModal();
1299  return 0;
1300 }

References EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame.

Referenced by setTransitions().

◆ UpdateNetHighlighting()

int SCH_EDITOR_CONTROL::UpdateNetHighlighting ( const TOOL_EVENT aEvent)

Updates net highlighting after an edit

Definition at line 760 of file sch_editor_control.cpp.

761 {
762  SCH_SCREEN* screen = g_CurrentSheet->LastScreen();
763  std::vector<EDA_ITEM*> itemsToRedraw;
764  wxString selectedNetName = m_frame->GetSelectedNetName();
765 
766  if( !screen )
767  return 0;
768 
769  for( auto item : screen->Items() )
770  {
771  SCH_CONNECTION* conn = item->Connection( *g_CurrentSheet );
772  bool redraw = item->IsBrightened();
773 
774  if( conn && conn->Name() == selectedNetName )
775  item->SetBrightened();
776  else
777  item->ClearBrightened();
778 
779  redraw |= item->IsBrightened();
780 
781  if( item->Type() == SCH_COMPONENT_T )
782  {
783  SCH_COMPONENT* comp = static_cast<SCH_COMPONENT*>( item );
784 
785  redraw |= comp->HasBrightenedPins();
786 
787  comp->ClearBrightenedPins();
788  std::vector<LIB_PIN*> pins;
789  comp->GetPins( pins );
790 
791  for( LIB_PIN* pin : pins )
792  {
793  auto pin_conn = comp->GetConnectionForPin( pin, *g_CurrentSheet );
794 
795  if( pin_conn && pin_conn->Name( false ) == selectedNetName )
796  {
797  comp->BrightenPin( pin );
798  redraw = true;
799  }
800  }
801  }
802  else if( item->Type() == SCH_SHEET_T )
803  {
804  for( SCH_SHEET_PIN* pin : static_cast<SCH_SHEET*>( item )->GetPins() )
805  {
806  auto pin_conn = pin->Connection( *g_CurrentSheet );
807  bool redrawPin = pin->IsBrightened();
808 
809  if( pin_conn && pin_conn->Name() == selectedNetName )
810  pin->SetBrightened();
811  else
812  pin->ClearBrightened();
813 
814  redrawPin |= pin->IsBrightened();
815 
816  if( redrawPin )
817  itemsToRedraw.push_back( pin );
818  }
819  }
820 
821  if( redraw )
822  itemsToRedraw.push_back( item );
823  }
824 
825  // Be sure highlight change will be redrawn
826  KIGFX::VIEW* view = getView();
827 
828  for( auto redrawItem : itemsToRedraw )
830 
831  m_frame->GetCanvas()->Refresh();
832 
833  return 0;
834 }
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:84
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:99
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 1287 of file sch_editor_control.cpp.

1288 {
1289  wxCommandEvent dummy;
1291  return 0;
1292 }
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:217
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:212

◆ 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:218
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(), EDA_3D_VIEWER_CONTROL::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(), EDA_3D_VIEWER_CONTROL::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(), EDA_3D_VIEWER_CONTROL::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 194 of file sch_editor_control.h.

◆ m_probingPcbToSch

bool SCH_EDITOR_CONTROL::m_probingPcbToSch
private

Definition at line 193 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 198 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 213 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 218 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::editFieldText(), 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 217 of file tool_base.h.

Referenced by TOOL_BASE::GetName().

◆ m_type

TOOL_TYPE TOOL_BASE::m_type
protectedinherited

Stores the type of the tool.

Definition at line 210 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: