KiCad PCB EDA Suite
LIB_EDIT_TOOL Class Reference

#include <lib_edit_tool.h>

Inheritance diagram for LIB_EDIT_TOOL:
EE_TOOL_BASE< LIB_EDIT_FRAME > TOOL_INTERACTIVE TOOL_BASE

Public Types

enum  RESET_REASON { RUN, MODEL_RELOAD, GAL_SWITCH }
 

Determines the reason of reset for a tool

More...
 

Public Member Functions

 LIB_EDIT_TOOL ()
 
 ~LIB_EDIT_TOOL () override
 
bool Init () override
 Function Init() Init() is called once upon a registration of the tool. More...
 
int Rotate (const TOOL_EVENT &aEvent)
 
int Mirror (const TOOL_EVENT &aEvent)
 
int Duplicate (const TOOL_EVENT &aEvent)
 
int Properties (const TOOL_EVENT &aEvent)
 
int PinTable (const TOOL_EVENT &aEvent)
 
int Undo (const TOOL_EVENT &aEvent)
 
int Redo (const TOOL_EVENT &aEvent)
 
int Cut (const TOOL_EVENT &aEvent)
 
int Copy (const TOOL_EVENT &aEvent)
 
int Paste (const TOOL_EVENT &aEvent)
 
int DoDelete (const TOOL_EVENT &aEvent)
 Function DoDelete() More...
 
int DeleteItemCursor (const TOOL_EVENT &aEvent)
 

Runs the deletion tool.

More...
 
void Reset (RESET_REASON aReason) override
 Function Reset() Brings the tool to a known, initial state. More...
 
void Activate ()
 Function Activate() Runs the tool. More...
 
TOOL_MENUGetToolMenu ()
 
void SetContextMenu (ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger=CMENU_BUTTON)
 Function SetContextMenu() More...
 
void RunMainStack (std::function< void()> aFunc)
 Function RunMainStack() More...
 
