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

Get the tool's top-level context menu

More...
 
void Activate ()
 Function Activate() Runs the tool. More...
 
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...
 
OPT_TOOL_EVENT Wait (const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
 Function Wait() More...
 
TOOL_TYPE GetType () const
 Function GetType() Returns the type of the tool. More...
 
TOOL_ID GetId () const
 Function GetId() Returns the unique identifier of the tool. More...
 
const std::string & GetName () const
 Function GetName() Returns the name of the tool. More...
 
TOOL_MANAGERGetManager () const
 Function GetManager() Returns the instance of TOOL_MANAGER that takes care of the tool. More...
 
TOOL_SETTINGSGetSettings ()
 
bool IsToolActive () const
 

Protected Member Functions

void updateView (EDA_ITEM *aItem) const
 

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

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

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

More...
 
const TOOL_EVENT evActivate (std::string aToolName="")
 functions below are not yet implemented - their interface may change More...
 
const TOOL_EVENT evCommand (int aCommandId=-1)
 
const TOOL_EVENT evCommand (std::string aCommandStr="")
 
const TOOL_EVENT evMotion ()
 
const TOOL_EVENT evClick (int aButton=BUT_ANY)
 
const TOOL_EVENT evDrag (int aButton=BUT_ANY)
 
const TOOL_EVENT evButtonUp (int aButton=BUT_ANY)
 
const TOOL_EVENT evButtonDown (int aButton=BUT_ANY)
 
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
 Menu model displayed by the tool. More...
 
TOOL_TYPE m_type
 

Stores the type of the tool.

More...
 
TOOL_ID m_toolId
 

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

More...
 
std::string m_toolName
 

Name of the tool.

More...
 
TOOL_MANAGERm_toolMgr
 
TOOL_SETTINGS m_toolSettings
 

Private Member Functions

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

Detailed Description

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

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

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( "libedit.InteractiveEdit" )
49 {
50 }
EE_TOOL_BASE(const std::string &aName)
Constructor.
Definition: ee_tool_base.h:57

◆ ~LIB_EDIT_TOOL()

LIB_EDIT_TOOL::~LIB_EDIT_TOOL ( )

Definition at line 53 of file lib_edit_tool.cpp.

54 {
55 }

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 49 of file tool_interactive.cpp.

50 {
52 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
TOOL_ID m_toolId
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:211
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(), DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), EDIT_TOOL::doCopyToClipboard(), SCH_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), SCH_DRAWING_TOOLS::doPlaceComponent(), SCH_DRAWING_TOOLS::doSingleClickPlace(), LIB_DRAWING_TOOLS::doTwoClickPlace(), SCH_DRAWING_TOOLS::doTwoClickPlace(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::drawZone(), PCB_EDITOR_CONTROL::DrillOrigin(), MODULE_EDITOR_TOOLS::EnumeratePads(), PCBNEW_CONTROL::GridSetOrigin(), SCH_EDITOR_CONTROL::HighlightNetCursor(), PCB_EDITOR_CONTROL::HighlightNetCursor(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), SCH_MOVE_TOOL::Main(), EE_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), EDIT_TOOL::Main(), LENGTH_TUNER_TOOL::mainLoop(), ROUTER_TOOL::mainLoop(), CVPCB_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), POINT_EDITOR::OnSelectionChange(), EDIT_TOOL::pickCopyReferencePoint(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), DRAWING_TOOL::SetAnchor(), PCB_EDITOR_CONTROL::ShowLocalRatsnest(), SCH_WIRE_BUS_TOOL::StartBus(), SCH_WIRE_BUS_TOOL::StartWire(), and SCH_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 59 of file tool_base.cpp.

