KiCad PCB EDA Suite
LIB_CONTROL Class Reference

LIB_CONTROL. More...

#include <lib_control.h>

Inheritance diagram for LIB_CONTROL:
EE_TOOL_BASE< SCH_BASE_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

 LIB_CONTROL ()
 
virtual ~LIB_CONTROL ()
 
bool Init () override
 Function Init() 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 ShowComponentTree (const TOOL_EVENT &aEvent)
 
int ToggleSyncedPinsMode (const TOOL_EVENT &aEvent)
 
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_BASE_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

void setTransitions () override
 

Sets up handlers for various events.

More...
 

Detailed Description

LIB_CONTROL.

Handles actions for the various symbol editor and viewers.

Definition at line 39 of file lib_control.h.

Member Enumeration Documentation

◆ RESET_REASON

enum TOOL_BASE::RESET_REASON
inherited

Determines the reason of reset for a tool

Enumerator
RUN 

Tool is invoked after being inactive.

MODEL_RELOAD 

Model changes (required full reload)

GAL_SWITCH 

Rendering engine changes.

Definition at line 79 of file tool_base.h.

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

Constructor & Destructor Documentation

◆ LIB_CONTROL()

LIB_CONTROL::LIB_CONTROL ( )
inline

Definition at line 42 of file lib_control.h.

42  :
43  EE_TOOL_BASE<SCH_BASE_FRAME>( "eeschema.SymbolLibraryControl" )
44  { }

◆ ~LIB_CONTROL()

virtual LIB_CONTROL::~LIB_CONTROL ( )
inlinevirtual

Definition at line 46 of file lib_control.h.

46 { }

Member Function Documentation

◆ Activate()

void TOOL_INTERACTIVE::Activate ( )
inherited

Function Activate() Runs the tool.

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

Definition at line 51 of file tool_interactive.cpp.

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

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

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

◆ AddLibrary()

int LIB_CONTROL::AddLibrary ( const TOOL_EVENT aEvent)

Definition at line 102 of file lib_control.cpp.

103 {
104  bool createNew = aEvent.IsAction( &ACTIONS::newLibrary );
105 
107  static_cast<LIB_EDIT_FRAME*>( m_frame )->AddLibraryFile( createNew );
108 
109  return 0;
110 }
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
static TOOL_ACTION newLibrary
Definition: actions.h:51
bool IsType(FRAME_T aType) const

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

Referenced by setTransitions().

◆ AddSymbol()

int LIB_CONTROL::AddSymbol ( const TOOL_EVENT aEvent)

Definition at line 128 of file lib_control.cpp.

129 {
131  {
132  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
133 
134  if( aEvent.IsAction( &EE_ACTIONS::newSymbol ) )
135  editFrame->CreateNewPart();
136  else if( aEvent.IsAction( &EE_ACTIONS::importSymbol ) )
137  editFrame->ImportPart();
138  }
139 
140  return 0;
141 }
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
static TOOL_ACTION importSymbol
Definition: ee_actions.h:172
void ImportPart()
Definition: lib_export.cpp:37
static TOOL_ACTION newSymbol
Definition: ee_actions.h:165
The symbol library editor main window.
bool IsType(FRAME_T aType) const
void CreateNewPart()
Creates a new part in the selected library.

References LIB_EDIT_FRAME::CreateNewPart(), FRAME_SCH_LIB_EDITOR, LIB_EDIT_FRAME::ImportPart(), EE_ACTIONS::importSymbol, TOOL_EVENT::IsAction(), EDA_BASE_FRAME::IsType(), EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, and EE_ACTIONS::newSymbol.

Referenced by setTransitions().

◆ AddSymbolToSchematic()

int LIB_CONTROL::AddSymbolToSchematic ( const TOOL_EVENT aEvent)

Definition at line 393 of file lib_control.cpp.

394 {
395  LIB_PART* part = nullptr;
396  LIB_ID libId;
397  int unit, convert;
398 
399  if( m_isLibEdit )
400  {
401  LIB_EDIT_FRAME* editFrame = getEditFrame<LIB_EDIT_FRAME>();
402 
403  part = editFrame->GetCurPart();
404  unit = editFrame->GetUnit();
405  convert = editFrame->GetConvert();
406 
407  if( part )
408  libId = part->GetLibId();
409  }
410  else
411  {
412  LIB_VIEW_FRAME* viewFrame = getEditFrame<LIB_VIEW_FRAME>();
413 
414  if( viewFrame->IsModal() )
415  {
416  // if we're modal then we just need to return the symbol selection; the caller is
417  // already in a EE_ACTIONS::placeSymbol coroutine.
418  viewFrame->FinishModal();
419  return 0;
420  }
421  else
422  {
423  part = viewFrame->GetSelectedSymbol();
424  unit = viewFrame->GetUnit();
425  convert = viewFrame->GetConvert();
426 
427  if( part )
428  libId = part->GetLibId();
429  }
430  }
431 
432  if( part )
433  {
434  SCH_EDIT_FRAME* schframe = (SCH_EDIT_FRAME*) m_frame->Kiway().Player( FRAME_SCH, false );
435 
436  if( !schframe ) // happens when the schematic editor is not active (or closed)
437  {
438  DisplayErrorMessage( m_frame, _( "No schematic currently open." ) );
439  return 0;
440  }
441 
442  wxCHECK( part->GetLibId().IsValid(), 0 );
443 
444  SCH_COMPONENT* comp =
445  new SCH_COMPONENT( *part, libId, &schframe->GetCurrentSheet(), unit, convert );
446 
447  comp->SetParent( schframe->GetCurrentSheet().LastScreen() );
448 
449  if( schframe->eeconfig()->m_AutoplaceFields.enable )
450  comp->AutoplaceFields( /* aScreen */ nullptr, /* aManual */ false );
451 
452  schframe->Raise();
453  schframe->GetToolManager()->RunAction( EE_ACTIONS::placeSymbol, true, comp );
454  }
455 
456  return 0;
457 }
LIB_PART * GetSelectedSymbol() const
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
LIB_ID GetLibId() const override
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:252
int GetConvert() const
int GetUnit() const
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:140
Schematic editor (Eeschema) main window.
LIB_PART * GetCurPart()
Return the current part being edited or NULL if none selected.
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
bool IsValid() const
Definition: lib_id.h:171
Symbol library viewer main window.
virtual void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:196
int GetConvert() const
EESCHEMA_SETTINGS * eeconfig() const
AUTOPLACE_FIELDS m_AutoplaceFields
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:342
Define a library symbol object.
static TOOL_ACTION placeSymbol
Definition: ee_actions.h:77
The symbol library editor main window.
SCH_SCREEN * LastScreen()
Function LastScreen.
#define _(s)
Definition: 3d_actions.cpp:33
void FinishModal()
Send the selected symbol back to the caller.
bool IsModal() const
Definition: kiway_player.h:176
Schematic symbol object.
Definition: sch_component.h:88
SCH_SHEET_PATH & GetCurrentSheet() const
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:74