template<class T >
void Go (int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
 Function Go() More...
 
TOOL_EVENTWait (const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
 Function Wait() More...
 
TOOL_TYPE GetType () const
 Function GetType() Returns the type of the tool. More...
 
TOOL_ID GetId () const
 Function GetId() Returns the unique identifier of the tool. More...
 
const std::string & GetName () const
 Function GetName() Returns the name of the tool. More...
 
TOOL_MANAGERGetManager () const
 Function GetManager() Returns the instance of TOOL_MANAGER that takes care of the tool. More...
 
bool IsToolActive () const
 

Protected Member Functions

void 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)
 

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

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

Stores the type of the tool.

More...
 
TOOL_ID m_toolId
 

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

More...
 
std::string m_toolName
 

Name of the tool.

More...
 
TOOL_MANAGERm_toolMgr
 

Private Member Functions

void editGraphicProperties (LIB_ITEM *aItem)
 
void editTextProperties (LIB_ITEM *aItem)
 
void editFieldProperties (LIB_FIELD *aField)
 
void editSymbolProperties ()
 
void setTransitions () override
 

Sets up handlers for various events.

More...
 

Private Attributes

EDA_ITEMm_pickerItem
 

Detailed Description

Definition at line 34 of file lib_edit_tool.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_EDIT_TOOL()

LIB_EDIT_TOOL::LIB_EDIT_TOOL ( )

Definition at line 47 of file lib_edit_tool.cpp.

47  :
48  EE_TOOL_BASE( "eeschema.SymbolEditTool" ),
49  m_pickerItem( nullptr )
50 {
51 }
EDA_ITEM * m_pickerItem
Definition: lib_edit_tool.h:77
EE_TOOL_BASE(const std::string &aName)
Constructor.
Definition: ee_tool_base.h:58

◆ ~LIB_EDIT_TOOL()

LIB_EDIT_TOOL::~LIB_EDIT_TOOL ( )
inlineoverride

Definition at line 38 of file lib_edit_tool.h.

38 { }

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(), 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(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), LIB_TREE::onContextMenu(), POINT_EDITOR::OnSelectionChange(), GROUP_TOOL::PickNewMember(), 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_TOOL::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

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

◆ Copy()

int LIB_EDIT_TOOL::Copy ( const TOOL_EVENT aEvent)

Definition at line 628 of file lib_edit_tool.cpp.

629 {
630  LIB_PART* part = m_frame->GetCurPart();
632 
633  if( !part || !selection.GetSize() )
634  return 0;
635 
636  for( LIB_ITEM& item : part->GetDrawItems() )
637  {
638  if( item.Type() == LIB_FIELD_T )
639  continue;
640 
641  wxASSERT( !item.HasFlag( STRUCT_DELETED ) );
642 
643  if( !item.IsSelected() )
644  item.SetFlags( STRUCT_DELETED );
645  }
646 
647  LIB_PART* partCopy = new LIB_PART( *part );
648 
649  STRING_FORMATTER formatter;
650  SCH_SEXPR_PLUGIN::FormatPart( partCopy, formatter );
651 
652  delete partCopy;
653 
654  for( LIB_ITEM& item : part->GetDrawItems() )
655  item.ClearFlags( STRUCT_DELETED );
656 
657  if( m_toolMgr->SaveClipboard( formatter.GetString() ) )
658  return 0;
659  else
660  return -1;
661 }
bool SaveClipboard(const std::string &aText)
Stores an information to the system clipboard.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
LIB_PART * GetCurPart()
Return the current part being edited or NULL if none selected.
static void FormatPart(LIB_PART *aPart, OUTPUTFORMATTER &aFormatter)
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
LIB_ITEMS_CONTAINER & GetDrawItems()
Return a reference to the draw item list.
Define a library symbol object.
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:181
const std::string & GetString()
Definition: richio.h:476
#define STRUCT_DELETED
flag indication structures to be erased
Definition: eda_item.h:115
virtual unsigned int GetSize() const override
Function GetSize() Returns the number of stored items.
Definition: selection.h:99
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:222
static KICAD_T nonFields[]
STRING_FORMATTER implements OUTPUTFORMATTER to a memory buffer.
Definition: richio.h:446

References EDA_ITEM::ClearFlags(), SCH_SEXPR_PLUGIN::FormatPart(), LIB_EDIT_FRAME::GetCurPart(), LIB_PART::GetDrawItems(), SELECTION::GetSize(), STRING_FORMATTER::GetString(), LIB_FIELD_T, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, nonFields, EE_SELECTION_TOOL::RequestSelection(), TOOL_MANAGER::SaveClipboard(), and STRUCT_DELETED.

Referenced by Cut(), and setTransitions().

◆ Cut()

int LIB_EDIT_TOOL::Cut ( const TOOL_EVENT aEvent)

Definition at line 617 of file lib_edit_tool.cpp.

618 {
619  int retVal = Copy( aEvent );
620 
621  if( retVal == 0 )
622  retVal = DoDelete( aEvent );
623 
624  return retVal;
625 }
int DoDelete(const TOOL_EVENT &aEvent)
Function DoDelete()
int Copy(const TOOL_EVENT &aEvent)

References Copy(), and DoDelete().

Referenced by setTransitions().

◆ DeleteItemCursor()

int LIB_EDIT_TOOL::DeleteItemCursor ( const TOOL_EVENT aEvent)

Runs the deletion tool.

Definition at line 299 of file lib_edit_tool.cpp.

300 {
301  std::string tool = aEvent.GetCommandStr().get();
303 
305  m_pickerItem = nullptr;
306 
307  // Deactivate other tools; particularly important if another PICKER is currently running
308  Activate();
309 
310  picker->SetCursor( KICURSOR::REMOVE );
311 
312  picker->SetClickHandler(
313  [this] ( const VECTOR2D& aPosition ) -> bool
314  {
315  if( m_pickerItem )
316  {
318  selectionTool->UnbrightenItem( m_pickerItem );
319  selectionTool->AddItemToSel( m_pickerItem, true /*quiet mode*/ );
321  m_pickerItem = nullptr;
322  }
323 
324  return true;
325  } );
326 
327  picker->SetMotionHandler(
328  [this] ( const VECTOR2D& aPos )
329  {
331  EE_COLLECTOR collector;
332  collector.m_Threshold = KiROUND( getView()->ToWorld( HITTEST_THRESHOLD_PIXELS ) );
333  collector.Collect( m_frame->GetScreen(), nonFields, (wxPoint) aPos, m_frame->GetUnit(),
334  m_frame->GetConvert() );
335 
336  // Remove unselectable items
337  for( int i = collector.GetCount() - 1; i >= 0; --i )
338  {
339  if( !selectionTool->Selectable( collector[ i ] ) )
340  collector.Remove( i );
341  }
342 
343  if( collector.GetCount() > 1 )
344  selectionTool->GuessSelectionCandidates( collector, aPos );
345 
346  EDA_ITEM* item = collector.GetCount() == 1 ? collector[ 0 ] : nullptr;
347 
348  if( m_pickerItem != item )
349  {
350  if( m_pickerItem )
351  selectionTool->UnbrightenItem( m_pickerItem );
352 
353  m_pickerItem = item;
354 
355  if( m_pickerItem )
356  selectionTool->BrightenItem( m_pickerItem );
357  }
358  } );
359 
360  picker->SetFinalizeHandler(
361  [this] ( const int& aFinalState )
362  {
363  if( m_pickerItem )
365 
366  // Wake the selection tool after exiting to ensure the cursor gets updated
368  } );
369 
370  m_toolMgr->RunAction( ACTIONS::pickerTool, true, &tool );
371 
372  return 0;
373 }
int m_Threshold
Definition: collector.h:66
void SetMotionHandler(MOTION_HANDLER aHandler)
Function SetMotionHandler() Sets a handler for mouse motion.
Definition: picker_tool.h:83
int GetConvert() const
static TOOL_ACTION doDelete
Definition: actions.h:75
void SetClickHandler(CLICK_HANDLER aHandler)
Function SetClickHandler() Sets a handler for mouse click event.
Definition: picker_tool.h:73
void SetCursor(KICURSOR aCursor)
Definition: picker_tool.h:66
EDA_ITEM * m_pickerItem
Definition: lib_edit_tool.h:77
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:141
EE_COLLECTOR.
Definition: ee_collectors.h:42
bool Selectable(const EDA_ITEM *aItem, bool checkVisibilityOnly=false) const
Function Selectable() Checks conditions for an item to be selected.
void GuessSelectionCandidates(EE_COLLECTOR &collector, const VECTOR2I &aPos)
Apply heuristics to try and determine a single object when multiple are found under the cursor.
static TOOL_ACTION pickerTool
Definition: actions.h:153
void SetFinalizeHandler(FINALIZE_HANDLER aHandler)
Function SetFinalizeHandler() Sets a handler for the finalize event.
Definition: picker_tool.h:103
void BrightenItem(EDA_ITEM *aItem)
int GetUnit() const
static TOOL_ACTION selectionActivate
Activation of the selection tool.
Definition: ee_actions.h:46
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:56
#define HITTEST_THRESHOLD_PIXELS
void UnbrightenItem(EDA_ITEM *aItem)
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
OPT< std::string > GetCommandStr() const
Definition: tool_event.h:463
int AddItemToSel(const TOOL_EVENT &aEvent)
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:68
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: eda_item.h:148
void Activate()
Function Activate() Runs the tool.
static KICAD_T nonFields[]

References TOOL_INTERACTIVE::Activate(), EE_SELECTION_TOOL::AddItemToSel(), EE_SELECTION_TOOL::BrightenItem(), EE_ACTIONS::clearSelection, ACTIONS::doDelete, TOOL_EVENT::GetCommandStr(), LIB_EDIT_FRAME::GetConvert(), SCH_BASE_FRAME::GetScreen(), TOOL_MANAGER::GetTool(), LIB_EDIT_FRAME::GetUnit(), TOOL_BASE::getView(), EE_SELECTION_TOOL::GuessSelectionCandidates(), HITTEST_THRESHOLD_PIXELS, KiROUND(), EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, m_pickerItem, COLLECTOR::m_Threshold, TOOL_BASE::m_toolMgr, nonFields, ACTIONS::pickerTool, REMOVE, TOOL_MANAGER::RunAction(), EE_SELECTION_TOOL::Selectable(), EE_ACTIONS::selectionActivate, PICKER_TOOL::SetClickHandler(), PICKER_TOOL::SetCursor(), PICKER_TOOL::SetFinalizeHandler(), PICKER_TOOL::SetMotionHandler(), and EE_SELECTION_TOOL::UnbrightenItem().

Referenced by setTransitions().

◆ DoDelete()

int LIB_EDIT_TOOL::DoDelete ( const TOOL_EVENT aEvent)

Function DoDelete()

Deletes the selected items, or the item under the cursor.

Definition at line 233 of file lib_edit_tool.cpp.

234 {
235  LIB_PART* part = m_frame->GetCurPart();
237 
238  if( items.empty() )
239  return 0;
240 
241  // Don't leave a freed pointer in the selection
243 
245 
246  std::set<LIB_ITEM *> toDelete;
247 
248  for( EDA_ITEM* item : items )
249  {
250  if( item->Type() == LIB_PIN_T )
251  {
252  LIB_PIN* pin = static_cast<LIB_PIN*>( item );
253  wxPoint pos = pin->GetPosition();
254 
255  toDelete.insert( pin );
256 
257  // when pin editing is synchronized, all pins of the same body style are removed:
258  if( m_frame->SynchronizePins() )
259  {
260  int curr_convert = pin->GetConvert();
261  LIB_PIN* next_pin = part->GetNextPin();
262 
263  while( next_pin != NULL )
264  {
265  pin = next_pin;
266  next_pin = part->GetNextPin( pin );
267 
268  if( pin->GetPosition() != pos )
269  continue;
270 
271  if( pin->GetConvert() != curr_convert )
272  continue;
273 
274  toDelete.insert( pin );
275  }
276  }
277  }
278  else
279  {
280  toDelete.insert( (LIB_ITEM*) item );
281  }
282  }
283 
284  for( auto item : toDelete )
285  {
286  part->RemoveDrawItem( item );
287  }
288 
289  m_frame->RebuildView();
290  m_frame->OnModify();
291 
292  return 0;
293 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:141
LIB_PART * GetCurPart()
Return the current part being edited or NULL if none selected.
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
#define NULL
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aType, bool aAppend=false)
Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.
Definition: ee_tool_base.h:138
const std::deque< EDA_ITEM * > GetItems() const
Definition: selection.h:131
Define a library symbol object.
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:181
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:56
int GetConvert() const
Definition: lib_item.h:299
wxPoint GetPosition() const override
Definition: lib_pin.h:258
LIB_PIN * GetNextPin(LIB_PIN *aItem=NULL)
Return the next pin object from the draw list.
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: eda_item.h:148
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current symbol.
static KICAD_T nonFields[]
void RemoveDrawItem(LIB_ITEM *aItem)
Remove draw aItem from list.

References EE_ACTIONS::clearSelection, LIB_ITEM::GetConvert(), LIB_EDIT_FRAME::GetCurPart(), SELECTION::GetItems(), LIB_PART::GetNextPin(), LIB_PIN::GetPosition(), LIB_PIN_T, LIBEDIT, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, nonFields, NULL, LIB_EDIT_FRAME::OnModify(), LIB_EDIT_FRAME::RebuildView(), LIB_PART::RemoveDrawItem(), EE_SELECTION_TOOL::RequestSelection(), TOOL_MANAGER::RunAction(), EE_TOOL_BASE< LIB_EDIT_FRAME >::saveCopyInUndoList(), and LIB_EDIT_FRAME::SynchronizePins().

Referenced by Cut(), and setTransitions().

◆ Duplicate()

int LIB_EDIT_TOOL::Duplicate ( const TOOL_EVENT aEvent)

Definition at line 729 of file lib_edit_tool.cpp.

730 {
731  LIB_PART* part = m_frame->GetCurPart();
733 
734  if( selection.GetSize() == 0 )
735  return 0;
736 
737  // Doing a duplicate of a new object doesn't really make any sense; we'd just end
738  // up dragging around a stack of objects...
739  if( selection.Front()->IsNew() )
740  return 0;
741 
742  if( !selection.Front()->IsMoving() )
744 
745  EDA_ITEMS newItems;
746 
747  for( unsigned ii = 0; ii < selection.GetSize(); ++ii )
748  {
749  LIB_ITEM* oldItem = static_cast<LIB_ITEM*>( selection.GetItem( ii ) );
750  LIB_ITEM* newItem = (LIB_ITEM*) oldItem->Clone();
751  oldItem->ClearFlags( IS_NEW | IS_PASTED | SELECTED );
752  newItem->SetFlags( IS_NEW | IS_PASTED | SELECTED );
753  newItem->SetParent( part );
754  newItems.push_back( newItem );
755 
756  part->GetDrawItems().push_back( newItem );
757  getView()->Add( newItem );
758  }
759 
761  m_toolMgr->RunAction( EE_ACTIONS::addItemsToSel, true, &newItems );
762 
763  selection.SetReferencePoint( mapCoords( getViewControls()->GetCursorPosition( true ) ) );
765 
766  return 0;
767 }
static TOOL_ACTION addItemsToSel
Selects a list of items (specified as the event parameter)
Definition: ee_actions.h:63
bool IsMoving() const
Definition: eda_item.h:189
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:141
LIB_PART * GetCurPart()
Return the current part being edited or NULL if none selected.
virtual EDA_ITEM * Clone() const
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: eda_item.cpp:97
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
bool IsNew() const
Definition: eda_item.h:188
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
void SetReferencePoint(const VECTOR2I &aP)
Definition: selection.h:239
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aType, bool aAppend=false)
Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.
Definition: ee_tool_base.h:138
LIB_ITEMS_CONTAINER & GetDrawItems()
Return a reference to the draw item list.
void push_back(T *aItem)
Definition: multivector.h:169
#define SELECTED
Definition: eda_item.h:113
Define a library symbol object.
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:181
std::vector< EDA_ITEM * > EDA_ITEMS
Define list of drawing items for screens.
Definition: eda_item.h:577
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:56
static VECTOR2D mapCoords(const wxPoint &aCoord)
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
Definition: selection.h:104
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
virtual unsigned int GetSize() const override
Function GetSize() Returns the number of stored items.
Definition: selection.h:99
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
Definition: eda_item.h:119
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:222
static KICAD_T nonFields[]
static TOOL_ACTION move
Definition: ee_actions.h:114
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:327
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:42
#define IS_NEW
New item, just created.
Definition: eda_item.h:106
EDA_ITEM * Front() const
Definition: selection.h:178