60 {
61  m_toolMgr = aManager;
62  m_toolSettings = TOOL_SETTINGS( this );
63 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
TOOL_SETTINGS m_toolSettings
Definition: tool_base.h:217
friend class TOOL_SETTINGS
Definition: tool_base.h:155

References TOOL_BASE::m_toolMgr, TOOL_BASE::m_toolSettings, and TOOL_BASE::TOOL_SETTINGS.

Referenced by TOOL_MANAGER::RegisterTool().

◆ Copy()

int LIB_EDIT_TOOL::Copy ( const TOOL_EVENT aEvent)

Definition at line 578 of file lib_edit_tool.cpp.

579 {
580  LIB_PART* part = m_frame->GetCurPart();
582 
583  if( !part || !selection.GetSize() )
584  return 0;
585 
586  for( LIB_ITEM& item : part->GetDrawItems() )
587  {
588  if( item.Type() == LIB_FIELD_T )
589  continue;
590 
591  wxASSERT( ( item.GetFlags() & STRUCT_DELETED ) == 0 );
592 
593  if( !item.IsSelected() )
594  item.SetFlags( STRUCT_DELETED );
595  }
596 
597  LIB_PART* partCopy = new LIB_PART( *part );
598 
599  STRING_FORMATTER formatter;
600  SCH_LEGACY_PLUGIN::FormatPart( partCopy, formatter );
601 
602  delete partCopy;
603 
604  for( LIB_ITEM& item : part->GetDrawItems() )
605  item.ClearFlags( STRUCT_DELETED );
606 
607  if( m_toolMgr->SaveClipboard( formatter.GetString() ) )
608  return 0;
609  else
610  return -1;
611 }
LIB_PART * GetCurPart() const
Return the current part being edited or NULL if none selected.
bool SaveClipboard(const std::string &aText)
Stores an information to the system clipboard.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67
LIB_ITEMS_CONTAINER & GetDrawItems()
Return a reference to the draw item list.
Define a library symbol object.
#define STRUCT_DELETED
flag indication structures to be erased
Definition: base_struct.h:123
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:143
const std::string & GetString()
Definition: richio.h:475
static void FormatPart(LIB_PART *aPart, OUTPUTFORMATTER &aFormatter)
virtual unsigned int GetSize() const override
Function GetSize() Returns the number of stored items.
Definition: selection.h:98
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:260
static KICAD_T nonFields[]
Class STRING_FORMATTER implements OUTPUTFORMATTER to a memory buffer.
Definition: richio.h:445
SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()

References EDA_ITEM::ClearFlags(), SCH_LEGACY_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 567 of file lib_edit_tool.cpp.

568 {
569  int retVal = Copy( aEvent );
570 
571  if( retVal == 0 )
572  retVal = DoDelete( aEvent );
573 
574  return retVal;
575 }
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 334 of file lib_edit_tool.cpp.

335 {
336  Activate();
337 
339  wxCHECK( picker, 0 );
340 
341  m_frame->SetToolID( ID_LIBEDIT_DELETE_ITEM_BUTT, wxCURSOR_BULLSEYE, _( "Delete item" ) );
342  picker->SetClickHandler( std::bind( deleteItem, m_frame, std::placeholders::_1 ) );
343  picker->Activate();
344  Wait();
345 
346  return 0;
347 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
OPT_TOOL_EVENT Wait(const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
Function Wait()
virtual void SetToolID(int aId, int aCursor, const wxString &aToolMsg)
Set the tool command ID to aId and sets the cursor to aCursor.
void SetClickHandler(CLICK_HANDLER aHandler)
Function SetClickHandler() Sets a handler for mouse click event.
void Activate()
Function Activate() Runs the tool.
static bool deleteItem(SCH_BASE_FRAME *aFrame, const VECTOR2D &aPosition)

References TOOL_INTERACTIVE::Activate(), deleteItem(), TOOL_MANAGER::GetTool(), ID_LIBEDIT_DELETE_ITEM_BUTT, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, TOOL_BASE::m_toolMgr, EE_PICKER_TOOL::SetClickHandler(), EDA_DRAW_FRAME::SetToolID(), and TOOL_INTERACTIVE::Wait().

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 262 of file lib_edit_tool.cpp.

263 {
264  LIB_PART* part = m_frame->GetCurPart();
266 
267  if( items.empty() )
268  return 0;
269 
270  // Don't leave a freed pointer in the selection
272 
274 
275  for( EDA_ITEM* item : items )
276  {
277  if( item->Type() == LIB_PIN_T )
278  {
279  LIB_PIN* pin = static_cast<LIB_PIN*>( item );
280  wxPoint pos = pin->GetPosition();
281 
282  part->RemoveDrawItem( pin );
283 
284  // when pin editing is synchronized, all pins of the same body style are removed:
285  if( m_frame->SynchronizePins() )
286  {
287  int curr_convert = pin->GetConvert();
288  LIB_PIN* next_pin = part->GetNextPin();
289 
290  while( next_pin != NULL )
291  {
292  pin = next_pin;
293  next_pin = part->GetNextPin( pin );
294 
295  if( pin->GetPosition() != pos )
296  continue;
297 
298  if( pin->GetConvert() != curr_convert )
299  continue;
300 
301  part->RemoveDrawItem( pin );
302  }
303  }
304  }
305  else
306  {
307  part->RemoveDrawItem( (LIB_ITEM*) item );
308  }
309  }
310 
311  m_frame->RebuildView();
312  m_frame->OnModify();
313 
314  return 0;
315 }
LIB_PART * GetCurPart() const
Return the current part being edited or NULL if none selected.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67
const std::deque< EDA_ITEM * > GetItems() const
Definition: selection.h:130
Define a library symbol object.
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:143
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:57
int GetConvert() const
wxPoint GetPosition() const override
Return the current draw object position.
Definition: lib_pin.h:432
LIB_PIN * GetNextPin(LIB_PIN *aItem=NULL)
Return the next pin object from the draw list.
void RemoveDrawItem(LIB_ITEM *aItem, EDA_DRAW_PANEL *aPanel=NULL, wxDC *aDc=NULL)
Remove draw aItem from list.
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO_T aType, bool aAppend=false)
Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.
Definition: ee_tool_base.h:120
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:157
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current symbol.
bool SynchronizePins()
Pin editing (add, delete, move...) can be synchronized between units when units are interchangeable b...
static KICAD_T nonFields[]
SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()

References EE_ACTIONS::clearSelection, LIB_ITEM::GetConvert(), LIB_EDIT_FRAME::GetCurPart(), SELECTION::GetItems(), LIB_PART::GetNextPin(), LIB_PIN::GetPosition(), LIB_PIN_T, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, nonFields, 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(), LIB_EDIT_FRAME::SynchronizePins(), and UR_LIBEDIT.

Referenced by Cut(), and setTransitions().

◆ Duplicate()

int LIB_EDIT_TOOL::Duplicate ( const TOOL_EVENT aEvent)

Definition at line 225 of file lib_edit_tool.cpp.

226 {
227  LIB_PART* part = m_frame->GetCurPart();
229 
230  if( selection.GetSize() == 0 )
231  return 0;
232 
233  // Doing a duplicate of a new object doesn't really make any sense; we'd just end
234  // up dragging around a stack of objects...
235  if( selection.Front()->IsNew() )
236  return 0;
237 
238  if( !selection.Front()->IsMoving() )
240 
241  EDA_ITEMS newItems;
242 
243  for( unsigned ii = 0; ii < selection.GetSize(); ++ii )
244  {
245  LIB_ITEM* oldItem = static_cast<LIB_ITEM*>( selection.GetItem( ii ) );
246  LIB_ITEM* newItem = (LIB_ITEM*) oldItem->Clone();
247  newItem->SetFlags( IS_NEW );
248  newItems.push_back( newItem );
249 
250  part->GetDrawItems().push_back( newItem );
251  getView()->Add( newItem );
252  }
253 
255  m_toolMgr->RunAction( EE_ACTIONS::addItemsToSel, true, &newItems );
257 
258  return 0;
259 }
LIB_PART * GetCurPart() const
Return the current part being edited or NULL if none selected.
static TOOL_ACTION addItemsToSel
Selects a list of items (specified as the event parameter)
Definition: ee_actions.h:64
bool IsMoving() const
Definition: base_struct.h:224
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
virtual EDA_ITEM * Clone() const
Function Clone creates a duplicate of this item with linked list members set to NULL.
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67
bool IsNew() const
Definition: base_struct.h:222
#define IS_NEW
New item, just created.
Definition: base_struct.h:114
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:259
LIB_ITEMS_CONTAINER & GetDrawItems()
Return a reference to the draw item list.
std::vector< EDA_ITEM * > EDA_ITEMS
Define list of drawing items for screens.
Definition: base_struct.h:588
void push_back(T *aItem)
Definition: multivector.h:169
Define a library symbol object.
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:143
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:57
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
Definition: selection.h:103
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:35
virtual unsigned int GetSize() const override
Function GetSize() Returns the number of stored items.
Definition: selection.h:98
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO_T aType, bool aAppend=false)
Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.
Definition: ee_tool_base.h:120
static KICAD_T nonFields[]
static TOOL_ACTION move
Definition: ee_actions.h:116
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:346
SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
EDA_ITEM * Front() const
Definition: selection.h:155

References KIGFX::VIEW::Add(), EE_ACTIONS::addItemsToSel, EE_ACTIONS::clearSelection, EDA_ITEM::Clone(), SELECTION::Front(), LIB_EDIT_FRAME::GetCurPart(), LIB_PART::GetDrawItems(), SELECTION::GetItem(), SELECTION::GetSize(), TOOL_BASE::getView(), IS_NEW, EDA_ITEM::IsMoving(), EDA_ITEM::IsNew(), EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, 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(), EDA_ITEM::SetFlags(), and UR_LIBEDIT.

Referenced by setTransitions().

◆ editFieldProperties()

void LIB_EDIT_TOOL::editFieldProperties ( LIB_FIELD aField)
private

Definition at line 450 of file lib_edit_tool.cpp.

451 {
452  if( aField == NULL )
453  return;
454 
455  wxString caption;
456  LIB_PART* parent = aField->GetParent();
457  wxCHECK( parent, /* void */ );
458 
459  // Editing the component value field is equivalent to creating a new component based
460  // on the current component. Set the dialog message to inform the user.
461  if( aField->GetId() == VALUE )
462  caption = _( "Edit Component Name" );
463  else
464  caption.Printf( _( "Edit %s Field" ), GetChars( aField->GetName() ) );
465 
466  DIALOG_LIB_EDIT_ONE_FIELD dlg( m_frame, caption, aField );
467 
468  // The dialog may invoke a kiway player for footprint fields
469  // so we must use a quasimodal dialog.
470  if( dlg.ShowQuasiModal() != wxID_OK )
471  return;
472 
473  wxString newFieldValue = LIB_ID::FixIllegalChars( dlg.GetText(), LIB_ID::ID_SCH );
474  wxString oldFieldValue = aField->GetFullText( m_frame->GetUnit() );
475  bool renamed = aField->GetId() == VALUE && newFieldValue != oldFieldValue;
476 
477  if( renamed )
479  else
480  saveCopyInUndoList( parent, UR_LIBEDIT );
481 
482  dlg.UpdateField( aField );
483 
484  if( renamed )
485  {
486  parent->SetName( newFieldValue );
487  m_frame->UpdateAfterSymbolProperties( &oldFieldValue, nullptr );
488  }
489  else
490  {
491  updateView( aField );
492  m_frame->GetCanvas()->Refresh();
493  m_frame->OnModify( );
494  }
495 }
wxString GetName(bool aTranslate=true) const
Returns the field name.
Definition: lib_field.cpp:408
LIB_PART * GetParent() const
void UpdateAfterSymbolProperties(wxString *aOldName, wxArrayString *aOldAliases)
Definition: libedit.cpp:549
int GetId() const
Definition: lib_field.h:139
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...
#define VALUE
Class DIALOG_LIB_EDIT_ONE_FIELD is a the class to handle editing a single component field in the libr...
SCH_DRAW_PANEL * GetCanvas() const override
Define a library symbol object.
void updateView(EDA_ITEM *aItem) const
Similar to getView()->Update(), but handles items that are redrawn by their parents.
Definition: ee_tool_base.h:107
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:100
wxString GetFullText(int unit=1) const
Return the text of a field.
Definition: lib_field.cpp:331
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO_T aType, bool aAppend=false)
Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.
Definition: ee_tool_base.h:120
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_ID::FixIllegalChars(), SCH_BASE_FRAME::GetCanvas(), GetChars(), 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, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, LIB_EDIT_FRAME::OnModify(), SCH_DRAW_PANEL::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 >::updateView(), UR_LIB_RENAME, UR_LIBEDIT, and VALUE.

Referenced by Properties().

◆ editGraphicProperties()

void LIB_EDIT_TOOL::editGraphicProperties ( LIB_ITEM aItem)
private

Definition at line 405 of file lib_edit_tool.cpp.