References _, DisplayErrorMessage(), SCH_BASE_FRAME::eeconfig(), EESCHEMA_SETTINGS::AUTOPLACE_FIELDS::enable, LIB_VIEW_FRAME::FinishModal(), FRAME_SCH, LIB_VIEW_FRAME::GetConvert(), LIB_EDIT_FRAME::GetConvert(), LIB_EDIT_FRAME::GetCurPart(), SCH_EDIT_FRAME::GetCurrentSheet(), LIB_PART::GetLibId(), LIB_VIEW_FRAME::GetSelectedSymbol(), TOOLS_HOLDER::GetToolManager(), LIB_VIEW_FRAME::GetUnit(), LIB_EDIT_FRAME::GetUnit(), KIWAY_PLAYER::IsModal(), LIB_ID::IsValid(), KIWAY_HOLDER::Kiway(), SCH_SHEET_PATH::LastScreen(), EESCHEMA_SETTINGS::m_AutoplaceFields, EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, EE_TOOL_BASE< SCH_BASE_FRAME >::m_isLibEdit, EE_ACTIONS::placeSymbol, KIWAY::Player(), TOOL_MANAGER::RunAction(), and EDA_ITEM::SetParent().

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

References TOOL_BASE::m_toolMgr.

Referenced by TOOL_MANAGER::RegisterTool().

◆ CutCopyDelete()

int LIB_CONTROL::CutCopyDelete ( const TOOL_EVENT aEvent)

Definition at line 180 of file lib_control.cpp.

181 {
183  {
184  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
185 
186  if( aEvt.IsAction( &EE_ACTIONS::cutSymbol ) || aEvt.IsAction( &EE_ACTIONS::copySymbol ) )
187  editFrame->CopyPartToClipboard();
188 
189  if( aEvt.IsAction( &EE_ACTIONS::cutSymbol ) || aEvt.IsAction( &EE_ACTIONS::deleteSymbol ) )
190  editFrame->DeletePartFromLibrary();
191  }
192 
193  return 0;
194 }
static TOOL_ACTION deleteSymbol
Definition: ee_actions.h:168
static TOOL_ACTION cutSymbol
Definition: ee_actions.h:169
static TOOL_ACTION copySymbol
Definition: ee_actions.h:170
The symbol library editor main window.
bool IsType(FRAME_T aType) const

References LIB_EDIT_FRAME::CopyPartToClipboard(), EE_ACTIONS::copySymbol, EE_ACTIONS::cutSymbol, LIB_EDIT_FRAME::DeletePartFromLibrary(), EE_ACTIONS::deleteSymbol, FRAME_SCH_LIB_EDITOR, TOOL_EVENT::IsAction(), EDA_BASE_FRAME::IsType(), and EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame.

Referenced by setTransitions().

◆ DuplicateSymbol()

int LIB_CONTROL::DuplicateSymbol ( const TOOL_EVENT aEvent)

Definition at line 197 of file lib_control.cpp.

198 {
200  {
201  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
202  editFrame->DuplicatePart( aEvent.IsAction( &EE_ACTIONS::pasteSymbol ) );
203  }
204 
205  return 0;
206 }
void DuplicatePart(bool aFromClipboard)
Inserts a duplicate part.
static TOOL_ACTION pasteSymbol
Definition: ee_actions.h:171
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
The symbol library editor main window.
bool IsType(FRAME_T aType) const

References LIB_EDIT_FRAME::DuplicatePart(), FRAME_SCH_LIB_EDITOR, TOOL_EVENT::IsAction(), EDA_BASE_FRAME::IsType(), EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, and EE_ACTIONS::pasteSymbol.

Referenced by setTransitions().

◆ EditSymbol()

int LIB_CONTROL::EditSymbol ( const TOOL_EVENT aEvent)

Definition at line 113 of file lib_control.cpp.

114 {
116  {
117  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
118  int unit = 0;
119  LIB_ID partId = editFrame->GetTreeLIBID( &unit );
120 
121  editFrame->LoadPart( partId.GetLibItemName(), partId.GetLibNickname(), unit );
122  }
123 
124  return 0;
125 }
const UTF8 & GetLibItemName() const
Definition: lib_id.h:114
void LoadPart(const wxString &aLibrary, const wxString &aPart, int Unit)
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.
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:97
The symbol library editor main window.
bool IsType(FRAME_T aType) const

References FRAME_SCH_LIB_EDITOR, LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), LIB_EDIT_FRAME::GetTreeLIBID(), EDA_BASE_FRAME::IsType(), LIB_EDIT_FRAME::LoadPart(), and EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame.

Referenced by setTransitions().

◆ ExportSymbol()

int LIB_CONTROL::ExportSymbol ( const TOOL_EVENT aEvent)

Definition at line 171 of file lib_control.cpp.

172 {
174  static_cast<LIB_EDIT_FRAME*>( m_frame )->ExportPart();
175 
176  return 0;
177 }
bool IsType(FRAME_T aType) const

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

Referenced by setTransitions().

◆ ExportSymbolAsSVG()

int LIB_CONTROL::ExportSymbolAsSVG ( const TOOL_EVENT aEvent)

Definition at line 348 of file lib_control.cpp.