References KIGFX::VIEW::Add(), EE_ACTIONS::addItemsToSel, EDA_ITEM::ClearFlags(), EE_ACTIONS::clearSelection, EDA_ITEM::Clone(), SELECTION::Front(), LIB_EDIT_FRAME::GetCurPart(), LIB_PART::GetDrawItems(), SELECTION::GetItem(), SELECTION::GetSize(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), IS_NEW, IS_PASTED, EDA_ITEM::IsMoving(), EDA_ITEM::IsNew(), LIBEDIT, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, KIGFX::mapCoords(), EE_ACTIONS::move, nonFields, MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::push_back(), EE_SELECTION_TOOL::RequestSelection(), TOOL_MANAGER::RunAction(), EE_TOOL_BASE< LIB_EDIT_FRAME >::saveCopyInUndoList(), SELECTED, and SELECTION::SetReferencePoint().

Referenced by setTransitions().

◆ editFieldProperties()

void LIB_EDIT_TOOL::editFieldProperties ( LIB_FIELD aField)
private

Definition at line 486 of file lib_edit_tool.cpp.

487 {
488  if( aField == NULL )
489  return;
490 
491  wxString caption;
492  LIB_PART* parent = aField->GetParent();
493  wxCHECK( parent, /* void */ );
494 
495  // Editing the component value field is equivalent to creating a new component based
496  // on the current component. Set the dialog message to inform the user.
497  if( aField->GetId() == VALUE )
498  caption = _( "Edit Component Name" );
499  else
500  caption.Printf( _( "Edit %s Field" ), aField->GetName() );
501 
502  DIALOG_LIB_EDIT_ONE_FIELD dlg( m_frame, caption, aField );
503 
504  // The dialog may invoke a kiway player for footprint fields
505  // so we must use a quasimodal dialog.
506  if( dlg.ShowQuasiModal() != wxID_OK )
507  return;
508 
509  wxString newFieldValue = LIB_ID::FixIllegalChars( dlg.GetText(), LIB_ID::ID_SCH );
510  wxString oldFieldValue = aField->GetFullText( m_frame->GetUnit() );
511  bool renamed = aField->GetId() == VALUE && newFieldValue != oldFieldValue;
512 
513  if( renamed )
515  else
517 
518  dlg.UpdateField( aField );
519 
520  if( renamed )
521  {
522  parent->SetName( newFieldValue );
523  m_frame->UpdateAfterSymbolProperties( &oldFieldValue );
524  }
525  else
526  {
527  updateItem( aField, true );
528  m_frame->GetCanvas()->Refresh();
529  m_frame->OnModify();
531  }
532 }
LIB_PART * GetParent() const
Definition: lib_item.h:183
int GetId() const
Definition: lib_field.h:138
wxString GetName(bool aUseDefaultName=true) const
Returns the field name.
Definition: lib_field.cpp:365
DIALOG_LIB_EDIT_ONE_FIELD is a the class to handle editing a single component field in the library ed...
int GetUnit() const
#define NULL
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aType, bool aAppend=false)
Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.
Definition: ee_tool_base.h:138
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
Define a library symbol object.
void UpdateAfterSymbolProperties(wxString *aOldName=nullptr)
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void updateItem(EDA_ITEM *aItem, bool aUpdateRTree) const
Similar to getView()->Update(), but handles items that are redrawn by their parents and updating the ...
Definition: ee_tool_base.h:107
void DisplayCmpDoc()
Display the documentation of the selected component.
Definition: symbedit.cpp:203
Field Value of part, i.e. "3.3K".
#define _(s)
Definition: 3d_actions.cpp:33
wxString GetFullText(int unit=1) const
Return the text of a field.
Definition: lib_field.cpp:297
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current symbol.
static UTF8 FixIllegalChars(const UTF8 &aLibItemName, LIB_ID_TYPE aType, bool aLib=false)
Replace illegal LIB_ID item name characters with underscores '_'.
Definition: lib_id.cpp:352
virtual void SetName(const wxString &aName)

References _, LIB_EDIT_FRAME::DisplayCmpDoc(), LIB_ID::FixIllegalChars(), SCH_BASE_FRAME::GetCanvas(), LIB_FIELD::GetFullText(), LIB_FIELD::GetId(), LIB_FIELD::GetName(), LIB_ITEM::GetParent(), DIALOG_EDIT_ONE_FIELD::GetText(), LIB_EDIT_FRAME::GetUnit(), LIB_ID::ID_SCH, LIB_RENAME, LIBEDIT, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, NULL, LIB_EDIT_FRAME::OnModify(), EDA_DRAW_PANEL_GAL::Refresh(), EE_TOOL_BASE< LIB_EDIT_FRAME >::saveCopyInUndoList(), LIB_PART::SetName(), DIALOG_SHIM::ShowQuasiModal(), LIB_EDIT_FRAME::UpdateAfterSymbolProperties(), DIALOG_LIB_EDIT_ONE_FIELD::UpdateField(), EE_TOOL_BASE< LIB_EDIT_FRAME >::updateItem(), and VALUE.

Referenced by Properties().

◆ editGraphicProperties()

void LIB_EDIT_TOOL::editGraphicProperties ( LIB_ITEM aItem)
private

Definition at line 431 of file lib_edit_tool.cpp.

432 {
433  if( aItem == NULL )
434  return;
435 
436  DIALOG_LIB_EDIT_DRAW_ITEM dialog( m_frame, aItem );
437 
438  if( dialog.ShowModal() != wxID_OK )
439  return;
440 
441  if( aItem->IsFillable() )
442  aItem->SetFillMode( (FILL_TYPE) dialog.GetFillStyle() );
443 
444  aItem->SetWidth( dialog.GetWidth() );
445 
446  if( dialog.GetApplyToAllConversions() )
447  aItem->SetConvert( 0 );
448  else
449  aItem->SetConvert( m_frame->GetConvert() );
450 
451  if( dialog.GetApplyToAllUnits() )
452  aItem->SetUnit( 0 );
453  else
454  aItem->SetUnit( m_frame->GetUnit() );
455 
456  updateItem( aItem, true );
457  m_frame->GetCanvas()->Refresh();
458  m_frame->OnModify( );
459 
461  drawingTools->SetDrawSpecificConvert( !dialog.GetApplyToAllConversions() );
462  drawingTools->SetDrawSpecificUnit( !dialog.GetApplyToAllUnits() );
463 
464  MSG_PANEL_ITEMS items;
465  aItem->GetMsgPanelInfo( m_frame, items );
466  m_frame->SetMsgPanel( items );
467 }
FILL_TYPE
Enum class FILL_TYPE is the set of fill types used in plotting or drawing enclosed areas.
Definition: fill_type.h:29
int GetConvert() const
virtual void SetWidth(int aWidth)=0
LIB_DRAWING_TOOLS.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
void SetFillMode(FILL_TYPE aFillMode)
Definition: lib_item.h:301
int GetUnit() const
#define NULL
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
void SetDrawSpecificUnit(bool aSpecific)
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Display basic info (type, part and convert) about the current item in message panel.
Definition: lib_item.cpp:50
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void updateItem(EDA_ITEM *aItem, bool aUpdateRTree) const
Similar to getView()->Update(), but handles items that are redrawn by their parents and updating the ...
Definition: ee_tool_base.h:107
void SetConvert(int aConvert)
Definition: lib_item.h:298
Dialog to edit library component graphic items.
void SetUnit(int aUnit)
Definition: lib_item.h:295
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current symbol.
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
Definition: msgpanel.h:103
bool IsFillable() const
Check if draw object can be filled.
Definition: lib_item.h:293
void SetDrawSpecificConvert(bool aSpecific)

References DIALOG_LIB_EDIT_DRAW_ITEM::GetApplyToAllConversions(), DIALOG_LIB_EDIT_DRAW_ITEM::GetApplyToAllUnits(), SCH_BASE_FRAME::GetCanvas(), LIB_EDIT_FRAME::GetConvert(), DIALOG_LIB_EDIT_DRAW_ITEM::GetFillStyle(), LIB_ITEM::GetMsgPanelInfo(), TOOL_MANAGER::GetTool(), LIB_EDIT_FRAME::GetUnit(), DIALOG_LIB_EDIT_DRAW_ITEM::GetWidth(), LIB_ITEM::IsFillable(), EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, TOOL_BASE::m_toolMgr, NULL, LIB_EDIT_FRAME::OnModify(), EDA_DRAW_PANEL_GAL::Refresh(), LIB_ITEM::SetConvert(), LIB_DRAWING_TOOLS::SetDrawSpecificConvert(), LIB_DRAWING_TOOLS::SetDrawSpecificUnit(), LIB_ITEM::SetFillMode(), EDA_DRAW_FRAME::SetMsgPanel(), LIB_ITEM::SetUnit(), LIB_ITEM::SetWidth(), and EE_TOOL_BASE< LIB_EDIT_FRAME >::updateItem().