406 {
407  if( aItem == NULL )
408  return;
409 
410  DIALOG_LIB_EDIT_DRAW_ITEM dialog( m_frame, aItem );
411 
412  if( dialog.ShowModal() != wxID_OK )
413  return;
414 
415  if( aItem->IsFillable() )
416  aItem->SetFillMode( (FILL_T) dialog.GetFillStyle() );
417 
418  aItem->SetWidth( dialog.GetWidth() );
419 
420  updateView( aItem );
421  m_frame->GetCanvas()->Refresh();
422  m_frame->OnModify( );
423 
424  m_frame->g_LastLineWidth = dialog.GetWidth();
425  m_frame->m_DrawSpecificConvert = !dialog.GetApplyToAllConversions();
426  m_frame->m_DrawSpecificUnit = !dialog.GetApplyToAllUnits();
427 
428  MSG_PANEL_ITEMS items;
429  aItem->GetMsgPanelInfo( m_frame->GetUserUnits(), items );
430  m_frame->SetMsgPanel( items );
431 }
void GetMsgPanelInfo(EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList) override
Display basic info (type, part and convert) about the current item in message panel.
bool m_DrawSpecificUnit
Specify which component parts the current draw item applies to.
virtual void SetWidth(int aWidth)=0
Set the width of the draw item to aWidth.
static int g_LastLineWidth
void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
bool m_DrawSpecificConvert
Convert of the item currently being drawn.
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
EDA_UNITS_T GetUserUnits() const override
Return the user units currently in use.
Definition: draw_frame.h:289
SCH_DRAW_PANEL * GetCanvas() const override
void SetFillMode(FILL_T aFillMode)
Dialog to edit library component graphic items.
void updateView(EDA_ITEM *aItem) const
Similar to getView()->Update(), but handles items that are redrawn by their parents.
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.
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
Definition: msgpanel.h:102
FILL_T
Enum FILL_T is the set of fill types used in plotting or drawing enclosed areas.
Definition: base_struct.h:54
bool IsFillable() const
Check if draw object can be filled.

References LIB_EDIT_FRAME::g_LastLineWidth, DIALOG_LIB_EDIT_DRAW_ITEM::GetApplyToAllConversions(), DIALOG_LIB_EDIT_DRAW_ITEM::GetApplyToAllUnits(), SCH_BASE_FRAME::GetCanvas(), DIALOG_LIB_EDIT_DRAW_ITEM::GetFillStyle(), LIB_ITEM::GetMsgPanelInfo(), EDA_DRAW_FRAME::GetUserUnits(), DIALOG_LIB_EDIT_DRAW_ITEM::GetWidth(), LIB_ITEM::IsFillable(), LIB_EDIT_FRAME::m_DrawSpecificConvert, LIB_EDIT_FRAME::m_DrawSpecificUnit, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, LIB_EDIT_FRAME::OnModify(), SCH_DRAW_PANEL::Refresh(), LIB_ITEM::SetFillMode(), EDA_DRAW_FRAME::SetMsgPanel(), LIB_ITEM::SetWidth(), and EE_TOOL_BASE< LIB_EDIT_FRAME >::updateView().

Referenced by Properties().

◆ editSymbolProperties()

void LIB_EDIT_TOOL::editSymbolProperties ( )
private

Definition at line 498 of file lib_edit_tool.cpp.

499 {
500  LIB_PART* part = m_frame->GetCurPart();
501  bool partLocked = part->UnitsLocked();
502  wxString oldName = part->GetName();
503  wxArrayString oldAliases = part->GetAliasNames( false );
504 
507 
509 
510  // This dialog itself subsequently can invoke a KIWAY_PLAYER as a quasimodal
511  // frame. Therefore this dialog as a modal frame parent, MUST be run under
512  // quasimodal mode for the quasimodal frame support to work. So don't use
513  // the QUASIMODAL macros here.
514  if( dlg.ShowQuasiModal() != wxID_OK )
515  return;
516 
517  // if m_UnitSelectionLocked has changed, set some edit options or defaults
518  // to the best value
519  if( partLocked != part->UnitsLocked() )
520  {
521  // Enable synchronized pin edit mode for symbols with interchangeable units
522  m_frame->m_SyncPinEdit = !part->UnitsLocked();
523  // also set default edit options to the better value
524  // Usually if units are locked, graphic items are specific to each unit
525  // and if units are interchangeable, graphic items are common to units
527  }
528 
529  m_frame->UpdateAfterSymbolProperties( &oldName, &oldAliases );
530 }
bool m_DrawSpecificUnit
Specify which component parts the current draw item applies to.
LIB_PART * GetCurPart() const
Return the current part being edited or NULL if none selected.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
static TOOL_ACTION cancelInteractive
Definition: actions.h:45
void UpdateAfterSymbolProperties(wxString *aOldName, wxArrayString *aOldAliases)
Definition: libedit.cpp:549
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
wxArrayString GetAliasNames(bool aIncludeRoot=true) const
Define a library symbol object.
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:57
bool m_SyncPinEdit
Set to true to not synchronize pins at the same position when editing symbols with multiple units or ...
const wxString & GetName() const
bool UnitsLocked() const
Check whether part units are interchangeable.

References ACTIONS::cancelInteractive, EE_ACTIONS::clearSelection, LIB_PART::GetAliasNames(), LIB_EDIT_FRAME::GetCurPart(), LIB_PART::GetName(), LIB_EDIT_FRAME::m_DrawSpecificUnit, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, LIB_EDIT_FRAME::m_SyncPinEdit, TOOL_BASE::m_toolMgr, TOOL_MANAGER::RunAction(), DIALOG_SHIM::ShowQuasiModal(), LIB_PART::UnitsLocked(), and LIB_EDIT_FRAME::UpdateAfterSymbolProperties().

Referenced by Properties().

◆ editTextProperties()

void LIB_EDIT_TOOL::editTextProperties ( LIB_ITEM aItem)
private

Definition at line 434 of file lib_edit_tool.cpp.

435 {
436  if ( ( aItem == NULL ) || ( aItem->Type() != LIB_TEXT_T ) )
437  return;
438 
439  DIALOG_LIB_EDIT_TEXT dlg( m_frame, (LIB_TEXT*) aItem );
440 
441  if( dlg.ShowModal() != wxID_OK )
442  return;
443 
444  updateView( aItem );
445  m_frame->GetCanvas()->Refresh();
446  m_frame->OnModify( );
447 }
Define a symbol library graphical text item.
Definition: lib_text.h:44
void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
SCH_DRAW_PANEL * GetCanvas() const override
void updateView(EDA_ITEM *aItem) const
Similar to getView()->Update(), but handles items that are redrawn by their parents.
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: base_struct.h:204

References SCH_BASE_FRAME::GetCanvas(), LIB_TEXT_T, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, LIB_EDIT_FRAME::OnModify(), SCH_DRAW_PANEL::Refresh(), EDA_ITEM::Type(), and EE_TOOL_BASE< LIB_EDIT_FRAME >::updateView().

Referenced by Properties().

◆ evActivate()

const TOOL_EVENT TOOL_INTERACTIVE::evActivate ( std::string  aToolName = "")
protectedinherited

functions below are not yet implemented - their interface may change

◆ evButtonDown()

const TOOL_EVENT TOOL_INTERACTIVE::evButtonDown ( int  aButton = BUT_ANY)
protectedinherited

◆ evButtonUp()

const TOOL_EVENT TOOL_INTERACTIVE::evButtonUp ( int  aButton = BUT_ANY)
protectedinherited

◆ evClick()

const TOOL_EVENT TOOL_INTERACTIVE::evClick ( int  aButton = BUT_ANY)
protectedinherited

◆ evCommand() [1/2]

const TOOL_EVENT TOOL_INTERACTIVE::evCommand ( int  aCommandId = -1)
protectedinherited

◆ evCommand() [2/2]

const TOOL_EVENT TOOL_INTERACTIVE::evCommand ( std::string  aCommandStr = "")
protectedinherited

◆ evDrag()

const TOOL_EVENT TOOL_INTERACTIVE::evDrag ( int  aButton = BUT_ANY)
protectedinherited

◆ evMotion()

const TOOL_EVENT TOOL_INTERACTIVE::evMotion ( )
protectedinherited

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

189  {
190  return static_cast<T*>( getEditFrameInt() );
191  }
wxWindow * getEditFrameInt() const
Definition: tool_base.cpp:47

References TOOL_BASE::getEditFrameInt().

Referenced by ZONE_CREATE_HELPER::commitZone(), ZONE_CREATE_HELPER::createNewZone(), and TOOL_SETTINGS::getConfigBase().

◆ GetId()

TOOL_ID TOOL_BASE::GetId ( ) const
inlineinherited

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

The identifier is set by an instance of TOOL_MANAGER.

Returns
Identifier of the tool.

Definition at line 122 of file tool_base.h.

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

References TOOL_BASE::m_toolId.

Referenced by TOOL_MANAGER::finishTool(), TOOL_MANAGER::InitTools(), TOOL_MANAGER::isActive(), TOOL_MANAGER::RegisterTool(), ACTION_MANAGER::RunHotKey(), TOOL_MANAGER::runTool(), and TOOL_MANAGER::saveViewControls().

◆ GetManager()

TOOL_MANAGER* TOOL_BASE::GetManager ( ) const
inlineinherited

Function GetManager() Returns the instance of TOOL_MANAGER that takes care of the tool.

Returns
Instance of the TOOL_MANAGER. If there is no TOOL_MANAGER associated, it returns NULL.

Definition at line 144 of file tool_base.h.

