KiCad PCB EDA Suite
SYMBOL_EDITOR_CONTROL Class Reference

Handle actions for the various symbol editor and viewers. More...

#include <symbol_editor_control.h>

Inheritance diagram for SYMBOL_EDITOR_CONTROL:
EE_TOOL_BASE< SCH_BASE_FRAME > TOOL_INTERACTIVE TOOL_BASE

Public Types

enum  RESET_REASON { RUN, MODEL_RELOAD, GAL_SWITCH }
 Determine the reason of reset for a tool. More...
 

Public Member Functions

 SYMBOL_EDITOR_CONTROL ()
 
virtual ~SYMBOL_EDITOR_CONTROL ()
 
bool Init () override
 Init() is called once upon a registration of the tool. More...
 
int AddLibrary (const TOOL_EVENT &aEvent)
 
int AddSymbol (const TOOL_EVENT &aEvent)
 
int EditSymbol (const TOOL_EVENT &aEvent)
 
int Save (const TOOL_EVENT &aEvt)
 
int Revert (const TOOL_EVENT &aEvent)
 
int CutCopyDelete (const TOOL_EVENT &aEvent)
 
int DuplicateSymbol (const TOOL_EVENT &aEvent)
 
int ExportSymbol (const TOOL_EVENT &aEvent)
 
int ExportView (const TOOL_EVENT &aEvent)
 
int ExportSymbolAsSVG (const TOOL_EVENT &aEvent)
 
int AddSymbolToSchematic (const TOOL_EVENT &aEvent)
 
int OnDeMorgan (const TOOL_EVENT &aEvent)
 
int ShowElectricalTypes (const TOOL_EVENT &aEvent)
 
int PinLibrary (const TOOL_EVENT &aEvent)
 
int UnpinLibrary (const TOOL_EVENT &aEvent)
 
int ToggleSymbolTree (const TOOL_EVENT &aEvent)
 
int ToggleSyncedPinsMode (const TOOL_EVENT &aEvent)
 
void Reset (RESET_REASON aReason) override
 Bring the tool to a known, initial state. More...
 
void Activate ()
 Run the tool. More...
 
TOOL_MENUGetToolMenu ()
 
void SetContextMenu (ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger=CMENU_BUTTON)
 Assign a context menu and tells when it should be activated. More...
 
void RunMainStack (std::function< void()> aFunc)
 Call a function using the main stack. More...
 