Referenced by Properties().

◆ editSymbolProperties()

void LIB_EDIT_TOOL::editSymbolProperties ( )
private

Definition at line 535 of file lib_edit_tool.cpp.

536 {
537  LIB_PART* part = m_frame->GetCurPart();
538  bool partLocked = part->UnitsLocked();
539  wxString oldName = part->GetName();
540 
543 
545 
546  // This dialog itself subsequently can invoke a KIWAY_PLAYER as a quasimodal
547  // frame. Therefore this dialog as a modal frame parent, MUST be run under
548  // quasimodal mode for the quasimodal frame support to work. So don't use
549  // the QUASIMODAL macros here.
550  if( dlg.ShowQuasiModal() != wxID_OK )
551  return;
552 
553  m_frame->OnModify();
554 
555  // if m_UnitSelectionLocked has changed, set some edit options or defaults
556  // to the best value
557  if( partLocked != part->UnitsLocked() )
558  {
560 
561  // Enable synchronized pin edit mode for symbols with interchangeable units
562  m_frame->m_SyncPinEdit = !part->UnitsLocked();
563 
564  // also set default edit options to the better value
565  // Usually if units are locked, graphic items are specific to each unit
566  // and if units are interchangeable, graphic items are common to units
567  tools->SetDrawSpecificUnit( part->UnitsLocked() );
568  }
569 }
wxString GetName() const override
LIB_DRAWING_TOOLS.
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:141
LIB_PART * GetCurPart()
Return the current part being edited or NULL if none selected.
void SetDrawSpecificUnit(bool aSpecific)
Define a library symbol object.
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:56
bool m_SyncPinEdit
Set to true to synchronize pins at the same position when editing symbols with multiple units or mult...
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current symbol.
bool UnitsLocked() const
Check whether part units are interchangeable.

References ACTIONS::cancelInteractive, EE_ACTIONS::clearSelection, LIB_EDIT_FRAME::GetCurPart(), LIB_PART::GetName(), TOOL_MANAGER::GetTool(), EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, LIB_EDIT_FRAME::m_SyncPinEdit, TOOL_BASE::m_toolMgr, LIB_EDIT_FRAME::OnModify(), TOOL_MANAGER::RunAction(), LIB_DRAWING_TOOLS::SetDrawSpecificUnit(), DIALOG_SHIM::ShowQuasiModal(), and LIB_PART::UnitsLocked().

Referenced by Properties().

◆ editTextProperties()

void LIB_EDIT_TOOL::editTextProperties ( LIB_ITEM aItem)
private

Definition at line 470 of file lib_edit_tool.cpp.

471 {
472  if ( ( aItem == NULL ) || ( aItem->Type() != LIB_TEXT_T ) )
473  return;
474 
475  DIALOG_LIB_EDIT_TEXT dlg( m_frame, (LIB_TEXT*) aItem );
476 
477  if( dlg.ShowModal() != wxID_OK )
478  return;
479 
480  updateItem( aItem, true );
481  m_frame->GetCanvas()->Refresh();
482  m_frame->OnModify( );
483 }
Define a symbol library graphical text item.
Definition: lib_text.h:40
#define NULL
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...
void updateItem(EDA_ITEM *aItem, bool aUpdateRTree) const
Similar to getView()->Update(), but handles items that are redrawn by their parents and updating the ...
Definition: ee_tool_base.h:107
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current symbol.
KICAD_T Type() const
Function Type()
Definition: eda_item.h:182

References SCH_BASE_FRAME::GetCanvas(), LIB_TEXT_T, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, NULL, LIB_EDIT_FRAME::OnModify(), EDA_DRAW_PANEL_GAL::Refresh(), EDA_ITEM::Type(), and EE_TOOL_BASE< LIB_EDIT_FRAME >::updateItem().

Referenced by Properties().

◆ 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: eda_item.h:148

References TOOL_BASE::getModelInt().