145  {
146  return m_toolMgr;
147  }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216

References TOOL_BASE::m_toolMgr.

Referenced by BOARD_COMMIT::BOARD_COMMIT(), ZONE_CREATE_HELPER::createNewZone(), PCB_TOOL_BASE::doInteractiveItemPlacement(), ACTION_MENU::getToolManager(), 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 199 of file tool_base.h.

200  {
201  EDA_ITEM* m = getModelInt();
202  wxASSERT( dynamic_cast<T*>( m ) );
203 
204  return static_cast<T*>( m );
205  }
EDA_ITEM * getModelInt() const
Definition: tool_base.cpp:53
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:157

References TOOL_BASE::getModelInt().

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

◆ GetName()

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

Function GetName() Returns the name of the tool.

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

Returns
The name of the tool.

Definition at line 133 of file tool_base.h.

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

References TOOL_BASE::m_toolName.

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

◆ GetSettings()

TOOL_SETTINGS & TOOL_BASE::GetSettings ( )
inherited

Definition at line 77 of file tool_base.cpp.

78 {
79  return m_toolSettings;
80 }
TOOL_SETTINGS m_toolSettings
Definition: tool_base.h:217

References TOOL_BASE::m_toolSettings.

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

◆ GetToolMenu()

TOOL_MENU& EE_TOOL_BASE< LIB_EDIT_FRAME >::GetToolMenu ( )
inlineinherited

Get the tool's top-level context menu

Definition at line 103 of file ee_tool_base.h.

103 { return m_menu; }
TOOL_MENU m_menu
Menu model displayed by the tool.
Definition: ee_tool_base.h:147

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

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

References TOOL_BASE::m_type.

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

◆ getView()

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

Function getView()

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

Returns
The instance of VIEW.

Definition at line 35 of file tool_base.cpp.

36 {
37  return m_toolMgr->GetView();
38 }
KIGFX::VIEW * GetView() const
Definition: tool_manager.h:252
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216

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

Referenced by EE_POINT_EDITOR::addCornerCondition(), ALIGN_DISTRIBUTE_TOOL::AlignLeft(), ALIGN_DISTRIBUTE_TOOL::AlignRight(), COMMON_TOOLS::CenterContents(), EE_SELECTION_TOOL::clearSelection(), PCB_EDITOR_CONTROL::CrossProbeSchToPcb(), COMMON_TOOLS::CursorControl(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), COMMON_TOOLS::doGridPreset(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), MICROWAVE_TOOL::drawMicrowaveInductor(), PCB_EDITOR_CONTROL::DrillOrigin(), Duplicate(), MODULE_EDITOR_TOOLS::EnumeratePads(), SELECTION_TOOL::findCallback(), ROUTER_TOOL::getStartLayer(), PCBNEW_CONTROL::GridResetOrigin(), PCBNEW_CONTROL::GridSetOrigin(), SELECTION_TOOL::guessSelectionCandidates(), EE_SELECTION_TOOL::highlight(), SELECTION_TOOL::highlight(), GERBVIEW_CONTROL::HighlightControl(), PNS::TOOL_BASE::highlightNet(), PCBNEW_CONTROL::LayerAlphaDec(), PCBNEW_CONTROL::LayerAlphaInc(), EE_POINT_EDITOR::Main(), CVPCB_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), POINT_EDITOR::OnSelectionChange(), COMMON_TOOLS::PanControl(), Paste(), PNS::TOOL_BASE::pickSingleItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Remove(), POINT_EDITOR::removeCorner(), 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(), GERBVIEW_SELECTION_TOOL::selectionContains(), EE_SELECTION_TOOL::selectionContains(), SELECTION_TOOL::selectionContains(), GERBVIEW_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::SelectPoint(), ZOOM_TOOL::selectRegion(), GERBVIEW_SELECTION_TOOL::selectVisually(), COMMON_TOOLS::ToggleGrid(), SCH_EDITOR_CONTROL::ToggleHiddenPins(), EE_SELECTION_TOOL::unhighlight(), SELECTION_TOOL::unhighlight(), GERBVIEW_SELECTION_TOOL::unselect(), GERBVIEW_SELECTION_TOOL::unselectVisually(), EE_POINT_EDITOR::updateEditedPoint(), POINT_EDITOR::updateEditedPoint(), PCBNEW_CONTROL::updateGrid(), EE_POINT_EDITOR::updateItem(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), EE_POINT_EDITOR::updatePoints(), POINT_EDITOR::updatePoints(), SELECTION_TOOL::updateSelection(), PNS::TOOL_BASE::updateStartItem(), EE_TOOL_BASE< SCH_BASE_FRAME >::updateView(), PCB_TOOL_BASE::view(), COMMON_TOOLS::ZoomFitScreen(), GERBVIEW_SELECTION_TOOL::zoomFitSelection(), SELECTION_TOOL::zoomFitSelection(), CVPCB_SELECTION_TOOL::~CVPCB_SELECTION_TOOL(), 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 41 of file tool_base.cpp.