template<class T >
void Go (int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
 Define which state (aStateFunc) to go when a certain event arrives (aConditions). More...
 
TOOL_EVENTWait (const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
 Suspend execution of the tool until an event specified in aEventList arrives. More...
 
TOOL_TYPE GetType () const
 Return the type of the tool. More...
 
TOOL_ID GetId () const
 Return the unique identifier of the tool. More...
 
const std::string & GetName () const
 Return the name of the tool. More...
 
TOOL_MANAGERGetManager () const
 Return the instance of TOOL_MANAGER that takes care of the tool. More...
 
bool IsToolActive () const
 

Protected Member Functions

void updateItem (EDA_ITEM *aItem, bool aUpdateRTree) const
 Similar to getView()->Update(), but handles items that are redrawn by their parents and updating the SCH_SCREEN's RTree. More...
 
void saveCopyInUndoList (EDA_ITEM *aItem, UNDO_REDO aType, bool aAppend=false)
 
void attachManager (TOOL_MANAGER *aManager)
 Set the TOOL_MANAGER the tool will belong to. More...
 
KIGFX::VIEWgetView () const
 Returns the instance of #VIEW object used in the application. More...
 
KIGFX::VIEW_CONTROLSgetViewControls () const
 Return the instance of VIEW_CONTROLS object used in the application. More...
 
template<typename T >
T * getEditFrame () const
 Return the application window object, casted to requested user type. More...
 
template<typename T >
T * getModel () const
 Return the model object if it matches the requested type. More...
 

Protected Attributes

SCH_BASE_FRAMEm_frame
 
KIGFX::SCH_VIEWm_view
 
EE_SELECTION_TOOLm_selectionTool
 
bool m_isSymbolEditor
 
TOOL_MENU m_menu
 The functions below are not yet implemented - their interface may change. More...
 
TOOL_TYPE m_type
 Unique identifier for the tool, assigned by a TOOL_MANAGER instance. More...
 
TOOL_ID m_toolId
 Name of the tool. More...
 
std::string m_toolName
 
TOOL_MANAGERm_toolMgr
 

Private Member Functions

void setTransitions () override
 < Set up handlers for various events. More...
 

Detailed Description

Handle actions for the various symbol editor and viewers.

Definition at line 37 of file symbol_editor_control.h.

Member Enumeration Documentation

◆ RESET_REASON

enum TOOL_BASE::RESET_REASON
inherited

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

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

Constructor & Destructor Documentation

◆ SYMBOL_EDITOR_CONTROL()

SYMBOL_EDITOR_CONTROL::SYMBOL_EDITOR_CONTROL ( )
inline

Definition at line 40 of file symbol_editor_control.h.

40  :
41  EE_TOOL_BASE<SCH_BASE_FRAME>( "eeschema.SymbolLibraryControl" )
42  { }

◆ ~SYMBOL_EDITOR_CONTROL()

virtual SYMBOL_EDITOR_CONTROL::~SYMBOL_EDITOR_CONTROL ( )
inlinevirtual

Definition at line 44 of file symbol_editor_control.h.

44 { }

Member Function Documentation

◆ Activate()

void TOOL_INTERACTIVE::Activate ( )
inherited

Run 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:214
TOOL_ID m_toolId
Name of the tool.
Definition: tool_base.h:209
bool InvokeTool(TOOL_ID aToolId)
Call 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(), SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::DrawRectangle(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), BOARD_EDITOR_CONTROL::DrillOrigin(), PAD_TOOL::EnumeratePads(), PCB_CONTROL::GridSetOrigin(), SCH_EDITOR_CONTROL::HighlightNetCursor(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), PCB_PICKER_TOOL::Main(), PL_EDIT_TOOL::Main(), EE_POINT_EDITOR::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PL_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), LIB_TREE::onContextMenu(), PCB_POINT_EDITOR::OnSelectionChange(), GROUP_TOOL::PickNewMember(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), DRAWING_TOOL::SetAnchor(), DRC_TOOL::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ AddLibrary()

int SYMBOL_EDITOR_CONTROL::AddLibrary ( const TOOL_EVENT aEvent)

Definition at line 125 of file symbol_editor_control.cpp.

126 {
127  bool createNew = aEvent.IsAction( &ACTIONS::newLibrary );
128 
130  static_cast<SYMBOL_EDIT_FRAME*>( m_frame )->AddLibraryFile( createNew );
131 
132  return 0;
133 }
bool IsAction(const TOOL_ACTION *aAction) const
Test if the event contains an action issued upon activation of the given TOOL_ACTION.
Definition: tool_event.cpp:88
static TOOL_ACTION newLibrary
Definition: actions.h:48
bool IsType(FRAME_T aType) const

References FRAME_SCH_SYMBOL_EDITOR, TOOL_EVENT::IsAction(), EDA_BASE_FRAME::IsType(), EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, and ACTIONS::newLibrary.

Referenced by setTransitions().

◆ AddSymbol()

int SYMBOL_EDITOR_CONTROL::AddSymbol ( const TOOL_EVENT aEvent)

Definition at line 151 of file symbol_editor_control.cpp.

152 {
154  {
155  SYMBOL_EDIT_FRAME* editFrame = static_cast<SYMBOL_EDIT_FRAME*>( m_frame );
156 
157  LIB_ID sel = editFrame->GetTreeLIBID();
158  const wxString& libName = sel.GetLibNickname();
159  wxString msg;
160 
161  if( libName.IsEmpty() )
162  {
163  msg.Printf( _( "No symbol library selected." ), libName );
164  m_frame->ShowInfoBarError( msg );
165  return 0;
166  }
167 
168  if( editFrame->GetLibManager().IsLibraryReadOnly( libName ) )
169  {
170  msg.Printf( _( "Symbol library '%s' is not writeable." ), libName );
171  m_frame->ShowInfoBarError( msg );
172  return 0;
173  }
174 
175  if( aEvent.IsAction( &EE_ACTIONS::newSymbol ) )
176  editFrame->CreateNewSymbol();
177  else if( aEvent.IsAction( &EE_ACTIONS::importSymbol ) )
178  editFrame->ImportSymbol();
179  }
180 
181  return 0;
182 }
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
bool IsAction(const TOOL_ACTION *aAction) const
Test if the event contains an action issued upon activation of the given TOOL_ACTION.
Definition: tool_event.cpp:88
void ShowInfoBarError(const wxString &aErrorMsg, bool aShowCloseButton=false, WX_INFOBAR::MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the WX_INFOBAR displayed on the top of the canvas with a message and an error icon on the left o...
LIB_ID GetTreeLIBID(int *aUnit=nullptr) const
Return the LIB_ID of the library or symbol selected in the symbol tree.
bool IsLibraryReadOnly(const wxString &aLibrary) const
Return true if the library is stored in a read-only file.
SYMBOL_LIBRARY_MANAGER & GetLibManager()
#define _(s)
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:90
static TOOL_ACTION importSymbol
Definition: ee_actions.h:175
static TOOL_ACTION newSymbol
Definition: ee_actions.h:168
bool IsType(FRAME_T aType) const
void CreateNewSymbol()
Create a new symbol in the selected library.
The symbol library editor main window.

References _, SYMBOL_EDIT_FRAME::CreateNewSymbol(), FRAME_SCH_SYMBOL_EDITOR, SYMBOL_EDIT_FRAME::GetLibManager(), LIB_ID::GetLibNickname(), SYMBOL_EDIT_FRAME::GetTreeLIBID(), SYMBOL_EDIT_FRAME::ImportSymbol(), EE_ACTIONS::importSymbol, TOOL_EVENT::IsAction(), SYMBOL_LIBRARY_MANAGER::IsLibraryReadOnly(), EDA_BASE_FRAME::IsType(), EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, EE_ACTIONS::newSymbol, and EDA_BASE_FRAME::ShowInfoBarError().

Referenced by setTransitions().

◆ AddSymbolToSchematic()

int SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic ( const TOOL_EVENT aEvent)

Definition at line 461 of file symbol_editor_control.cpp.

462 {
463  LIB_SYMBOL* libSymbol = nullptr;
464  LIB_ID libId;
465  int unit, convert;
466 
467  if( m_isSymbolEditor )
468  {
469  SYMBOL_EDIT_FRAME* editFrame = getEditFrame<SYMBOL_EDIT_FRAME>();
470 
471  libSymbol = editFrame->GetCurSymbol();
472  unit = editFrame->GetUnit();
473  convert = editFrame->GetConvert();
474 
475  if( libSymbol )
476  libId = libSymbol->GetLibId();
477  }
478  else
479  {
480  SYMBOL_VIEWER_FRAME* viewerFrame = getEditFrame<SYMBOL_VIEWER_FRAME>();
481 
482  if( viewerFrame->IsModal() )
483  {
484  // if we're modal then we just need to return the symbol selection; the caller is
485  // already in a EE_ACTIONS::placeSymbol coroutine.
486  viewerFrame->FinishModal();
487  return 0;
488  }
489  else
490  {
491  libSymbol = viewerFrame->GetSelectedSymbol();
492  unit = viewerFrame->GetUnit();
493  convert = viewerFrame->GetConvert();
494 
495  if( libSymbol )
496  libId = libSymbol->GetLibId();
497  }
498  }
499 
500  if( libSymbol )
501  {
502  SCH_EDIT_FRAME* schframe = (SCH_EDIT_FRAME*) m_frame->Kiway().Player( FRAME_SCH, false );
503 
504  if( !schframe ) // happens when the schematic editor is not active (or closed)
505  {
506  DisplayErrorMessage( m_frame, _( "No schematic currently open." ) );
507  return 0;
508  }
509 
510  wxCHECK( libSymbol->GetLibId().IsValid(), 0 );
511 
512  SCH_SYMBOL* symbol = new SCH_SYMBOL( *libSymbol, libId, &schframe->GetCurrentSheet(),
513  unit, convert );
514 
515  symbol->SetParent( schframe->GetScreen() );
516 
517  if( schframe->eeconfig()->m_AutoplaceFields.enable )
518  symbol->AutoplaceFields( /* aScreen */ nullptr, /* aManual */ false );
519 
520  schframe->Raise();
521  schframe->GetToolManager()->RunAction( EE_ACTIONS::placeSymbol, true, symbol );
522  }
523 
524  return 0;
525 }
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:53
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:284
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
Symbol library viewer main window.
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:382
Schematic editor (Eeschema) main window.
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
bool IsValid() const
Check if this LID_ID is valid.
Definition: lib_id.h:159
Define a library symbol object.
Definition: lib_symbol.h:96
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:116
EESCHEMA_SETTINGS * eeconfig() const
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
LIB_SYMBOL * GetCurSymbol() const
Return the current symbol being edited or NULL if none selected.
AUTOPLACE_FIELDS m_AutoplaceFields
LIB_ID GetLibId() const override
Definition: lib_symbol.h:135
#define _(s)
static TOOL_ACTION placeSymbol
Definition: ee_actions.h:74
bool IsModal() const override
Return true if the frame is shown in our modal mode and false if the frame is shown as an usual frame...
Definition: kiway_player.h:173
Schematic symbol object.
Definition: sch_symbol.h:78
LIB_SYMBOL * GetSelectedSymbol() const
SCH_SHEET_PATH & GetCurrentSheet() const
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:54
void FinishModal()
Send the selected symbol back to the caller.
The symbol library editor main window.

References _, convert, DisplayErrorMessage(), SCH_BASE_FRAME::eeconfig(), EESCHEMA_SETTINGS::AUTOPLACE_FIELDS::enable, SYMBOL_VIEWER_FRAME::FinishModal(), FRAME_SCH, SYMBOL_VIEWER_FRAME::GetConvert(), SYMBOL_EDIT_FRAME::GetConvert(), SCH_EDIT_FRAME::GetCurrentSheet(), SYMBOL_EDIT_FRAME::GetCurSymbol(), LIB_SYMBOL::GetLibId(), SCH_EDIT_FRAME::GetScreen(), SYMBOL_VIEWER_FRAME::GetSelectedSymbol(), TOOLS_HOLDER::GetToolManager(), SYMBOL_VIEWER_FRAME::GetUnit(), SYMBOL_EDIT_FRAME::GetUnit(), KIWAY_PLAYER::IsModal(), LIB_ID::IsValid(), KIWAY_HOLDER::Kiway(), EESCHEMA_SETTINGS::m_AutoplaceFields, EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, EE_TOOL_BASE< SCH_BASE_FRAME >::m_isSymbolEditor, EE_ACTIONS::placeSymbol, KIWAY::Player(), TOOL_MANAGER::RunAction(), and EDA_ITEM::SetParent().

Referenced by setTransitions().

◆ attachManager()

void TOOL_BASE::attachManager ( TOOL_MANAGER aManager)
protectedinherited

Set 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:214

References TOOL_BASE::m_toolMgr.

Referenced by TOOL_MANAGER::RegisterTool().

◆ CutCopyDelete()

int SYMBOL_EDITOR_CONTROL::CutCopyDelete ( const TOOL_EVENT aEvent)

Definition at line 223 of file symbol_editor_control.cpp.

224 {
226  {
227  SYMBOL_EDIT_FRAME* editFrame = static_cast<SYMBOL_EDIT_FRAME*>( m_frame );
228 
229  if( aEvt.IsAction( &EE_ACTIONS::cutSymbol ) || aEvt.IsAction( &EE_ACTIONS::copySymbol ) )
230  editFrame->CopySymbolToClipboard();
231 
232  if( aEvt.IsAction( &EE_ACTIONS::cutSymbol ) || aEvt.IsAction( &EE_ACTIONS::deleteSymbol ) )
233  {
234  LIB_ID sel = editFrame->GetTreeLIBID();
235  const wxString& libName = sel.GetLibNickname();
236  wxString msg;
237 
238  if( editFrame->GetLibManager().IsLibraryReadOnly( libName ) )
239  {
240  msg.Printf( _( "Symbol library '%s' is not writeable." ), libName );
241  m_frame->ShowInfoBarError( msg );
242  return 0;
243  }
244 
245  editFrame->DeleteSymbolFromLibrary();
246  }
247  }
248 
249  return 0;
250 }
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
void ShowInfoBarError(const wxString &aErrorMsg, bool aShowCloseButton=false, WX_INFOBAR::MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the WX_INFOBAR displayed on the top of the canvas with a message and an error icon on the left o...
LIB_ID GetTreeLIBID(int *aUnit=nullptr) const
Return the LIB_ID of the library or symbol selected in the symbol tree.
bool IsLibraryReadOnly(const wxString &aLibrary) const
Return true if the library is stored in a read-only file.
SYMBOL_LIBRARY_MANAGER & GetLibManager()
static TOOL_ACTION deleteSymbol
Definition: ee_actions.h:171
static TOOL_ACTION cutSymbol
Definition: ee_actions.h:172
#define _(s)
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:90
void DeleteSymbolFromLibrary()
static TOOL_ACTION copySymbol
Definition: ee_actions.h:173
bool IsType(FRAME_T aType) const
The symbol library editor main window.

References _, EE_ACTIONS::copySymbol, SYMBOL_EDIT_FRAME::CopySymbolToClipboard(), EE_ACTIONS::cutSymbol, EE_ACTIONS::deleteSymbol, SYMBOL_EDIT_FRAME::DeleteSymbolFromLibrary(), FRAME_SCH_SYMBOL_EDITOR, SYMBOL_EDIT_FRAME::GetLibManager(), LIB_ID::GetLibNickname(), SYMBOL_EDIT_FRAME::GetTreeLIBID(), TOOL_EVENT::IsAction(), SYMBOL_LIBRARY_MANAGER::IsLibraryReadOnly(), EDA_BASE_FRAME::IsType(), EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, and EDA_BASE_FRAME::ShowInfoBarError().

Referenced by setTransitions().

◆ DuplicateSymbol()

int SYMBOL_EDITOR_CONTROL::DuplicateSymbol ( const TOOL_EVENT aEvent)

Definition at line 253 of file symbol_editor_control.cpp.

254 {
256  {
257  SYMBOL_EDIT_FRAME* editFrame = static_cast<SYMBOL_EDIT_FRAME*>( m_frame );
258 
259  LIB_ID sel = editFrame->GetTreeLIBID();
260  const wxString& libName = sel.GetLibNickname();
261  wxString msg;
262 
263  if( editFrame->GetLibManager().IsLibraryReadOnly( libName ) )
264  {
265  msg.Printf( _( "Symbol library '%s' is not writeable." ), libName );
266  m_frame->ShowInfoBarError( msg );
267  return 0;
268  }
269 
270  editFrame->DuplicateSymbol( aEvent.IsAction( &EE_ACTIONS::pasteSymbol ) );
271  }
272 
273  return 0;
274 }
static TOOL_ACTION pasteSymbol
Definition: ee_actions.h:174
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
bool IsAction(const TOOL_ACTION *aAction) const
Test if the event contains an action issued upon activation of the given TOOL_ACTION.
Definition: tool_event.cpp:88
void ShowInfoBarError(const wxString &aErrorMsg, bool aShowCloseButton=false, WX_INFOBAR::MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the WX_INFOBAR displayed on the top of the canvas with a message and an error icon on the left o...
LIB_ID GetTreeLIBID(int *aUnit=nullptr) const
Return the LIB_ID of the library or symbol selected in the symbol tree.
bool IsLibraryReadOnly(const wxString &aLibrary) const
Return true if the library is stored in a read-only file.
SYMBOL_LIBRARY_MANAGER & GetLibManager()
#define _(s)
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:90
bool IsType(FRAME_T aType) const
void DuplicateSymbol(bool aFromClipboard)
Insert a duplicate symbol.
The symbol library editor main window.

References _, SYMBOL_EDIT_FRAME::DuplicateSymbol(), FRAME_SCH_SYMBOL_EDITOR, SYMBOL_EDIT_FRAME::GetLibManager(), LIB_ID::GetLibNickname(), SYMBOL_EDIT_FRAME::GetTreeLIBID(), TOOL_EVENT::IsAction(), SYMBOL_LIBRARY_MANAGER::IsLibraryReadOnly(), EDA_BASE_FRAME::IsType(), EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, EE_ACTIONS::pasteSymbol, and EDA_BASE_FRAME::ShowInfoBarError().

Referenced by setTransitions().

◆ EditSymbol()

int SYMBOL_EDITOR_CONTROL::EditSymbol ( const TOOL_EVENT aEvent)

Definition at line 136 of file symbol_editor_control.cpp.

137 {
139  {
140  SYMBOL_EDIT_FRAME* editFrame = static_cast<SYMBOL_EDIT_FRAME*>( m_frame );
141  int unit = 0;
142  LIB_ID partId = editFrame->GetTreeLIBID( &unit );
143 
144  editFrame->LoadSymbol( partId.GetLibItemName(), partId.GetLibNickname(), unit );
145  }
146 
147  return 0;
148 }
const UTF8 & GetLibItemName() const
Definition: lib_id.h:104
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
LIB_ID GetTreeLIBID(int *aUnit=nullptr) const
Return the LIB_ID of the library or symbol selected in the symbol tree.
void LoadSymbol(const wxString &aLibrary, const wxString &aSymbol, int Unit)
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:90
bool IsType(FRAME_T aType) const
The symbol library editor main window.

References FRAME_SCH_SYMBOL_EDITOR, LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), SYMBOL_EDIT_FRAME::GetTreeLIBID(), EDA_BASE_FRAME::IsType(), SYMBOL_EDIT_FRAME::LoadSymbol(), and EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame.

Referenced by setTransitions().

◆ ExportSymbol()

int SYMBOL_EDITOR_CONTROL::ExportSymbol ( const TOOL_EVENT aEvent)

Definition at line 214 of file symbol_editor_control.cpp.

215 {
217  static_cast<SYMBOL_EDIT_FRAME*>( m_frame )->ExportSymbol();
218 
219  return 0;
220 }
bool IsType(FRAME_T aType) const

References FRAME_SCH_SYMBOL_EDITOR, EDA_BASE_FRAME::IsType(), and EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame.

Referenced by setTransitions().

◆ ExportSymbolAsSVG()

int SYMBOL_EDITOR_CONTROL::ExportSymbolAsSVG ( const TOOL_EVENT aEvent)

Definition at line 416 of file symbol_editor_control.cpp.

417 {
418  if( !m_isSymbolEditor )
419  return 0;
420 
421  SYMBOL_EDIT_FRAME* editFrame = getEditFrame<SYMBOL_EDIT_FRAME>();
422  LIB_SYMBOL* symbol = editFrame->GetCurSymbol();
423 
424  if( !symbol )
425  {
426  wxMessageBox( _( "No symbol to export" ) );
427  return 0;
428  }
429 
430  wxString file_ext = SVGFileExtension;
431  wxFileName fn( symbol->GetName() );
432  fn.SetExt( SVGFileExtension );
433 
434  wxString pro_dir = wxPathOnly( m_frame->Prj().GetProjectFullName() );
435 
436  wxString fullFileName = wxFileSelector( _( "SVG File Name" ), pro_dir, fn.GetFullName(),
437  SVGFileExtension, SVGFileWildcard(), wxFD_SAVE,
438  m_frame );
439 
440  if( !fullFileName.IsEmpty() )
441  {
442  PAGE_INFO pageSave = editFrame->GetScreen()->GetPageSettings();
443  PAGE_INFO pageTemp = pageSave;
444 
445  wxSize symbolSize = symbol->GetUnitBoundingBox( editFrame->GetUnit(),
446  editFrame->GetConvert() ).GetSize();
447 
448  // Add a small margin to the plot bounding box
449  pageTemp.SetWidthMils( int( symbolSize.x * 1.2 ) );
450  pageTemp.SetHeightMils( int( symbolSize.y * 1.2 ) );
451 
452  editFrame->GetScreen()->SetPageSettings( pageTemp );
453  editFrame->SVGPlotSymbol( fullFileName );
454  editFrame->GetScreen()->SetPageSettings( pageSave );
455  }
456 
457  return 0;
458 }
wxString SVGFileWildcard()
wxString GetName() const override
Definition: lib_symbol.h:133
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: sch_screen.h:133
Define a library symbol object.
Definition: lib_symbol.h:96
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:132
LIB_SYMBOL * GetCurSymbol() const
Return the current symbol being edited or NULL if none selected.
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:53
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
const EDA_RECT GetUnitBoundingBox(int aUnit, int aConvert) const
Get the bounding box for the symbol.
Definition: lib_symbol.cpp:805
#define _(s)
virtual const wxString GetProjectFullName() const
Return the full path and name of the project.
Definition: project.cpp:116
void SetHeightMils(int aHeightInMils)
Definition: page_info.cpp:257
void SetWidthMils(int aWidthInMils)
Definition: page_info.cpp:243
const std::string SVGFileExtension
void SVGPlotSymbol(const wxString &aFullFileName)
Create the SVG print file for the current edited symbol.
The symbol library editor main window.

References _, SYMBOL_EDIT_FRAME::GetConvert(), SYMBOL_EDIT_FRAME::GetCurSymbol(), LIB_SYMBOL::GetName(), SCH_SCREEN::GetPageSettings(), PROJECT::GetProjectFullName(), SCH_BASE_FRAME::GetScreen(), SYMBOL_EDIT_FRAME::GetUnit(), LIB_SYMBOL::GetUnitBoundingBox(), EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, EE_TOOL_BASE< SCH_BASE_FRAME >::m_isSymbolEditor, KIWAY_HOLDER::Prj(), PAGE_INFO::SetHeightMils(), SCH_SCREEN::SetPageSettings(), PAGE_INFO::SetWidthMils(), SVGFileExtension, SVGFileWildcard(), and SYMBOL_EDIT_FRAME::SVGPlotSymbol().

Referenced by setTransitions().

◆ ExportView()

int SYMBOL_EDITOR_CONTROL::ExportView ( const TOOL_EVENT aEvent)

Definition at line 376 of file symbol_editor_control.cpp.

377 {
378  if( !m_isSymbolEditor )
379  return 0;
380 
381  SYMBOL_EDIT_FRAME* editFrame = getEditFrame<SYMBOL_EDIT_FRAME>();
382  LIB_SYMBOL* symbol = editFrame->GetCurSymbol();
383 
384  if( !symbol )
385  {
386  wxMessageBox( _( "No symbol to export" ) );
387  return 0;
388  }
389 
390  wxString file_ext = wxT( "png" );
391  wxString mask = wxT( "*." ) + file_ext;
392  wxFileName fn( symbol->GetName() );
393  fn.SetExt( "png" );
394 
395  wxString projectPath = wxPathOnly( m_frame->Prj().GetProjectFullName() );
396 
397  wxFileDialog dlg( editFrame, _( "Image File Name" ), projectPath, fn.GetFullName(),
398  PngFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
399 
400  if( dlg.ShowModal() == wxID_OK && !dlg.GetPath().IsEmpty() )
401  {
402  // calling wxYield is mandatory under Linux, after closing the file selector dialog
403  // to refresh the screen before creating the PNG or JPEG image from screen
404  wxYield();
405 
406  if( !SaveCanvasImageToFile( editFrame, dlg.GetPath(), BITMAP_TYPE::PNG ) )
407  {
408  wxMessageBox( wxString::Format( _( "Can't save file '%s'." ), dlg.GetPath() ) );
409  }
410  }
411 
412  return 0;
413 }
wxString GetName() const override
Definition: lib_symbol.h:133
Define a library symbol object.
Definition: lib_symbol.h:96
LIB_SYMBOL * GetCurSymbol() const
Return the current symbol being edited or NULL if none selected.
bool SaveCanvasImageToFile(EDA_DRAW_FRAME *aFrame, const wxString &aFileName, BITMAP_TYPE aBitmapType)
Save the current view as an image file.
Definition: bitmap.cpp:207
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
#define _(s)
virtual const wxString GetProjectFullName() const
Return the full path and name of the project.
Definition: project.cpp:116
wxString PngFileWildcard()
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
The symbol library editor main window.

References _, Format(), SYMBOL_EDIT_FRAME::GetCurSymbol(), LIB_SYMBOL::GetName(), PROJECT::GetProjectFullName(), EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, EE_TOOL_BASE< SCH_BASE_FRAME >::m_isSymbolEditor, PNG, PngFileWildcard(), KIWAY_HOLDER::Prj(), and SaveCanvasImageToFile().

Referenced by setTransitions().

◆ getEditFrame()

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

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

Definition at line 184 of file tool_base.h.

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

References TOOL_BASE::getToolHolderInt().

Referenced by ZONE_CREATE_HELPER::createNewZone().

◆ GetId()

TOOL_ID TOOL_BASE::GetId ( ) const
inlineinherited

Return 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
Name of the tool.
Definition: tool_base.h:209

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

Return the instance of TOOL_MANAGER that takes care of the tool.

Returns
Instance of the TOOL_MANAGER or NULL if there is no associated tool manager.

Definition at line 143 of file tool_base.h.

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

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

Return the model object if it matches the requested type.

Store the type of the tool.

Definition at line 196 of file tool_base.h.

References TOOL_BASE::getModelInt().

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

◆ GetName()

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

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

134  {
135  return m_toolName;
136  }
std::string m_toolName
Definition: tool_base.h:213

References TOOL_BASE::m_toolName.

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

◆ GetToolMenu()

◆ GetType()

TOOL_TYPE TOOL_BASE::GetType ( ) const
inlineinherited

Return the type of the tool.

Returns
The type of the tool.

Definition at line 108 of file tool_base.h.

109  {
110  return m_type;
111  }
TOOL_TYPE m_type
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:206

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

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:283
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214

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(), SCH_EDIT_TOOL::ChangeTextType(), EE_INSPECTION_TOOL::CheckSymbol(), GERBVIEW_CONTROL::ClearAllLayers(), PL_SELECTION_TOOL::ClearSelection(), EE_SELECTION_TOOL::ClearSelection(), EE_SELECTION_TOOL::CollectHits(), SCH_LINE_WIRE_BUS_TOOL::computeBreakPoint(), COMMON_TOOLS::CursorControl(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PL_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), PCB_SELECTION_TOOL::doSelectionMenu(), COMMON_TOOLS::doZoomFit(), COMMON_TOOLS::doZoomInOut(), COMMON_TOOLS::doZoomToPreset(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), PL_DRAWING_TOOLS::DrawShape(), DRAWING_TOOL::DrawZone(), BOARD_EDITOR_CONTROL::DrillOrigin(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), SCH_EDITOR_CONTROL::FindSymbolAndItem(), EE_SELECTION_TOOL::GetNode(), ROUTER_TOOL::getStartLayer(), PCB_CONTROL::GridResetOrigin(), PCB_CONTROL::GridSetOrigin(), ROUTER_TOOL::handleCommonEvents(), PL_SELECTION_TOOL::highlight(), EE_SELECTION_TOOL::highlight(), PCB_SELECTION_TOOL::highlight(), GERBVIEW_CONTROL::HighlightControl(), PNS::TOOL_BASE::highlightNet(), BOARD_INSPECTION_TOOL::highlightNet(), PCB_SELECTION_TOOL::hitTestDistance(), SCH_EDIT_TOOL::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineDrag(), PCB_PICKER_TOOL::Main(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), PL_EDIT_TOOL::moveItem(), COMMON_TOOLS::OnGridChanged(), PCB_POINT_EDITOR::OnSelectionChange(), COMMON_TOOLS::PanControl(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), PL_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), ROUTER_TOOL::performRouting(), PNS::TOOL_BASE::pickSingleItem(), BOARD_EDITOR_CONTROL::PlaceFootprint(), PL_DRAWING_TOOLS::PlaceItem(), BOARD_EDITOR_CONTROL::PlaceTarget(), ROUTER_TOOL::prepareInteractive(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), EDIT_TOOL::Remove(), BOARD_EDITOR_CONTROL::Reset(), PNS::TOOL_BASE::Reset(), PCB_CONTROL::Reset(), GERBVIEW_SELECTION_TOOL::Reset(), DRAWING_TOOL::Reset(), EE_SELECTION_TOOL::Reset(), PCB_SELECTION_TOOL::Reset(), EE_TOOL_BASE< SCH_BASE_FRAME >::Reset(), SCH_EDIT_TOOL::Rotate(), GERBVIEW_SELECTION_TOOL::select(), GERBVIEW_SELECTION_TOOL::selectable(), PCB_SELECTION_TOOL::Selectable(), PCB_SELECTION_TOOL::SelectAll(), EE_SELECTION_TOOL::SelectAll(), PL_SELECTION_TOOL::selectionContains(), EE_SELECTION_TOOL::selectionContains(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::SelectPoint(), ZOOM_TOOL::selectRegion(), GERBVIEW_SELECTION_TOOL::selectVisually(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_EDITOR_CONTROL::ToggleHiddenFields(), SCH_EDITOR_CONTROL::ToggleHiddenPins(), SCH_DRAWING_TOOLS::TwoClickPlace(), PL_SELECTION_TOOL::unhighlight(), EE_SELECTION_TOOL::unhighlight(), PCB_SELECTION_TOOL::unhighlight(), GERBVIEW_SELECTION_TOOL::unselect(), GERBVIEW_SELECTION_TOOL::unselectVisually(), EE_POINT_EDITOR::updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), PCB_POINT_EDITOR::updateEditedPoint(), SCH_EDITOR_CONTROL::UpdateFind(), PL_POINT_EDITOR::updateItem(), PCB_POINT_EDITOR::updateItem(), EE_TOOL_BASE< SCH_BASE_FRAME >::updateItem(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), EE_POINT_EDITOR::updateParentItem(), EE_POINT_EDITOR::updatePoints(), PL_POINT_EDITOR::updatePoints(), PCB_POINT_EDITOR::updatePoints(), PCB_SELECTION_TOOL::updateSelection(), PNS::TOOL_BASE::updateStartItem(), PCB_VIEWER_TOOLS::view(), PCB_TOOL_BASE::view(), PCB_SELECTION_TOOL::zoomFitSelection(), EE_SELECTION_TOOL::~EE_SELECTION_TOOL(), GERBVIEW_SELECTION_TOOL::~GERBVIEW_SELECTION_TOOL(), and PCB_SELECTION_TOOL::~PCB_SELECTION_TOOL().

◆ getViewControls()

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

Return 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:214
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(), PCB_POINT_EDITOR::addCorner(), EE_POINT_EDITOR::addCornerCondition(), SCH_EDITOR_CONTROL::AssignNetclass(), SCH_EDIT_TOOL::BreakWire(), PCB_TOOL_BASE::controls(), EDIT_TOOL::copyToClipboard(), SCH_DRAWING_TOOLS::createSheetPin(), COMMON_TOOLS::CursorControl(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), EDIT_TOOL::doMoveSelection(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), COMMON_TOOLS::doZoomToPreset(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::DrawRectangle(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), SCH_DRAWING_TOOLS::GetCanvasFreeAreaPixels(), BOARD_INSPECTION_TOOL::HighlightNet(), SCH_EDITOR_CONTROL::HighlightNet(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), SCH_EDIT_TOOL::Init(), EDIT_TOOL::Init(), PCB_PICKER_TOOL::Main(), EE_POINT_EDITOR::Main(), PL_EDIT_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PL_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), EE_SELECTION_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), COMMON_TOOLS::OnGridChanged(), PCB_POINT_EDITOR::OnSelectionChange(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), ROUTER_TOOL::performDragging(), LENGTH_TUNER_TOOL::performTuning(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), PCB_CONTROL::placeBoardItems(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), EDIT_TOOL::Remove(), SCH_EDIT_TOOL::RepeatDrawItem(), PL_SELECTION_TOOL::RequestSelection(), EE_SELECTION_TOOL::RequestSelection(), PCB_POINT_EDITOR::Reset(), DRAWING_TOOL::Reset(), COMMON_TOOLS::ResetLocalCoords(), GERBVIEW_SELECTION_TOOL::selectCursor(), PCB_SELECTION_TOOL::selectCursor(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::SelectNode(), ZOOM_TOOL::selectRegion(), ALIGN_DISTRIBUTE_TOOL::selectTarget(), PCB_PICKER_TOOL::setControls(), PICKER_TOOL::setControls(), EE_POINT_EDITOR::setEditedPoint(), PL_POINT_EDITOR::setEditedPoint(), PCB_POINT_EDITOR::setEditedPoint(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), EE_POINT_EDITOR::updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), PCB_POINT_EDITOR::updateEditedPoint(), PCB_POINT_EDITOR::updateItem(), PL_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

Define which state (aStateFunc) to go when a certain event arrives (aConditions).

No conditions means any event.

Definition at line 147 of file tool_interactive.h.

149 {
150  TOOL_STATE_FUNC sptr = std::bind( aStateFunc, static_cast<T*>( this ), std::placeholders::_1 );
151 
152  goInternal( sptr, aConditions );
153 }
std::function< int(const TOOL_EVENT &)> TOOL_STATE_FUNC
Definition: tool_base.h:58
void goInternal(TOOL_STATE_FUNC &aState, const TOOL_EVENT_LIST &aConditions)

References TOOL_INTERACTIVE::goInternal().

Referenced by AUTOPLACE_TOOL::setTransitions(), ZOOM_TOOL::setTransitions(), LENGTH_TUNER_TOOL::setTransitions(), BOARD_REANNOTATE_TOOL::setTransitions(), GERBVIEW_INSPECTION_TOOL::setTransitions(), ROUTER_TOOL::setTransitions(), PCB_PICKER_TOOL::setTransitions(), SCH_NAVIGATE_TOOL::setTransitions(), SYMBOL_EDITOR_PIN_TOOL::setTransitions(), SYMBOL_EDITOR_MOVE_TOOL::setTransitions(), PL_DRAWING_TOOLS::setTransitions(), EE_POINT_EDITOR::setTransitions(), PL_POINT_EDITOR::setTransitions(), SCRIPTING_TOOL::setTransitions(), COMMON_CONTROL::setTransitions(), KICAD_MANAGER_CONTROL::setTransitions(), CONVERT_TOOL::setTransitions(), SYMBOL_EDITOR_DRAWING_TOOLS::setTransitions(), ZONE_FILLER_TOOL::setTransitions(), PCB_VIEWER_TOOLS::setTransitions(), MICROWAVE_TOOL::setTransitions(), EE_INSPECTION_TOOL::setTransitions(), PAD_TOOL::setTransitions(), PCB_POINT_EDITOR::setTransitions(), GERBVIEW_CONTROL::setTransitions(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::setTransitions(), GLOBAL_EDIT_TOOL::setTransitions(), GROUP_TOOL::setTransitions(), PL_EDITOR_CONTROL::setTransitions(), SYMBOL_EDITOR_EDIT_TOOL::setTransitions(), setTransitions(), SCH_MOVE_TOOL::setTransitions(), PL_EDIT_TOOL::setTransitions(), POSITION_RELATIVE_TOOL::setTransitions(), GERBVIEW_SELECTION_TOOL::setTransitions(), SCH_DRAWING_TOOLS::setTransitions(), FOOTPRINT_EDITOR_CONTROL::setTransitions(), SCH_EDIT_TOOL::setTransitions(), ALIGN_DISTRIBUTE_TOOL::setTransitions(), COMMON_TOOLS::setTransitions(), PCB_CONTROL::setTransitions(), EDA_3D_CONTROLLER::setTransitions(), DRC_TOOL::setTransitions(), CVPCB_CONTROL::setTransitions(), SCH_LINE_WIRE_BUS_TOOL::setTransitions(), CVPCB_ASSOCIATION_TOOL::setTransitions(), BOARD_INSPECTION_TOOL::setTransitions(), BOARD_EDITOR_CONTROL::setTransitions(), PICKER_TOOL::setTransitions(), EDIT_TOOL::setTransitions(), PCB_SELECTION_TOOL::setTransitions(), PL_SELECTION_TOOL::setTransitions(), SCH_EDITOR_CONTROL::setTransitions(), DRAWING_TOOL::setTransitions(), and EE_SELECTION_TOOL::setTransitions().

◆ Init()

bool SYMBOL_EDITOR_CONTROL::Init ( )
overridevirtual

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 41 of file symbol_editor_control.cpp.

42 {
43  m_frame = getEditFrame<SCH_BASE_FRAME>();
46 
47  if( m_isSymbolEditor )
48  {
49  CONDITIONAL_MENU& ctxMenu = m_menu.GetMenu();
50  SYMBOL_EDIT_FRAME* editFrame = getEditFrame<SYMBOL_EDIT_FRAME>();
51 
52  wxCHECK( editFrame, false );
53 
54  auto libSelectedCondition =
55  [ editFrame ]( const SELECTION& aSel )
56  {
57  LIB_ID sel = editFrame->GetTreeLIBID();
58  return !sel.GetLibNickname().empty() && sel.GetLibItemName().empty();
59  };
60  // The libInferredCondition allows you to do things like New Symbol and Paste with a
61  // symbol selected (in other words, when we know the library context even if the library
62  // itself isn't selected.
63  auto libInferredCondition =
64  [ editFrame ]( const SELECTION& aSel )
65  {
66  LIB_ID sel = editFrame->GetTreeLIBID();
67  return !sel.GetLibNickname().empty();
68  };
69  auto pinnedLibSelectedCondition =
70  [ editFrame ]( const SELECTION& aSel )
71  {
72  LIB_TREE_NODE* current = editFrame->GetCurrentTreeNode();
73  return current && current->m_Type == LIB_TREE_NODE::LIB && current->m_Pinned;
74  };
75  auto unpinnedLibSelectedCondition =
76  [ editFrame ](const SELECTION& aSel )
77  {
78  LIB_TREE_NODE* current = editFrame->GetCurrentTreeNode();
79  return current && current->m_Type == LIB_TREE_NODE::LIB && !current->m_Pinned;
80  };
81  auto symbolSelectedCondition =
82  [ editFrame ]( const SELECTION& aSel )
83  {
84  LIB_ID sel = editFrame->GetTreeLIBID();
85  return !sel.GetLibNickname().empty() && !sel.GetLibItemName().empty();
86  };
87  auto saveSymbolAsCondition =
88  [ editFrame ]( const SELECTION& aSel )
89  {
90  LIB_ID sel = editFrame->GetTargetLibId();
91  return !sel.GetLibNickname().empty() && !sel.GetLibItemName().empty();
92  };
93 
94  ctxMenu.AddItem( ACTIONS::pinLibrary, unpinnedLibSelectedCondition );
95  ctxMenu.AddItem( ACTIONS::unpinLibrary, pinnedLibSelectedCondition );
96 
97  ctxMenu.AddSeparator();
98  ctxMenu.AddItem( EE_ACTIONS::newSymbol, libInferredCondition );
99 
100  ctxMenu.AddSeparator();
101  ctxMenu.AddItem( ACTIONS::save, symbolSelectedCondition || libInferredCondition );
102  ctxMenu.AddItem( EE_ACTIONS::saveLibraryAs, libSelectedCondition );
103  ctxMenu.AddItem( EE_ACTIONS::saveSymbolAs, saveSymbolAsCondition );
104  ctxMenu.AddItem( ACTIONS::revert, symbolSelectedCondition || libInferredCondition );
105 
106  ctxMenu.AddSeparator();
107  ctxMenu.AddItem( EE_ACTIONS::cutSymbol, symbolSelectedCondition );
108  ctxMenu.AddItem( EE_ACTIONS::copySymbol, symbolSelectedCondition );
109  ctxMenu.AddItem( EE_ACTIONS::pasteSymbol, libInferredCondition );
110  ctxMenu.AddItem( EE_ACTIONS::duplicateSymbol, symbolSelectedCondition );
111  ctxMenu.AddItem( EE_ACTIONS::deleteSymbol, symbolSelectedCondition );
112 
113  ctxMenu.AddSeparator();
114  ctxMenu.AddItem( EE_ACTIONS::importSymbol, libInferredCondition );
115  ctxMenu.AddItem( EE_ACTIONS::exportSymbol, symbolSelectedCondition );
116 
117  // If we've got nothing else to show, at least show a hide tree option
118  ctxMenu.AddItem( EE_ACTIONS::hideSymbolTree, !libInferredCondition );
119  }
120 
121  return true;
122 }
static TOOL_ACTION pinLibrary
Definition: actions.h:109
const UTF8 & GetLibItemName() const
Definition: lib_id.h:104
TOOL_MENU m_menu
The functions below are not yet implemented - their interface may change.
static TOOL_ACTION pasteSymbol
Definition: ee_actions.h:174
static TOOL_ACTION hideSymbolTree
Definition: ee_actions.h:201
static TOOL_ACTION duplicateSymbol
Definition: ee_actions.h:170
CONDITIONAL_MENU & GetMenu()
Definition: tool_menu.cpp:46
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
static TOOL_ACTION unpinLibrary
Definition: actions.h:110
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
LIB_TREE_NODE * GetCurrentTreeNode() const
LIB_ID GetTreeLIBID(int *aUnit=nullptr) const
Return the LIB_ID of the library or symbol selected in the symbol tree.
static TOOL_ACTION save
Definition: actions.h:51
static TOOL_ACTION deleteSymbol
Definition: ee_actions.h:171
static TOOL_ACTION cutSymbol
Definition: ee_actions.h:172
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:90
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:177
static TOOL_ACTION importSymbol
Definition: ee_actions.h:175
Model class in the component selector Model-View-Adapter (mediated MVC) architecture.
void AddSeparator(int aOrder=ANY_ORDER)
Add a separator to the menu.
static TOOL_ACTION newSymbol
Definition: ee_actions.h:168
static TOOL_ACTION exportSymbol
Definition: ee_actions.h:176
static TOOL_ACTION copySymbol
Definition: ee_actions.h:173
static TOOL_ACTION saveSymbolAs
Definition: ee_actions.h:167
LIB_ID GetTargetLibId() const
bool IsType(FRAME_T aType) const
enum TYPE m_Type
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Add a menu entry to run a TOOL_ACTION on selected items.
static TOOL_ACTION revert
Definition: actions.h:55
static TOOL_ACTION saveLibraryAs
Definition: ee_actions.h:166
bool empty() const
Definition: utf8.h:103
The symbol library editor main window.

References CONDITIONAL_MENU::AddItem(), CONDITIONAL_MENU::AddSeparator(), EE_ACTIONS::copySymbol, EE_ACTIONS::cutSymbol, EE_ACTIONS::deleteSymbol, EE_ACTIONS::duplicateSymbol, UTF8::empty(), EE_ACTIONS::exportSymbol, FRAME_SCH_SYMBOL_EDITOR, SYMBOL_EDIT_FRAME::GetCurrentTreeNode(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), TOOL_MENU::GetMenu(), SYMBOL_EDIT_FRAME::GetTargetLibId(), TOOL_MANAGER::GetTool(), SYMBOL_EDIT_FRAME::GetTreeLIBID(), EE_ACTIONS::hideSymbolTree, EE_ACTIONS::importSymbol, EDA_BASE_FRAME::IsType(), LIB_TREE_NODE::LIB, EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, EE_TOOL_BASE< SCH_BASE_FRAME >::m_isSymbolEditor, TOOL_INTERACTIVE::m_menu, LIB_TREE_NODE::m_Pinned, EE_TOOL_BASE< SCH_BASE_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, LIB_TREE_NODE::m_Type, EE_ACTIONS::newSymbol, EE_ACTIONS::pasteSymbol, ACTIONS::pinLibrary, ACTIONS::revert, ACTIONS::save, EE_ACTIONS::saveLibraryAs, EE_ACTIONS::saveSymbolAs, and ACTIONS::unpinLibrary.

◆ 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:214
TOOL_ID m_toolId
Name of the tool.
Definition: tool_base.h:209
bool IsToolActive(TOOL_ID aId) const
Return true if a tool with given id is active (executing)

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

Referenced by ROUTER_TOOL::handleLayerSwitch(), EDIT_TOOL::isRouterActive(), PCB_SELECTION_TOOL::Main(), BOARD_EDITOR_CONTROL::TrackWidthDec(), and BOARD_EDITOR_CONTROL::TrackWidthInc().

◆ OnDeMorgan()

int SYMBOL_EDITOR_CONTROL::OnDeMorgan ( const TOOL_EVENT aEvent)

Definition at line 277 of file symbol_editor_control.cpp.

278 {
280  LIB_ITEM::LIB_CONVERT::BASE : LIB_ITEM::LIB_CONVERT::DEMORGAN;
281 
283  {
286 
287  SYMBOL_EDIT_FRAME* symbolEditor = static_cast<SYMBOL_EDIT_FRAME*>( m_frame );
288  symbolEditor->SetConvert( convert );
289 
291  symbolEditor->RebuildView();
292  }
294  {
295  SYMBOL_VIEWER_FRAME* symbolViewer = static_cast<SYMBOL_VIEWER_FRAME*>( m_frame );
296  symbolViewer->SetUnitAndConvert( symbolViewer->GetUnit(), convert );
297  }
298 
299  return 0;
300 }
Model changes (required full reload)
Definition: tool_base.h:80
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
static TOOL_ACTION cancelInteractive
Definition: actions.h:62
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
Symbol library viewer main window.
bool IsAction(const TOOL_ACTION *aAction) const
Test if the event contains an action issued upon activation of the given TOOL_ACTION.
Definition: tool_event.cpp:88
void SetConvert(int aConvert)
void ResetTools(TOOL_BASE::RESET_REASON aReason)
Reset all tools (i.e.
void SetUnitAndConvert(int aUnit, int aConvert)
Set unit and convert, and set flag preventing them from automatically resetting to 1.
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:53
static TOOL_ACTION showDeMorganStandard
Definition: ee_actions.h:123
bool IsType(FRAME_T aType) const
The symbol library editor main window.

References ACTIONS::cancelInteractive, EE_ACTIONS::clearSelection, convert, FRAME_SCH_SYMBOL_EDITOR, FRAME_SCH_VIEWER, FRAME_SCH_VIEWER_MODAL, SYMBOL_VIEWER_FRAME::GetUnit(), TOOL_EVENT::IsAction(), EDA_BASE_FRAME::IsType(), EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, TOOL_BASE::m_toolMgr, TOOL_BASE::MODEL_RELOAD, SYMBOL_EDIT_FRAME::RebuildView(), TOOL_MANAGER::ResetTools(), TOOL_MANAGER::RunAction(), SYMBOL_EDIT_FRAME::SetConvert(), SYMBOL_VIEWER_FRAME::SetUnitAndConvert(), and EE_ACTIONS::showDeMorganStandard.

Referenced by setTransitions().

◆ PinLibrary()

int SYMBOL_EDITOR_CONTROL::PinLibrary ( const TOOL_EVENT aEvent)

Definition at line 303 of file symbol_editor_control.cpp.

304 {
306  {
307  SYMBOL_EDIT_FRAME* editFrame = static_cast<SYMBOL_EDIT_FRAME*>( m_frame );
308  LIB_TREE_NODE* currentNode = editFrame->GetCurrentTreeNode();
309 
310  if( currentNode && !currentNode->m_Pinned )
311  {
312  currentNode->m_Pinned = true;
313  editFrame->RegenerateLibraryTree();
314  }
315  }
316 
317  return 0;
318 }
LIB_TREE_NODE * GetCurrentTreeNode() const
Model class in the component selector Model-View-Adapter (mediated MVC) architecture.
void RegenerateLibraryTree()
Filter, sort, and redisplay the library tree.
bool IsType(FRAME_T aType) const
The symbol library editor main window.

References FRAME_SCH_SYMBOL_EDITOR, SYMBOL_EDIT_FRAME::GetCurrentTreeNode(), EDA_BASE_FRAME::IsType(), EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, LIB_TREE_NODE::m_Pinned, and SYMBOL_EDIT_FRAME::RegenerateLibraryTree().

Referenced by setTransitions().

◆ Reset()

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

Bring 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 86 of file ee_tool_base.h.

87  {
88  if( aReason == MODEL_RELOAD )
89  {
90  // Init variables used by every drawing tool
91  m_frame = getEditFrame<T>();
92  m_isSymbolEditor = dynamic_cast<SYMBOL_EDIT_FRAME*>( m_frame ) != nullptr;
93  }
94 
95  m_view = static_cast<KIGFX::SCH_VIEW*>( getView() );
96  }
Model changes (required full reload)
Definition: tool_base.h:80
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36

◆ Revert()

int SYMBOL_EDITOR_CONTROL::Revert ( const TOOL_EVENT aEvent)

Definition at line 205 of file symbol_editor_control.cpp.

206 {
208  static_cast<SYMBOL_EDIT_FRAME*>( m_frame )->Revert();
209 
210  return 0;
211 }
bool IsType(FRAME_T aType) const

References FRAME_SCH_SYMBOL_EDITOR, EDA_BASE_FRAME::IsType(), and EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame.

Referenced by setTransitions().

◆ RunMainStack()

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

Call 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:214
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 SYMBOL_EDITOR_CONTROL::Save ( const TOOL_EVENT aEvt)

Definition at line 185 of file symbol_editor_control.cpp.

186 {
188  {
189  SYMBOL_EDIT_FRAME* editFrame = static_cast<SYMBOL_EDIT_FRAME*>( m_frame );
190 
191  if( aEvt.IsAction( &EE_ACTIONS::save ) )
192  editFrame->Save();
193  else if( aEvt.IsAction( &EE_ACTIONS::saveLibraryAs ) )
194  editFrame->SaveLibraryAs();
195  else if( aEvt.IsAction( &EE_ACTIONS::saveSymbolAs ) )
196  editFrame->SaveSymbolAs();
197  else if( aEvt.IsAction( &EE_ACTIONS::saveAll ) )
198  editFrame->SaveAll();
199  }
200 
201  return 0;
202 }
void Save()
Save the selected symbol or library.
void SaveAll()
Save all modified symbols and libraries.
bool IsAction(const TOOL_ACTION *aAction) const
Test if the event contains an action issued upon activation of the given TOOL_ACTION.
Definition: tool_event.cpp:88
void SaveSymbolAs()
Save the currently selected symbol to a new name and/or location.
static TOOL_ACTION save
Definition: actions.h:51
static TOOL_ACTION saveSymbolAs
Definition: ee_actions.h:167
bool IsType(FRAME_T aType) const
static TOOL_ACTION saveAll
Definition: actions.h:54
void SaveLibraryAs()
Save the currently selected library to a new file.
static TOOL_ACTION saveLibraryAs
Definition: ee_actions.h:166
The symbol library editor main window.

References FRAME_SCH_SYMBOL_EDITOR, TOOL_EVENT::IsAction(), EDA_BASE_FRAME::IsType(), EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, ACTIONS::save, SYMBOL_EDIT_FRAME::Save(), ACTIONS::saveAll, SYMBOL_EDIT_FRAME::SaveAll(), SYMBOL_EDIT_FRAME::SaveLibraryAs(), EE_ACTIONS::saveLibraryAs, SYMBOL_EDIT_FRAME::SaveSymbolAs(), and EE_ACTIONS::saveSymbolAs.

Referenced by setTransitions().

◆ saveCopyInUndoList()

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

Definition at line 134 of file ee_tool_base.h.

135  {
136  KICAD_T itemType = aItem->Type();
137  bool selected = aItem->IsSelected();
138 
139  // IS_SELECTED flag should not be set on undo items which were added for
140  // a drag operation.
141  if( selected && aItem->HasFlag( TEMP_SELECTED ) )
142  aItem->ClearSelected();
143 
144  if( m_isSymbolEditor )
145  {
146  SYMBOL_EDIT_FRAME* editFrame = dynamic_cast<SYMBOL_EDIT_FRAME*>( m_frame );
147  wxASSERT( editFrame );
148 
149  editFrame->SaveCopyInUndoList( static_cast<LIB_ITEM*>( aItem ), aType, aAppend );
150  }
151  else
152  {
153  SCH_EDIT_FRAME* editFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
154  wxASSERT( editFrame );
155 
156  if( itemType == SCH_PIN_T || itemType == SCH_FIELD_T || itemType == SCH_SHEET_PIN_T )
157  {
158  editFrame->SaveCopyInUndoList( editFrame->GetScreen(),
159  static_cast<SCH_ITEM*>( aItem->GetParent() ),
160  UNDO_REDO::CHANGED, aAppend );
161  }
162  else
163  {
164  editFrame->SaveCopyInUndoList( editFrame->GetScreen(),
165  static_cast<SCH_ITEM*>( aItem ),
166  aType, aAppend );
167  }
168  }
169 
170  if( selected && aItem->HasFlag( TEMP_SELECTED ) )
171  aItem->SetSelected();
172  }
bool IsSelected() const
Definition: eda_item.h:123
void ClearSelected()
Definition: eda_item.h:132
bool HasFlag(EDA_ITEM_FLAGS aFlag) const
Definition: eda_item.h:156
Schematic editor (Eeschema) main window.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void SetSelected()
Definition: eda_item.h:129
void SaveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aUndoType=UNDO_REDO::LIBEDIT, bool aAppend=false)
Create a copy of the current symbol, and save it in the undo list.
EDA_ITEM * GetParent() const
Definition: eda_item.h:115
#define TEMP_SELECTED
flag indicating that the structure has already selected
void SaveCopyInUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItemToCopy, UNDO_REDO aTypeCommand, bool aAppend)
Create a copy of the current schematic item, and put it in the undo list.
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113
The symbol library editor main window.

◆ SetContextMenu()

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

Assign 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:214
void SetTool(TOOL_INTERACTIVE *aTool)
Set a tool that is the creator of the menu.
void ScheduleContextMenu(TOOL_BASE *aTool, ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger)
Set behavior of the tool's context popup menu.

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

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), PCB_SELECTION_TOOL::doSelectionMenu(), TOOL_MENU::ShowContextMenu(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ setTransitions()

void SYMBOL_EDITOR_CONTROL::setTransitions ( )
overrideprivatevirtual

< Set up handlers for various events.

Implements TOOL_INTERACTIVE.

Definition at line 528 of file symbol_editor_control.cpp.

529 {
535 
541 
551 
554 
561 }
int ExportSymbol(const TOOL_EVENT &aEvent)
static TOOL_ACTION pinLibrary
Definition: actions.h:109
int ShowElectricalTypes(const TOOL_EVENT &aEvent)
static TOOL_ACTION pasteSymbol
Definition: ee_actions.h:174
static TOOL_ACTION hideSymbolTree
Definition: ee_actions.h:201
static TOOL_ACTION showSymbolTree
Definition: ee_actions.h:200
static TOOL_ACTION duplicateSymbol
Definition: ee_actions.h:170
int ExportView(const TOOL_EVENT &aEvent)
static TOOL_ACTION unpinLibrary
Definition: actions.h:110
static TOOL_ACTION showDeMorganAlternate
Definition: ee_actions.h:124
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Define which state (aStateFunc) to go when a certain event arrives (aConditions).
int CutCopyDelete(const TOOL_EVENT &aEvent)
int EditSymbol(const TOOL_EVENT &aEvent)
int AddLibrary(const TOOL_EVENT &aEvent)
static TOOL_ACTION editSymbol
Definition: ee_actions.h:169
int Revert(const TOOL_EVENT &aEvent)
int AddSymbolToSchematic(const TOOL_EVENT &aEvent)
static TOOL_ACTION save
Definition: actions.h:51
static TOOL_ACTION deleteSymbol
Definition: ee_actions.h:171
static TOOL_ACTION cutSymbol
Definition: ee_actions.h:172
static TOOL_ACTION addLibrary
Definition: actions.h:49
int ToggleSyncedPinsMode(const TOOL_EVENT &aEvent)
static TOOL_ACTION importSymbol
Definition: ee_actions.h:175
int DuplicateSymbol(const TOOL_EVENT &aEvent)
static TOOL_ACTION addSymbolToSchematic
Definition: ee_actions.h:163
static TOOL_ACTION newLibrary
Definition: actions.h:48
static TOOL_ACTION showDeMorganStandard
Definition: ee_actions.h:123
static TOOL_ACTION showElectricalTypes
Definition: ee_actions.h:199
static TOOL_ACTION exportSymbolView
Definition: ee_actions.h:204
static TOOL_ACTION newSymbol
Definition: ee_actions.h:168
static TOOL_ACTION exportSymbol
Definition: ee_actions.h:176
static TOOL_ACTION copySymbol
Definition: ee_actions.h:173
static TOOL_ACTION saveSymbolAs
Definition: ee_actions.h:167
int Save(const TOOL_EVENT &aEvt)
int ToggleSymbolTree(const TOOL_EVENT &aEvent)
int UnpinLibrary(const TOOL_EVENT &aEvent)
int OnDeMorgan(const TOOL_EVENT &aEvent)
static TOOL_ACTION toggleSyncedPinsMode
Definition: ee_actions.h:193
int AddSymbol(const TOOL_EVENT &aEvent)
static TOOL_ACTION saveAll
Definition: actions.h:54
int ExportSymbolAsSVG(const TOOL_EVENT &aEvent)
int PinLibrary(const TOOL_EVENT &aEvent)
static TOOL_ACTION exportSymbolAsSVG
Definition: ee_actions.h:205
static TOOL_ACTION revert
Definition: actions.h:55
static TOOL_ACTION saveLibraryAs
Definition: ee_actions.h:166

References AddLibrary(), ACTIONS::addLibrary, AddSymbol(), AddSymbolToSchematic(), EE_ACTIONS::addSymbolToSchematic, EE_ACTIONS::copySymbol, CutCopyDelete(), EE_ACTIONS::cutSymbol, EE_ACTIONS::deleteSymbol, DuplicateSymbol(), EE_ACTIONS::duplicateSymbol, EditSymbol(), EE_ACTIONS::editSymbol, ExportSymbol(), EE_ACTIONS::exportSymbol, ExportSymbolAsSVG(), EE_ACTIONS::exportSymbolAsSVG, EE_ACTIONS::exportSymbolView, ExportView(), TOOL_INTERACTIVE::Go(), EE_ACTIONS::hideSymbolTree, EE_ACTIONS::importSymbol, ACTIONS::newLibrary, EE_ACTIONS::newSymbol, OnDeMorgan(), EE_ACTIONS::pasteSymbol, PinLibrary(), ACTIONS::pinLibrary, Revert(), ACTIONS::revert, ACTIONS::save, Save(), ACTIONS::saveAll, EE_ACTIONS::saveLibraryAs, EE_ACTIONS::saveSymbolAs, EE_ACTIONS::showDeMorganAlternate, EE_ACTIONS::showDeMorganStandard, ShowElectricalTypes(), EE_ACTIONS::showElectricalTypes, EE_ACTIONS::showSymbolTree, ToggleSymbolTree(), ToggleSyncedPinsMode(), EE_ACTIONS::toggleSyncedPinsMode, UnpinLibrary(), and ACTIONS::unpinLibrary.

◆ ShowElectricalTypes()

int SYMBOL_EDITOR_CONTROL::ShowElectricalTypes ( const TOOL_EVENT aEvent)

Definition at line 351 of file symbol_editor_control.cpp.

352 {
354  renderSettings->m_ShowPinsElectricalType = !renderSettings->m_ShowPinsElectricalType;
355 
356  // Update canvas
358  m_frame->GetCanvas()->Refresh();
359 
360  return 0;
361 }
KIGFX::SCH_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
Definition: view.cpp:1430
KIGFX::SCH_RENDER_SETTINGS * GetRenderSettings()
Item needs to be redrawn.
Definition: view_item.h:57
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
Store schematic specific render settings.
Definition: sch_painter.h:70

References SCH_BASE_FRAME::GetCanvas(), SCH_BASE_FRAME::GetRenderSettings(), SCH_DRAW_PANEL::GetView(), EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, KIGFX::SCH_RENDER_SETTINGS::m_ShowPinsElectricalType, EDA_DRAW_PANEL_GAL::Refresh(), KIGFX::REPAINT, and KIGFX::VIEW::UpdateAllItems().

Referenced by setTransitions().

◆ ToggleSymbolTree()

int SYMBOL_EDITOR_CONTROL::ToggleSymbolTree ( const TOOL_EVENT aEvent)

Definition at line 339 of file symbol_editor_control.cpp.

340 {
342  {
343  wxCommandEvent dummy;
344  static_cast<SYMBOL_EDIT_FRAME*>( m_frame )->OnToggleSymbolTree( dummy );
345  }
346 
347  return 0;
348 }
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
Definition: sch_symbol.cpp:72
bool IsType(FRAME_T aType) const

References dummy(), FRAME_SCH_SYMBOL_EDITOR, EDA_BASE_FRAME::IsType(), and EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame.

Referenced by setTransitions().

◆ ToggleSyncedPinsMode()

int SYMBOL_EDITOR_CONTROL::ToggleSyncedPinsMode ( const TOOL_EVENT aEvent)

Definition at line 364 of file symbol_editor_control.cpp.

365 {
366  if( !m_isSymbolEditor )
367  return 0;
368 
369  SYMBOL_EDIT_FRAME* editFrame = getEditFrame<SYMBOL_EDIT_FRAME>();
370  editFrame->m_SyncPinEdit = !editFrame->m_SyncPinEdit;
371 
372  return 0;
373 }
bool m_SyncPinEdit
Set to true to synchronize pins at the same position when editing symbols with multiple units or mult...
The symbol library editor main window.

References EE_TOOL_BASE< SCH_BASE_FRAME >::m_isSymbolEditor, and SYMBOL_EDIT_FRAME::m_SyncPinEdit.

Referenced by setTransitions().

◆ UnpinLibrary()

int SYMBOL_EDITOR_CONTROL::UnpinLibrary ( const TOOL_EVENT aEvent)

Definition at line 321 of file symbol_editor_control.cpp.

322 {
324  {
325  SYMBOL_EDIT_FRAME* editFrame = static_cast<SYMBOL_EDIT_FRAME*>( m_frame );
326  LIB_TREE_NODE* currentNode = editFrame->GetCurrentTreeNode();
327 
328  if( currentNode && currentNode->m_Pinned )
329  {
330  currentNode->m_Pinned = false;
331  editFrame->RegenerateLibraryTree();
332  }
333  }
334 
335  return 0;
336 }
LIB_TREE_NODE * GetCurrentTreeNode() const
Model class in the component selector Model-View-Adapter (mediated MVC) architecture.
void RegenerateLibraryTree()
Filter, sort, and redisplay the library tree.
bool IsType(FRAME_T aType) const
The symbol library editor main window.

References FRAME_SCH_SYMBOL_EDITOR, SYMBOL_EDIT_FRAME::GetCurrentTreeNode(), EDA_BASE_FRAME::IsType(), EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, LIB_TREE_NODE::m_Pinned, and SYMBOL_EDIT_FRAME::RegenerateLibraryTree().

Referenced by setTransitions().

◆ updateItem()

void EE_TOOL_BASE< SCH_BASE_FRAME >::updateItem ( EDA_ITEM aItem,
bool  aUpdateRTree 
) const
inlineprotectedinherited

Similar to getView()->Update(), but handles items that are redrawn by their parents and updating the SCH_SCREEN's RTree.

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

Definition at line 103 of file ee_tool_base.h.

◆ Wait()

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

Suspend 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:214
TOOL_EVENT * ScheduleWait(TOOL_BASE *aTool, const TOOL_EVENT_LIST &aConditions)
Pause 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(), EDIT_TOOL::doMoveSelection(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), PCB_SELECTION_TOOL::doSelectionMenu(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), ZOOM_TOOL::Main(), PCB_PICKER_TOOL::Main(), EE_POINT_EDITOR::Main(), PL_EDIT_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), CVPCB_CONTROL::Main(), PL_POINT_EDITOR::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), PL_SELECTION_TOOL::Main(), EDA_3D_CONTROLLER::Main(), GERBVIEW_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), PCB_SELECTION_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), PCB_POINT_EDITOR::OnSelectionChange(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), GROUP_TOOL::PickNewMember(), EDIT_TOOL::pickReferencePoint(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), GERBVIEW_SELECTION_TOOL::selectPoint(), PCB_SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), ZOOM_TOOL::selectRegion(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

Member Data Documentation

◆ m_frame

SCH_BASE_FRAME * EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame
protectedinherited

Definition at line 175 of file ee_tool_base.h.

◆ m_isSymbolEditor

bool EE_TOOL_BASE< SCH_BASE_FRAME >::m_isSymbolEditor
protectedinherited

Definition at line 178 of file ee_tool_base.h.

◆ m_menu

TOOL_MENU TOOL_INTERACTIVE::m_menu
protectedinherited

The functions below are not yet implemented - their interface may change.

Definition at line 125 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(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), TOOL_INTERACTIVE::GetToolMenu(), ROUTER_TOOL::Init(), LENGTH_TUNER_TOOL::Init(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Init(), PL_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), PAD_TOOL::Init(), PL_DRAWING_TOOLS::Init(), SYMBOL_EDITOR_DRAWING_TOOLS::Init(), Init(), PCB_VIEWER_TOOLS::Init(), FOOTPRINT_EDITOR_CONTROL::Init(), PL_SELECTION_TOOL::Init(), SCH_DRAWING_TOOLS::Init(), BOARD_EDITOR_CONTROL::Init(), GERBVIEW_SELECTION_TOOL::Init(), EDA_3D_CONTROLLER::Init(), DRAWING_TOOL::Init(), EE_SELECTION_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), PCB_SELECTION_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), PCB_TOOL_BASE::Init(), PICKER_TOOL::Init(), DRAWING_TOOL::InteractivePlaceWithPreview(), PCB_PICKER_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), PL_EDIT_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), EDA_3D_CONTROLLER::Main(), PL_SELECTION_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), PCB_SELECTION_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ m_selectionTool