349 {
350  if( !m_isLibEdit )
351  return 0;
352 
353  LIB_EDIT_FRAME* editFrame = getEditFrame<LIB_EDIT_FRAME>();
354  LIB_PART* part = editFrame->GetCurPart();
355 
356  if( !part )
357  {
358  wxMessageBox( _( "No symbol to export" ) );
359  return 0;
360  }
361 
362  wxString file_ext = wxT( "svg" );
363  wxString mask = wxT( "*." ) + file_ext;
364  wxFileName fn( part->GetName() );
365  fn.SetExt( file_ext );
366 
367  wxString pro_dir = wxPathOnly( m_frame->Prj().GetProjectFullName() );
368 
369  wxString fullFileName = EDA_FILE_SELECTOR( _( "Filename:" ), pro_dir, fn.GetFullName(),
370  file_ext, mask, m_frame, wxFD_SAVE, true );
371 
372  if( !fullFileName.IsEmpty() )
373  {
374  PAGE_INFO pageSave = editFrame->GetScreen()->GetPageSettings();
375  PAGE_INFO pageTemp = pageSave;
376 
377  wxSize componentSize = part->GetUnitBoundingBox( editFrame->GetUnit(),
378  editFrame->GetConvert() ).GetSize();
379 
380  // Add a small margin to the plot bounding box
381  pageTemp.SetWidthMils( int( componentSize.x * 1.2 ) );
382  pageTemp.SetHeightMils( int( componentSize.y * 1.2 ) );
383 
384  editFrame->GetScreen()->SetPageSettings( pageTemp );
385  editFrame->SVG_PlotComponent( fullFileName );
386  editFrame->GetScreen()->SetPageSettings( pageSave );
387  }
388 
389  return 0;
390 }
void SVG_PlotComponent(const wxString &aFullFileName)
Creates the SVG print file for the current edited component.
int GetConvert() const
wxString GetName() const override
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:181
LIB_PART * GetCurPart()
Return the current part being edited or NULL if none selected.
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:180
int GetUnit() const
PAGE_INFO describes the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:54
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
wxString EDA_FILE_SELECTOR(const wxString &aTitle, const wxString &aPath, const wxString &aFileName, const wxString &aExtension, const wxString &aWildcard, wxWindow *aParent, int aStyle, const bool aKeepWorkingDirectory, const wxPoint &aPosition, wxString *aMruPath)
Function EDA_FILE_SELECTOR.
Definition: gestfich.cpp:52
Define a library symbol object.
VTBL_ENTRY const wxString GetProjectFullName() const
Function GetProjectFullName returns the full path and name of the project.
Definition: project.cpp:116
void SetHeightMils(int aHeightInMils)
Definition: page_info.cpp:253
The symbol library editor main window.
#define _(s)
Definition: 3d_actions.cpp:33
void SetWidthMils(int aWidthInMils)
Definition: page_info.cpp:239
const EDA_RECT GetUnitBoundingBox(int aUnit, int aConvert) const
Get the bounding box for the symbol.

References _, EDA_FILE_SELECTOR(), LIB_EDIT_FRAME::GetConvert(), LIB_EDIT_FRAME::GetCurPart(), LIB_PART::GetName(), SCH_SCREEN::GetPageSettings(), PROJECT::GetProjectFullName(), SCH_BASE_FRAME::GetScreen(), LIB_EDIT_FRAME::GetUnit(), LIB_PART::GetUnitBoundingBox(), EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, EE_TOOL_BASE< SCH_BASE_FRAME >::m_isLibEdit, KIWAY_HOLDER::Prj(), PAGE_INFO::SetHeightMils(), SCH_SCREEN::SetPageSettings(), PAGE_INFO::SetWidthMils(), and LIB_EDIT_FRAME::SVG_PlotComponent().

Referenced by setTransitions().

◆ ExportView()

int LIB_CONTROL::ExportView ( const TOOL_EVENT aEvent)

Definition at line 308 of file lib_control.cpp.