42 {
43  return m_toolMgr->GetViewControls();
44 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
KIGFX::VIEW_CONTROLS * GetViewControls() const
Definition: tool_manager.h:257

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

Referenced by EE_POINT_EDITOR::addCorner(), POINT_EDITOR::addCorner(), EE_POINT_EDITOR::addCornerCondition(), SCH_EDIT_TOOL::BreakWire(), PCB_TOOL_BASE::controls(), COMMON_TOOLS::CursorControl(), SCH_WIRE_BUS_TOOL::doDrawSegments(), SCH_DRAWING_TOOLS::doPlaceComponent(), SCH_DRAWING_TOOLS::doSingleClickPlace(), LIB_DRAWING_TOOLS::doTwoClickPlace(), SCH_DRAWING_TOOLS::doTwoClickPlace(), COMMON_TOOLS::doZoomToPreset(), MICROWAVE_TOOL::drawMicrowaveInductor(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), MODULE_EDITOR_TOOLS::EnumeratePads(), SELECTION_TOOL::findMove(), SCH_WIRE_BUS_TOOL::finishSegments(), SCH_EDITOR_CONTROL::HighlightNet(), PCB_EDITOR_CONTROL::HighlightNet(), PCB_EDITOR_CONTROL::HighlightNetCursor(), SCH_MOVE_TOOL::Main(), EE_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), EE_PICKER_TOOL::Main(), PICKER_TOOL::Main(), CVPCB_SELECTION_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), EDIT_TOOL::Main(), ROUTER_TOOL::mainLoop(), CVPCB_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), POINT_EDITOR::OnSelectionChange(), ROUTER_TOOL::performDragging(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceImage(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), SCH_EDIT_TOOL::RepeatDrawItem(), EE_SELECTION_TOOL::RequestSelection(), POINT_EDITOR::Reset(), DRAWING_TOOL::Reset(), CVPCB_CONTROL::ResetCoords(), GERBVIEW_CONTROL::ResetCoords(), PCBNEW_CONTROL::ResetCoords(), GERBVIEW_SELECTION_TOOL::selectCursor(), SELECTION_TOOL::selectCursor(), GERBVIEW_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::SelectNode(), ZOOM_TOOL::selectRegion(), ALIGN_DISTRIBUTE_TOOL::selectTarget(), EE_PICKER_TOOL::setControls(), PICKER_TOOL::setControls(), EE_POINT_EDITOR::setEditedPoint(), POINT_EDITOR::setEditedPoint(), LIB_MOVE_TOOL::updateModificationPoint(), SCH_MOVE_TOOL::updateModificationPoint(), EDIT_TOOL::updateModificationPoint(), and COMMON_TOOLS::ZoomCenter().

◆ Go()

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

Function Go()

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

Definition at line 135 of file tool_interactive.h.

137 {
138  TOOL_STATE_FUNC sptr = std::bind( aStateFunc, static_cast<T*>( this ), std::placeholders::_1 );
139 
140  goInternal( sptr, aConditions );
141 }
std::function< int(const TOOL_EVENT &)> TOOL_STATE_FUNC
Definition: tool_base.h:59
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(), MICROWAVE_TOOL::setTransitions(), ROUTER_TOOL::setTransitions(), PAD_TOOL::setTransitions(), EE_INSPECTION_TOOL::setTransitions(), EE_POINT_EDITOR::setTransitions(), LIB_CONTROL::setTransitions(), LIB_PIN_TOOL::setTransitions(), ZONE_FILLER_TOOL::setTransitions(), CVPCB_CONTROL::setTransitions(), LIB_DRAWING_TOOLS::setTransitions(), LIB_MOVE_TOOL::setTransitions(), POINT_EDITOR::setTransitions(), GERBVIEW_CONTROL::setTransitions(), SCH_MOVE_TOOL::setTransitions(), setTransitions(), SCH_EDIT_TOOL::setTransitions(), POSITION_RELATIVE_TOOL::setTransitions(), COMMON_TOOLS::setTransitions(), CVPCB_SELECTION_TOOL::setTransitions(), SCH_DRAWING_TOOLS::setTransitions(), MODULE_EDITOR_TOOLS::setTransitions(), SCH_WIRE_BUS_TOOL::setTransitions(), ALIGN_DISTRIBUTE_TOOL::setTransitions(), PCBNEW_CONTROL::setTransitions(), GERBVIEW_SELECTION_TOOL::setTransitions(), SCH_EDITOR_CONTROL::setTransitions(), EE_PICKER_TOOL::setTransitions(), PICKER_TOOL::setTransitions(), PCB_EDITOR_CONTROL::setTransitions(), SELECTION_TOOL::setTransitions(), EDIT_TOOL::setTransitions(), DRAWING_TOOL::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 58 of file lib_edit_tool.cpp.

59 {
61 
64 
65  wxASSERT_MSG( drawingTools, "libedit.InteractiveDrawing tool is not available" );
66 
67  //
68  // Add edit actions to the move tool menu
69  //
70  if( moveTool )
71  {
72  CONDITIONAL_MENU& moveMenu = moveTool->GetToolMenu().GetMenu();
73 
81 
83 
87  }
88 
89  //
90  // Add editing actions to the drawing tool menu
91  //
92  CONDITIONAL_MENU& drawMenu = drawingTools->GetToolMenu().GetMenu();
93 
94  drawMenu.AddSeparator( EE_CONDITIONS::NotEmpty, 200 );
99 
100  drawMenu.AddItem( EE_ACTIONS::properties, EE_CONDITIONS::Count( 1 ), 200 );
101 
102  //
103  // Add editing actions to the selection tool menu
104  //
106 
113 
114  selToolMenu.AddItem( EE_ACTIONS::properties, EE_CONDITIONS::Count( 1 ), 200 );
115 
116  selToolMenu.AddSeparator( EE_CONDITIONS::Idle, 300 );
119  selToolMenu.AddItem( ACTIONS::paste, EE_CONDITIONS::Idle, 300 );
120 
121  return true;
122 }
static TOOL_ACTION properties
Definition: ee_actions.h:124
static TOOL_ACTION duplicate
Definition: ee_actions.h:118
TOOL_MENU & GetToolMenu()
void AddSeparator(const SELECTION_CONDITION &aCondition=SELECTION_CONDITIONS::ShowAlways, int aOrder=ANY_ORDER)
Function AddSeparator()
Class LIB_DRAWING_TOOLS.
CONDITIONAL_MENU & GetMenu()
Function GetMenu.
Definition: tool_menu.cpp:46
static TOOL_ACTION mirrorY
Definition: ee_actions.h:123
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
static SELECTION_CONDITION IdleSelection
static SELECTION_CONDITION Idle
static SELECTION_CONDITION Count(int aNumber)
Function Count Creates a functor that tests if the number of selected items is equal to the value giv...
TOOL_MENU & GetToolMenu()
Get the tool's top-level context menu
Definition: ee_tool_base.h:103
static bool NotEmpty(const SELECTION &aSelection)
Function NotEmpty Tests if there are any items selected.
static TOOL_ACTION rotateCW
Definition: ee_actions.h:120
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:53
static TOOL_ACTION rotateCCW
Definition: ee_actions.h:121
static TOOL_ACTION cut
Definition: actions.h:52
static TOOL_ACTION mirrorX
Definition: ee_actions.h:122
static TOOL_ACTION doDelete
Definition: ee_actions.h:131
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:143
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Function AddItem()
static TOOL_ACTION paste
Definition: actions.h:54

References CONDITIONAL_MENU::AddItem(), CONDITIONAL_MENU::AddSeparator(), ACTIONS::copy, SELECTION_CONDITIONS::Count(), ACTIONS::cut, EE_ACTIONS::doDelete, EE_ACTIONS::duplicate, TOOL_MENU::GetMenu(), TOOL_MANAGER::GetTool(), EE_SELECTION_TOOL::GetToolMenu(), EE_TOOL_BASE< T >::GetToolMenu(), EE_CONDITIONS::Idle, EE_CONDITIONS::IdleSelection, EE_TOOL_BASE< T >::Init(), 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, and EE_ACTIONS::rotateCW.

◆ IsToolActive()

bool TOOL_BASE::IsToolActive ( ) const
inherited

Definition at line 30 of file tool_base.cpp.

31 {
32  return m_toolMgr->IsToolActive( m_toolId );
33 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
TOOL_ID m_toolId
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:211
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.

◆ Mirror()

int LIB_EDIT_TOOL::Mirror ( const TOOL_EVENT aEvent)

Definition at line 165 of file lib_edit_tool.cpp.

166 {
168 
169  if( selection.GetSize() == 0 )
170  return 0;
171 
172  wxPoint mirrorPoint;
173  bool xAxis = ( aEvent.Matches( EE_ACTIONS::mirrorX.MakeEvent() ) );
174  LIB_ITEM* item = static_cast<LIB_ITEM*>( selection.Front() );
175 
176  if( !item->IsMoving() )
178 
179  if( selection.GetSize() == 1 )
180  mirrorPoint = item->GetPosition();
181  else
182  mirrorPoint = m_frame->GetNearestGridPosition( mapCoords( selection.GetCenter() ) );
183 
184  for( unsigned ii = 0; ii < selection.GetSize(); ii++ )
185  {
186  item = static_cast<LIB_ITEM*>( selection.GetItem( ii ) );
187 
188  if( xAxis )
189  item->MirrorVertical( mirrorPoint );
190  else
191  item->MirrorHorizontal( mirrorPoint );
192 
193  m_frame->RefreshItem( item );
194  }
195 
197 
198  if( !item->IsMoving() )
199  {
200  if( selection.IsHover() )
202 
203  m_frame->OnModify();
204  }
205 
206  return 0;
207 }
virtual wxPoint GetPosition() const =0
Return the current draw object position.
LIB_PART * GetCurPart() const
Return the current part being edited or NULL if none selected.
VECTOR2I GetCenter() const
Returns the center point of the selection area bounding box.
bool IsHover() const
Definition: selection.h:69
bool IsMoving() const
Definition: base_struct.h:224
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
virtual void MirrorHorizontal(const wxPoint &aCenter)=0
Mirror the draw object along the horizontal (X) axis about aCenter point.
static const TOOL_EVENT SelectedItemsModified
Definition: actions.h:136
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67
static TOOL_ACTION mirrorX
Definition: ee_actions.h:122
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:143
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:338
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:57
static VECTOR2D mapCoords(const wxPoint &aCoord)
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
Definition: selection.h:103
virtual unsigned int GetSize() const override
Function GetSize() Returns the number of stored items.
Definition: selection.h:98
wxPoint GetNearestGridPosition(const wxPoint &aPosition, wxRealPoint *aGridSize=NULL) const
Return the nearest aGridSize location to aPosition.
void RefreshItem(EDA_ITEM *aItem, bool isAddOrDelete=false)
Mark an item for refresh.
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO_T aType, bool aAppend=false)
Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.
Definition: ee_tool_base.h:120
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:238
SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
EDA_ITEM * Front() const
Definition: selection.h:155

References EE_ACTIONS::clearSelection, SELECTION::Front(), SELECTION::GetCenter(), LIB_EDIT_FRAME::GetCurPart(), SELECTION::GetItem(), EDA_DRAW_FRAME::GetNearestGridPosition(), LIB_ITEM::GetPosition(), SELECTION::GetSize(), SELECTION::IsHover(), EDA_ITEM::IsMoving(), 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(), SCH_BASE_FRAME::RefreshItem(), EE_SELECTION_TOOL::RequestSelection(), TOOL_MANAGER::RunAction(), EE_TOOL_BASE< LIB_EDIT_FRAME >::saveCopyInUndoList(), EVENTS::SelectedItemsModified, and UR_LIBEDIT.

Referenced by setTransitions().

◆ Paste()

int LIB_EDIT_TOOL::Paste ( const TOOL_EVENT aEvent)

Definition at line 614 of file lib_edit_tool.cpp.

615 {
616  LIB_PART* part = m_frame->GetCurPart();
617 
618  if( !part )
619  return 0;
620 
621  std::string text = m_toolMgr->GetClipboard();
622  STRING_LINE_READER reader( text, "Clipboard" );
623  LIB_PART* newPart;
624  EDA_ITEMS newItems;
625 
626  try
627  {
628  reader.ReadLine();
629  newPart = SCH_LEGACY_PLUGIN::ParsePart( reader );
630  }
631  catch( IO_ERROR& e )
632  {
633  wxLogError( wxString::Format( "Malformed clipboard: %s" ), GetChars( e.What() ) );
634  return -1;
635  }
636 
637  for( LIB_ITEM& item : newPart->GetDrawItems() )
638  {
639  if( item.Type() == LIB_FIELD_T )
640  continue;
641 
642  LIB_ITEM* newItem = (LIB_ITEM*) item.Clone();
643  newItem->SetFlags( IS_NEW );
644  newItems.push_back( newItem );
645 
646  part->GetDrawItems().push_back( newItem );
647  getView()->Add( newItem );
648  }
649 
650  delete newPart;
651 
653  m_toolMgr->RunAction( EE_ACTIONS::addItemsToSel, true, &newItems );
655 
656  return 0;
657 }
LIB_PART * GetCurPart() const
Return the current part being edited or NULL if none selected.
static TOOL_ACTION addItemsToSel
Selects a list of items (specified as the event parameter)
Definition: ee_actions.h:64
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
static LIB_PART * ParsePart(LINE_READER &aReader, int majorVersion=0, int minorVersion=0)
virtual EDA_ITEM * Clone() const
Function Clone creates a duplicate of this item with linked list members set to NULL.
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67
#define IS_NEW
New item, just created.
Definition: base_struct.h:114
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:259
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
LIB_ITEMS_CONTAINER & GetDrawItems()
Return a reference to the draw item list.
std::vector< EDA_ITEM * > EDA_ITEMS
Define list of drawing items for screens.
Definition: base_struct.h:588
void push_back(T *aItem)
Definition: multivector.h:169
Define a library symbol object.
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:57
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:35
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:100
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
std::string GetClipboard() const
Returns the information currently stored in the system clipboard.
static TOOL_ACTION move
Definition: ee_actions.h:116
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:346
Class STRING_LINE_READER is a LINE_READER that reads from a multiline 8 bit wide std::string.
Definition: richio.h:254
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

References KIGFX::VIEW::Add(), EE_ACTIONS::addItemsToSel, EE_ACTIONS::clearSelection, EDA_ITEM::Clone(), Format(), GetChars(), TOOL_MANAGER::GetClipboard(), LIB_EDIT_FRAME::GetCurPart(), LIB_PART::GetDrawItems(), TOOL_BASE::getView(), IS_NEW, LIB_FIELD_T, EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, TOOL_BASE::m_toolMgr, EE_ACTIONS::move, SCH_LEGACY_PLUGIN::ParsePart(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::push_back(), STRING_LINE_READER::ReadLine(), TOOL_MANAGER::RunAction(), EDA_ITEM::SetFlags(), and IO_ERROR::What().

Referenced by setTransitions().

◆ PinTable()

int LIB_EDIT_TOOL::PinTable ( const TOOL_EVENT aEvent)

Definition at line 533 of file lib_edit_tool.cpp.

534 {
535  LIB_PART* part = m_frame->GetCurPart();
536 
538 
540 
541  DIALOG_LIB_EDIT_PIN_TABLE dlg( m_frame, part );
542 
543  if( dlg.ShowModal() == wxID_CANCEL )
544  return -1;
545 
546  m_frame->RebuildView();
547  m_frame->OnModify();
548 
549  return 0;
550 }
LIB_PART * GetCurPart() const
Return the current part being edited or NULL if none selected.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
Define a library symbol object.
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:57
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO_T aType, bool aAppend=false)
Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.
Definition: ee_tool_base.h:120
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(), EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame, TOOL_BASE::m_toolMgr, LIB_EDIT_FRAME::OnModify(), LIB_EDIT_FRAME::RebuildView(), TOOL_MANAGER::RunAction(), EE_TOOL_BASE< LIB_EDIT_FRAME >::saveCopyInUndoList(), and UR_LIBEDIT.

Referenced by setTransitions().

◆ Properties()

int LIB_EDIT_TOOL::Properties ( const TOOL_EVENT aEvent)

Definition at line 350 of file lib_edit_tool.cpp.

351 {
353 
354  if( selection.Empty() || aEvent.IsAction( &EE_ACTIONS::symbolProperties ) )
355  {
356  if( m_frame->GetCurPart() )
358  }
359  else if( selection.Size() == 1 )
360  {
361  LIB_ITEM* item = (LIB_ITEM*) selection.Front();
362 
363  // Save copy for undo if not in edit (edit command already handle the save copy)
364  if( !item->InEditMode() )
366 
367  switch( item->Type() )
368  {
369  case LIB_PIN_T:
370  {
372 
373  if( pinTool )
374  pinTool->EditPinProperties( (LIB_PIN*) item );
375 
376  break;
377  }
378  case LIB_ARC_T:
379  case LIB_CIRCLE_T:
380  case LIB_RECTANGLE_T:
381  case LIB_POLYLINE_T:
382  editGraphicProperties( item );
383  break;
384 
385  case LIB_TEXT_T:
386  editTextProperties( item );
387  break;
388 
389  case LIB_FIELD_T:
390  editFieldProperties( (LIB_FIELD*) item );
391  break;
392 
393  default:
394  wxFAIL_MSG( wxT( "Unhandled item <" ) + item->GetClass() + wxT( ">" ) );
395  break;
396  }
397  }
398 
400 
401  return 0;
402 }
LIB_PART * GetCurPart() const
Return the current part being edited or NULL if none selected.
LIB_PART * GetParent() const
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
Field object used in symbol libraries.
Definition: lib_field.h:59
static const TOOL_EVENT SelectedItemsModified
Definition: actions.h:136
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67
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:54
void editTextProperties(LIB_ITEM *aItem)
void editSymbolProperties()
void editGraphicProperties(LIB_ITEM *aItem)
bool InEditMode() const
Return the draw item editing mode status.
static TOOL_ACTION symbolProperties
Definition: ee_actions.h:165
bool EditPinProperties(LIB_PIN *aPin)
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:143
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:119
virtual wxString GetClass() const =0
Function GetClass returns the class name.
int Size() const
Returns the number of selected parts.
Definition: selection.h:125
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO_T aType, bool aAppend=false)
Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.
Definition: ee_tool_base.h:120
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:238
SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
void editFieldProperties(LIB_FIELD *aField)
EDA_ITEM * Front() const
Definition: selection.h:155
KICAD_T Type() const
Function Type()
Definition: base_struct.h:204