Referenced by ZONE_CREATE_HELPER::commitZone(), 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:290
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(), EE_SELECTION_TOOL::collectHits(), SCH_LINE_WIRE_BUS_TOOL::computeBreakPoint(), COMMON_TOOLS::CursorControl(), 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::doZoomFit(), COMMON_TOOLS::doZoomInOut(), COMMON_TOOLS::doZoomToPreset(), MICROWAVE_TOOL::drawMicrowaveInductor(), PL_DRAWING_TOOLS::DrawShape(), PCB_EDITOR_CONTROL::DrillOrigin(), 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(), 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(), POINT_EDITOR::OnSelectionChange(), COMMON_TOOLS::PanControl(), 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(), SELECTION_TOOL::SelectAll(), EE_SELECTION_TOOL::SelectAll(), 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(), ZOOM_TOOL::selectRegion(), GERBVIEW_SELECTION_TOOL::selectVisually(), 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(), PL_POINT_EDITOR::updateItem(), 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(), POINT_EDITOR::updatePoints(), SELECTION_TOOL::updateSelection(), PNS::TOOL_BASE::updateStartItem(), PCB_VIEWER_TOOLS::view(), PCB_TOOL_BASE::view(), 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:292

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(), EDIT_TOOL::copyToClipboard(), 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(), 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(), LIB_MOVE_TOOL::Main(), PL_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), PCBNEW_PICKER_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), COMMON_TOOLS::OnGridChanged(), POINT_EDITOR::OnSelectionChange(), Paste(), ROUTER_TOOL::performDragging(), LENGTH_TUNER_TOOL::performTuning(), 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(), POINT_EDITOR::updateItem(), 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 ZOOM_TOOL::setTransitions(), AUTOPLACE_TOOL::setTransitions(), LENGTH_TUNER_TOOL::setTransitions(), PCB_REANNOTATE_TOOL::setTransitions(), GERBVIEW_INSPECTION_TOOL::setTransitions(), ROUTER_TOOL::setTransitions(), LIB_PIN_TOOL::setTransitions(), EE_INSPECTION_TOOL::setTransitions(), SCH_NAVIGATE_TOOL::setTransitions(), PL_DRAWING_TOOLS::setTransitions(), EE_POINT_EDITOR::setTransitions(), PL_POINT_EDITOR::setTransitions(), COMMON_CONTROL::setTransitions(), ZONE_FILLER_TOOL::setTransitions(), LIB_MOVE_TOOL::setTransitions(), KICAD_MANAGER_CONTROL::setTransitions(), CONVERT_TOOL::setTransitions(), DRC_TOOL::setTransitions(), PCB_VIEWER_TOOLS::setTransitions(), POINT_EDITOR::setTransitions(), LIB_DRAWING_TOOLS::setTransitions(), MICROWAVE_TOOL::setTransitions(), GLOBAL_EDIT_TOOL::setTransitions(), GERBVIEW_CONTROL::setTransitions(), SCH_DRAWING_TOOLS::setTransitions(), PAD_TOOL::setTransitions(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::setTransitions(), SCH_MOVE_TOOL::setTransitions(), GROUP_TOOL::setTransitions(), setTransitions(), PL_EDITOR_CONTROL::setTransitions(), LIB_CONTROL::setTransitions(), PL_EDIT_TOOL::setTransitions(), FOOTPRINT_EDITOR_TOOLS::setTransitions(), GERBVIEW_SELECTION_TOOL::setTransitions(), SCH_EDIT_TOOL::setTransitions(), POSITION_RELATIVE_TOOL::setTransitions(), PCBNEW_CONTROL::setTransitions(), EDA_3D_CONTROLLER::setTransitions(), ALIGN_DISTRIBUTE_TOOL::setTransitions(), COMMON_TOOLS::setTransitions(), CVPCB_CONTROL::setTransitions(), CVPCB_ASSOCIATION_TOOL::setTransitions(), SCH_LINE_WIRE_BUS_TOOL::setTransitions(), PCBNEW_PICKER_TOOL::setTransitions(), PICKER_TOOL::setTransitions(), PCB_INSPECTION_TOOL::setTransitions(), PCB_EDITOR_CONTROL::setTransitions(), DRAWING_TOOL::setTransitions(), EDIT_TOOL::setTransitions(), SELECTION_TOOL::setTransitions(), PL_SELECTION_TOOL::setTransitions(), SCH_EDITOR_CONTROL::setTransitions(), and EE_SELECTION_TOOL::setTransitions().

◆ Init()

bool LIB_EDIT_TOOL::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 54 of file lib_edit_tool.cpp.

55 {
57 
60 
61  wxASSERT_MSG( drawingTools, "eeschema.SymbolDrawing tool is not available" );
62 
63  auto havePartCondition =
64  [&]( const SELECTION& sel )
65  {
66  return m_isLibEdit && static_cast<LIB_EDIT_FRAME*>( m_frame )->GetCurPart();
67  };
68 
69  // Add edit actions to the move tool menu
70  //
71  if( moveTool )
72  {
73  CONDITIONAL_MENU& moveMenu = moveTool->GetToolMenu().GetMenu();
74 
75  moveMenu.AddSeparator( 200 );
81 
83 
84  moveMenu.AddSeparator( 300 );
88 
89  moveMenu.AddSeparator( 400 );
90  moveMenu.AddItem( ACTIONS::selectAll, havePartCondition, 400 );
91  }
92 
93  // Add editing actions to the drawing tool menu
94  //
95  CONDITIONAL_MENU& drawMenu = drawingTools->GetToolMenu().GetMenu();
96 
97  drawMenu.AddSeparator( 200 );
102 
103  drawMenu.AddItem( EE_ACTIONS::properties, EE_CONDITIONS::Count( 1 ), 200 );
104 
105  // Add editing actions to the selection tool menu
106  //
108 
114 
115  selToolMenu.AddItem( EE_ACTIONS::properties, EE_CONDITIONS::Count( 1 ), 200 );
116 
117  selToolMenu.AddSeparator( 300 );
120  selToolMenu.AddItem( ACTIONS::paste, EE_CONDITIONS::Idle, 300 );
122 
123  selToolMenu.AddSeparator( 400 );
124  selToolMenu.AddItem( ACTIONS::selectAll, havePartCondition, 400 );
125 
126  return true;
127 }
static TOOL_ACTION properties
Definition: ee_actions.h:121
static TOOL_ACTION doDelete
Definition: actions.h:75
LIB_DRAWING_TOOLS.
static bool Idle(const SELECTION &aSelection)
Tests if there no items selected or being edited.
CONDITIONAL_MENU & GetMenu()
Function GetMenu.
Definition: tool_menu.cpp:46
static TOOL_ACTION mirrorY
Definition: ee_actions.h:120
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
TOOL_MENU & GetToolMenu()
static SELECTION_CONDITION Count(int aNumber)
Creates a functor that tests if the number of selected items is equal to the value given as parameter...
static bool IdleSelection(const SELECTION &aSelection)
Tests if all selected items are not being edited.
static bool NotEmpty(const SELECTION &aSelection)
Tests if there are any items selected.
static TOOL_ACTION rotateCW
Definition: ee_actions.h:117
bool Init() override
Function Init() Init() is called once upon a registration of the tool.
Definition: ee_tool_base.h:69
static TOOL_ACTION copy
Definition: actions.h:70
static TOOL_ACTION rotateCCW
Definition: ee_actions.h:118
static TOOL_ACTION cut
Definition: actions.h:69
static TOOL_ACTION mirrorX
Definition: ee_actions.h:119
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:181
void AddSeparator(int aOrder=ANY_ORDER)
Adds a separator to the menu.
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Adds a menu entry to run a TOOL_ACTION on selected items.
static TOOL_ACTION selectAll
Definition: actions.h:73
static TOOL_ACTION paste
Definition: actions.h:71
static TOOL_ACTION duplicate
Definition: actions.h:74

References CONDITIONAL_MENU::AddItem(), CONDITIONAL_MENU::AddSeparator(), ACTIONS::copy, SELECTION_CONDITIONS::Count(), ACTIONS::cut, ACTIONS::doDelete, ACTIONS::duplicate, TOOL_MENU::GetMenu(), TOOL_MANAGER::GetTool(), TOOL_INTERACTIVE::GetToolMenu(), SELECTION_CONDITIONS::Idle(), SELECTION_CONDITIONS::IdleSelection(), EE_TOOL_BASE< T >::Init(), EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_isLibEdit, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, EE_ACTIONS::mirrorX, EE_ACTIONS::mirrorY, SELECTION_CONDITIONS::NotEmpty(), ACTIONS::paste, EE_ACTIONS::properties, EE_ACTIONS::rotateCCW, EE_ACTIONS::rotateCW, and ACTIONS::selectAll.

◆ 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 EDIT_TOOL::isRouterActive(), and ROUTER_TOOL::onViaCommand().

◆ Mirror()

int LIB_EDIT_TOOL::Mirror ( const TOOL_EVENT aEvent)

Definition at line 172 of file lib_edit_tool.cpp.

173 {
175 
176  if( selection.GetSize() == 0 )
177  return 0;
178 
179  wxPoint mirrorPoint;
180  bool xAxis = ( aEvent.Matches( EE_ACTIONS::mirrorX.MakeEvent() ) );
181  LIB_ITEM* item = static_cast<LIB_ITEM*>( selection.Front() );
182 
183  if( !item->IsMoving() )
185 
186  if( selection.GetSize() == 1 )
187  mirrorPoint = item->GetPosition();
188  else
189  mirrorPoint = m_frame->GetNearestGridPosition( mapCoords( selection.GetCenter() ) );
190 
191  for( unsigned ii = 0; ii < selection.GetSize(); ii++ )
192  {
193  item = static_cast<LIB_ITEM*>( selection.GetItem( ii ) );
194 
195  if( xAxis )
196  item->MirrorVertical( mirrorPoint );
197  else
198  item->MirrorHorizontal( mirrorPoint );
199 
200  m_frame->UpdateItem( item );
201  }
202 
204 
205  if( item->IsMoving() )
207  else
208  {
209  if( selection.IsHover() )
211 
212  m_frame->OnModify();
213  }
214 
215  return 0;
216 }
void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false)
Mark an item for refresh.
bool IsHover() const
Definition: selection.h:70
virtual VECTOR2I GetCenter() const
Returns the center point of the selection area bounding box.
Definition: selection.h:137
bool IsMoving() const
Definition: eda_item.h:189
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:141
virtual void MirrorHorizontal(const wxPoint &aCenter)=0
Mirror the draw object along the horizontal (X) axis about aCenter point.
LIB_PART * GetCurPart()
Return the current part being edited or NULL if none selected.
virtual wxPoint GetPosition() const
Definition: eda_item.h:326
wxPoint GetNearestGridPosition(const wxPoint &aPosition) const
Return the nearest aGridSize location to aPosition.
static const TOOL_EVENT SelectedItemsModified
Definition: actions.h:213
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aType, bool aAppend=false)
Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.
Definition: ee_tool_base.h:138
static TOOL_ACTION mirrorX
Definition: ee_actions.h:119
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:181
bool Matches(const TOOL_EVENT &aEvent) const
Function Matches() Tests whether two events match in terms of category & action or command.
Definition: tool_event.h:364
virtual void MirrorVertical(const wxPoint &aCenter)=0
Mirror the draw object along the MirrorVertical (Y) axis about aCenter point.
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:56
static VECTOR2D mapCoords(const wxPoint &aCoord)
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
Definition: selection.h:104
virtual unsigned int GetSize() const override
Function GetSize() Returns the number of stored items.
Definition: selection.h:99
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current symbol.
void PostEvent(const TOOL_EVENT &aEvent)
Puts an event to the event queue to be processed at the end of event processing cycle.
Definition: tool_manager.h:274
static TOOL_ACTION refreshPreview
Definition: actions.h:104
EDA_ITEM * Front() const
Definition: selection.h:178

References EE_ACTIONS::clearSelection, SELECTION::Front(), SELECTION::GetCenter(), LIB_EDIT_FRAME::GetCurPart(), SELECTION::GetItem(), EDA_DRAW_FRAME::GetNearestGridPosition(), EDA_ITEM::GetPosition(), SELECTION::GetSize(), SELECTION::IsHover(), EDA_ITEM::IsMoving(), LIBEDIT, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, KIGFX::mapCoords(), TOOL_EVENT::Matches(), LIB_ITEM::MirrorHorizontal(), LIB_ITEM::MirrorVertical(), EE_ACTIONS::mirrorX, LIB_EDIT_FRAME::OnModify(), TOOL_MANAGER::PostEvent(), ACTIONS::refreshPreview, EE_SELECTION_TOOL::RequestSelection(), TOOL_MANAGER::RunAction(), EE_TOOL_BASE< LIB_EDIT_FRAME >::saveCopyInUndoList(), EVENTS::SelectedItemsModified, and SCH_BASE_FRAME::UpdateItem().

Referenced by setTransitions().

◆ Paste()

int LIB_EDIT_TOOL::Paste ( const TOOL_EVENT aEvent)

Definition at line 664 of file lib_edit_tool.cpp.