309 {
310  if( !m_isLibEdit )
311  return 0;
312 
313  LIB_EDIT_FRAME* editFrame = getEditFrame<LIB_EDIT_FRAME>();
314  LIB_PART* part = editFrame->GetCurPart();
315 
316  if( !part )
317  {
318  wxMessageBox( _( "No symbol to export" ) );
319  return 0;
320  }
321 
322  wxString file_ext = wxT( "png" );
323  wxString mask = wxT( "*." ) + file_ext;
324  wxFileName fn( part->GetName() );
325  fn.SetExt( "png" );
326 
327  wxString projectPath = wxPathOnly( m_frame->Prj().GetProjectFullName() );
328 
329  wxFileDialog dlg( editFrame, _( "Image File Name" ), projectPath, fn.GetFullName(),
330  PngFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
331 
332  if( dlg.ShowModal() == wxID_OK && !dlg.GetPath().IsEmpty() )
333  {
334  // calling wxYield is mandatory under Linux, after closing the file selector dialog
335  // to refresh the screen before creating the PNG or JPEG image from screen
336  wxYield();
337 
338  if( !SaveCanvasImageToFile( editFrame, dlg.GetPath(), wxBITMAP_TYPE_PNG ) )
339  {
340  wxMessageBox( wxString::Format( _( "Can't save file \"%s\"." ), dlg.GetPath() ) );
341  }
342  }
343 
344  return 0;
345 }
wxString GetName() const override
bool SaveCanvasImageToFile(EDA_DRAW_FRAME *aFrame, const wxString &aFileName, wxBitmapType aBitmapType)
Save the current view as an image file.
Definition: bitmap.cpp:177
LIB_PART * GetCurPart()
Return the current part being edited or NULL if none selected.
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
Define a library symbol object.
VTBL_ENTRY const wxString GetProjectFullName() const
Function GetProjectFullName returns the full path and name of the project.
Definition: project.cpp:116
wxString PngFileWildcard()
The symbol library editor main window.
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

References _, Format(), LIB_EDIT_FRAME::GetCurPart(), LIB_PART::GetName(), PROJECT::GetProjectFullName(), EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, EE_TOOL_BASE< SCH_BASE_FRAME >::m_isLibEdit, PngFileWildcard(), KIWAY_HOLDER::Prj(), and SaveCanvasImageToFile().

Referenced by setTransitions().

◆ getEditFrame()

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

Function getEditFrame()

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

Definition at line 187 of file tool_base.h.

188  {
189 #if !defined( QA_TEST ) // Dynamic casts give the linker a siezure in the test framework
190  wxASSERT( dynamic_cast<T*>( getToolHolderInt() ) );
191 #endif
192  return static_cast<T*>( getToolHolderInt() );
193  }
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

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

The identifier is set by an instance of TOOL_MANAGER.

Returns
Identifier of the tool.

Definition at line 121 of file tool_base.h.

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

References TOOL_BASE::m_toolId.

Referenced by TOOL_MANAGER::finishTool(), TOOL_MANAGER::InitTools(), TOOL_MANAGER::isActive(), TOOL_MANAGER::RegisterTool(), ACTION_MANAGER::RunHotKey(), TOOL_MANAGER::runTool(), 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 143 of file tool_base.h.

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

References TOOL_BASE::m_toolMgr.

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

◆ getModel()

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

Function getModel()

Returns the model object if it matches the requested type.

Definition at line 201 of file tool_base.h.

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

References TOOL_BASE::getModelInt().

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

◆ GetName()

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

Function GetName() Returns the name of the tool.

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

Returns
The name of the tool.

Definition at line 132 of file tool_base.h.

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

References TOOL_BASE::m_toolName.

Referenced by TOOL_MANAGER::dispatchInternal(), TOOL_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 110 of file tool_base.h.

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

References TOOL_BASE::m_type.

Referenced by TOOL_MANAGER::finishTool(), TOOL_MANAGER::InvokeTool(), TOOL_MANAGER::ResetTools(), 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:284
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219

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

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

◆ getViewControls()

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

Function getViewControls()

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

Returns
The instance of VIEW_CONTROLS.

Definition at line 42 of file tool_base.cpp.

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

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

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

◆ Go()

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

Function Go()

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

Definition at line 129 of file tool_interactive.h.

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

References TOOL_INTERACTIVE::goInternal().

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

◆ Init()

bool LIB_CONTROL::Init ( )
overridevirtual

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 39 of file lib_control.cpp.

40 {
41  m_frame = getEditFrame<SCH_BASE_FRAME>();
44 
45  if( m_isLibEdit )
46  {
47  CONDITIONAL_MENU& ctxMenu = m_menu.GetMenu();
48  LIB_EDIT_FRAME* editFrame = getEditFrame<LIB_EDIT_FRAME>();
49 
50  auto libSelectedCondition = [ editFrame ] ( const SELECTION& aSel ) {
51  LIB_ID sel = editFrame->GetTreeLIBID();
52  return !sel.GetLibNickname().empty() && sel.GetLibItemName().empty();
53  };
54  auto pinnedLibSelectedCondition = [ editFrame ] ( const SELECTION& aSel ) {
55  LIB_TREE_NODE* current = editFrame->GetCurrentTreeNode();
56  return current && current->m_Type == LIB_TREE_NODE::LIB && current->m_Pinned;
57  };
58  auto unpinnedLibSelectedCondition = [ editFrame ] (const SELECTION& aSel ) {
59  LIB_TREE_NODE* current = editFrame->GetCurrentTreeNode();
60  return current && current->m_Type == LIB_TREE_NODE::LIB && !current->m_Pinned;
61  };
62  auto symbolSelectedCondition = [ editFrame ] ( const SELECTION& aSel ) {
63  LIB_ID sel = editFrame->GetTreeLIBID();
64  return !sel.GetLibNickname().empty() && !sel.GetLibItemName().empty();
65  };
66 
67  ctxMenu.AddItem( ACTIONS::pinLibrary, unpinnedLibSelectedCondition );
68  ctxMenu.AddItem( ACTIONS::unpinLibrary, pinnedLibSelectedCondition );
69  ctxMenu.AddSeparator();
70 
73  ctxMenu.AddItem( ACTIONS::save, libSelectedCondition );
74  ctxMenu.AddItem( ACTIONS::saveAs, libSelectedCondition );
75  ctxMenu.AddItem( ACTIONS::revert, libSelectedCondition );
76 
77  ctxMenu.AddSeparator();
79  ctxMenu.AddItem( EE_ACTIONS::editSymbol, symbolSelectedCondition );
80 
81  ctxMenu.AddSeparator();
82  ctxMenu.AddItem( ACTIONS::save, symbolSelectedCondition );
83  ctxMenu.AddItem( ACTIONS::saveCopyAs, symbolSelectedCondition );
84  ctxMenu.AddItem( EE_ACTIONS::duplicateSymbol, symbolSelectedCondition );
85  ctxMenu.AddItem( EE_ACTIONS::deleteSymbol, symbolSelectedCondition );
86  ctxMenu.AddItem( ACTIONS::revert, symbolSelectedCondition );
87 
88  ctxMenu.AddSeparator();
89  ctxMenu.AddItem( EE_ACTIONS::cutSymbol, symbolSelectedCondition );
90  ctxMenu.AddItem( EE_ACTIONS::copySymbol, symbolSelectedCondition );
92 
93  ctxMenu.AddSeparator();
95  ctxMenu.AddItem( EE_ACTIONS::exportSymbol, symbolSelectedCondition );
96  }
97 
98  return true;
99 }
static bool ShowAlways(const SELECTION &aSelection)
Function ShowAlways The default condition function (always returns true).
static TOOL_ACTION pinLibrary
Definition: actions.h:105
const UTF8 & GetLibItemName() const
Definition: lib_id.h:114
TOOL_MENU m_menu
functions below are not yet implemented - their interface may change
static TOOL_ACTION pasteSymbol
Definition: ee_actions.h:171
static TOOL_ACTION duplicateSymbol
Definition: ee_actions.h:167
CONDITIONAL_MENU & GetMenu()
Function GetMenu.
Definition: tool_menu.cpp:46
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
static TOOL_ACTION unpinLibrary
Definition: actions.h:106
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
static TOOL_ACTION saveCopyAs
Definition: actions.h:56
LIB_ID GetTreeLIBID(int *aUnit=nullptr) const
Return the LIB_ID of the library or symbol selected in the symbol tree.
static TOOL_ACTION editSymbol
Definition: ee_actions.h:166
static TOOL_ACTION save
Definition: actions.h:54
static TOOL_ACTION deleteSymbol
Definition: ee_actions.h:168
static TOOL_ACTION cutSymbol
Definition: ee_actions.h:169
static TOOL_ACTION addLibrary
Definition: actions.h:52
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:97
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:160
static TOOL_ACTION importSymbol
Definition: ee_actions.h:172
Model class in the component selector Model-View-Adapter (mediated MVC) architecture.
static TOOL_ACTION newLibrary
Definition: actions.h:51
void AddSeparator(int aOrder=ANY_ORDER)
Function AddSeparator()
static TOOL_ACTION newSymbol
Definition: ee_actions.h:165
static TOOL_ACTION exportSymbol
Definition: ee_actions.h:173
static TOOL_ACTION copySymbol
Definition: ee_actions.h:170
The symbol library editor main window.
bool IsType(FRAME_T aType) const
static TOOL_ACTION saveAs
Definition: actions.h:55
enum TYPE m_Type
LIB_TREE_NODE * GetCurrentTreeNode() const
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Function AddItem()
static TOOL_ACTION revert
Definition: actions.h:58
bool empty() const
Definition: utf8.h:108

References CONDITIONAL_MENU::AddItem(), ACTIONS::addLibrary, CONDITIONAL_MENU::AddSeparator(), EE_ACTIONS::copySymbol, EE_ACTIONS::cutSymbol, EE_ACTIONS::deleteSymbol, EE_ACTIONS::duplicateSymbol, EE_ACTIONS::editSymbol, UTF8::empty(), EE_ACTIONS::exportSymbol, FRAME_SCH_LIB_EDITOR, LIB_EDIT_FRAME::GetCurrentTreeNode(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), TOOL_MENU::GetMenu(), TOOL_MANAGER::GetTool(), LIB_EDIT_FRAME::GetTreeLIBID(), 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_isLibEdit, 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, ACTIONS::newLibrary, EE_ACTIONS::newSymbol, EE_ACTIONS::pasteSymbol, ACTIONS::pinLibrary, ACTIONS::revert, ACTIONS::save, ACTIONS::saveAs, ACTIONS::saveCopyAs, SELECTION_CONDITIONS::ShowAlways(), 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:219
TOOL_ID m_toolId
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:214
bool IsToolActive(TOOL_ID aId) const
Function IsToolActive() Returns true if a tool with given id is active (executing)

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

Referenced by ROUTER_TOOL::onViaCommand().

◆ OnDeMorgan()

int LIB_CONTROL::OnDeMorgan ( const TOOL_EVENT aEvent)

Definition at line 209 of file lib_control.cpp.

210 {
211  int convert = aEvent.IsAction( &EE_ACTIONS::showDeMorganStandard ) ?
212  LIB_ITEM::LIB_CONVERT::BASE : LIB_ITEM::LIB_CONVERT::DEMORGAN;
213 
215  {
218 
219  LIB_EDIT_FRAME* libEditFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
220  libEditFrame->SetConvert( convert );
221 
223  libEditFrame->RebuildView();
224  }
226  {
227  LIB_VIEW_FRAME* libViewFrame = static_cast<LIB_VIEW_FRAME*>( m_frame );
228  libViewFrame->SetUnitAndConvert( libViewFrame->GetUnit(), convert );
229  }
230 
231  return 0;
232 }
void SetUnitAndConvert(int aUnit, int aConvert)
Set unit and convert, and set flag preventing them from automatically resetting to 1.
Model changes (required full reload)
Definition: tool_base.h:82
int GetUnit() const
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
static TOOL_ACTION cancelInteractive
Definition: actions.h:65
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:140
Symbol library viewer main window.
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
void ResetTools(TOOL_BASE::RESET_REASON aReason)
Function ResetTools() Resets all tools (i.e.
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:56
static TOOL_ACTION showDeMorganStandard
Definition: ee_actions.h:126
The symbol library editor main window.
bool IsType(FRAME_T aType) const
void SetConvert(int aConvert)

References ACTIONS::cancelInteractive, EE_ACTIONS::clearSelection, FRAME_SCH_LIB_EDITOR, FRAME_SCH_VIEWER, FRAME_SCH_VIEWER_MODAL, LIB_VIEW_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, LIB_EDIT_FRAME::RebuildView(), TOOL_MANAGER::ResetTools(), TOOL_MANAGER::RunAction(), LIB_EDIT_FRAME::SetConvert(), LIB_VIEW_FRAME::SetUnitAndConvert(), and EE_ACTIONS::showDeMorganStandard.

Referenced by setTransitions().

◆ PinLibrary()

int LIB_CONTROL::PinLibrary ( const TOOL_EVENT aEvent)

Definition at line 235 of file lib_control.cpp.

236 {
238  {
239  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
240  LIB_TREE_NODE* currentNode = editFrame->GetCurrentTreeNode();
241 
242  if( currentNode && !currentNode->m_Pinned )
243  {
244  currentNode->m_Pinned = true;
245  editFrame->RegenerateLibraryTree();
246  }
247  }
248 
249  return 0;
250 }
void RegenerateLibraryTree()
Filter, sort, and redisplay the library tree.
Model class in the component selector Model-View-Adapter (mediated MVC) architecture.
The symbol library editor main window.
bool IsType(FRAME_T aType) const
LIB_TREE_NODE * GetCurrentTreeNode() const

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

Referenced by setTransitions().

◆ Reset()

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

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

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

Parameters
aReasoncontains information about the reason of tool reset.

Implements TOOL_BASE.

Definition at line 90 of file ee_tool_base.h.

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

◆ Revert()

int LIB_CONTROL::Revert ( const TOOL_EVENT aEvent)

Definition at line 162 of file lib_control.cpp.

163 {
165  static_cast<LIB_EDIT_FRAME*>( m_frame )->Revert();
166 
167  return 0;
168 }
bool IsType(FRAME_T aType) const

References FRAME_SCH_LIB_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

Function RunMainStack()

Calls a function using the main stack.

Parameters
aFuncis the function to be calls.

Definition at line 87 of file tool_interactive.cpp.

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

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

Referenced by DRAWING_TOOL::PlaceText().

◆ Save()

int LIB_CONTROL::Save ( const TOOL_EVENT aEvt)

Definition at line 144 of file lib_control.cpp.

145 {
147  {
148  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
149 
150  if( aEvt.IsAction( &EE_ACTIONS::save ) )
151  editFrame->Save();
152  else if( aEvt.IsAction( &EE_ACTIONS::saveAs ) || aEvt.IsAction( &EE_ACTIONS::saveCopyAs ) )
153  editFrame->SaveAs();
154  else if( aEvt.IsAction( &EE_ACTIONS::saveAll ) )
155  editFrame->SaveAll();
156  }
157 
158  return 0;
159 }
static TOOL_ACTION saveCopyAs
Definition: actions.h:56
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
void Save()
Saves the selected part or library.
void SaveAs()
Saves the selected part or library to a new name and/or location.
void SaveAll()
Saves all modified parts and libraries.
static TOOL_ACTION save
Definition: actions.h:54
The symbol library editor main window.
bool IsType(FRAME_T aType) const
static TOOL_ACTION saveAs
Definition: actions.h:55
static TOOL_ACTION saveAll
Definition: actions.h:57

References FRAME_SCH_LIB_EDITOR, TOOL_EVENT::IsAction(), EDA_BASE_FRAME::IsType(), EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame, ACTIONS::save, LIB_EDIT_FRAME::Save(), ACTIONS::saveAll, LIB_EDIT_FRAME::SaveAll(), ACTIONS::saveAs, LIB_EDIT_FRAME::SaveAs(), and ACTIONS::saveCopyAs.

Referenced by setTransitions().

◆ saveCopyInUndoList()

void EE_TOOL_BASE< SCH_BASE_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  {
141  editFrame->SaveCopyInUndoList( editFrame->GetScreen(),
142  static_cast<SCH_ITEM*>( aItem->GetParent() ),
143  UR_CHANGED, aAppend );
144  }
145  else
146  {
147  editFrame->SaveCopyInUndoList( editFrame->GetScreen(),
148  static_cast<SCH_ITEM*>( aItem ),
149  aType, aAppend );
150  }
151  }
152 
153  if( selected && aItem->HasFlag( TEMP_SELECTED ) )
154  aItem->SetSelected();
155  }
#define TEMP_SELECTED
flag indicating that the structure has already selected
Definition: base_struct.h:125
bool IsSelected() const
Definition: base_struct.h:203
void ClearSelected()
Definition: base_struct.h:211
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
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void SetSelected()
Definition: base_struct.h:208
EDA_ITEM * GetParent() const
Definition: base_struct.h:195
The symbol library editor main window.
void SaveCopyInUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, bool aAppend, const wxPoint &aTransformPoint=wxPoint(0, 0))
Create a copy of the current schematic item, and put it in the undo list.
bool HasFlag(STATUS_FLAGS aFlag)
Definition: base_struct.h:235
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:193