References editFieldProperties(), editGraphicProperties(), LIB_PIN_TOOL::EditPinProperties(), editSymbolProperties(), editTextProperties(), SELECTION::Empty(), SELECTION::Front(), LIB_FIELD::GetClass(), LIB_EDIT_FRAME::GetCurPart(), LIB_ITEM::GetParent(), TOOL_MANAGER::GetTool(), LIB_ITEM::InEditMode(), TOOL_EVENT::IsAction(), LIB_ARC_T, LIB_CIRCLE_T, LIB_FIELD_T, LIB_PIN_T, LIB_POLYLINE_T, LIB_RECTANGLE_T, LIB_TEXT_T, 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, EDA_ITEM::Type(), and UR_LIBEDIT.

Referenced by setTransitions().

◆ Redo()

int LIB_EDIT_TOOL::Redo ( const TOOL_EVENT aEvent)

Definition at line 560 of file lib_edit_tool.cpp.

561 {
563  return 0;
564 }
void GetComponentFromRedoList()

References LIB_EDIT_FRAME::GetComponentFromRedoList(), and EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame.

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:83
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:35

◆ Rotate()

int LIB_EDIT_TOOL::Rotate ( const TOOL_EVENT aEvent)

Definition at line 125 of file lib_edit_tool.cpp.

126 {
128 
129  if( selection.GetSize() == 0 )
130  return 0;
131 
132  wxPoint rotPoint;
133  bool ccw = ( aEvent.Matches( EE_ACTIONS::rotateCCW.MakeEvent() ) );
134  LIB_ITEM* item = static_cast<LIB_ITEM*>( selection.Front() );
135 
136  if( !item->IsMoving() )
138 
139  if( selection.GetSize() == 1 )
140  rotPoint = item->GetPosition();
141  else
142  rotPoint = m_frame->GetNearestGridPosition( mapCoords( selection.GetCenter() ) );
143 
144  for( unsigned ii = 0; ii < selection.GetSize(); ii++ )
145  {
146  item = static_cast<LIB_ITEM*>( selection.GetItem( ii ) );
147  item->Rotate( rotPoint, ccw );
148  m_frame->RefreshItem( item );
149  }
150 
152 
153  if( !item->IsMoving() )
154  {
155  if( selection.IsHover() )
157 
158  m_frame->OnModify();
159  }
160 
161  return 0;
162 }
virtual wxPoint GetPosition() const =0
Return the current draw object position.
LIB_PART * GetCurPart() const
Return the current part being edited or NULL if none selected.
VECTOR2I GetCenter() const
Returns the center point of the selection area bounding box.
bool IsHover() const
Definition: selection.h:69
bool IsMoving() const
Definition: base_struct.h:224
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
static const TOOL_EVENT SelectedItemsModified
Definition: actions.h:136
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67
static TOOL_ACTION rotateCCW
Definition: ee_actions.h:121
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:143
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:338
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:57
static VECTOR2D mapCoords(const wxPoint &aCoord)
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
Definition: selection.h:103
virtual unsigned int GetSize() const override
Function GetSize() Returns the number of stored items.
Definition: selection.h:98
wxPoint GetNearestGridPosition(const wxPoint &aPosition, wxRealPoint *aGridSize=NULL) const
Return the nearest aGridSize location to aPosition.
void RefreshItem(EDA_ITEM *aItem, bool isAddOrDelete=false)
Mark an item for refresh.
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO_T aType, bool aAppend=false)
Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.
Definition: ee_tool_base.h:120
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:238
SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
EDA_ITEM * Front() const
Definition: selection.h:155