665 {
666  LIB_PART* part = m_frame->GetCurPart();
667 
668  if( !part )
669  return 0;
670 
671  std::string text = m_toolMgr->GetClipboard();
672  STRING_LINE_READER reader( text, "Clipboard" );
673  LIB_PART* newPart;
674 
675  try
676  {
677  newPart = SCH_SEXPR_PLUGIN::ParsePart( reader );
678  }
679  catch( IO_ERROR& )
680  {
681  // If it's not a part then paste as text
682  newPart = new LIB_PART( "dummy_part" );
683  LIB_TEXT* newText = new LIB_TEXT( newPart );
684  newText->SetText( text );
685  newPart->AddDrawItem( newText );
686  }
687 
688  if( !newPart )
689  return -1;
690 
691  m_frame->SaveCopyInUndoList( part );
693 
694  for( LIB_ITEM& item : part->GetDrawItems() )
695  item.ClearFlags( IS_NEW | IS_PASTED | SELECTED );
696 
697  for( LIB_ITEM& item : newPart->GetDrawItems() )
698  {
699  if( item.Type() == LIB_FIELD_T )
700  continue;
701 
702  LIB_ITEM* newItem = (LIB_ITEM*) item.Clone();
703  newItem->SetParent( part );
704  newItem->SetFlags( IS_NEW | IS_PASTED | SELECTED );
705 
706  newItem->SetUnit( newItem->GetUnit() ? m_frame->GetUnit() : 0 );
707  newItem->SetConvert( newItem->GetConvert() ? m_frame->GetConvert() : 0 );
708 
709  part->GetDrawItems().push_back( newItem );
710  getView()->Add( newItem );
711  }
712 
713  delete newPart;
714 
716 
717  EE_SELECTION& selection = m_selectionTool->GetSelection();
718 
719  if( !selection.Empty() )
720  {
721  selection.SetReferencePoint( getViewControls()->GetCursorPosition( true ) );
723  }
724 
725  return 0;
726 }
int GetConvert() const
static LIB_PART * ParsePart(LINE_READER &aReader, int aVersion=SEXPR_SCHEMATIC_FILE_VERSION)
Define a symbol library graphical text item.
Definition: lib_text.h:40
void SaveCopyInUndoList(EDA_ITEM *ItemToCopy, UNDO_REDO undoType=UNDO_REDO::LIBEDIT, bool aAppend=false)
Create a copy of the current component, and save it in the undo list.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:141
LIB_PART * GetCurPart()
Return the current part being edited or NULL if none selected.
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:185
virtual EDA_ITEM * Clone() const
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: eda_item.cpp:97
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
void AddDrawItem(LIB_ITEM *aItem)
Add a new draw aItem to the draw object list.
EE_SELECTION & GetSelection()
Function GetSelection()
void SetReferencePoint(const VECTOR2I &aP)
Definition: selection.h:239
int GetUnit() const
Definition: lib_item.h:296
int GetUnit() const
void SetFlags(STATUS_FLAGS aMask)
Definition: eda_item.h:221
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:120
LIB_ITEMS_CONTAINER & GetDrawItems()
Return a reference to the draw item list.
void push_back(T *aItem)
Definition: multivector.h:169
#define SELECTED
Definition: eda_item.h:113
Define a library symbol object.
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:181
int GetConvert() const
Definition: lib_item.h:299
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:120
void SetConvert(int aConvert)
Definition: lib_item.h:298
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
Definition: eda_item.h:119
void SetUnit(int aUnit)
Definition: lib_item.h:295
int ClearSelection(const TOOL_EVENT &aEvent)
Clear current selection event handler.
std::string GetClipboard() const
Returns the information currently stored in the system clipboard.
void RebuildSelection()
Rebuilds the selection from the EDA_ITEMs' selection flags.
static TOOL_ACTION move
Definition: ee_actions.h:114
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:327
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:42
STRING_LINE_READER is a LINE_READER that reads from a multiline 8 bit wide std::string.
Definition: richio.h:255
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
#define IS_NEW
New item, just created.
Definition: eda_item.h:106

References KIGFX::VIEW::Add(), LIB_PART::AddDrawItem(), EE_SELECTION_TOOL::ClearSelection(), EDA_ITEM::Clone(), SELECTION::Empty(), TOOL_MANAGER::GetClipboard(), LIB_EDIT_FRAME::GetConvert(), LIB_ITEM::GetConvert(), LIB_EDIT_FRAME::GetCurPart(), LIB_PART::GetDrawItems(), EE_SELECTION_TOOL::GetSelection(), LIB_EDIT_FRAME::GetUnit(), LIB_ITEM::GetUnit(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), IS_NEW, IS_PASTED, LIB_FIELD_T, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, EE_ACTIONS::move, SCH_SEXPR_PLUGIN::ParsePart(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::push_back(), EE_SELECTION_TOOL::RebuildSelection(), TOOL_MANAGER::RunAction(), LIB_EDIT_FRAME::SaveCopyInUndoList(), SELECTED, LIB_ITEM::SetConvert(), EDA_ITEM::SetFlags(), EDA_ITEM::SetParent(), SELECTION::SetReferencePoint(), EDA_TEXT::SetText(), and LIB_ITEM::SetUnit().

Referenced by setTransitions().

◆ PinTable()

int LIB_EDIT_TOOL::PinTable ( const TOOL_EVENT aEvent)

Definition at line 572 of file lib_edit_tool.cpp.

573 {
574  LIB_PART* part = m_frame->GetCurPart();
575 
576  if( !part )
577  return 0;
578 
580 
582 
583  DIALOG_LIB_EDIT_PIN_TABLE dlg( m_frame, part );
584 
585  if( dlg.ShowModal() == wxID_CANCEL )
586  return -1;
587 
588  m_frame->RebuildView();
589  m_frame->OnModify();
590 
591  return 0;
592 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:141
LIB_PART * GetCurPart()
Return the current part being edited or NULL if none selected.
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aType, bool aAppend=false)
Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.
Definition: ee_tool_base.h:138
Define a library symbol object.
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:56
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current symbol.

References EE_ACTIONS::clearSelection, LIB_EDIT_FRAME::GetCurPart(), LIBEDIT, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, TOOL_BASE::m_toolMgr, LIB_EDIT_FRAME::OnModify(), LIB_EDIT_FRAME::RebuildView(), TOOL_MANAGER::RunAction(), and EE_TOOL_BASE< LIB_EDIT_FRAME >::saveCopyInUndoList().

Referenced by setTransitions().

◆ Properties()

int LIB_EDIT_TOOL::Properties ( const TOOL_EVENT aEvent)

Definition at line 376 of file lib_edit_tool.cpp.

377 {
379 
380  if( selection.Empty() || aEvent.IsAction( &EE_ACTIONS::symbolProperties ) )
381  {
382  if( m_frame->GetCurPart() )
384  }
385  else if( selection.Size() == 1 )
386  {
387  LIB_ITEM* item = (LIB_ITEM*) selection.Front();
388 
389  // Save copy for undo if not in edit (edit command already handle the save copy)
390  if( item->GetEditFlags() == 0 )
392 
393  switch( item->Type() )
394  {
395  case LIB_PIN_T:
396  {
398 
399  if( pinTool )
400  pinTool->EditPinProperties( (LIB_PIN*) item );
401 
402  break;
403  }
404  case LIB_ARC_T:
405  case LIB_CIRCLE_T:
406  case LIB_RECTANGLE_T:
407  case LIB_POLYLINE_T:
408  editGraphicProperties( item );
409  break;
410 
411  case LIB_TEXT_T:
412  editTextProperties( item );
413  break;
414 
415  case LIB_FIELD_T:
416  editFieldProperties( (LIB_FIELD*) item );
417  break;
418 
419  default:
420  wxFAIL_MSG( wxT( "Unhandled item <" ) + item->GetClass() + wxT( ">" ) );
421  break;
422  }
423  }
424 
426 
427  return 0;
428 }
LIB_PART * GetParent() const
Definition: lib_item.h:183
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
Field object used in symbol libraries.
Definition: lib_field.h:59
LIB_PART * GetCurPart()
Return the current part being edited or NULL if none selected.
static const TOOL_EVENT SelectedItemsModified
Definition: actions.h:213
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
bool IsAction(const TOOL_ACTION *aAction) const
Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_AC...
Definition: tool_event.cpp:67
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
void editTextProperties(LIB_ITEM *aItem)
void editSymbolProperties()
void editGraphicProperties(LIB_ITEM *aItem)
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aType, bool aAppend=false)
Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.
Definition: ee_tool_base.h:138
STATUS_FLAGS GetEditFlags() const
Definition: eda_item.h:226
static TOOL_ACTION symbolProperties
Definition: ee_actions.h:145
bool EditPinProperties(LIB_PIN *aPin)
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:181
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:120
virtual wxString GetClass() const =0
Function GetClass returns the class name.
int Size() const
Returns the number of selected parts.
Definition: selection.h:126
void PostEvent(const TOOL_EVENT &aEvent)
Puts an event to the event queue to be processed at the end of event processing cycle.
Definition: tool_manager.h:274
void editFieldProperties(LIB_FIELD *aField)
EDA_ITEM * Front() const
Definition: selection.h:178
KICAD_T Type() const
Function Type()
Definition: eda_item.h:182

References editFieldProperties(), editGraphicProperties(), LIB_PIN_TOOL::EditPinProperties(), editSymbolProperties(), editTextProperties(), SELECTION::Empty(), SELECTION::Front(), LIB_FIELD::GetClass(), LIB_EDIT_FRAME::GetCurPart(), EDA_ITEM::GetEditFlags(), LIB_ITEM::GetParent(), TOOL_MANAGER::GetTool(), TOOL_EVENT::IsAction(), LIB_ARC_T, LIB_CIRCLE_T, LIB_FIELD_T, LIB_PIN_T, LIB_POLYLINE_T, LIB_RECTANGLE_T, LIB_TEXT_T, LIBEDIT, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, TOOL_MANAGER::PostEvent(), EE_SELECTION_TOOL::RequestSelection(), EE_TOOL_BASE< LIB_EDIT_FRAME >::saveCopyInUndoList(), EVENTS::SelectedItemsModified, SELECTION::Size(), EE_ACTIONS::symbolProperties, and EDA_ITEM::Type().