◆ SetContextMenu()

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

Function SetContextMenu()

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

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

Definition at line 76 of file tool_interactive.cpp.

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

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

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

◆ setTransitions()

void LIB_CONTROL::setTransitions ( )
overrideprivatevirtual

Sets up handlers for various events.

Implements TOOL_INTERACTIVE.

Definition at line 460 of file lib_control.cpp.

461 {
467 
468  Go( &LIB_CONTROL::Save, ACTIONS::save.MakeEvent() );
469  Go( &LIB_CONTROL::Save, ACTIONS::saveAs.MakeEvent() ); // for libraries
470  Go( &LIB_CONTROL::Save, ACTIONS::saveCopyAs.MakeEvent() ); // for symbols
471  Go( &LIB_CONTROL::Save, ACTIONS::saveAll.MakeEvent() );
472  Go( &LIB_CONTROL::Revert, ACTIONS::revert.MakeEvent() );
473 
483 
486 
492 }
static TOOL_ACTION pinLibrary
Definition: actions.h:105
int AddLibrary(const TOOL_EVENT &aEvent)
int UnpinLibrary(const TOOL_EVENT &aEvent)
int EditSymbol(const TOOL_EVENT &aEvent)
static TOOL_ACTION pasteSymbol
Definition: ee_actions.h:171
int PinLibrary(const TOOL_EVENT &aEvent)
int ToggleSyncedPinsMode(const TOOL_EVENT &aEvent)
static TOOL_ACTION duplicateSymbol
Definition: ee_actions.h:167
int AddSymbol(const TOOL_EVENT &aEvent)
int ShowElectricalTypes(const TOOL_EVENT &aEvent)
static TOOL_ACTION unpinLibrary
Definition: actions.h:106
int ExportView(const TOOL_EVENT &aEvent)
static TOOL_ACTION showComponentTree
Definition: ee_actions.h:194
int ExportSymbol(const TOOL_EVENT &aEvent)
static TOOL_ACTION showDeMorganAlternate
Definition: ee_actions.h:127
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Function Go()
static TOOL_ACTION saveCopyAs
Definition: actions.h:56
static TOOL_ACTION editSymbol
Definition: ee_actions.h:166
static TOOL_ACTION save
Definition: actions.h:54
int Save(const TOOL_EVENT &aEvt)
static TOOL_ACTION deleteSymbol
Definition: ee_actions.h:168
static TOOL_ACTION cutSymbol
Definition: ee_actions.h:169
static TOOL_ACTION addLibrary
Definition: actions.h:52
static TOOL_ACTION importSymbol
Definition: ee_actions.h:172
static TOOL_ACTION addSymbolToSchematic
Definition: ee_actions.h:162
int AddSymbolToSchematic(const TOOL_EVENT &aEvent)
static TOOL_ACTION newLibrary
Definition: actions.h:51
static TOOL_ACTION showDeMorganStandard
Definition: ee_actions.h:126
static TOOL_ACTION showElectricalTypes
Definition: ee_actions.h:193
static TOOL_ACTION exportSymbolView
Definition: ee_actions.h:197
static TOOL_ACTION newSymbol
Definition: ee_actions.h:165
static TOOL_ACTION exportSymbol
Definition: ee_actions.h:173
static TOOL_ACTION copySymbol
Definition: ee_actions.h:170
int CutCopyDelete(const TOOL_EVENT &aEvent)
int Revert(const TOOL_EVENT &aEvent)
static TOOL_ACTION saveAs
Definition: actions.h:55
static TOOL_ACTION toggleSyncedPinsMode
Definition: ee_actions.h:187
int ExportSymbolAsSVG(const TOOL_EVENT &aEvent)
static TOOL_ACTION saveAll
Definition: actions.h:57
int DuplicateSymbol(const TOOL_EVENT &aEvent)
static TOOL_ACTION exportSymbolAsSVG
Definition: ee_actions.h:198
int ShowComponentTree(const TOOL_EVENT &aEvent)
static TOOL_ACTION revert
Definition: actions.h:58
int OnDeMorgan(const TOOL_EVENT &aEvent)

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::importSymbol, ACTIONS::newLibrary, EE_ACTIONS::newSymbol, OnDeMorgan(), EE_ACTIONS::pasteSymbol, PinLibrary(), ACTIONS::pinLibrary, Revert(), ACTIONS::revert, ACTIONS::save, Save(), ACTIONS::saveAll, ACTIONS::saveAs, ACTIONS::saveCopyAs, ShowComponentTree(), EE_ACTIONS::showComponentTree, EE_ACTIONS::showDeMorganAlternate, EE_ACTIONS::showDeMorganStandard, ShowElectricalTypes(), EE_ACTIONS::showElectricalTypes, ToggleSyncedPinsMode(), EE_ACTIONS::toggleSyncedPinsMode, UnpinLibrary(), and ACTIONS::unpinLibrary.