References EE_ACTIONS::clearSelection, SELECTION::Front(), SELECTION::GetCenter(), LIB_EDIT_FRAME::GetCurPart(), SELECTION::GetItem(), EDA_DRAW_FRAME::GetNearestGridPosition(), LIB_ITEM::GetPosition(), SELECTION::GetSize(), SELECTION::IsHover(), EDA_ITEM::IsMoving(), 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(), SCH_BASE_FRAME::RefreshItem(), EE_SELECTION_TOOL::RequestSelection(), LIB_ITEM::Rotate(), EE_ACTIONS::rotateCCW, TOOL_MANAGER::RunAction(), EE_TOOL_BASE< LIB_EDIT_FRAME >::saveCopyInUndoList(), EVENTS::SelectedItemsModified, and UR_LIBEDIT.

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

86 {
87  m_toolMgr->RunMainStack( this, std::move( aFunc ) );
88 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
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_T  aType,
bool  aAppend = false 
)
inlineprotectedinherited

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

Definition at line 120 of file ee_tool_base.h.

121  {
122  KICAD_T itemType = aItem->Type();
123 
124  if( m_isLibEdit )
125  {
126  LIB_EDIT_FRAME* editFrame = dynamic_cast<LIB_EDIT_FRAME*>( m_frame );
127  editFrame->SaveCopyInUndoList( (LIB_ITEM*) aItem, aType, aAppend );
128  }
129  else
130  {
131  SCH_EDIT_FRAME* editFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
132 
133  if( itemType == SCH_PIN_T || itemType == SCH_FIELD_T || itemType == SCH_SHEET_PIN_T )
134  editFrame->SaveCopyInUndoList( (SCH_ITEM*) aItem->GetParent(), UR_CHANGED, aAppend );
135  else
136  editFrame->SaveCopyInUndoList( (SCH_ITEM*) aItem, aType, aAppend );
137  }
138  }
Schematic editor (Eeschema) main window.
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67
void SaveCopyInUndoList(SCH_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, bool aAppend=false, const wxPoint &aTransformPoint=wxPoint(0, 0))
Create a copy of the current schematic item, and put it in the undo list.
EDA_ITEM * GetParent() const
Definition: base_struct.h:214
The symbol library editor main window.
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
Definition: sch_item.h:114
void SaveCopyInUndoList(EDA_ITEM *ItemToCopy, UNDO_REDO_T undoType=UR_LIBEDIT, bool aAppend=false)
Create a copy of the current component, and save it in the undo list.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:204

◆ 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 74 of file tool_interactive.cpp.

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

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

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), LENGTH_TUNER_TOOL::mainLoop(), ROUTER_TOOL::mainLoop(), TOOL_MENU::ShowContextMenu(), and SCH_WIRE_BUS_TOOL::UnfoldBus().

◆ setTransitions()

void LIB_EDIT_TOOL::setTransitions ( )
overrideprivatevirtual

Sets up handlers for various events.

Implements TOOL_INTERACTIVE.

Definition at line 660 of file lib_edit_tool.cpp.

661 {
669 
673 
674  Go( &LIB_EDIT_TOOL::Undo, ACTIONS::undo.MakeEvent() );
675  Go( &LIB_EDIT_TOOL::Redo, ACTIONS::redo.MakeEvent() );
676  Go( &LIB_EDIT_TOOL::Cut, ACTIONS::cut.MakeEvent() );
677  Go( &LIB_EDIT_TOOL::Copy, ACTIONS::copy.MakeEvent() );
678  Go( &LIB_EDIT_TOOL::Paste, ACTIONS::paste.MakeEvent() );
679 }
static TOOL_ACTION pinTable
Definition: ee_actions.h:166
static TOOL_ACTION properties
Definition: ee_actions.h:124
static TOOL_ACTION deleteItemCursor
Definition: ee_actions.h:167
static TOOL_ACTION duplicate
Definition: ee_actions.h:118
static TOOL_ACTION mirrorY
Definition: ee_actions.h:123
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:120
static TOOL_ACTION copy
Definition: actions.h:53
static TOOL_ACTION rotateCCW
Definition: ee_actions.h:121
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:165
int Undo(const TOOL_EVENT &aEvent)
static TOOL_ACTION cut
Definition: actions.h:52
static TOOL_ACTION mirrorX
Definition: ee_actions.h:122
static TOOL_ACTION doDelete
Definition: ee_actions.h:131
int Redo(const TOOL_EVENT &aEvent)
int DeleteItemCursor(const TOOL_EVENT &aEvent)
Runs the deletion tool.
static TOOL_ACTION redo
Definition: actions.h:51
int PinTable(const TOOL_EVENT &aEvent)
int Paste(const TOOL_EVENT &aEvent)
static TOOL_ACTION undo
Definition: actions.h:50
int Cut(const TOOL_EVENT &aEvent)
int Copy(const TOOL_EVENT &aEvent)
static TOOL_ACTION paste
Definition: actions.h:54
int Rotate(const TOOL_EVENT &aEvent)

References Copy(), ACTIONS::copy, Cut(), ACTIONS::cut, DeleteItemCursor(), EE_ACTIONS::deleteItemCursor, DoDelete(), EE_ACTIONS::doDelete, Duplicate(), EE_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 553 of file lib_edit_tool.cpp.

554 {
556  return 0;
557 }

References LIB_EDIT_FRAME::GetComponentFromUndoList(), and EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame.

Referenced by setTransitions().

◆ updateView()

void EE_TOOL_BASE< LIB_EDIT_FRAME >::updateView ( EDA_ITEM aItem) const
inlineprotectedinherited

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

Definition at line 107 of file ee_tool_base.h.

108  {
109  KICAD_T itemType = aItem->Type();
110 
111  if( itemType == SCH_PIN_T || itemType == SCH_FIELD_T || itemType == SCH_SHEET_PIN_T )
112  getView()->Update( aItem->GetParent() );
113 
114  getView()->Update( aItem );
115  }
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
EDA_ITEM * GetParent() const
Definition: base_struct.h:214
virtual void Update(VIEW_ITEM *aItem, int aUpdateFlags)
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1539
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:35
KICAD_T Type() const
Function Type()
Definition: base_struct.h:204

◆ Wait()

OPT_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 55 of file tool_interactive.cpp.

56 {
57  return m_toolMgr->ScheduleWait( this, aEventList );
58 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:216
OPT< 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 DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), SCH_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), SCH_DRAWING_TOOLS::doPlaceComponent(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), SCH_DRAWING_TOOLS::doSingleClickPlace(), LIB_DRAWING_TOOLS::doTwoClickPlace(), SCH_DRAWING_TOOLS::doTwoClickPlace(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::drawZone(), PCB_EDITOR_CONTROL::DrillOrigin(), MODULE_EDITOR_TOOLS::EnumeratePads(), PCBNEW_CONTROL::GridSetOrigin(), SCH_EDITOR_CONTROL::HighlightNetCursor(), PCB_EDITOR_CONTROL::HighlightNetCursor(), ROUTER_TOOL::InlineDrag(), ZOOM_TOOL::Main(), SCH_MOVE_TOOL::Main(), EE_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), EE_PICKER_TOOL::Main(), PICKER_TOOL::Main(), CVPCB_SELECTION_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), EDIT_TOOL::Main(), SELECTION_TOOL::Main(), LENGTH_TUNER_TOOL::mainLoop(), ROUTER_TOOL::mainLoop(), CVPCB_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), POINT_EDITOR::OnSelectionChange(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), EDIT_TOOL::pickCopyReferencePoint(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), GERBVIEW_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(), PCB_EDITOR_CONTROL::ShowLocalRatsnest(), and SCH_WIRE_BUS_TOOL::UnfoldBus().

Member Data Documentation

◆ m_frame

LIB_EDIT_FRAME * EE_TOOL_BASE< LIB_EDIT_FRAME >::m_frame
protectedinherited