EE_SELECTION_TOOL* EE_TOOL_BASE< SCH_BASE_FRAME >::m_selectionTool
protectedinherited

Definition at line 177 of file ee_tool_base.h.

◆ m_toolId

TOOL_ID TOOL_BASE::m_toolId
protectedinherited

Name of the tool.

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

Definition at line 209 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 214 of file tool_base.h.

Referenced by TOOL_INTERACTIVE::Activate(), PL_SELECTION_TOOL::AddItemsToSel(), EE_SELECTION_TOOL::AddItemsToSel(), PL_SELECTION_TOOL::AddItemToSel(), PCB_SELECTION_TOOL::AddItemToSel(), EE_SELECTION_TOOL::AddItemToSel(), SCH_MOVE_TOOL::AlignElements(), SCH_EDITOR_CONTROL::AssignNetclass(), CVPCB_ASSOCIATION_TOOL::Associate(), TOOL_BASE::attachManager(), SCH_EDIT_TOOL::AutoplaceFields(), SCH_EDIT_TOOL::BreakWire(), BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), ROUTER_TOOL::CanInlineDrag(), SCH_EDIT_TOOL::ChangeTextType(), EDIT_TOOL::ChangeTrackWidth(), SCH_EDIT_TOOL::CleanupSheetPins(), GERBVIEW_CONTROL::ClearAllLayers(), BOARD_INSPECTION_TOOL::ClearHighlight(), SCH_EDITOR_CONTROL::ClearHighlight(), PL_SELECTION_TOOL::ClearSelection(), PCB_SELECTION_TOOL::ClearSelection(), GERBVIEW_SELECTION_TOOL::clearSelection(), EE_SELECTION_TOOL::ClearSelection(), SCH_EDIT_TOOL::ConvertDeMorgan(), PL_EDIT_TOOL::Copy(), SYMBOL_EDITOR_EDIT_TOOL::Copy(), PAD_TOOL::copyPadSettings(), EDIT_TOOL::copyToClipboard(), MICROWAVE_TOOL::createInductorBetween(), BOARD_INSPECTION_TOOL::CrossProbePcbToSch(), COMMON_TOOLS::CursorControl(), SCH_EDITOR_CONTROL::Cut(), SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), PL_SELECTION_TOOL::disambiguateCursor(), EE_SELECTION_TOOL::disambiguateCursor(), PCB_SELECTION_TOOL::disambiguateCursor(), SCH_EDITOR_CONTROL::doCopy(), SCH_EDITOR_CONTROL::doCrossProbeSchToPcb(), SYMBOL_EDITOR_EDIT_TOOL::DoDelete(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), BOARD_INSPECTION_TOOL::doHideNet(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), COMMON_TOOLS::doZoomInOut(), COMMON_TOOLS::doZoomToPreset(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawRectangle(), DRAWING_TOOL::drawSegment(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), BOARD_EDITOR_CONTROL::DrillOrigin(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), EDIT_TOOL::Duplicate(), SCH_EDIT_TOOL::EditField(), SCH_EDIT_TOOL::editFieldText(), BOARD_EDITOR_CONTROL::EditFpInFpEditor(), SYMBOL_EDITOR_EDIT_TOOL::editGraphicProperties(), PAD_TOOL::EditPad(), SYMBOL_EDITOR_EDIT_TOOL::editSymbolProperties(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), GROUP_TOOL::EnterGroup(), SCH_NAVIGATE_TOOL::EnterSheet(), SCH_EDITOR_CONTROL::EnterSheet(), PAD_TOOL::EnumeratePads(), EE_INSPECTION_TOOL::ExcludeMarker(), PCB_SELECTION_TOOL::expandConnection(), PAD_TOOL::explodePad(), PCB_SELECTION_TOOL::filterSelection(), PCB_SELECTION_TOOL::FindItem(), SCH_EDITOR_CONTROL::FindSymbolAndItem(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), EDIT_TOOL::Flip(), EDIT_TOOL::GetAndPlace(), TOOL_BASE::GetManager(), TOOL_BASE::getModelInt(), DRAWING_TOOL::getSourceZoneForAction(), TOOL_BASE::getToolHolderInt(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), TOOL_INTERACTIVE::goInternal(), COMMON_TOOLS::GridNext(), COMMON_TOOLS::GridPreset(), COMMON_TOOLS::GridPrev(), PCB_CONTROL::GridSetOrigin(), GROUP_TOOL::Group(), GERBVIEW_CONTROL::HighlightControl(), BOARD_INSPECTION_TOOL::HighlightItem(), BOARD_INSPECTION_TOOL::HighlightNet(), SCH_EDITOR_CONTROL::HighlightNet(), BOARD_INSPECTION_TOOL::highlightNet(), SCH_EDITOR_CONTROL::HighlightNetCursor(), PL_EDIT_TOOL::ImportDrawingSheetContent(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), BOARD_REANNOTATE_TOOL::Init(), SYMBOL_EDITOR_EDIT_TOOL::Init(), PL_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), GROUP_TOOL::Init(), PAD_TOOL::Init(), CONVERT_TOOL::Init(), PL_DRAWING_TOOLS::Init(), GLOBAL_EDIT_TOOL::Init(), Init(), PL_POINT_EDITOR::Init(), BOARD_INSPECTION_TOOL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), PCB_POINT_EDITOR::Init(), BOARD_EDITOR_CONTROL::Init(), POSITION_RELATIVE_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectConstraints(), DRAWING_TOOL::InteractivePlaceWithPreview(), EDIT_TOOL::invokeInlineRouter(), EDIT_TOOL::isInteractiveDragEnabled(), EDIT_TOOL::isRouterActive(), TOOL_BASE::IsToolActive(), GROUP_TOOL::LeaveGroup(), SCH_NAVIGATE_TOOL::LeaveSheet(), SCH_EDITOR_CONTROL::LeaveSheet(), COMMON_CONTROL::ListHotKeys(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), PCB_PICKER_TOOL::Main(), PL_EDIT_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), CVPCB_CONTROL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), PL_SELECTION_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), PCB_SELECTION_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), PCB_VIEWER_TOOLS::MeasureTool(), SYMBOL_EDITOR_EDIT_TOOL::Mirror(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::Mirror(), BOARD_EDITOR_CONTROL::modifyLockSelected(), EDIT_TOOL::MoveExact(), OnDeMorgan(), PL_SELECTION_TOOL::onDisambiguationExpire(), EE_SELECTION_TOOL::onDisambiguationExpire(), PCB_SELECTION_TOOL::onDisambiguationExpire(), COMMON_TOOLS::OnGridChanged(), PCB_POINT_EDITOR::OnSelectionChange(), PL_EDIT_TOOL::Paste(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), PAD_TOOL::pastePadProperties(), ROUTER_TOOL::performRouting(), GROUP_TOOL::PickNewMember(), EDIT_TOOL::pickReferencePoint(), SYMBOL_EDITOR_EDIT_TOOL::PinTable(), PCB_CONTROL::placeBoardItems(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), PCB_CONTROL::Print(), GERBVIEW_CONTROL::Print(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), PAD_TOOL::pushPadSettings(), EE_SELECTION_TOOL::RebuildSelection(), SYMBOL_EDITOR_EDIT_TOOL::Redo(), SCH_EDITOR_CONTROL::Redo(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), EDIT_TOOL::Remove(), PCB_POINT_EDITOR::removeCorner(), GROUP_TOOL::RemoveFromGroup(), PL_SELECTION_TOOL::RemoveItemFromSel(), EE_SELECTION_TOOL::RemoveItemFromSel(), PCB_SELECTION_TOOL::RemoveItemFromSel(), PL_SELECTION_TOOL::RemoveItemsFromSel(), EE_SELECTION_TOOL::RemoveItemsFromSel(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDITOR_DRAWING_TOOLS::RepeatDrawItem(), EE_SELECTION_TOOL::RequestSelection(), PCB_SELECTION_TOOL::RequestSelection(), COMMON_TOOLS::Reset(), PNS::TOOL_BASE::Reset(), EDA_3D_CONTROLLER::Reset(), COMMON_TOOLS::ResetLocalCoords(), TOOL_INTERACTIVE::resetTransitions(), SYMBOL_EDITOR_EDIT_TOOL::Rotate(), SCH_EDIT_TOOL::Rotate(), EDIT_TOOL::Rotate(), TOOL_INTERACTIVE::RunMainStack(), DRC_TOOL::RunTests(), EE_SELECTION_TOOL::Selectable(), EE_SELECTION_TOOL::SelectConnection(), PCB_TOOL_BASE::selection(), COMMON_TOOLS::SelectionTool(), GERBVIEW_SELECTION_TOOL::SelectItem(), GERBVIEW_SELECTION_TOOL::SelectItems(), PCB_SELECTION_TOOL::SelectItems(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectNet(), PL_SELECTION_TOOL::SelectPoint(), GERBVIEW_SELECTION_TOOL::selectPoint(), EE_SELECTION_TOOL::selectPoint(), PCB_SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), PCB_SELECTION_TOOL::selectSameSheet(), PCB_SELECTION_TOOL::selectSheetContents(), DRAWING_TOOL::SetAnchor(), TOOL_INTERACTIVE::SetContextMenu(), EDA_3D_CONTROLLER::SetMaterial(), DRC_TOOL::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), EDA_3D_CONTROLLER::ToggleVisibility(), BOARD_EDITOR_CONTROL::TrackWidthDec(), BOARD_EDITOR_CONTROL::TrackWidthInc(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_EDIT_TOOL::Undo(), SCH_EDITOR_CONTROL::Undo(), GROUP_TOOL::Ungroup(), GERBVIEW_SELECTION_TOOL::UnselectItem(), GERBVIEW_SELECTION_TOOL::UnselectItems(), PCB_SELECTION_TOOL::UnselectItems(), PNS::TOOL_BASE::updateEndItem(), EE_INSPECTION_TOOL::UpdateMessagePanel(), GERBVIEW_CONTROL::UpdateMessagePanel(), PL_EDITOR_CONTROL::UpdateMessagePanel(), PCB_CONTROL::UpdateMessagePanel(), EDIT_TOOL::updateModificationPoint(), BOARD_INSPECTION_TOOL::UpdateSelectionRatsnest(), PNS::TOOL_BASE::updateStartItem(), BOARD_EDITOR_CONTROL::ViaSizeDec(), BOARD_EDITOR_CONTROL::ViaSizeInc(), TOOL_INTERACTIVE::Wait(), BOARD_EDITOR_CONTROL::ZoneDuplicate(), and BOARD_EDITOR_CONTROL::ZoneMerge().

◆ m_toolName

std::string TOOL_BASE::m_toolName
protectedinherited

Definition at line 213 of file tool_base.h.

Referenced by TOOL_BASE::GetName().

◆ m_type

TOOL_TYPE TOOL_BASE::m_type
protectedinherited

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

Definition at line 206 of file tool_base.h.

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

◆ m_view

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

Definition at line 176 of file ee_tool_base.h.


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