◆ ShowComponentTree()

int LIB_CONTROL::ShowComponentTree ( const TOOL_EVENT aEvent)

Definition at line 271 of file lib_control.cpp.

272 {
274  {
275  wxCommandEvent dummy;
276  static_cast<LIB_EDIT_FRAME*>( m_frame )->OnToggleSearchTree( dummy );
277  }
278 
279  return 0;
280 }
bool IsType(FRAME_T aType) const
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.

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

Referenced by setTransitions().

◆ ShowElectricalTypes()

int LIB_CONTROL::ShowElectricalTypes ( const TOOL_EVENT aEvent)

Definition at line 283 of file lib_control.cpp.

284 {
286  renderSettings->m_ShowPinsElectricalType = !renderSettings->m_ShowPinsElectricalType;
287 
288  // Update canvas
290  m_frame->GetCanvas()->Refresh();
291 
292  return 0;
293 }
KIGFX::SCH_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
void UpdateAllItems(int aUpdateFlags)
Updates all items in the view according to the given flags.
Definition: view.cpp:1444
KIGFX::SCH_RENDER_SETTINGS * GetRenderSettings()
Item is being added to the view.
Definition: view_item.h:62
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=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
SCH_RENDER_SETTINGS Stores 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().

◆ ToggleSyncedPinsMode()