Definition at line 141 of file ee_tool_base.h.

◆ m_isLibEdit

bool EE_TOOL_BASE< LIB_EDIT_FRAME >::m_isLibEdit
protectedinherited

Definition at line 144 of file ee_tool_base.h.

◆ m_menu

TOOL_MENU EE_TOOL_BASE< LIB_EDIT_FRAME >::m_menu
protectedinherited

Menu model displayed by the tool.

Definition at line 147 of file ee_tool_base.h.

◆ m_selectionTool

EE_SELECTION_TOOL* EE_TOOL_BASE< LIB_EDIT_FRAME >::m_selectionTool
protectedinherited

Definition at line 143 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 211 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 216 of file tool_base.h.

Referenced by TOOL_INTERACTIVE::Activate(), EE_SELECTION_TOOL::AddItemsToSel(), EE_SELECTION_TOOL::AddItemToSel(), SCH_DRAWING_TOOLS::AddJunction(), SCH_DRAWING_TOOLS::AddLabel(), TOOL_BASE::attachManager(), PCB_EDITOR_CONTROL::calculateSelectionRatsnest(), ROUTER_TOOL::CanInlineDrag(), SCH_EDITOR_CONTROL::ClearHighlight(), PCB_EDITOR_CONTROL::ClearHighlight(), GERBVIEW_SELECTION_TOOL::clearSelection(), EE_SELECTION_TOOL::clearSelection(), SELECTION_TOOL::clearSelection(), SCH_EDIT_TOOL::ConvertDeMorgan(), Copy(), PAD_TOOL::copyPadSettings(), MODULE_EDITOR_TOOLS::CreatePadFromShapes(), PCB_EDITOR_CONTROL::CrossProbePcbToSch(), PCB_EDITOR_CONTROL::CrossProbeSchToPcb(), COMMON_TOOLS::CursorControl(), ROUTER_TOOL::CustomTrackWidthDialog(), SCH_EDITOR_CONTROL::Cut(), DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCBNEW_CONTROL::DeleteItemCursor(), SCH_EDITOR_CONTROL::doCopy(), SCH_EDITOR_CONTROL::doCrossProbeSchToPcb(), DoDelete(), SCH_EDIT_TOOL::DoDelete(), SCH_WIRE_BUS_TOOL::doDrawSegments(), SCH_DRAWING_TOOLS::doPlaceComponent(), SCH_DRAWING_TOOLS::doSingleClickPlace(), LIB_DRAWING_TOOLS::doTwoClickPlace(), SCH_DRAWING_TOOLS::doTwoClickPlace(), DRAWING_TOOL::drawArc(), SCH_WIRE_BUS_TOOL::DrawBusses(), DRAWING_TOOL::DrawDimension(), SCH_WIRE_BUS_TOOL::DrawLines(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_WIRE_BUS_TOOL::DrawWires(), DRAWING_TOOL::drawZone(), PCB_EDITOR_CONTROL::DrillOrigin(), Duplicate(), SCH_EDIT_TOOL::Duplicate(), EDIT_TOOL::Duplicate(), EDIT_TOOL::editFootprintInFpEditor(), editSymbolProperties(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), SCH_EDITOR_CONTROL::EnterSheet(), MODULE_EDITOR_TOOLS::EnumeratePads(), EDIT_TOOL::ExchangeFootprints(), SELECTION_TOOL::expandConnection(), MODULE_EDITOR_TOOLS::ExplodePadToShapes(), SELECTION_TOOL::findCallback(), SELECTION_TOOL::findMove(), SCH_WIRE_BUS_TOOL::finishSegments(), EDIT_TOOL::Flip(), TOOL_BASE::getEditFrameInt(), TOOL_BASE::GetManager(), TOOL_BASE::getModelInt(), DRAWING_TOOL::getSourceZoneForAction(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), TOOL_INTERACTIVE::goInternal(), PCBNEW_CONTROL::GridSetOrigin(), GERBVIEW_CONTROL::HighlightControl(), SCH_EDITOR_CONTROL::HighlightNet(), PCB_EDITOR_CONTROL::HighlightNet(), SCH_EDITOR_CONTROL::HighlightNetCursor(), PCB_EDITOR_CONTROL::HighlightNetCursor(), Init(), SCH_EDIT_TOOL::Init(), PAD_TOOL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), PCB_EDITOR_CONTROL::Init(), POINT_EDITOR::Init(), POSITION_RELATIVE_TOOL::Init(), EDIT_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), EDIT_TOOL::invokeInlineRouter(), EDIT_TOOL::isInteractiveDragEnabled(), TOOL_BASE::IsToolActive(), ZOOM_TOOL::Main(), SCH_MOVE_TOOL::Main(), EE_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), EE_PICKER_TOOL::Main(), PICKER_TOOL::Main(), EDIT_TOOL::Main(), EE_SELECTION_TOOL::Main(), SELECTION_TOOL::Main(), LENGTH_TUNER_TOOL::mainLoop(), ROUTER_TOOL::mainLoop(), Mirror(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::Mirror(), PCB_EDITOR_CONTROL::modifyLockSelected(), EDIT_TOOL::MoveExact(), POINT_EDITOR::OnSelectionChange(), Paste(), SCH_EDITOR_CONTROL::Paste(), PAD_TOOL::pastePadProperties(), EDIT_TOOL::pickCopyReferencePoint(), PinTable(), PCBNEW_CONTROL::placeBoardItems(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), Properties(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), PAD_TOOL::pushPadSettings(), SCH_EDITOR_CONTROL::Redo(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), EDIT_TOOL::Remove(), POINT_EDITOR::removeCorner(), EE_SELECTION_TOOL::RemoveItemFromSel(), EE_SELECTION_TOOL::RemoveItemsFromSel(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_DRAWING_TOOLS::RepeatDrawItem(), SELECTION_TOOL::RequestSelection(), CVPCB_CONTROL::ResetCoords(), PCBNEW_CONTROL::ResetCoords(), TOOL_INTERACTIVE::resetTransitions(), Rotate(), SCH_EDIT_TOOL::Rotate(), EDIT_TOOL::Rotate(), TOOL_INTERACTIVE::RunMainStack(), EE_SELECTION_TOOL::SelectConnection(), SELECTION_TOOL::selectCopper(), PCB_TOOL_BASE::selection(), GERBVIEW_SELECTION_TOOL::SelectItem(), SELECTION_TOOL::SelectItem(), GERBVIEW_SELECTION_TOOL::SelectItems(), SELECTION_TOOL::SelectItems(), GERBVIEW_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectNet(), EE_SELECTION_TOOL::SelectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), SELECTION_TOOL::selectSameSheet(), SELECTION_TOOL::selectSheetContents(), TOOL_INTERACTIVE::SetContextMenu(), PCB_EDITOR_CONTROL::ShowLocalRatsnest(), SCH_WIRE_BUS_TOOL::StartBus(), SCH_WIRE_BUS_TOOL::StartLine(), SCH_WIRE_BUS_TOOL::StartWire(), GERBVIEW_SELECTION_TOOL::toggleSelection(), EE_SELECTION_TOOL::toggleSelection(), SELECTION_TOOL::toggleSelection(), PCB_EDITOR_CONTROL::TrackWidthDec(), PCB_EDITOR_CONTROL::TrackWidthInc(), SCH_EDITOR_CONTROL::Undo(), SCH_WIRE_BUS_TOOL::UnfoldBus(), GERBVIEW_SELECTION_TOOL::UnselectItem(), SELECTION_TOOL::UnselectItem(), GERBVIEW_SELECTION_TOOL::UnselectItems(), SELECTION_TOOL::UnselectItems(), EE_INSPECTION_TOOL::UpdateMessagePanel(), PCB_EDITOR_CONTROL::UpdateSelectionRatsnest(), PCB_EDITOR_CONTROL::ViaSizeDec(), PCB_EDITOR_CONTROL::ViaSizeInc(), TOOL_INTERACTIVE::Wait(), PCB_EDITOR_CONTROL::ZoneDuplicate(), and PCB_EDITOR_CONTROL::ZoneMerge().

◆ m_toolName

std::string TOOL_BASE::m_toolName
protectedinherited

Name of the tool.

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

Definition at line 215 of file tool_base.h.

Referenced by TOOL_BASE::GetName().

◆ m_toolSettings

TOOL_SETTINGS TOOL_BASE::m_toolSettings
protectedinherited

Definition at line 217 of file tool_base.h.

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

◆ m_type

TOOL_TYPE TOOL_BASE::m_type
protectedinherited

Stores the type of the tool.

Definition at line 208 of file tool_base.h.

Referenced by TOOL_BASE::GetType().

◆ m_view

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

Definition at line 142 of file ee_tool_base.h.


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