Referenced by setTransitions().

◆ Redo()

int LIB_EDIT_TOOL::Redo ( const TOOL_EVENT aEvent)

Definition at line 606 of file lib_edit_tool.cpp.

607 {
609 
611  selTool->RebuildSelection();
612 
613  return 0;
614 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
void GetComponentFromRedoList()
void RebuildSelection()
Rebuilds the selection from the EDA_ITEMs' selection flags.

References LIB_EDIT_FRAME::GetComponentFromRedoList(), TOOL_MANAGER::GetTool(), EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, TOOL_BASE::m_toolMgr, and EE_SELECTION_TOOL::RebuildSelection().

Referenced by setTransitions().

◆ Reset()

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

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

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

Parameters
aReasoncontains information about the reason of tool reset.

Implements TOOL_BASE.

Definition at line 90 of file ee_tool_base.h.

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

◆ Rotate()

int LIB_EDIT_TOOL::Rotate ( const TOOL_EVENT aEvent)

Definition at line 130 of file lib_edit_tool.cpp.

131 {
133 
134  if( selection.GetSize() == 0 )
135  return 0;
136 
137  wxPoint rotPoint;
138  bool ccw = ( aEvent.Matches( EE_ACTIONS::rotateCCW.MakeEvent() ) );
139  LIB_ITEM* item = static_cast<LIB_ITEM*>( selection.Front() );
140 
141  if( !item->IsMoving() )
143 
144  if( selection.GetSize() == 1 )
145  rotPoint = item->GetPosition();
146  else
147  rotPoint = m_frame->GetNearestGridPosition( mapCoords( selection.GetCenter() ) );
148 
149  for( unsigned ii = 0; ii < selection.GetSize(); ii++ )
150  {
151  item = static_cast<LIB_ITEM*>( selection.GetItem( ii ) );
152  item->Rotate( rotPoint, ccw );
153  m_frame->UpdateItem( item );
154  }
155 
156  if( item->IsMoving() )
158  else
159  {
161 
162  if( selection.IsHover() )
164 
165  m_frame->OnModify();
166  }
167 
168  return 0;
169 }
void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false)
Mark an item for refresh.
bool IsHover() const
Definition: selection.h:70
virtual VECTOR2I GetCenter() const
Returns the center point of the selection area bounding box.
Definition: selection.h:137
bool IsMoving() const
Definition: eda_item.h:189
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:141
LIB_PART * GetCurPart()
Return the current part being edited or NULL if none selected.
virtual wxPoint GetPosition() const
Definition: eda_item.h:326
wxPoint GetNearestGridPosition(const wxPoint &aPosition) const
Return the nearest aGridSize location to aPosition.
static const TOOL_EVENT SelectedItemsModified
Definition: actions.h:213
The base class for drawable items used by schematic library components.
Definition: lib_item.h:62
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
static TOOL_ACTION rotateCCW
Definition: ee_actions.h:118
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aType, bool aAppend=false)
Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.
Definition: ee_tool_base.h:138
virtual void Rotate(const wxPoint &aCenter, bool aRotateCCW=true)=0
Rotate the object about aCenter point.
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:181
bool Matches(const TOOL_EVENT &aEvent) const
Function Matches() Tests whether two events match in terms of category & action or command.
Definition: tool_event.h:364
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:56
static VECTOR2D mapCoords(const wxPoint &aCoord)
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
Definition: selection.h:104
virtual unsigned int GetSize() const override
Function GetSize() Returns the number of stored items.
Definition: selection.h:99
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current symbol.
void PostEvent(const TOOL_EVENT &aEvent)
Puts an event to the event queue to be processed at the end of event processing cycle.
Definition: tool_manager.h:274
static TOOL_ACTION refreshPreview
Definition: actions.h:104
EDA_ITEM * Front() const
Definition: selection.h:178

References EE_ACTIONS::clearSelection, SELECTION::Front(), SELECTION::GetCenter(), LIB_EDIT_FRAME::GetCurPart(), SELECTION::GetItem(), EDA_DRAW_FRAME::GetNearestGridPosition(), EDA_ITEM::GetPosition(), SELECTION::GetSize(), SELECTION::IsHover(), EDA_ITEM::IsMoving(), LIBEDIT, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, KIGFX::mapCoords(), TOOL_EVENT::Matches(), LIB_EDIT_FRAME::OnModify(), TOOL_MANAGER::PostEvent(), ACTIONS::refreshPreview, EE_SELECTION_TOOL::RequestSelection(), LIB_ITEM::Rotate(), EE_ACTIONS::rotateCCW, TOOL_MANAGER::RunAction(), EE_TOOL_BASE< LIB_EDIT_FRAME >::saveCopyInUndoList(), EVENTS::SelectedItemsModified, and SCH_BASE_FRAME::UpdateItem().

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

◆ saveCopyInUndoList()

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

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

Definition at line 138 of file ee_tool_base.h.

139  {
140  KICAD_T itemType = aItem->Type();
141  bool selected = aItem->IsSelected();
142 
143  // IS_SELECTED flag should not be set on undo items which were added for
144  // a drag operation.
145  if( selected && aItem->HasFlag( TEMP_SELECTED ) )
146  aItem->ClearSelected();
147 
148  if( m_isLibEdit )
149  {
150  LIB_EDIT_FRAME* editFrame = dynamic_cast<LIB_EDIT_FRAME*>( m_frame );
151  wxASSERT( editFrame );
152 
153  editFrame->SaveCopyInUndoList( static_cast<LIB_ITEM*>( aItem ), aType, aAppend );
154  }
155  else
156  {
157  SCH_EDIT_FRAME* editFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
158  wxASSERT( editFrame );
159 
160  if( itemType == SCH_PIN_T || itemType == SCH_FIELD_T || itemType == SCH_SHEET_PIN_T )
161  {
162  editFrame->SaveCopyInUndoList( editFrame->GetScreen(),
163  static_cast<SCH_ITEM*>( aItem->GetParent() ),
164  UNDO_REDO::CHANGED, aAppend );
165  }
166  else
167  {
168  editFrame->SaveCopyInUndoList( editFrame->GetScreen(),
169  static_cast<SCH_ITEM*>( aItem ),
170  aType, aAppend );
171  }
172  }
173 
174  if( selected && aItem->HasFlag( TEMP_SELECTED ) )
175  aItem->SetSelected();
176  }
bool IsSelected() const
Definition: eda_item.h:192
void ClearSelected()
Definition: eda_item.h:200
void SaveCopyInUndoList(EDA_ITEM *ItemToCopy, UNDO_REDO undoType=UNDO_REDO::LIBEDIT, bool aAppend=false)
Create a copy of the current component, and save it in the undo list.
Schematic editor (Eeschema) main window.
#define TEMP_SELECTED
flag indicating that the structure has already selected
Definition: eda_item.h:114
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: eda_item.h:197
void SaveCopyInUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItemToCopy, UNDO_REDO aTypeCommand, bool aAppend, const wxPoint &aTransformPoint=wxPoint(0, 0))
Create a copy of the current schematic item, and put it in the undo list.
EDA_ITEM * GetParent() const
Definition: eda_item.h:184
The symbol library editor main window.
bool HasFlag(STATUS_FLAGS aFlag)
Definition: eda_item.h:224
KICAD_T Type() const
Function Type()
Definition: eda_item.h:182