int LIB_CONTROL::ToggleSyncedPinsMode ( const TOOL_EVENT aEvent)

Definition at line 296 of file lib_control.cpp.

297 {
298  if( !m_isLibEdit )
299  return 0;
300 
301  LIB_EDIT_FRAME* editFrame = getEditFrame<LIB_EDIT_FRAME>();
302  editFrame->m_SyncPinEdit = !editFrame->m_SyncPinEdit;
303 
304  return 0;
305 }
The symbol library editor main window.
bool m_SyncPinEdit
Set to true to synchronize pins at the same position when editing symbols with multiple units or mult...

References EE_TOOL_BASE< SCH_BASE_FRAME >::m_isLibEdit, and LIB_EDIT_FRAME::m_SyncPinEdit.

Referenced by setTransitions().

◆ UnpinLibrary()

int LIB_CONTROL::UnpinLibrary ( const TOOL_EVENT aEvent)

Definition at line 253 of file lib_control.cpp.

254 {
256  {
257  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
258  LIB_TREE_NODE* currentNode = editFrame->GetCurrentTreeNode();
259 
260  if( currentNode && currentNode->m_Pinned )
261  {
262  currentNode->m_Pinned = false;
263  editFrame->RegenerateLibraryTree();
264  }
265  }
266 
267  return 0;
268 }
void RegenerateLibraryTree()
Filter, sort, and redisplay the library tree.
Model class in the component selector Model-View-Adapter (mediated MVC) architecture.
The symbol library editor main window.
bool IsType(FRAME_T aType) const
LIB_TREE_NODE * GetCurrentTreeNode() const

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

Referenced by setTransitions().

◆ updateView()

void EE_TOOL_BASE< SCH_BASE_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:195
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:193

◆ Wait()

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

Function Wait()

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

Definition at line 57 of file tool_interactive.cpp.

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

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

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

Member Data Documentation

◆ m_frame

SCH_BASE_FRAME * EE_TOOL_BASE< SCH_BASE_FRAME >::m_frame
protectedinherited

Definition at line 158 of file ee_tool_base.h.

◆ m_isLibEdit

bool EE_TOOL_BASE< SCH_BASE_FRAME >::m_isLibEdit
protectedinherited

Definition at line 161 of file ee_tool_base.h.

◆ m_menu

TOOL_MENU TOOL_INTERACTIVE::m_menu
protectedinherited

functions below are not yet implemented - their interface may change

Definition at line 108 of file tool_interactive.h.

Referenced by SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), TOOL_INTERACTIVE::GetToolMenu(), PICKER_TOOL::Init(), PL_EDIT_TOOL::Init(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Init(), SCH_EDIT_TOOL::Init(), LIB_DRAWING_TOOLS::Init(), FOOTPRINT_EDITOR_TOOLS::Init(), PCB_VIEWER_TOOLS::Init(), PL_DRAWING_TOOLS::Init(), Init(), PCB_EDITOR_CONTROL::Init(), SCH_DRAWING_TOOLS::Init(), EDA_3D_CONTROLLER::Init(), GERBVIEW_SELECTION_TOOL::Init(), PL_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(), PL_EDIT_TOOL::Main(), LIB_MOVE_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), EDA_3D_CONTROLLER::Main(), PICKER_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), PL_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), SELECTION_TOOL::Main(), PCB_VIEWER_TOOLS::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ m_selectionTool

EE_SELECTION_TOOL* EE_TOOL_BASE< SCH_BASE_FRAME >::m_selectionTool
protectedinherited

Definition at line 160 of file ee_tool_base.h.

◆ m_toolId

TOOL_ID TOOL_BASE::m_toolId
protectedinherited

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

Definition at line 214 of file tool_base.h.

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

◆ m_toolMgr

TOOL_MANAGER* TOOL_BASE::m_toolMgr
protectedinherited

Definition at line 219 of file tool_base.h.