◆ 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)
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(), TOOL_MENU::ShowContextMenu(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ setTransitions()

void LIB_EDIT_TOOL::setTransitions ( )
overrideprivatevirtual

Sets up handlers for various events.

Implements TOOL_INTERACTIVE.

Definition at line 770 of file lib_edit_tool.cpp.

771 {
772  Go( &LIB_EDIT_TOOL::Undo, ACTIONS::undo.MakeEvent() );
773  Go( &LIB_EDIT_TOOL::Redo, ACTIONS::redo.MakeEvent() );
774  Go( &LIB_EDIT_TOOL::Cut, ACTIONS::cut.MakeEvent() );
775  Go( &LIB_EDIT_TOOL::Copy, ACTIONS::copy.MakeEvent() );
776  Go( &LIB_EDIT_TOOL::Paste, ACTIONS::paste.MakeEvent() );
778 
785 
789 }
static TOOL_ACTION pinTable
Definition: ee_actions.h:146
static TOOL_ACTION properties
Definition: ee_actions.h:121
static TOOL_ACTION doDelete
Definition: actions.h:75
static TOOL_ACTION mirrorY
Definition: ee_actions.h:120
int Properties(const TOOL_EVENT &aEvent)
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Function Go()
static TOOL_ACTION rotateCW
Definition: ee_actions.h:117
static TOOL_ACTION copy
Definition: actions.h:70
static TOOL_ACTION rotateCCW
Definition: ee_actions.h:118
int DoDelete(const TOOL_EVENT &aEvent)
Function DoDelete()
int Mirror(const TOOL_EVENT &aEvent)
int Duplicate(const TOOL_EVENT &aEvent)
static TOOL_ACTION symbolProperties
Definition: ee_actions.h:145
int Undo(const TOOL_EVENT &aEvent)
static TOOL_ACTION cut
Definition: actions.h:69
static TOOL_ACTION mirrorX
Definition: ee_actions.h:119
int Redo(const TOOL_EVENT &aEvent)
int DeleteItemCursor(const TOOL_EVENT &aEvent)
Runs the deletion tool.
static TOOL_ACTION redo
Definition: actions.h:68
int PinTable(const TOOL_EVENT &aEvent)
int Paste(const TOOL_EVENT &aEvent)
static TOOL_ACTION deleteTool
Definition: actions.h:76
static TOOL_ACTION undo
Definition: actions.h:67
int Cut(const TOOL_EVENT &aEvent)
int Copy(const TOOL_EVENT &aEvent)
static TOOL_ACTION paste
Definition: actions.h:71
static TOOL_ACTION duplicate
Definition: actions.h:74
int Rotate(const TOOL_EVENT &aEvent)

References Copy(), ACTIONS::copy, Cut(), ACTIONS::cut, DeleteItemCursor(), ACTIONS::deleteTool, DoDelete(), ACTIONS::doDelete, Duplicate(), ACTIONS::duplicate, TOOL_INTERACTIVE::Go(), Mirror(), EE_ACTIONS::mirrorX, EE_ACTIONS::mirrorY, Paste(), ACTIONS::paste, PinTable(), EE_ACTIONS::pinTable, Properties(), EE_ACTIONS::properties, Redo(), ACTIONS::redo, Rotate(), EE_ACTIONS::rotateCCW, EE_ACTIONS::rotateCW, EE_ACTIONS::symbolProperties, Undo(), and ACTIONS::undo.

◆ Undo()

int LIB_EDIT_TOOL::Undo ( const TOOL_EVENT aEvent)

Definition at line 595 of file lib_edit_tool.cpp.

596 {
598 
600  selTool->RebuildSelection();
601 
602  return 0;
603 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
void RebuildSelection()
Rebuilds the selection from the EDA_ITEMs' selection flags.

References LIB_EDIT_FRAME::GetComponentFromUndoList(), TOOL_MANAGER::GetTool(), EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, TOOL_BASE::m_toolMgr, and EE_SELECTION_TOOL::RebuildSelection().

Referenced by setTransitions().

◆ updateItem()

void EE_TOOL_BASE< LIB_EDIT_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.

Definition at line 107 of file ee_tool_base.h.

108  {
109  switch( aItem->Type() )
110  {
111  case SCH_SHEET_PIN_T:
112  getView()->Update( aItem );
113  getView()->Update( aItem->GetParent() );
114 
115  // Moving sheet pins does not change the BBox.
116  break;
117 
118  case SCH_PIN_T:
119  case SCH_FIELD_T:
120  getView()->Update( aItem );
121  getView()->Update( aItem->GetParent() );
122 
123  if( aUpdateRTree )
124  m_frame->GetScreen()->Update( static_cast<SCH_ITEM*>( aItem->GetParent() ) );
125 
126  break;
127 
128  default:
129  getView()->Update( aItem );
130 
131  if( aUpdateRTree )
132  m_frame->GetScreen()->Update( static_cast<SCH_ITEM*>( aItem ) );
133  }
134  }
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
EDA_ITEM * GetParent() const
Definition: eda_item.h:184
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
void Update(SCH_ITEM *aItem)
Updates aItem's bounding box in the tree.
Definition: sch_screen.cpp:234
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1513
KICAD_T Type() const
Function Type()
Definition: eda_item.h:182

◆ 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(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), POINT_EDITOR::OnSelectionChange(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), GROUP_TOOL::PickNewMember(), 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

LIB_EDIT_FRAME * EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame
protectedinherited

Definition at line 179 of file ee_tool_base.h.

◆ m_isLibEdit

bool EE_TOOL_BASE< LIB_EDIT_FRAME >::m_isLibEdit
protectedinherited

Definition at line 182 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(), ROUTER_TOOL::Init(), LENGTH_TUNER_TOOL::Init(), PL_EDIT_TOOL::Init(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Init(), SCH_EDIT_TOOL::Init(), PICKER_TOOL::Init(), LIB_CONTROL::Init(), LIB_DRAWING_TOOLS::Init(), FOOTPRINT_EDITOR_TOOLS::Init(), PCB_VIEWER_TOOLS::Init(), PL_DRAWING_TOOLS::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(), 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(), 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(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ m_pickerItem

EDA_ITEM* LIB_EDIT_TOOL::m_pickerItem
private

Definition at line 77 of file lib_edit_tool.h.

Referenced by DeleteItemCursor().

◆ m_selectionTool

EE_SELECTION_TOOL* EE_TOOL_BASE< LIB_EDIT_FRAME >::m_selectionTool
protectedinherited

Definition at line 181 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_MOVE_TOOL::AlignElements(), 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(), GERBVIEW_CONTROL::ClearAllLayers(), 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(), Copy(), PL_EDIT_TOOL::Copy(), PAD_TOOL::copyPadSettings(), EDIT_TOOL::copyToClipboard(), MICROWAVE_TOOL::createInductorBetween(), PCB_INSPECTION_TOOL::CrossProbePcbToSch(), COMMON_TOOLS::CursorControl(), SCH_EDITOR_CONTROL::Cut(), DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), SCH_EDITOR_CONTROL::doCopy(), SCH_EDITOR_CONTROL::doCrossProbeSchToPcb(), 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(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PCB_EDITOR_CONTROL::DrillOrigin(), Duplicate(), SCH_EDIT_TOOL::Duplicate(), EDIT_TOOL::Duplicate(), SCH_EDIT_TOOL::EditField(), SCH_EDIT_TOOL::editFieldText(), PCB_EDITOR_CONTROL::EditFpInFpEditor(), editGraphicProperties(), PAD_TOOL::EditPad(), editSymbolProperties(), SCH_EDITOR_CONTROL::EditWithLibEdit(), GROUP_TOOL::EnterGroup(), SCH_NAVIGATE_TOOL::EnterSheet(), 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(), GROUP_TOOL::Group(), EE_SELECTION_TOOL::GuessSelectionCandidates(), 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(), Init(), PL_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), GROUP_TOOL::Init(), CONVERT_TOOL::Init(), GLOBAL_EDIT_TOOL::Init(), LIB_CONTROL::Init(), PAD_TOOL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), PL_DRAWING_TOOLS::Init(), PL_POINT_EDITOR::Init(), PCB_EDITOR_CONTROL::Init(), POINT_EDITOR::Init(), POSITION_RELATIVE_TOOL::Init(), PCB_INSPECTION_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), PCB_INSPECTION_TOOL::InspectClearance(), PCB_INSPECTION_TOOL::InspectConstraints(), 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(), PCB_INSPECTION_TOOL::LocalRatsnestTool(), PL_EDIT_TOOL::Main(), CVPCB_CONTROL::Main(), LIB_MOVE_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), PCBNEW_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(), Mirror(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::Mirror(), PCB_EDITOR_CONTROL::modifyLockSelected(), EDIT_TOOL::MoveExact(), LIB_CONTROL::OnDeMorgan(), COMMON_TOOLS::OnGridChanged(), POINT_EDITOR::OnSelectionChange(), Paste(), PL_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), PAD_TOOL::pastePadProperties(), GROUP_TOOL::PickNewMember(), EDIT_TOOL::pickReferencePoint(), 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(), Properties(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), PAD_TOOL::pushPadSettings(), EE_SELECTION_TOOL::RebuildSelection(), Redo(), SCH_EDITOR_CONTROL::Redo(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), GERBVIEW_CONTROL::ReloadAllLayers(), EDIT_TOOL::Remove(), POINT_EDITOR::removeCorner(), GROUP_TOOL::RemoveFromGroup(), 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(), Rotate(), SCH_EDIT_TOOL::Rotate(), EDIT_TOOL::Rotate(), TOOL_INTERACTIVE::RunMainStack(), DRC_TOOL::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(), EDA_3D_CONTROLLER::SetMaterial(), DRC_TOOL::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(), Undo(), SCH_EDITOR_CONTROL::Undo(), GROUP_TOOL::Ungroup(), GERBVIEW_SELECTION_TOOL::UnselectItem(), GERBVIEW_SELECTION_TOOL::UnselectItems(), SELECTION_TOOL::UnselectItems(), PNS::TOOL_BASE::updateEndItem(), EE_INSPECTION_TOOL::UpdateMessagePanel(), GERBVIEW_CONTROL::UpdateMessagePanel(), PL_EDITOR_CONTROL::UpdateMessagePanel(), PCBNEW_CONTROL::UpdateMessagePanel(), PCB_INSPECTION_TOOL::UpdateSelectionRatsnest(), PNS::TOOL_BASE::updateStartItem(), 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< LIB_EDIT_FRAME >::m_view
protectedinherited

Definition at line 180 of file ee_tool_base.h.


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