Referenced by TOOL_INTERACTIVE::Activate(), PL_SELECTION_TOOL::AddItemsToSel(), EE_SELECTION_TOOL::AddItemsToSel(), PL_SELECTION_TOOL::AddItemToSel(), EE_SELECTION_TOOL::AddItemToSel(), SELECTION_TOOL::AddItemToSel(), SCH_EDITOR_CONTROL::AssignNetclass(), CVPCB_ASSOCIATION_TOOL::Associate(), TOOL_BASE::attachManager(), SCH_EDIT_TOOL::AutoplaceFields(), PCB_INSPECTION_TOOL::calculateSelectionRatsnest(), ROUTER_TOOL::CanInlineDrag(), SCH_EDIT_TOOL::ChangeTextType(), EDIT_TOOL::ChangeTrackWidth(), SCH_EDIT_TOOL::CleanupSheetPins(), PCB_INSPECTION_TOOL::ClearHighlight(), SCH_EDITOR_CONTROL::ClearHighlight(), SELECTION_TOOL::ClearSelection(), PL_SELECTION_TOOL::ClearSelection(), GERBVIEW_SELECTION_TOOL::clearSelection(), EE_SELECTION_TOOL::ClearSelection(), SCH_EDIT_TOOL::ConvertDeMorgan(), LIB_EDIT_TOOL::Copy(), PL_EDIT_TOOL::Copy(), PAD_TOOL::copyPadSettings(), MICROWAVE_TOOL::createInductorBetween(), PCB_INSPECTION_TOOL::CrossProbePcbToSch(), COMMON_TOOLS::CursorControl(), ROUTER_TOOL::CustomTrackWidthDialog(), SCH_EDITOR_CONTROL::Cut(), LIB_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), SCH_EDITOR_CONTROL::doCopy(), SCH_EDITOR_CONTROL::doCrossProbeSchToPcb(), LIB_EDIT_TOOL::DoDelete(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_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(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PCB_EDITOR_CONTROL::DrillOrigin(), LIB_EDIT_TOOL::Duplicate(), SCH_EDIT_TOOL::Duplicate(), EDIT_TOOL::Duplicate(), SCH_EDIT_TOOL::EditField(), SCH_EDIT_TOOL::editFieldText(), PCB_EDITOR_CONTROL::EditFpInFpEditor(), LIB_EDIT_TOOL::editGraphicProperties(), PAD_TOOL::EditPad(), LIB_EDIT_TOOL::editSymbolProperties(), SCH_EDITOR_CONTROL::EditWithLibEdit(), SCH_EDITOR_CONTROL::EnterSheet(), PAD_TOOL::EnumeratePads(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), SELECTION_TOOL::expandConnection(), PAD_TOOL::explodePad(), SELECTION_TOOL::filterSelection(), SELECTION_TOOL::findCallback(), SCH_EDITOR_CONTROL::FindComponentAndItem(), POINT_EDITOR::finishItem(), 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(), PCBNEW_CONTROL::GridSetOrigin(), GERBVIEW_CONTROL::HighlightControl(), PCB_INSPECTION_TOOL::HighlightItem(), PCB_INSPECTION_TOOL::HighlightNet(), SCH_EDITOR_CONTROL::HighlightNet(), PCB_INSPECTION_TOOL::highlightNet(), SCH_EDITOR_CONTROL::HighlightNetCursor(), PCB_INSPECTION_TOOL::HighlightNetTool(), FOOTPRINT_EDITOR_TOOLS::ImportFootprint(), PL_EDIT_TOOL::ImportWorksheetContent(), LIB_EDIT_TOOL::Init(), PL_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), PCB_INSPECTION_TOOL::Init(), GLOBAL_EDIT_TOOL::Init(), PAD_TOOL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), PL_DRAWING_TOOLS::Init(), Init(), PL_POINT_EDITOR::Init(), POINT_EDITOR::Init(), PCB_EDITOR_CONTROL::Init(), POSITION_RELATIVE_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), EDIT_TOOL::invokeInlineRouter(), EDIT_TOOL::isInteractiveDragEnabled(), TOOL_BASE::IsToolActive(), SCH_EDITOR_CONTROL::LeaveSheet(), COMMON_CONTROL::ListHotKeys(), PCB_INSPECTION_TOOL::LocalRatsnestTool(), PL_EDIT_TOOL::Main(), CVPCB_CONTROL::Main(), LIB_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), PL_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), SELECTION_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), PCB_VIEWER_TOOLS::MeasureTool(), LIB_EDIT_TOOL::Mirror(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::Mirror(), PCB_EDITOR_CONTROL::modifyLockSelected(), EDIT_TOOL::MoveExact(), OnDeMorgan(), COMMON_TOOLS::OnGridChanged(), POINT_EDITOR::OnSelectionChange(), LIB_EDIT_TOOL::Paste(), PL_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), PAD_TOOL::pastePadProperties(), EDIT_TOOL::pickReferencePoint(), LIB_EDIT_TOOL::PinTable(), PCBNEW_CONTROL::placeBoardItems(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), PCBNEW_CONTROL::Print(), GERBVIEW_CONTROL::Print(), LIB_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), PAD_TOOL::pushPadSettings(), EE_SELECTION_TOOL::RebuildSelection(), LIB_EDIT_TOOL::Redo(), SCH_EDITOR_CONTROL::Redo(), SCH_EDIT_TOOL::RefreshSymbolFromLibrary(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), EDIT_TOOL::Remove(), POINT_EDITOR::removeCorner(), PL_SELECTION_TOOL::RemoveItemFromSel(), EE_SELECTION_TOOL::RemoveItemFromSel(), SELECTION_TOOL::RemoveItemFromSel(), PL_SELECTION_TOOL::RemoveItemsFromSel(), EE_SELECTION_TOOL::RemoveItemsFromSel(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_DRAWING_TOOLS::RepeatDrawItem(), EE_SELECTION_TOOL::RequestSelection(), SELECTION_TOOL::RequestSelection(), COMMON_TOOLS::Reset(), PNS::TOOL_BASE::Reset(), EDA_3D_CONTROLLER::Reset(), 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(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectNet(), PL_SELECTION_TOOL::SelectPoint(), GERBVIEW_SELECTION_TOOL::selectPoint(), EE_SELECTION_TOOL::SelectPoint(), SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), SELECTION_TOOL::selectSameSheet(), SELECTION_TOOL::selectSheetContents(), DRAWING_TOOL::SetAnchor(), TOOL_INTERACTIVE::SetContextMenu(), DRC::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), EDA_3D_CONTROLLER::ToggleVisibility(), PCB_EDITOR_CONTROL::TrackWidthDec(), PCB_EDITOR_CONTROL::TrackWidthInc(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), LIB_EDIT_TOOL::Undo(), SCH_EDITOR_CONTROL::Undo(), GERBVIEW_SELECTION_TOOL::UnselectItem(), GERBVIEW_SELECTION_TOOL::UnselectItems(), SELECTION_TOOL::UnselectItems(), EE_INSPECTION_TOOL::UpdateMessagePanel(), GERBVIEW_CONTROL::UpdateMessagePanel(), PL_EDITOR_CONTROL::UpdateMessagePanel(), PCBNEW_CONTROL::UpdateMessagePanel(), PCB_INSPECTION_TOOL::UpdateSelectionRatsnest(), PCB_EDITOR_CONTROL::ViaSizeDec(), PCB_EDITOR_CONTROL::ViaSizeInc(), TOOL_INTERACTIVE::Wait(), PCB_EDITOR_CONTROL::ZoneDuplicate(), and PCB_EDITOR_CONTROL::ZoneMerge().

◆ m_toolName

std::string TOOL_BASE::m_toolName
protectedinherited

Name of the tool.

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

Definition at line 218 of file tool_base.h.

Referenced by TOOL_BASE::GetName().

◆ m_type

TOOL_TYPE TOOL_BASE::m_type
protectedinherited

Stores the type of the tool.

Definition at line 211 of file tool_base.h.

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

◆ m_view

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

Definition at line 159 of file ee_tool_base.h.


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