KiCad PCB EDA Suite
SCH_EDIT_TOOL Class Reference

#include <sch_edit_tool.h>

Inheritance diagram for SCH_EDIT_TOOL:
EE_TOOL_BASE< SCH_EDIT_FRAME > TOOL_INTERACTIVE TOOL_BASE

Public Types

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

Public Member Functions

 SCH_EDIT_TOOL ()
 
 ~SCH_EDIT_TOOL () override
 
bool Init () override
 Init() is called once upon a registration of the tool. More...
 
int Rotate (const TOOL_EVENT &aEvent)
 
int Mirror (const TOOL_EVENT &aEvent)
 
int RepeatDrawItem (const TOOL_EVENT &aEvent)
 
int Properties (const TOOL_EVENT &aEvent)
 
int EditField (const TOOL_EVENT &aEvent)
 
int AutoplaceFields (const TOOL_EVENT &aEvent)
 
int ChangeSymbols (const TOOL_EVENT &aEvent)
 
int ConvertDeMorgan (const TOOL_EVENT &aEvent)
 
int EditPageNumber (const TOOL_EVENT &aEvent)
 
int ChangeTextType (const TOOL_EVENT &aEvent)
 Change a text type to another one. More...
 
int BreakWire (const TOOL_EVENT &aEvent)
 
int CleanupSheetPins (const TOOL_EVENT &aEvent)
 
int GlobalEdit (const TOOL_EVENT &aEvent)
 Delete the selected items, or the item under the cursor. More...
 
int DoDelete (const TOOL_EVENT &aEvent)
 Run the deletion tool. More...
 
int DeleteItemCursor (const TOOL_EVENT &aEvent)
 
void Reset (RESET_REASON aReason) override
 Bring the tool to a known, initial state. More...
 
void Activate ()
 Run the tool. More...
 
TOOL_MENUGetToolMenu ()
 
void SetContextMenu (ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger=CMENU_BUTTON)
 Assign a context menu and tells when it should be activated. More...
 
void RunMainStack (std::function< void()> aFunc)
 Call a function using the main stack. More...
 
template<class T >
void Go (int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
 Define which state (aStateFunc) to go when a certain event arrives (aConditions). More...
 
TOOL_EVENTWait (const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
 Suspend execution of the tool until an event specified in aEventList arrives. More...
 
TOOL_TYPE GetType () const
 Return the type of the tool. More...
 
TOOL_ID GetId () const
 Return the unique identifier of the tool. More...
 
const std::string & GetName () const
 Return the name of the tool. More...
 
TOOL_MANAGERGetManager () const
 Return the instance of TOOL_MANAGER that takes care of the tool. More...
 
bool IsToolActive () const
 

Protected Member Functions

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

Protected Attributes

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

Private Member Functions

void editFieldText (SCH_FIELD *aField)
 Set up handlers for various events. More...
 
void setTransitions () override
 This method is meant to be overridden in order to specify handlers for events. More...
 

Private Attributes

EDA_ITEMm_pickerItem
 

Detailed Description

Definition at line 36 of file sch_edit_tool.h.

Member Enumeration Documentation

◆ RESET_REASON

enum TOOL_BASE::RESET_REASON
inherited

Determine the reason of reset for a tool.

Enumerator
RUN 

Tool is invoked after being inactive.

MODEL_RELOAD 

Model changes (required full reload)

GAL_SWITCH 

Rendering engine changes.

Definition at line 77 of file tool_base.h.

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

Constructor & Destructor Documentation

◆ SCH_EDIT_TOOL()

SCH_EDIT_TOOL::SCH_EDIT_TOOL ( )

Definition at line 134 of file sch_edit_tool.cpp.

134  :
135  EE_TOOL_BASE<SCH_EDIT_FRAME>( "eeschema.InteractiveEdit" )
136 {
137  m_pickerItem = nullptr;
138 }
EDA_ITEM * m_pickerItem
Definition: sch_edit_tool.h:87

References m_pickerItem.

◆ ~SCH_EDIT_TOOL()

SCH_EDIT_TOOL::~SCH_EDIT_TOOL ( )
inlineoverride

Definition at line 40 of file sch_edit_tool.h.

40 { }

Member Function Documentation

◆ Activate()

void TOOL_INTERACTIVE::Activate ( )
inherited

Run the tool.

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

Definition at line 51 of file tool_interactive.cpp.

52 {
54 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
TOOL_ID m_toolId
Name of the tool.
Definition: tool_base.h:209
bool InvokeTool(TOOL_ID aToolId)
Call a tool by sending a tool activation event to tool of given ID.

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

Referenced by AUTOPLACE_TOOL::autoplace(), EDIT_TOOL::copyToClipboard(), SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::DrawRectangle(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), BOARD_EDITOR_CONTROL::DrillOrigin(), PAD_TOOL::EnumeratePads(), PCB_CONTROL::GridSetOrigin(), SCH_EDITOR_CONTROL::HighlightNetCursor(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), PCB_PICKER_TOOL::Main(), PL_EDIT_TOOL::Main(), EE_POINT_EDITOR::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PL_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), LIB_TREE::onContextMenu(), PCB_POINT_EDITOR::OnSelectionChange(), GROUP_TOOL::PickNewMember(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), DRAWING_TOOL::SetAnchor(), DRC_TOOL::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ attachManager()

void TOOL_BASE::attachManager ( TOOL_MANAGER aManager)
protectedinherited

Set the TOOL_MANAGER the tool will belong to.

Called by TOOL_MANAGER::RegisterTool()

Definition at line 60 of file tool_base.cpp.

61 {
62  m_toolMgr = aManager;
63 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214

References TOOL_BASE::m_toolMgr.

Referenced by TOOL_MANAGER::RegisterTool().

◆ AutoplaceFields()

int SCH_EDIT_TOOL::AutoplaceFields ( const TOOL_EVENT aEvent)

Definition at line 1177 of file sch_edit_tool.cpp.

1178 {
1180 
1181  if( selection.Empty() )
1182  return 0;
1183 
1184  for( EDA_ITEM* item : selection )
1185  {
1186  SCH_ITEM* sch_item = static_cast<SCH_ITEM*>( item );
1187 
1188  if( !sch_item->IsNew() )
1190 
1191  sch_item->AutoplaceFields( m_frame->GetScreen(), /* aManual */ true );
1192  updateItem( sch_item, true );
1193  }
1194 
1195  m_frame->OnModify();
1196 
1197  if( selection.IsHover() )
1199 
1200  return 0;
1201 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
static const KICAD_T FieldOwners[]
Definition: ee_collectors.h:48
bool IsNew() const
Definition: eda_item.h:119
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Return either an existing selection (filtered), or the selection at the current cursor if the existin...
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aType, bool aAppend=false)
Definition: ee_tool_base.h:134
virtual void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual)
Definition: sch_item.h:447
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:177
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:53
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:97
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:103
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:193

References SCH_ITEM::AutoplaceFields(), CHANGED, EE_ACTIONS::clearSelection, SELECTION::Empty(), EE_COLLECTOR::FieldOwners, SCH_EDIT_FRAME::GetScreen(), EDA_ITEM::IsNew(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, SCH_EDIT_FRAME::OnModify(), EE_SELECTION_TOOL::RequestSelection(), TOOL_MANAGER::RunAction(), EE_TOOL_BASE< SCH_EDIT_FRAME >::saveCopyInUndoList(), and EE_TOOL_BASE< SCH_EDIT_FRAME >::updateItem().

Referenced by setTransitions().

◆ BreakWire()

int SCH_EDIT_TOOL::BreakWire ( const TOOL_EVENT aEvent)

Definition at line 1619 of file sch_edit_tool.cpp.

1620 {
1621  wxPoint cursorPos = (wxPoint) getViewControls()->GetCursorPosition( !aEvent.DisableGridSnapping() );
1623 
1624  std::vector<SCH_LINE*> lines;
1625 
1626  for( EDA_ITEM* item : selection )
1627  {
1628  if( SCH_LINE* line = dyn_cast<SCH_LINE*>( item ) )
1629  {
1630  if( !line->IsEndPoint( cursorPos ) )
1631  lines.push_back( line );
1632  }
1633  }
1634 
1636  m_frame->StartNewUndo();
1637 
1638  for( SCH_LINE* line : lines )
1639  m_frame->BreakSegment( line, cursorPos );
1640 
1641  if( !lines.empty() )
1642  {
1643  if( m_frame->GetScreen()->IsJunctionNeeded( cursorPos, true ) )
1644  m_frame->AddJunction( m_frame->GetScreen(), cursorPos, true, false );
1645 
1647 
1648  m_frame->OnModify();
1649  m_frame->GetCanvas()->Refresh();
1650 
1652  }
1653 
1654  return 0;
1655 }
void StartNewUndo()
Create a new, blank stack for future Undo commands to be pushed to.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
SCH_JUNCTION * AddJunction(SCH_SCREEN *aScreen, const wxPoint &aPos, bool aAppendToUndo, bool aFinal=true)
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Return either an existing selection (filtered), or the selection at the current cursor if the existin...
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:177
bool DisableGridSnapping() const
Definition: tool_event.h:341
bool BreakSegment(SCH_LINE *aSegment, const wxPoint &aPoint, SCH_LINE **aNewSegment=nullptr, SCH_SCREEN *aScreen=nullptr)
Break a single segment into two at the specified point.
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:37
int ClearSelection(const TOOL_EVENT &aEvent)
Select all visible items in sheet.
static TOOL_ACTION drag
Definition: ee_actions.h:111
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
bool IsJunctionNeeded(const wxPoint &aPosition, bool aNew=false) const
Test if a junction is required for the items at aPosition on the screen.
Definition: sch_screen.cpp:401
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
Definition: tool_base.cpp:42
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
static const KICAD_T WiresOnly[]
Definition: ee_collectors.h:47

References SCH_EDIT_FRAME::AddJunction(), SCH_EDIT_FRAME::BreakSegment(), EE_SELECTION_TOOL::ClearSelection(), TOOL_EVENT::DisableGridSnapping(), EE_ACTIONS::drag, SCH_BASE_FRAME::GetCanvas(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), SCH_EDIT_FRAME::GetScreen(), TOOL_BASE::getViewControls(), SCH_SCREEN::IsJunctionNeeded(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, SCH_EDIT_FRAME::OnModify(), EDA_DRAW_PANEL_GAL::Refresh(), EE_SELECTION_TOOL::RequestSelection(), TOOL_MANAGER::RunAction(), SCH_EDIT_FRAME::StartNewUndo(), SCH_EDIT_FRAME::TestDanglingEnds(), and EE_COLLECTOR::WiresOnly.

Referenced by setTransitions().

◆ ChangeSymbols()

int SCH_EDIT_TOOL::ChangeSymbols ( const TOOL_EVENT aEvent)

Definition at line 1204 of file sch_edit_tool.cpp.

1205 {
1206  SCH_SYMBOL* selectedSymbol = nullptr;
1208 
1209  if( !selection.Empty() )
1210  selectedSymbol = dynamic_cast<SCH_SYMBOL*>( selection.Front() );
1211 
1213 
1214  if( aEvent.IsAction( &EE_ACTIONS::changeSymbol )
1215  || aEvent.IsAction( &EE_ACTIONS::changeSymbols ) )
1216  {
1218  }
1219 
1220  DIALOG_CHANGE_SYMBOLS dlg( m_frame, selectedSymbol, mode );
1221 
1222  dlg.ShowQuasiModal();
1223 
1224  return 0;
1225 }
static TOOL_ACTION changeSymbol
Definition: ee_actions.h:145
Dialog to update or change schematic library symbols.
bool IsAction(const TOOL_ACTION *aAction) const
Test if the event contains an action issued upon activation of the given TOOL_ACTION.
Definition: tool_event.cpp:88
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Return either an existing selection (filtered), or the selection at the current cursor if the existin...
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:177
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:97
Schematic symbol object.
Definition: sch_symbol.h:78
static TOOL_ACTION changeSymbols
Definition: ee_actions.h:143
static const KICAD_T SymbolsOnly[]
Definition: ee_collectors.h:45
EDA_ITEM * Front() const
Definition: selection.h:144

References DIALOG_CHANGE_SYMBOLS::CHANGE, EE_ACTIONS::changeSymbol, EE_ACTIONS::changeSymbols, SELECTION::Empty(), SELECTION::Front(), TOOL_EVENT::IsAction(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, EE_SELECTION_TOOL::RequestSelection(), DIALOG_SHIM::ShowQuasiModal(), EE_COLLECTOR::SymbolsOnly, and DIALOG_CHANGE_SYMBOLS::UPDATE.

Referenced by setTransitions().

◆ ChangeTextType()

int SCH_EDIT_TOOL::ChangeTextType ( const TOOL_EVENT aEvent)

Change a text type to another one.

The new text, label, hierarchical label, or global label is created from the old text and the old text object is deleted.

A tricky case is when the 'old" text is being edited (i.e. moving) because we must create a new text, and prepare the undo/redo command data for this change and the current move/edit command

Definition at line 1518 of file sch_edit_tool.cpp.

1519 {
1520  KICAD_T convertTo = aEvent.Parameter<KICAD_T>();
1522  EE_SELECTION& selection = m_selectionTool->RequestSelection( allTextTypes );
1523 
1524  for( unsigned int i = 0; i < selection.GetSize(); ++i )
1525  {
1526  SCH_TEXT* text = dynamic_cast<SCH_TEXT*>( selection.GetItem( i ) );
1527 
1528  if( text && text->Type() != convertTo )
1529  {
1530  bool selected = text->IsSelected();
1531  SCH_TEXT* newtext = nullptr;
1532  const wxPoint& position = text->GetPosition();
1533  LABEL_SPIN_STYLE orientation = text->GetLabelSpinStyle();
1534  wxString txt = UnescapeString( text->GetText() );
1535 
1536  // There can be characters in a SCH_TEXT object that can break labels so we have to
1537  // fix them here.
1538  if( text->Type() == SCH_TEXT_T )
1539  {
1540  txt.Replace( "\n", "_" );
1541  txt.Replace( "\r", "_" );
1542  txt.Replace( "\t", "_" );
1543  txt.Replace( " ", "_" );
1544  }
1545 
1546  // label strings are "escaped" i.e. a '/' is replaced by "{slash}"
1547  if( convertTo != SCH_TEXT_T )
1548  txt = EscapeString( txt, CTX_NETNAME );
1549 
1550  switch( convertTo )
1551  {
1552  case SCH_LABEL_T: newtext = new SCH_LABEL( position, txt ); break;
1553  case SCH_GLOBAL_LABEL_T: newtext = new SCH_GLOBALLABEL( position, txt ); break;
1554  case SCH_HIER_LABEL_T: newtext = new SCH_HIERLABEL( position, txt ); break;
1555  case SCH_TEXT_T: newtext = new SCH_TEXT( position, txt ); break;
1556 
1557  default:
1558  wxFAIL_MSG( wxString::Format( "Invalid text type: %d.", convertTo ) );
1559  return 0;
1560  }
1561 
1562  // Copy the old text item settings to the new one. Justifications are not copied
1563  // because they are not used in labels. Justifications will be set to default value
1564  // in the new text item type.
1565  //
1566  newtext->SetFlags( text->GetEditFlags() );
1567  newtext->SetShape( text->GetShape() );
1568  newtext->SetLabelSpinStyle( orientation );
1569  newtext->SetTextSize( text->GetTextSize() );
1570  newtext->SetTextThickness( text->GetTextThickness() );
1571  newtext->SetItalic( text->IsItalic() );
1572  newtext->SetBold( text->IsBold() );
1573  newtext->SetIsDangling( text->IsDangling() );
1574 
1575  if( selected )
1577 
1578  if( !text->IsNew() )
1579  {
1581  saveCopyInUndoList( newtext, UNDO_REDO::NEWITEM, true );
1582 
1584  m_frame->AddToScreen( newtext, m_frame->GetScreen() );
1585 
1586  if( convertTo == SCH_GLOBAL_LABEL_T )
1587  static_cast<SCH_GLOBALLABEL*>( newtext )->UpdateIntersheetRefProps();
1588  }
1589 
1590  if( selected )
1591  m_toolMgr->RunAction( EE_ACTIONS::addItemToSel, true, newtext );
1592 
1593  // Otherwise, pointer is owned by the undo stack
1594  if( text->IsNew() )
1595  delete text;
1596 
1597  if( convertTo == SCH_TEXT_T )
1598  {
1599  if( newtext->IsDangling() )
1600  {
1601  newtext->SetIsDangling( false );
1602  getView()->Update( newtext, KIGFX::REPAINT );
1603  }
1604  }
1605  else
1607 
1608  m_frame->OnModify();
1609  }
1610  }
1611 
1612  if( selection.IsHover() )
1614 
1615  return 0;
1616 }
bool IsDangling() const override
Definition: sch_text.h:230
void SetShape(PINSHEETLABEL_SHAPE aShape)
Definition: sch_text.h:163
bool IsHover() const
Definition: selection.h:73
void SetItalic(bool isItalic)
Definition: eda_text.h:179
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
void SetFlags(EDA_ITEM_FLAGS aMask)
Definition: eda_item.h:153
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
void RemoveFromScreen(EDA_ITEM *aItem, SCH_SCREEN *aScreen)
Remove an item from the screen (and view) aScreen is the screen the item is located on,...
void SetTextSize(const wxSize &aNewSize)
Definition: eda_text.h:237
void SetIsDangling(bool aIsDangling)
Definition: sch_text.h:231
search types array terminator (End Of Types)
Definition: typeinfo.h:81
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
static TOOL_ACTION removeItemFromSel
Definition: ee_actions.h:57
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Return either an existing selection (filtered), or the selection at the current cursor if the existin...
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
Item needs to be redrawn.
Definition: view_item.h:57
static TOOL_ACTION addItemToSel
Selects an item (specified as the event parameter).
Definition: ee_actions.h:56
void TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aType, bool aAppend=false)
Definition: ee_tool_base.h:134
T Parameter() const
Return a non-standard parameter assigned to the event.
Definition: tool_event.h:432
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:177
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:53
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
wxString UnescapeString(const wxString &aSource)
virtual unsigned int GetSize() const override
Return the number of stored items.
Definition: selection.h:87
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
void AddToScreen(EDA_ITEM *aItem, SCH_SCREEN *aScreen)
Add an item to the screen (and view) aScreen is the screen the item is located on,...
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
Definition: selection.cpp:52
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
Definition: eda_text.h:159
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
wxString EscapeString(const wxString &aSource, ESCAPE_CONTEXT aContext)
The Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which are:...
virtual void SetLabelSpinStyle(LABEL_SPIN_STYLE aSpinStyle)
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
Definition: sch_text.cpp:319
void SetBold(bool aBold)
Definition: eda_text.h:182
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: view.cpp:1518

References EE_ACTIONS::addItemToSel, SCH_BASE_FRAME::AddToScreen(), EE_ACTIONS::clearSelection, CTX_NETNAME, DELETED, EOT, EscapeString(), Format(), SELECTION::GetItem(), SCH_EDIT_FRAME::GetScreen(), SELECTION::GetSize(), TOOL_BASE::getView(), SCH_TEXT::IsDangling(), SELECTION::IsHover(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, NEWITEM, SCH_EDIT_FRAME::OnModify(), TOOL_EVENT::Parameter(), SCH_BASE_FRAME::RemoveFromScreen(), EE_ACTIONS::removeItemFromSel, KIGFX::REPAINT, EE_SELECTION_TOOL::RequestSelection(), TOOL_MANAGER::RunAction(), EE_TOOL_BASE< SCH_EDIT_FRAME >::saveCopyInUndoList(), SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, SCH_TEXT_T, EDA_TEXT::SetBold(), EDA_ITEM::SetFlags(), SCH_TEXT::SetIsDangling(), EDA_TEXT::SetItalic(), SCH_TEXT::SetLabelSpinStyle(), SCH_TEXT::SetShape(), EDA_TEXT::SetTextSize(), EDA_TEXT::SetTextThickness(), SCH_EDIT_FRAME::TestDanglingEnds(), text, UnescapeString(), and KIGFX::VIEW::Update().

Referenced by setTransitions().

◆ CleanupSheetPins()

int SCH_EDIT_TOOL::CleanupSheetPins ( const TOOL_EVENT aEvent)

Definition at line 1658 of file sch_edit_tool.cpp.

1659 {
1661  SCH_SHEET* sheet = (SCH_SHEET*) selection.Front();
1662 
1663  if( !sheet || !sheet->HasUndefinedPins() )
1664  return 0;
1665 
1666  if( !IsOK( m_frame, _( "Do you wish to delete the unreferenced pins from this sheet?" ) ) )
1667  return 0;
1668 
1670 
1671  sheet->CleanupSheet();
1672 
1673  updateItem( sheet, true );
1674  m_frame->OnModify();
1675 
1676  if( selection.IsHover() )
1678 
1679  return 0;
1680 }
bool IsHover() const
Definition: selection.h:73
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
bool HasUndefinedPins() const
Check all sheet labels against schematic for undefined hierarchical labels.
Definition: sch_sheet.cpp:372
static const KICAD_T SheetsOnly[]
Definition: ee_collectors.h:46
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Return either an existing selection (filtered), or the selection at the current cursor if the existin...
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aType, bool aAppend=false)
Definition: ee_tool_base.h:134
#define _(s)
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:177
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:53
void CleanupSheet()
Delete sheet label which do not have a corresponding hierarchical label.
Definition: sch_sheet.cpp:471
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:103
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:54
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:315
EDA_ITEM * Front() const
Definition: selection.h:144

References _, CHANGED, SCH_SHEET::CleanupSheet(), EE_ACTIONS::clearSelection, SELECTION::Front(), SCH_SHEET::HasUndefinedPins(), SELECTION::IsHover(), IsOK(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, SCH_EDIT_FRAME::OnModify(), EE_SELECTION_TOOL::RequestSelection(), TOOL_MANAGER::RunAction(), EE_TOOL_BASE< SCH_EDIT_FRAME >::saveCopyInUndoList(), EE_COLLECTOR::SheetsOnly, and EE_TOOL_BASE< SCH_EDIT_FRAME >::updateItem().

Referenced by setTransitions().

◆ ConvertDeMorgan()

int SCH_EDIT_TOOL::ConvertDeMorgan ( const TOOL_EVENT aEvent)

Definition at line 1228 of file sch_edit_tool.cpp.

1229 {
1231 
1232  if( selection.Empty() )
1233  return 0;
1234 
1235  SCH_SYMBOL* symbol = (SCH_SYMBOL*) selection.Front();
1236 
1238  && symbol->GetConvert() == LIB_ITEM::LIB_CONVERT::BASE )
1239  {
1240  return 0;
1241  }
1242 
1244  && symbol->GetConvert() != LIB_ITEM::LIB_CONVERT::DEMORGAN )
1245  {
1246  return 0;
1247  }
1248 
1249  if( !symbol->IsNew() )
1251 
1252  m_frame->ConvertPart( symbol );
1253 
1254  if( symbol->IsNew() )
1256 
1257  if( selection.IsHover() )
1259 
1260  return 0;
1261 }
bool IsHover() const
Definition: selection.h:73
void ConvertPart(SCH_SYMBOL *aSymbol)
Definition: getpart.cpp:237
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
static TOOL_ACTION showDeMorganAlternate
Definition: ee_actions.h:124
bool IsNew() const
Definition: eda_item.h:119
bool IsAction(const TOOL_ACTION *aAction) const
Test if the event contains an action issued upon activation of the given TOOL_ACTION.
Definition: tool_event.cpp:88
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Return either an existing selection (filtered), or the selection at the current cursor if the existin...
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aType, bool aAppend=false)
Definition: ee_tool_base.h:134
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:177
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:53
static TOOL_ACTION showDeMorganStandard
Definition: ee_actions.h:123
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:97
Schematic symbol object.
Definition: sch_symbol.h:78
static const KICAD_T SymbolsOnly[]
Definition: ee_collectors.h:45
int GetConvert() const
Definition: sch_symbol.h:223
static TOOL_ACTION refreshPreview
Definition: actions.h:106
EDA_ITEM * Front() const
Definition: selection.h:144

References CHANGED, EE_ACTIONS::clearSelection, SCH_EDIT_FRAME::ConvertPart(), SELECTION::Empty(), SELECTION::Front(), SCH_SYMBOL::GetConvert(), TOOL_EVENT::IsAction(), SELECTION::IsHover(), EDA_ITEM::IsNew(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, ACTIONS::refreshPreview, EE_SELECTION_TOOL::RequestSelection(), TOOL_MANAGER::RunAction(), EE_TOOL_BASE< SCH_EDIT_FRAME >::saveCopyInUndoList(), EE_ACTIONS::showDeMorganAlternate, EE_ACTIONS::showDeMorganStandard, and EE_COLLECTOR::SymbolsOnly.

Referenced by setTransitions().

◆ DeleteItemCursor()

int SCH_EDIT_TOOL::DeleteItemCursor ( const TOOL_EVENT aEvent)

Definition at line 1026 of file sch_edit_tool.cpp.

1027 {
1028  std::string tool = aEvent.GetCommandStr().get();
1029  PICKER_TOOL* picker = m_toolMgr->GetTool<PICKER_TOOL>();
1030 
1032  m_pickerItem = nullptr;
1033 
1034  // Deactivate other tools; particularly important if another PICKER is currently running
1035  Activate();
1036 
1037  picker->SetCursor( KICURSOR::REMOVE );
1038  picker->SetSnapping( false );
1039 
1040  picker->SetClickHandler(
1041  [this]( const VECTOR2D& aPosition ) -> bool
1042  {
1043  if( m_pickerItem )
1044  {
1046  selectionTool->UnbrightenItem( m_pickerItem );
1047  selectionTool->AddItemToSel( m_pickerItem, true /*quiet mode*/ );
1049  m_pickerItem = nullptr;
1050  }
1051 
1052  return true;
1053  } );
1054 
1055  picker->SetMotionHandler(
1056  [this]( const VECTOR2D& aPos )
1057  {
1058  EE_COLLECTOR collector;
1059  collector.m_Threshold = KiROUND( getView()->ToWorld( HITTEST_THRESHOLD_PIXELS ) );
1060  collector.Collect( m_frame->GetScreen(), deletableItems, (wxPoint) aPos );
1061 
1063  selectionTool->GuessSelectionCandidates( collector, aPos );
1064 
1065  EDA_ITEM* item = collector.GetCount() == 1 ? collector[ 0 ] : nullptr;
1066 
1067  if( m_pickerItem != item )
1068  {
1069  if( m_pickerItem )
1070  selectionTool->UnbrightenItem( m_pickerItem );
1071 
1072  m_pickerItem = item;
1073 
1074  if( m_pickerItem )
1075  selectionTool->BrightenItem( m_pickerItem );
1076  }
1077  } );
1078 
1079  picker->SetFinalizeHandler(
1080  [this]( const int& aFinalState )
1081  {
1082  if( m_pickerItem )
1084 
1085  // Wake the selection tool after exiting to ensure the cursor gets updated
1087  } );
1088 
1089  m_toolMgr->RunAction( ACTIONS::pickerTool, true, &tool );
1090 
1091  return 0;
1092 }
#define HITTEST_THRESHOLD_PIXELS
int m_Threshold
Definition: collector.h:248
static TOOL_ACTION doDelete
Definition: actions.h:72
void Collect(SCH_SCREEN *aScreen, const KICAD_T aFilterList[], const wxPoint &aPos, int aUnit=0, int aConvert=0)
Scan a EDA_ITEM using this class's Inspector method which does the collection.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
void SetFinalizeHandler(FINALIZE_HANDLER aHandler)
Set a handler for the finalize event.
Definition: picker_tool.h:102
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:155
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
int GetCount() const
Return the number of objects in the list.
Definition: collector.h:87
void BrightenItem(EDA_ITEM *aItem)
void SetMotionHandler(MOTION_HANDLER aHandler)
Set a handler for mouse motion.
Definition: picker_tool.h:82
static TOOL_ACTION selectionActivate
Activation of the selection tool.
Definition: ee_actions.h:43
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:53
void UnbrightenItem(EDA_ITEM *aItem)
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
void SetCursor(KICURSOR aCursor)
Definition: picker_tool.h:62
EDA_ITEM * m_pickerItem
Definition: sch_edit_tool.h:87
void SetClickHandler(CLICK_HANDLER aHandler)
Set a handler for mouse click event.
Definition: picker_tool.h:71
OPT< std::string > GetCommandStr() const
Definition: tool_event.h:460
static KICAD_T deletableItems[]
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:73
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
void Activate()
Run the tool.
void SetSnapping(bool aSnap)
Definition: picker_tool.h:64

References TOOL_INTERACTIVE::Activate(), EE_SELECTION_TOOL::AddItemToSel(), EE_SELECTION_TOOL::BrightenItem(), EE_ACTIONS::clearSelection, EE_COLLECTOR::Collect(), deletableItems, ACTIONS::doDelete, TOOL_EVENT::GetCommandStr(), COLLECTOR::GetCount(), SCH_EDIT_FRAME::GetScreen(), TOOL_MANAGER::GetTool(), TOOL_BASE::getView(), EE_SELECTION_TOOL::GuessSelectionCandidates(), HITTEST_THRESHOLD_PIXELS, KiROUND(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, m_pickerItem, COLLECTOR::m_Threshold, TOOL_BASE::m_toolMgr, ACTIONS::pickerTool, REMOVE, TOOL_MANAGER::RunAction(), EE_ACTIONS::selectionActivate, PICKER_TOOL_BASE::SetClickHandler(), PICKER_TOOL_BASE::SetCursor(), PICKER_TOOL_BASE::SetFinalizeHandler(), PICKER_TOOL_BASE::SetMotionHandler(), PICKER_TOOL_BASE::SetSnapping(), and EE_SELECTION_TOOL::UnbrightenItem().

Referenced by setTransitions().

◆ DoDelete()

int SCH_EDIT_TOOL::DoDelete ( const TOOL_EVENT aEvent)

Run the deletion tool.

Definition at line 938 of file sch_edit_tool.cpp.

939 {
940  SCH_SCREEN* screen = m_frame->GetScreen();
942  bool appendToUndo = false;
943  std::vector<wxPoint> pts;
944 
945  if( items.empty() )
946  return 0;
947 
948  // Don't leave a freed pointer in the selection
950 
951  for( EDA_ITEM* item : items )
952  item->ClearFlags( STRUCT_DELETED );
953 
954  for( EDA_ITEM* item : items )
955  {
956  SCH_ITEM* sch_item = dynamic_cast<SCH_ITEM*>( item );
957 
958  if( !sch_item )
959  continue;
960 
961  if( sch_item->IsConnectable() )
962  {
963  std::vector<wxPoint> tmp_pts = sch_item->GetConnectionPoints();
964  pts.insert( pts.end(), tmp_pts.begin(), tmp_pts.end() );
965  }
966 
967  if( sch_item->Type() == SCH_JUNCTION_T )
968  {
969  sch_item->SetFlags( STRUCT_DELETED );
970  // clean up junctions at the end
971  }
972  else if( sch_item->Type() == SCH_SHEET_PIN_T )
973  {
974  SCH_SHEET_PIN* pin = (SCH_SHEET_PIN*) sch_item;
975  SCH_SHEET* sheet = pin->GetParent();
976 
977  if( !alg::contains( items, sheet ) )
978  {
979  pin->SetFlags( STRUCT_DELETED );
980  saveCopyInUndoList( item, UNDO_REDO::DELETED, appendToUndo );
981  appendToUndo = true;
982 
983  updateItem( pin, false );
984 
985  sheet->RemovePin( pin );
986  }
987  }
988  else
989  {
990  sch_item->SetFlags( STRUCT_DELETED );
991  saveCopyInUndoList( item, UNDO_REDO::DELETED, appendToUndo );
992  appendToUndo = true;
993 
994  updateItem( sch_item, false );
995 
996  m_frame->RemoveFromScreen( sch_item, m_frame->GetScreen() );
997 
998  if( sch_item->Type() == SCH_SHEET_T )
1000  }
1001  }
1002 
1003  for( auto point : pts )
1004  {
1005  SCH_ITEM* junction = screen->GetItem( point, 0, SCH_JUNCTION_T );
1006 
1007  if( !junction )
1008  continue;
1009 
1010  if( junction->HasFlag( STRUCT_DELETED ) || !screen->IsJunctionNeeded( point ) )
1011  m_frame->DeleteJunction( junction, appendToUndo );
1012  }
1013 
1015 
1016  m_frame->GetCanvas()->Refresh();
1017  m_frame->OnModify();
1018 
1019  return 0;
1020 }
virtual bool IsConnectable() const
Definition: sch_item.h:358
virtual std::vector< wxPoint > GetConnectionPoints() const
Add all the connection points for this item to aPoints.
Definition: sch_item.h:373
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
bool HasFlag(EDA_ITEM_FLAGS aFlag) const
Definition: eda_item.h:156
void SetFlags(EDA_ITEM_FLAGS aMask)
Definition: eda_item.h:153
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
void RemoveFromScreen(EDA_ITEM *aItem, SCH_SCREEN *aScreen)
Remove an item from the screen (and view) aScreen is the screen the item is located on,...
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Return either an existing selection (filtered), or the selection at the current cursor if the existin...
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aType, bool aAppend=false)
Definition: ee_tool_base.h:134
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
SCH_ITEM * GetItem(const wxPoint &aPosition, int aAccuracy=0, KICAD_T aType=SCH_LOCATE_ANY_T) const
Check aPosition within a distance of aAccuracy for items of type aFilter.
Definition: sch_screen.cpp:340
const std::deque< EDA_ITEM * > GetItems() const
Definition: selection.h:108
void UpdateHierarchyNavigator(bool aForceUpdate=false)
Run the Hierarchy Navigator dialog.
#define STRUCT_DELETED
flag indication structures to be erased
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:177
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet_pin.h:65
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:53
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
Definition: kicad_algo.h:99
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:103
void RemovePin(const SCH_SHEET_PIN *aSheetPin)
Remove aSheetPin from the sheet.
Definition: sch_sheet.cpp:310
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:54
static KICAD_T deletableItems[]
void DeleteJunction(SCH_ITEM *aItem, bool aAppend=false)
Removes a given junction and heals any wire segments under the junction.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
bool IsJunctionNeeded(const wxPoint &aPosition, bool aNew=false) const
Test if a junction is required for the items at aPosition on the screen.
Definition: sch_screen.cpp:401
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:193
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113

References EE_ACTIONS::clearSelection, alg::contains(), deletableItems, DELETED, SCH_EDIT_FRAME::DeleteJunction(), SCH_BASE_FRAME::GetCanvas(), SCH_ITEM::GetConnectionPoints(), SCH_SCREEN::GetItem(), SELECTION::GetItems(), SCH_EDIT_FRAME::GetScreen(), EDA_ITEM::HasFlag(), SCH_ITEM::IsConnectable(), SCH_SCREEN::IsJunctionNeeded(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, SCH_EDIT_FRAME::OnModify(), pin, EDA_DRAW_PANEL_GAL::Refresh(), SCH_BASE_FRAME::RemoveFromScreen(), SCH_SHEET::RemovePin(), EE_SELECTION_TOOL::RequestSelection(), TOOL_MANAGER::RunAction(), EE_TOOL_BASE< SCH_EDIT_FRAME >::saveCopyInUndoList(), SCH_JUNCTION_T, SCH_SHEET_PIN_T, SCH_SHEET_T, EDA_ITEM::SetFlags(), STRUCT_DELETED, SCH_EDIT_FRAME::TestDanglingEnds(), EDA_ITEM::Type(), SCH_EDIT_FRAME::UpdateHierarchyNavigator(), and EE_TOOL_BASE< SCH_EDIT_FRAME >::updateItem().

Referenced by setTransitions().

◆ EditField()

int SCH_EDIT_TOOL::EditField ( const TOOL_EVENT aEvent)

Definition at line 1131 of file sch_edit_tool.cpp.

1132 {
1133  static KICAD_T Nothing[] = { EOT };
1134  static KICAD_T CmpOrReference[] = { SCH_FIELD_LOCATE_REFERENCE_T, SCH_SYMBOL_T, EOT };
1135  static KICAD_T CmpOrValue[] = { SCH_FIELD_LOCATE_VALUE_T, SCH_SYMBOL_T, EOT };
1136  static KICAD_T CmpOrFootprint[] = { SCH_FIELD_LOCATE_FOOTPRINT_T, SCH_SYMBOL_T, EOT };
1137 
1138  KICAD_T* filter = Nothing;
1139 
1140  if( aEvent.IsAction( &EE_ACTIONS::editReference ) )
1141  filter = CmpOrReference;
1142  else if( aEvent.IsAction( &EE_ACTIONS::editValue ) )
1143  filter = CmpOrValue;
1144  else if( aEvent.IsAction( &EE_ACTIONS::editFootprint ) )
1145  filter = CmpOrFootprint;
1146 
1148 
1149  if( selection.Size() != 1 )
1150  return 0;
1151 
1152  SCH_ITEM* item = (SCH_ITEM*) selection.Front();
1153 
1154  if( item->Type() == SCH_SYMBOL_T )
1155  {
1156  SCH_SYMBOL* symbol = (SCH_SYMBOL*) item;
1157 
1158  if( aEvent.IsAction( &EE_ACTIONS::editReference ) )
1159  editFieldText( symbol->GetField( REFERENCE_FIELD ) );
1160  else if( aEvent.IsAction( &EE_ACTIONS::editValue ) )
1161  editFieldText( symbol->GetField( VALUE_FIELD ) );
1162  else if( aEvent.IsAction( &EE_ACTIONS::editFootprint ) )
1163  editFieldText( symbol->GetField( FOOTPRINT_FIELD ) );
1164  }
1165  else if( item->Type() == SCH_FIELD_T )
1166  {
1167  editFieldText( (SCH_FIELD*) item );
1168  }
1169 
1170  if( selection.IsHover() )
1172 
1173  return 0;
1174 }
Field Reference of part, i.e. "IC21".
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:49
bool IsHover() const
Definition: selection.h:73
SCH_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
Definition: sch_symbol.cpp:675
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
search types array terminator (End Of Types)
Definition: typeinfo.h:81
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
bool IsAction(const TOOL_ACTION *aAction) const
Test if the event contains an action issued upon activation of the given TOOL_ACTION.
Definition: tool_event.cpp:88
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Return either an existing selection (filtered), or the selection at the current cursor if the existin...
void editFieldText(SCH_FIELD *aField)
Set up handlers for various events.
static TOOL_ACTION editFootprint
Definition: ee_actions.h:120
Field Value of part, i.e. "3.3K".
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:177
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:53
static TOOL_ACTION editValue
Definition: ee_actions.h:119
Schematic symbol object.
Definition: sch_symbol.h:78
int Size() const
Returns the number of selected parts.
Definition: selection.h:103
static TOOL_ACTION editReference
Definition: ee_actions.h:118
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:193
EDA_ITEM * Front() const
Definition: selection.h:144
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113
Field Name Module PCB, i.e. "16DIP300".

References EE_ACTIONS::clearSelection, editFieldText(), EE_ACTIONS::editFootprint, EE_ACTIONS::editReference, EE_ACTIONS::editValue, EOT, filter, FOOTPRINT_FIELD, SELECTION::Front(), SCH_SYMBOL::GetField(), TOOL_EVENT::IsAction(), SELECTION::IsHover(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, REFERENCE_FIELD, EE_SELECTION_TOOL::RequestSelection(), TOOL_MANAGER::RunAction(), SCH_FIELD_LOCATE_FOOTPRINT_T, SCH_FIELD_LOCATE_REFERENCE_T, SCH_FIELD_LOCATE_VALUE_T, SCH_FIELD_T, SCH_SYMBOL_T, SELECTION::Size(), EDA_ITEM::Type(), and VALUE_FIELD.

Referenced by setTransitions().

◆ editFieldText()

void SCH_EDIT_TOOL::editFieldText ( SCH_FIELD aField)
private

Set up handlers for various events.

Definition at line 1095 of file sch_edit_tool.cpp.

1096 {
1097  // Save old symbol in undo list if not already in edit, or moving.
1098  if( aField->GetEditFlags() == 0 ) // i.e. not edited, or moved
1100 
1101  KICAD_T parentType = aField->GetParent() ? aField->GetParent()->Type() : SCHEMATIC_T;
1102  wxString caption;
1103 
1104  // Use title caps for mandatory fields. "Edit Sheet name Field" looks dorky.
1105  if( parentType == SCH_SYMBOL_T && aField->GetId() < MANDATORY_FIELDS )
1106  caption.Printf( _( "Edit %s Field" ), TitleCaps( aField->GetName() ) );
1107  else if( parentType == SCH_SHEET_T && aField->GetId() < SHEET_MANDATORY_FIELDS )
1108  caption.Printf( _( "Edit %s Field" ), TitleCaps( aField->GetName() ) );
1109  else
1110  caption.Printf( _( "Edit '%s' Field" ), aField->GetName() );
1111 
1112  DIALOG_SCH_FIELD_PROPERTIES dlg( m_frame, caption, aField );
1113 
1114  // The footprint field dialog can invoke a KIWAY_PLAYER so we must use a quasi-modal
1115  if( dlg.ShowQuasiModal() != wxID_OK )
1116  return;
1117 
1118  dlg.UpdateField( aField, &m_frame->GetCurrentSheet() );
1119 
1120  if( m_frame->eeconfig()->m_AutoplaceFields.enable || parentType == SCH_SHEET_T )
1121  static_cast<SCH_ITEM*>( aField->GetParent() )->AutoAutoplaceFields( m_frame->GetScreen() );
1122 
1123  m_frame->UpdateItem( aField );
1124  m_frame->OnModify();
1125 
1126  // This must go after OnModify() so that the connectivity graph will have been updated.
1128 }
void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false)
Mark an item for refresh.
The first 2 are mandatory, and must be instantiated in SCH_SHEET.
Definition: sch_sheet.h:47
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
int GetId() const
Definition: sch_field.h:113
Handle editing a single symbol field in the schematic editor.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
Definition: actions.h:204
EESCHEMA_SETTINGS * eeconfig() const
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
AUTOPLACE_FIELDS m_AutoplaceFields
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aType, bool aAppend=false)
Definition: ee_tool_base.h:134
wxString TitleCaps(const wxString &aString)
Capitalize the first letter in each word.
EDA_ITEM * GetParent() const
Definition: eda_item.h:115
#define _(s)
EDA_ITEM_FLAGS GetEditFlags() const
Definition: eda_item.h:158
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
wxString GetName(bool aUseDefaultName=true) const
Return the field name.
Definition: sch_field.cpp:544
SCH_SHEET_PATH & GetCurrentSheet() const
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
void PostEvent(const TOOL_EVENT &aEvent)
Put an event to the event queue to be processed at the end of event processing cycle.
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113

References _, CHANGED, SCH_BASE_FRAME::eeconfig(), EESCHEMA_SETTINGS::AUTOPLACE_FIELDS::enable, SCH_EDIT_FRAME::GetCurrentSheet(), EDA_ITEM::GetEditFlags(), SCH_FIELD::GetId(), SCH_FIELD::GetName(), EDA_ITEM::GetParent(), SCH_EDIT_FRAME::GetScreen(), EESCHEMA_SETTINGS::m_AutoplaceFields, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, TOOL_BASE::m_toolMgr, MANDATORY_FIELDS, SCH_EDIT_FRAME::OnModify(), TOOL_MANAGER::PostEvent(), EE_TOOL_BASE< SCH_EDIT_FRAME >::saveCopyInUndoList(), SCH_SHEET_T, SCH_SYMBOL_T, SCHEMATIC_T, EVENTS::SelectedItemsModified, SHEET_MANDATORY_FIELDS, DIALOG_SHIM::ShowQuasiModal(), TitleCaps(), EDA_ITEM::Type(), DIALOG_SCH_FIELD_PROPERTIES::UpdateField(), and SCH_BASE_FRAME::UpdateItem().

Referenced by EditField(), and Properties().

◆ EditPageNumber()

int SCH_EDIT_TOOL::EditPageNumber ( const TOOL_EVENT aEvent)

Definition at line 1683 of file sch_edit_tool.cpp.

1684 {
1686 
1687  if( selection.GetSize() > 1 )
1688  return 0;
1689 
1690  SCH_SHEET* sheet = (SCH_SHEET*) selection.Front();
1691 
1692  SCH_SHEET_PATH instance = m_frame->GetCurrentSheet();
1693 
1694  SCH_SCREEN* screen;
1695 
1696  if( sheet )
1697  {
1698  // When changing the page number of a selected sheet, the current screen owns the sheet.
1699  screen = m_frame->GetScreen();
1700 
1701  instance.push_back( sheet );
1702  }
1703  else
1704  {
1705  SCH_SHEET_PATH prevInstance = instance;
1706 
1707  // When change the page number in the screen, the previous screen owns the sheet.
1708  if( prevInstance.size() )
1709  {
1710  prevInstance.pop_back();
1711  screen = prevInstance.LastScreen();
1712  }
1713  else
1714  {
1715  // The root sheet and root screen are effectively the same thing.
1716  screen = m_frame->GetScreen();
1717  }
1718 
1719  sheet = m_frame->GetCurrentSheet().Last();
1720  }
1721 
1722  wxString msg;
1723  wxString sheetPath = instance.PathHumanReadable( false );
1724  wxString pageNumber = instance.GetPageNumber();
1725 
1726  msg.Printf( _( "Enter page number for sheet path%s" ),
1727  ( sheetPath.Length() > 20 ) ? "\n" + sheetPath : " " + sheetPath );
1728 
1729  wxTextEntryDialog dlg( m_frame, msg, _( "Edit Sheet Page Number" ), pageNumber );
1730 
1731  dlg.SetTextValidator( wxFILTER_ALPHANUMERIC ); // No white space.
1732 
1733  if( dlg.ShowModal() == wxID_CANCEL || dlg.GetValue() == instance.GetPageNumber() )
1734  return 0;
1735 
1736  m_frame->SaveCopyInUndoList( screen, sheet, UNDO_REDO::CHANGED, false );
1737 
1738  instance.SetPageNumber( dlg.GetValue() );
1739 
1740  if( instance == m_frame->GetCurrentSheet() )
1741  {
1742  m_frame->GetScreen()->SetPageNumber( dlg.GetValue() );
1744  }
1745 
1746  m_frame->OnModify();
1747 
1748  return 0;
1749 }
void SetPageNumber(const wxString &aPageNumber)
Set the sheet instance user definable page number.
void SetPageNumber(const wxString &aPageNumber)
Definition: base_screen.h:79
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
wxString PathHumanReadable(bool aUseShortRootName=true) const
Return the sheet path in a human readable form made from the sheet names.
void OnPageSettingsChange() override
Called when modifying the page settings.
static const KICAD_T SheetsOnly[]
Definition: ee_collectors.h:46
void pop_back()
Forwarded method from std::vector.
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Return either an existing selection (filtered), or the selection at the current cursor if the existin...
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
size_t size() const
Forwarded method from std::vector.
wxString GetPageNumber() const
#define _(s)
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:177
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:54
virtual unsigned int GetSize() const override
Return the number of stored items.
Definition: selection.h:87
SCH_SCREEN * LastScreen()
void SaveCopyInUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItemToCopy, UNDO_REDO aTypeCommand, bool aAppend)
Create a copy of the current schematic item, and put it in the undo list.
SCH_SHEET_PATH & GetCurrentSheet() const
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
EDA_ITEM * Front() const
Definition: selection.h:144

References _, CHANGED, SELECTION::Front(), SCH_EDIT_FRAME::GetCurrentSheet(), SCH_SHEET_PATH::GetPageNumber(), SCH_EDIT_FRAME::GetScreen(), SELECTION::GetSize(), SCH_SHEET_PATH::Last(), SCH_SHEET_PATH::LastScreen(), EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, SCH_EDIT_FRAME::OnModify(), SCH_EDIT_FRAME::OnPageSettingsChange(), SCH_SHEET_PATH::PathHumanReadable(), SCH_SHEET_PATH::pop_back(), SCH_SHEET_PATH::push_back(), EE_SELECTION_TOOL::RequestSelection(), SCH_EDIT_FRAME::SaveCopyInUndoList(), BASE_SCREEN::SetPageNumber(), SCH_SHEET_PATH::SetPageNumber(), EE_COLLECTOR::SheetsOnly, and SCH_SHEET_PATH::size().

Referenced by setTransitions().

◆ getEditFrame()

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

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

Definition at line 184 of file tool_base.h.

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

References TOOL_BASE::getToolHolderInt().

Referenced by ZONE_CREATE_HELPER::createNewZone().

◆ GetId()

TOOL_ID TOOL_BASE::GetId ( ) const
inlineinherited

Return the unique identifier of the tool.

The identifier is set by an instance of TOOL_MANAGER.

Returns
Identifier of the tool.

Definition at line 120 of file tool_base.h.

121  {
122  return m_toolId;
123  }
TOOL_ID m_toolId
Name of the tool.
Definition: tool_base.h:209

References TOOL_BASE::m_toolId.

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

◆ GetManager()

TOOL_MANAGER* TOOL_BASE::GetManager ( ) const
inlineinherited

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

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

Definition at line 143 of file tool_base.h.

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

References TOOL_BASE::m_toolMgr.

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

◆ getModel()

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

Return the model object if it matches the requested type.

Store the type of the tool.

Definition at line 196 of file tool_base.h.

References TOOL_BASE::getModelInt().

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

◆ GetName()

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

Return the name of the tool.

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

Returns
The name of the tool.

Definition at line 133 of file tool_base.h.

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

References TOOL_BASE::m_toolName.

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

◆ GetToolMenu()

◆ GetType()

TOOL_TYPE TOOL_BASE::GetType ( ) const
inlineinherited

Return the type of the tool.

Returns
The type of the tool.

Definition at line 108 of file tool_base.h.

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

References TOOL_BASE::m_type.

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

◆ getView()

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

Returns the instance of #VIEW object used in the application.

It allows tools to draw.

Returns
The instance of VIEW.

Definition at line 36 of file tool_base.cpp.

37 {
38  return m_toolMgr->GetView();
39 }
KIGFX::VIEW * GetView() const
Definition: tool_manager.h:283
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214

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

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

◆ getViewControls()

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

Return the instance of VIEW_CONTROLS object used in the application.

It allows tools to read & modify user input and its settings (eg. show cursor, enable snapping to grid, etc.).

Returns
The instance of VIEW_CONTROLS.

Definition at line 42 of file tool_base.cpp.

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

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

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

◆ GlobalEdit()

int SCH_EDIT_TOOL::GlobalEdit ( const TOOL_EVENT aEvent)

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

Definition at line 484 of file eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp.

References EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame.

Referenced by setTransitions().

◆ Go()

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

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

No conditions means any event.

Definition at line 147 of file tool_interactive.h.

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

References TOOL_INTERACTIVE::goInternal().

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

◆ Init()

bool SCH_EDIT_TOOL::Init ( )
overridevirtual

Init() is called once upon a registration of the tool.

Returns
True if the initialization went fine, false - otherwise.

Reimplemented from TOOL_BASE.

Definition at line 143 of file sch_edit_tool.cpp.

144 {
146 
149 
150  wxASSERT_MSG( drawingTools, "eeshema.InteractiveDrawing tool is not available" );
151 
152  auto hasElements =
153  [ this ] ( const SELECTION& aSel )
154  {
155  return !m_frame->GetScreen()->Items().empty();
156  };
157 
158  auto sheetHasUndefinedPins =
159  [ this ] ( const SELECTION& aSel )
160  {
161  if( aSel.Size() != 1 )
162  return false;
163 
164  if( !aSel.HasType( SCH_SHEET_T ) )
165  return false;
166 
167  SCH_ITEM* item = dynamic_cast<SCH_ITEM*>( aSel.Front() );
168 
169  wxCHECK( item, false );
170 
171  SCH_SHEET* sheet = dynamic_cast<SCH_SHEET*>( item );
172 
173  wxCHECK( sheet, false );
174 
175  return sheet->HasUndefinedPins();
176  };
177 
178  auto anyTextTool =
179  [ this ] ( const SELECTION& aSel )
180  {
185  };
186 
187  auto duplicateCondition =
188  [] ( const SELECTION& aSel )
189  {
191  return false;
192 
193  return true;
194  };
195 
196  auto orientCondition =
197  [] ( const SELECTION& aSel )
198  {
199  if( aSel.Empty() )
200  return false;
201 
203  return false;
204 
205  if( aSel.GetSize() > 1 )
206  return true;
207 
208  SCH_ITEM* item = (SCH_ITEM*) aSel.Front();
209 
210  switch( item->Type() )
211  {
212  case SCH_MARKER_T:
213  case SCH_JUNCTION_T:
214  case SCH_NO_CONNECT_T:
215  case SCH_PIN_T:
216  return false;
217  case SCH_LINE_T:
218  return item->GetLayer() != LAYER_WIRE && item->GetLayer() != LAYER_BUS;
219  default:
220  return true;
221  }
222  };
223 
224  auto propertiesCondition =
225  [&]( const SELECTION& aSel )
226  {
227  if( aSel.GetSize() == 0 )
228  {
230  {
233 
234  if( ds && ds->HitTestDrawingSheetItems( getView(), (wxPoint) cursor ) )
235  return true;
236  }
237 
238  return false;
239  }
240 
241  SCH_ITEM* firstItem = dynamic_cast<SCH_ITEM*>( aSel.Front() );
242  const EE_SELECTION* eeSelection = dynamic_cast<const EE_SELECTION*>( &aSel );
243 
244  if( !firstItem || !eeSelection )
245  return false;
246 
247  switch( firstItem->Type() )
248  {
249  case SCH_SYMBOL_T:
250  case SCH_SHEET_T:
251  case SCH_SHEET_PIN_T:
252  case SCH_TEXT_T:
253  case SCH_LABEL_T:
254  case SCH_GLOBAL_LABEL_T:
255  case SCH_HIER_LABEL_T:
256  case SCH_FIELD_T:
257  case SCH_BITMAP_T:
258  return aSel.GetSize() == 1;
259 
260  case SCH_LINE_T:
262  return eeSelection->AllItemsHaveLineStroke();
263 
264  case SCH_JUNCTION_T:
265  return eeSelection->AreAllItemsIdentical();
266 
267  default:
268  return false;
269  }
270  };
271 
272  auto autoplaceCondition =
273  [] ( const SELECTION& aSel )
274  {
275  for( const EDA_ITEM* item : aSel )
276  {
277  if( item->IsType( EE_COLLECTOR::FieldOwners ) )
278  return true;
279  }
280 
281  return false;
282  };
283 
284  static KICAD_T toLabelTypes[] = { SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_TEXT_T, EOT };
285  auto toLabelCondition = E_C::Count( 1 ) && E_C::OnlyTypes( toLabelTypes );
286 
287  static KICAD_T toHLableTypes[] = { SCH_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_TEXT_T, EOT };
288  auto toHLabelCondition = E_C::Count( 1 ) && E_C::OnlyTypes( toHLableTypes );
289 
290  static KICAD_T toGLableTypes[] = { SCH_LABEL_T, SCH_HIER_LABEL_T, SCH_TEXT_T, EOT };
291  auto toGLabelCondition = E_C::Count( 1 ) && E_C::OnlyTypes( toGLableTypes );
292 
293  static KICAD_T toTextTypes[] = { SCH_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, EOT };
294  auto toTextlCondition = E_C::Count( 1 ) && E_C::OnlyTypes( toTextTypes );
295 
296  static KICAD_T entryTypes[] = { SCH_BUS_WIRE_ENTRY_T, SCH_BUS_BUS_ENTRY_T, EOT };
297  auto entryCondition = E_C::MoreThan( 0 ) && E_C::OnlyTypes( entryTypes );
298 
299  auto singleSheetCondition = E_C::Count( 1 ) && E_C::OnlyType( SCH_SHEET_T );
300 
301  //
302  // Add edit actions to the move tool menu
303  //
304  if( moveTool )
305  {
306  CONDITIONAL_MENU& moveMenu = moveTool->GetToolMenu().GetMenu();
307 
308  moveMenu.AddSeparator();
309  moveMenu.AddItem( EE_ACTIONS::rotateCCW, orientCondition );
310  moveMenu.AddItem( EE_ACTIONS::rotateCW, orientCondition );
311  moveMenu.AddItem( EE_ACTIONS::mirrorV, orientCondition );
312  moveMenu.AddItem( EE_ACTIONS::mirrorH, orientCondition );
313 
314  moveMenu.AddItem( EE_ACTIONS::properties, propertiesCondition );
319 
320  std::shared_ptr<SYMBOL_UNIT_MENU> symUnitMenu = std::make_shared<SYMBOL_UNIT_MENU>();
321  symUnitMenu->SetTool( this );
322  m_menu.AddSubMenu( symUnitMenu );
323  moveMenu.AddMenu( symUnitMenu.get(), E_C::SingleMultiUnitSymbol, 1 );
324 
325  moveMenu.AddSeparator();
329  moveMenu.AddItem( ACTIONS::duplicate, duplicateCondition );
330 
331  moveMenu.AddSeparator();
332  moveMenu.AddItem( ACTIONS::selectAll, hasElements );
333  }
334 
335  //
336  // Add editing actions to the drawing tool menu
337  //
338  CONDITIONAL_MENU& drawMenu = drawingTools->GetToolMenu().GetMenu();
339 
340  drawMenu.AddItem( EE_ACTIONS::rotateCCW, orientCondition, 200 );
341  drawMenu.AddItem( EE_ACTIONS::rotateCW, orientCondition, 200 );
342  drawMenu.AddItem( EE_ACTIONS::mirrorV, orientCondition, 200 );
343  drawMenu.AddItem( EE_ACTIONS::mirrorH, orientCondition, 200 );
344 
345  drawMenu.AddItem( EE_ACTIONS::properties, propertiesCondition, 200 );
349  drawMenu.AddItem( EE_ACTIONS::autoplaceFields, autoplaceCondition, 200 );
351 
352  std::shared_ptr<SYMBOL_UNIT_MENU> symUnitMenu2 = std::make_shared<SYMBOL_UNIT_MENU>();
353  symUnitMenu2->SetTool( drawingTools );
354  drawingTools->GetToolMenu().AddSubMenu( symUnitMenu2 );
355  drawMenu.AddMenu( symUnitMenu2.get(), E_C::SingleMultiUnitSymbol, 1 );
356 
358 
359  drawMenu.AddItem( EE_ACTIONS::toLabel, anyTextTool && E_C::Idle, 200 );
360  drawMenu.AddItem( EE_ACTIONS::toHLabel, anyTextTool && E_C::Idle, 200 );
361  drawMenu.AddItem( EE_ACTIONS::toGLabel, anyTextTool && E_C::Idle, 200 );
362  drawMenu.AddItem( EE_ACTIONS::toText, anyTextTool && E_C::Idle, 200 );
363 
364  //
365  // Add editing actions to the selection tool menu
366  //
368 
369  selToolMenu.AddItem( EE_ACTIONS::rotateCCW, orientCondition, 200 );
370  selToolMenu.AddItem( EE_ACTIONS::rotateCW, orientCondition, 200 );
371  selToolMenu.AddItem( EE_ACTIONS::mirrorV, orientCondition, 200 );
372  selToolMenu.AddItem( EE_ACTIONS::mirrorH, orientCondition, 200 );
373 
374  selToolMenu.AddItem( EE_ACTIONS::properties, propertiesCondition, 200 );
376  selToolMenu.AddItem( EE_ACTIONS::editValue, E_C::SingleSymbol, 200 );
378  selToolMenu.AddItem( EE_ACTIONS::autoplaceFields, autoplaceCondition, 200 );
380 
381  std::shared_ptr<SYMBOL_UNIT_MENU> symUnitMenu3 = std::make_shared<SYMBOL_UNIT_MENU>();
382  symUnitMenu3->SetTool( m_selectionTool );
383  m_selectionTool->GetToolMenu().AddSubMenu( symUnitMenu3 );
384  selToolMenu.AddMenu( symUnitMenu3.get(), E_C::SingleMultiUnitSymbol, 1 );
385 
389 
390  selToolMenu.AddItem( EE_ACTIONS::toLabel, toLabelCondition, 200 );
391  selToolMenu.AddItem( EE_ACTIONS::toHLabel, toHLabelCondition, 200 );
392  selToolMenu.AddItem( EE_ACTIONS::toGLabel, toGLabelCondition, 200 );
393  selToolMenu.AddItem( EE_ACTIONS::toText, toTextlCondition, 200 );
394  selToolMenu.AddItem( EE_ACTIONS::cleanupSheetPins, sheetHasUndefinedPins, 250 );
395 
396  selToolMenu.AddSeparator( 300 );
397  selToolMenu.AddItem( ACTIONS::cut, E_C::IdleSelection, 300 );
398  selToolMenu.AddItem( ACTIONS::copy, E_C::IdleSelection, 300 );
399  selToolMenu.AddItem( ACTIONS::paste, E_C::Idle, 300 );
400  selToolMenu.AddItem( ACTIONS::pasteSpecial, E_C::Idle, 300 );
401  selToolMenu.AddItem( ACTIONS::doDelete, E_C::NotEmpty, 300 );
402  selToolMenu.AddItem( ACTIONS::duplicate, duplicateCondition, 300 );
403 
404  selToolMenu.AddSeparator( 400 );
405  selToolMenu.AddItem( ACTIONS::selectAll, hasElements, 400 );
406 
407 
408  return true;
409 }
bool empty() const
Definition: sch_rtree.h:163
void AddMenu(ACTION_MENU *aMenu, const SELECTION_CONDITION &aCondition=SELECTION_CONDITIONS::ShowAlways, int aOrder=ANY_ORDER)
Add a submenu to the menu.
KIGFX::SCH_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
static TOOL_ACTION properties
Definition: ee_actions.h:117
bool IsCurrentTool(const TOOL_ACTION &aAction) const
TOOL_MENU m_menu
The functions below are not yet implemented - their interface may change.
static TOOL_ACTION toggleDeMorgan
Definition: ee_actions.h:122
static SELECTION_CONDITION SingleSymbol
static TOOL_ACTION doDelete
Definition: actions.h:72
Tool responsible for drawing/placing items (symbols, wires, buses, labels, etc.).
static SELECTION_CONDITION MoreThan(int aNumber)
Create a functor that tests if the number of selected items is greater than the value given as parame...
static bool Idle(const SELECTION &aSelection)
Test if there no items selected or being edited.
static SELECTION_CONDITION OnlyTypes(const KICAD_T aTypes[])
Create a functor that tests if the selected items are only of given types.
CONDITIONAL_MENU & GetMenu()
Definition: tool_menu.cpp:46
static TOOL_ACTION placeHierLabel
Definition: ee_actions.h:84
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
static TOOL_ACTION changeSymbol
Definition: ee_actions.h:145
TOOL_MENU & GetToolMenu()
bool HasUndefinedPins() const
Check all sheet labels against schematic for undefined hierarchical labels.
Definition: sch_sheet.cpp:372
static TOOL_ACTION toText
Definition: ee_actions.h:129
static const KICAD_T FieldOwners[]
Definition: ee_collectors.h:48
static TOOL_ACTION autoplaceFields
Definition: ee_actions.h:121
bool HitTestDrawingSheetItems(KIGFX::VIEW *aView, const wxPoint &aPosition)
static TOOL_ACTION mirrorH
Definition: ee_actions.h:116
static SELECTION_CONDITION Count(int aNumber)
Create a functor that tests if the number of selected items is equal to the value given as parameter.
static bool IdleSelection(const SELECTION &aSelection)
Test if all selected items are not being edited.
static bool NotEmpty(const SELECTION &aSelection)
Test if there are any items selected.
search types array terminator (End Of Types)
Definition: typeinfo.h:81
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
static TOOL_ACTION mirrorV
Definition: ee_actions.h:115
static TOOL_ACTION rotateCW
Definition: ee_actions.h:113
bool Init() override
Init() is called once upon a registration of the tool.
Definition: ee_tool_base.h:66
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
static SELECTION_CONDITION SingleDeMorganSymbol
static TOOL_ACTION copy
Definition: actions.h:67
static TOOL_ACTION cleanupSheetPins
Definition: ee_actions.h:187
static TOOL_ACTION rotateCCW
Definition: ee_actions.h:114
static TOOL_ACTION editFootprint
Definition: ee_actions.h:120
static TOOL_ACTION placeSchematicText
Definition: ee_actions.h:87
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
static TOOL_ACTION updateSymbol
Definition: ee_actions.h:146
static TOOL_ACTION cut
Definition: actions.h:66
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:177
virtual bool IsType(const KICAD_T aScanTypes[]) const
Check whether the item is one of the listed types.
Definition: eda_item.h:183
static SELECTION_CONDITION SingleMultiUnitSymbol
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:54
void AddSeparator(int aOrder=ANY_ORDER)
Add a separator to the menu.
static TOOL_ACTION pasteSpecial
Definition: actions.h:69
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:268
static TOOL_ACTION placeLabel
Definition: ee_actions.h:82
static bool IsDrawingLineWireOrBus(const SELECTION &aSelection)
static TOOL_ACTION editValue
Definition: ee_actions.h:119
void AddSubMenu(std::shared_ptr< ACTION_MENU > aSubMenu)
Store a submenu of this menu model.
Definition: tool_menu.cpp:52
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
static SELECTION_CONDITION OnlyType(KICAD_T aType)
Create a functor that tests if the selected items are only of given type.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
static SELECTION_CONDITION SingleSymbolOrPower
static TOOL_ACTION editWithLibEdit
Definition: ee_actions.h:158
static TOOL_ACTION toLabel
Definition: ee_actions.h:126
DS_PROXY_VIEW_ITEM * GetDrawingSheet() const
Definition: sch_view.h:97
static TOOL_ACTION toHLabel
Definition: ee_actions.h:127
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
Definition: tool_base.cpp:42
static TOOL_ACTION editReference
Definition: ee_actions.h:118
static TOOL_ACTION placeGlobalLabel
Definition: ee_actions.h:83
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Add a menu entry to run a TOOL_ACTION on selected items.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:193
static TOOL_ACTION selectAll
Definition: actions.h:70
static TOOL_ACTION toGLabel
Definition: ee_actions.h:128
static TOOL_ACTION paste
Definition: actions.h:68
static TOOL_ACTION duplicate
Definition: actions.h:71
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
Definition: view.h:405

References CONDITIONAL_MENU::AddItem(), CONDITIONAL_MENU::AddMenu(), CONDITIONAL_MENU::AddSeparator(), TOOL_MENU::AddSubMenu(), EE_ACTIONS::autoplaceFields, EE_ACTIONS::changeSymbol, EE_ACTIONS::cleanupSheetPins, ACTIONS::copy, SELECTION_CONDITIONS::Count(), cursor, ACTIONS::cut, ACTIONS::doDelete, ACTIONS::duplicate, EE_ACTIONS::editFootprint, EE_ACTIONS::editReference, EE_ACTIONS::editValue, EE_ACTIONS::editWithLibEdit, EE_RTREE::empty(), EOT, EE_COLLECTOR::FieldOwners, SCH_BASE_FRAME::GetCanvas(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), KIGFX::SCH_VIEW::GetDrawingSheet(), SCH_ITEM::GetLayer(), TOOL_MENU::GetMenu(), SCH_EDIT_FRAME::GetScreen(), TOOL_MANAGER::GetTool(), TOOL_INTERACTIVE::GetToolMenu(), SCH_DRAW_PANEL::GetView(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), SCH_SHEET::HasUndefinedPins(), DS_PROXY_VIEW_ITEM::HitTestDrawingSheetItems(), SELECTION_CONDITIONS::Idle(), SELECTION_CONDITIONS::IdleSelection(), EE_TOOL_BASE< T >::Init(), TOOLS_HOLDER::IsCurrentTool(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLineWireOrBus(), KIGFX::VIEW::IsLayerVisible(), SCH_SCREEN::Items(), LAYER_BUS, LAYER_SCHEMATIC_DRAWINGSHEET, LAYER_WIRE, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, TOOL_INTERACTIVE::m_menu, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, EE_ACTIONS::mirrorH, EE_ACTIONS::mirrorV, SELECTION_CONDITIONS::MoreThan(), SELECTION_CONDITIONS::NotEmpty(), SELECTION_CONDITIONS::OnlyType(), SELECTION_CONDITIONS::OnlyTypes(), ACTIONS::paste, ACTIONS::pasteSpecial, EE_ACTIONS::placeGlobalLabel, EE_ACTIONS::placeHierLabel, EE_ACTIONS::placeLabel, EE_ACTIONS::placeSchematicText, EE_ACTIONS::properties, EE_ACTIONS::rotateCCW, EE_ACTIONS::rotateCW, SCH_BITMAP_T, SCH_BUS_BUS_ENTRY_T, SCH_BUS_WIRE_ENTRY_T, SCH_FIELD_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_JUNCTION_T, SCH_LABEL_T, SCH_LINE_T, SCH_MARKER_T, SCH_NO_CONNECT_T, SCH_PIN_T, SCH_SHEET_PIN_T, SCH_SHEET_T, SCH_SYMBOL_T, SCH_TEXT_T, ACTIONS::selectAll, EE_CONDITIONS::SingleDeMorganSymbol, EE_CONDITIONS::SingleMultiUnitSymbol, EE_CONDITIONS::SingleSymbol, EE_CONDITIONS::SingleSymbolOrPower, EE_ACTIONS::toggleDeMorgan, EE_ACTIONS::toGLabel, EE_ACTIONS::toHLabel, EE_ACTIONS::toLabel, EE_ACTIONS::toText, EDA_ITEM::Type(), and EE_ACTIONS::updateSymbol.

◆ IsToolActive()

bool TOOL_BASE::IsToolActive ( ) const
inherited

Definition at line 31 of file tool_base.cpp.

32 {
33  return m_toolMgr->IsToolActive( m_toolId );
34 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
TOOL_ID m_toolId
Name of the tool.
Definition: tool_base.h:209
bool IsToolActive(TOOL_ID aId) const
Return true if a tool with given id is active (executing)

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

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

◆ Mirror()

int SCH_EDIT_TOOL::Mirror ( const TOOL_EVENT aEvent)

Definition at line 656 of file sch_edit_tool.cpp.

657 {
659 
660  if( selection.GetSize() == 0 )
661  return 0;
662 
663  wxPoint mirrorPoint;
664  bool vertical = ( aEvent.Matches( EE_ACTIONS::mirrorV.MakeEvent() ) );
665  SCH_ITEM* item = static_cast<SCH_ITEM*>( selection.Front() );
666  bool connections = false;
667  bool moving = item->IsMoving();
668 
669  if( selection.GetSize() == 1 )
670  {
671  if( !moving )
673 
674  switch( item->Type() )
675  {
676  case SCH_SYMBOL_T:
677  {
678  SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
679 
680  if( vertical )
681  symbol->SetOrientation( SYM_MIRROR_X );
682  else
683  symbol->SetOrientation( SYM_MIRROR_Y );
684 
686  symbol->AutoAutoplaceFields( m_frame->GetScreen() );
687 
688  break;
689  }
690 
691  case SCH_TEXT_T:
692  case SCH_LABEL_T:
693  case SCH_GLOBAL_LABEL_T:
694  case SCH_HIER_LABEL_T:
695  {
696  SCH_TEXT* textItem = static_cast<SCH_TEXT*>( item );
697  textItem->MirrorSpinStyle( !vertical );
698  break;
699  }
700 
701  case SCH_SHEET_PIN_T:
702  {
703  // mirror within parent sheet
704  SCH_SHEET_PIN* pin = static_cast<SCH_SHEET_PIN*>( item );
705  SCH_SHEET* sheet = pin->GetParent();
706 
707  if( vertical )
708  pin->MirrorVertically( sheet->GetBoundingBox().GetCenter().y );
709  else
710  pin->MirrorHorizontally( sheet->GetBoundingBox().GetCenter().x );
711 
712  break;
713  }
714 
715  case SCH_BUS_BUS_ENTRY_T:
717  if( vertical )
718  item->MirrorVertically( item->GetPosition().y );
719  else
720  item->MirrorHorizontally( item->GetPosition().x );
721  break;
722 
723  case SCH_FIELD_T:
724  {
725  SCH_FIELD* field = static_cast<SCH_FIELD*>( item );
726 
727  if( vertical )
729  else
731 
732  // Now that we're re-justifying a field, they're no longer autoplaced.
733  static_cast<SCH_ITEM*>( item->GetParent() )->ClearFieldsAutoplaced();
734 
735  break;
736  }
737 
738  case SCH_BITMAP_T:
739  if( vertical )
740  item->MirrorVertically( item->GetPosition().y );
741  else
742  item->MirrorHorizontally( item->GetPosition().x );
743 
744  // The bitmap is cached in Opengl: clear the cache to redraw
746  break;
747 
748  case SCH_SHEET_T:
749  // Mirror the sheet on itself. Sheets do not have a anchor point.
750  mirrorPoint = m_frame->GetNearestHalfGridPosition( item->GetBoundingBox().Centre() );
751 
752  if( vertical )
753  item->MirrorVertically( mirrorPoint.y );
754  else
755  item->MirrorHorizontally( mirrorPoint.x );
756 
757  break;
758 
759  default:
760  break;
761  }
762 
763  connections = item->IsConnectable();
764  m_frame->UpdateItem( item );
765  }
766  else if( selection.GetSize() > 1 )
767  {
768  mirrorPoint = m_frame->GetNearestHalfGridPosition( (wxPoint)selection.GetCenter() );
769 
770  for( unsigned ii = 0; ii < selection.GetSize(); ii++ )
771  {
772  item = static_cast<SCH_ITEM*>( selection.GetItem( ii ) );
773 
774  if( !moving )
775  saveCopyInUndoList( item, UNDO_REDO::CHANGED, ii > 0 );
776 
777  if( item->Type() == SCH_SHEET_PIN_T )
778  {
779  if( item->GetParent()->IsSelected() )
780  {
781  // parent will mirror us
782  }
783  else
784  {
785  // mirror within parent sheet
786  SCH_SHEET_PIN* pin = static_cast<SCH_SHEET_PIN*>( item );
787  SCH_SHEET* sheet = pin->GetParent();
788 
789  if( vertical )
790  pin->MirrorVertically( sheet->GetBoundingBox().GetCenter().y );
791  else
792  pin->MirrorHorizontally( sheet->GetBoundingBox().GetCenter().x );
793  }
794  }
795  else
796  {
797  if( vertical )
798  item->MirrorVertically( mirrorPoint.y );
799  else
800  item->MirrorHorizontally( mirrorPoint.x );
801  }
802 
803  connections |= item->IsConnectable();
804  m_frame->UpdateItem( item );
805  }
806  }
807 
809 
810  // Update R-Tree for modified items
811  for( EDA_ITEM* selected : selection )
812  updateItem( selected, true );
813 
814  if( item->IsMoving() )
815  {
817  }
818  else
819  {
820  if( selection.IsHover() )
822 
823  if( connections )
825 
826  m_frame->OnModify();
827  }
828 
829  return 0;
830 }
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:49
virtual bool IsConnectable() const
Definition: sch_item.h:358
void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false)
Mark an item for refresh.
virtual VECTOR2I GetCenter() const
Returns the center point of the selection area bounding box.
Definition: selection.cpp:70
EDA_TEXT_HJUSTIFY_T
Definition: eda_text.h:61
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:199
void SetOrientation(int aOrientation)
Compute the new transform matrix based on aOrientation for the symbol which is applied to the current...
bool IsSelected() const
Definition: eda_item.h:123
void AutoAutoplaceFields(SCH_SCREEN *aScreen)
Autoplace fields only if correct to do so automatically.
Definition: sch_item.h:441
bool IsMoving() const
Definition: eda_item.h:120
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
void RecacheAllItems()
Rebuild GAL display lists.
Definition: view.cpp:1395
virtual void MirrorVertically(int aCenter)=0
Mirror item vertically about aCenter.
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
wxPoint GetNearestHalfGridPosition(const wxPoint &aPosition) const
Return the nearest aGridSize / 2 location to aPosition.
virtual wxPoint GetPosition() const
Definition: eda_item.h:252
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
Definition: actions.h:204
static TOOL_ACTION mirrorV
Definition: ee_actions.h:115
EESCHEMA_SETTINGS * eeconfig() const
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Return either an existing selection (filtered), or the selection at the current cursor if the existin...
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
AUTOPLACE_FIELDS m_AutoplaceFields
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:198
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_sheet.cpp:595
void TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aType, bool aAppend=false)
Definition: ee_tool_base.h:134
void SetVertJustify(EDA_TEXT_VJUSTIFY_T aType)
Definition: eda_text.h:202
EDA_ITEM * GetParent() const
Definition: eda_item.h:115
const KICAD_T rotatableItems[]
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:177
bool Matches(const TOOL_EVENT &aEvent) const
Test whether two events match in terms of category & action or command.
Definition: tool_event.h:362
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet_pin.h:65
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:53
virtual void MirrorHorizontally(int aCenter)=0
Mirror item horizontally about aCenter.
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
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:103
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:54
EDA_TEXT_VJUSTIFY_T
Definition: eda_text.h:68
virtual unsigned int GetSize() const override
Return the number of stored items.
Definition: selection.h:87
Schematic symbol object.
Definition: sch_symbol.h:78
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
Definition: selection.cpp:52
void SetHorizJustify(EDA_TEXT_HJUSTIFY_T aType)
Definition: eda_text.h:201
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
wxPoint Centre() const
Definition: eda_rect.h:55
virtual void MirrorSpinStyle(bool aLeftRight)
Definition: sch_text.cpp:310
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
virtual const EDA_RECT GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
Definition: eda_item.cpp:75
const wxPoint GetCenter() const
Definition: eda_rect.h:104
void PostEvent(const TOOL_EVENT &aEvent)
Put an event to the event queue to be processed at the end of event processing cycle.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:193
static TOOL_ACTION refreshPreview
Definition: actions.h:106
EDA_ITEM * Front() const
Definition: selection.h:144
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113

References SCH_ITEM::AutoAutoplaceFields(), EDA_RECT::Centre(), CHANGED, EE_ACTIONS::clearSelection, SCH_BASE_FRAME::eeconfig(), EESCHEMA_SETTINGS::AUTOPLACE_FIELDS::enable, SELECTION::Front(), EDA_ITEM::GetBoundingBox(), SCH_SHEET::GetBoundingBox(), EDA_RECT::GetCenter(), SELECTION::GetCenter(), EDA_TEXT::GetHorizJustify(), SELECTION::GetItem(), EDA_DRAW_FRAME::GetNearestHalfGridPosition(), EDA_ITEM::GetParent(), EDA_ITEM::GetPosition(), SCH_EDIT_FRAME::GetScreen(), SELECTION::GetSize(), EDA_TEXT::GetVertJustify(), TOOL_BASE::getView(), SCH_ITEM::IsConnectable(), EDA_ITEM::IsMoving(), EDA_ITEM::IsSelected(), EESCHEMA_SETTINGS::m_AutoplaceFields, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, TOOL_EVENT::Matches(), SCH_ITEM::MirrorHorizontally(), SCH_TEXT::MirrorSpinStyle(), EE_ACTIONS::mirrorV, SCH_ITEM::MirrorVertically(), SCH_EDIT_FRAME::OnModify(), pin, TOOL_MANAGER::PostEvent(), KIGFX::VIEW::RecacheAllItems(), ACTIONS::refreshPreview, EE_SELECTION_TOOL::RequestSelection(), rotatableItems, TOOL_MANAGER::RunAction(), EE_TOOL_BASE< SCH_EDIT_FRAME >::saveCopyInUndoList(), SCH_BITMAP_T, SCH_BUS_BUS_ENTRY_T, SCH_BUS_WIRE_ENTRY_T, SCH_FIELD_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, SCH_SHEET_PIN_T, SCH_SHEET_T, SCH_SYMBOL_T, SCH_TEXT_T, EVENTS::SelectedItemsModified, EDA_TEXT::SetHorizJustify(), SCH_SYMBOL::SetOrientation(), EDA_TEXT::SetVertJustify(), SYM_MIRROR_X, SYM_MIRROR_Y, SCH_EDIT_FRAME::TestDanglingEnds(), EDA_ITEM::Type(), EE_TOOL_BASE< SCH_EDIT_FRAME >::updateItem(), and SCH_BASE_FRAME::UpdateItem().

Referenced by setTransitions().

◆ Properties()

int SCH_EDIT_TOOL::Properties ( const TOOL_EVENT aEvent)

Definition at line 1264 of file sch_edit_tool.cpp.

1265 {
1267 
1268  if( selection.Empty() )
1269  {
1271  {
1273  VECTOR2D cursorPos = getViewControls()->GetCursorPosition( false );
1274 
1275  if( ds && ds->HitTestDrawingSheetItems( getView(), (wxPoint) cursorPos ) )
1277  }
1278 
1279  return 0;
1280  }
1281 
1282  SCH_ITEM* item = (SCH_ITEM*) selection.Front();
1283 
1284  switch( item->Type() )
1285  {
1286  case SCH_LINE_T:
1287  case SCH_BUS_WIRE_ENTRY_T:
1288  if( !selection.AllItemsHaveLineStroke() )
1289  return 0;
1290 
1291  break;
1292 
1293  case SCH_JUNCTION_T:
1294  if( !selection.AreAllItemsIdentical() )
1295  return 0;
1296 
1297  break;
1298 
1299  default:
1300  if( selection.Size() > 1 )
1301  return 0;
1302 
1303  break;
1304  }
1305 
1306  switch( item->Type() )
1307  {
1308  case SCH_SYMBOL_T:
1309  {
1310  SCH_SYMBOL* symbol = (SCH_SYMBOL*) item;
1311  DIALOG_SYMBOL_PROPERTIES symbolPropsDialog( m_frame, symbol );
1312 
1313  // This dialog itself subsequently can invoke a KIWAY_PLAYER as a quasimodal
1314  // frame. Therefore this dialog as a modal frame parent, MUST be run under
1315  // quasimodal mode for the quasimodal frame support to work. So don't use
1316  // the QUASIMODAL macros here.
1317  int retval = symbolPropsDialog.ShowQuasiModal();
1318 
1319  if( retval == SYMBOL_PROPS_EDIT_OK )
1320  {
1322  symbol->AutoAutoplaceFields( m_frame->GetScreen() );
1323 
1325  m_frame->OnModify();
1326  }
1327  else if( retval == SYMBOL_PROPS_EDIT_SCHEMATIC_SYMBOL )
1328  {
1330  true );
1331 
1332  editor->LoadSymbolFromSchematic( symbol );
1333 
1334  editor->Show( true );
1335  editor->Raise();
1336  }
1337  else if( retval == SYMBOL_PROPS_EDIT_LIBRARY_SYMBOL )
1338  {
1340  true );
1341 
1342  editor->LoadSymbol( symbol->GetLibId(), symbol->GetUnit(), symbol->GetConvert() );
1343 
1344  editor->Show( true );
1345  editor->Raise();
1346  }
1347  else if( retval == SYMBOL_PROPS_WANT_UPDATE_SYMBOL )
1348  {
1350  dlg.ShowQuasiModal();
1351  }
1352  else if( retval == SYMBOL_PROPS_WANT_EXCHANGE_SYMBOL )
1353  {
1355  dlg.ShowQuasiModal();
1356  }
1357  }
1358  break;
1359 
1360  case SCH_SHEET_T:
1361  {
1362  SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
1363  bool doClearAnnotation;
1364  bool doRefresh = false;
1365 
1366  // Keep track of existing sheet paths. EditSheet() can modify this list.
1367  // Note that we use the validity checking/repairing version here just to make sure
1368  // we've got a valid hierarchy to begin with.
1369  SCH_SHEET_LIST initial_sheetpathList( &m_frame->Schematic().Root(), true );
1370 
1371  doRefresh = m_frame->EditSheetProperties( sheet, &m_frame->GetCurrentSheet(),
1372  &doClearAnnotation );
1373 
1374  // If the sheet file is changed and new sheet contents are loaded then we have to
1375  // clear the annotations on the new content (as it may have been set from some other
1376  // sheet path reference)
1377  if( doClearAnnotation )
1378  {
1379  SCH_SCREENS screensList( &m_frame->Schematic().Root() );
1380  // We clear annotation of new sheet paths here:
1381  screensList.ClearAnnotationOfNewSheetPaths( initial_sheetpathList );
1382  // Clear annotation of g_CurrentSheet itself, because its sheetpath is not a new
1383  // path, but symbols managed by its sheet path must have their annotation cleared
1384  // because they are new:
1386  }
1387 
1388  if( doRefresh )
1389  {
1391  m_frame->GetCanvas()->Refresh();
1393  }
1394 
1395  break;
1396  }
1397 
1398  case SCH_SHEET_PIN_T:
1399  {
1400  SCH_SHEET_PIN* pin = (SCH_SHEET_PIN*) item;
1402 
1403  // QuasiModal required for help dialog
1404  if( dlg.ShowQuasiModal() == wxID_OK )
1405  {
1407  m_frame->OnModify();
1408  }
1409  }
1410  break;
1411 
1412  case SCH_TEXT_T:
1413  case SCH_LABEL_T:
1414  case SCH_GLOBAL_LABEL_T:
1415  case SCH_HIER_LABEL_T:
1416  {
1418 
1419  // Must be quasi modal for syntax help
1420  if( dlg.ShowQuasiModal() == wxID_OK )
1421  {
1423  m_frame->OnModify();
1424  }
1425  }
1426  break;
1427 
1428  case SCH_FIELD_T:
1429  editFieldText( (SCH_FIELD*) item );
1430  break;
1431 
1432  case SCH_BITMAP_T:
1433  {
1434  SCH_BITMAP* bitmap = (SCH_BITMAP*) item;
1435  DIALOG_IMAGE_EDITOR dlg( m_frame, bitmap->GetImage() );
1436 
1437  if( dlg.ShowModal() == wxID_OK )
1438  {
1439  // save old image in undo list if not already in edit
1440  if( bitmap->GetEditFlags() == 0 )
1442 
1443  dlg.TransferToImage( bitmap->GetImage() );
1444 
1445  // The bitmap is cached in Opengl: clear the cache in case it has become invalid
1446  getView()->RecacheAllItems();
1448  m_frame->OnModify();
1449  }
1450  }
1451  break;
1452 
1453  case SCH_LINE_T:
1454  case SCH_BUS_WIRE_ENTRY_T:
1455  {
1456  std::deque<SCH_ITEM*> strokeItems;
1457 
1458  for( auto selItem : selection.Items() )
1459  {
1460  SCH_ITEM* schItem = dynamic_cast<SCH_ITEM*>( selItem );
1461 
1462  if( schItem && schItem->HasLineStroke() )
1463  strokeItems.push_back( schItem );
1464  else
1465  return 0;
1466  }
1467 
1468  DIALOG_LINE_WIRE_BUS_PROPERTIES dlg( m_frame, strokeItems );
1469 
1470  if( dlg.ShowModal() == wxID_OK )
1471  {
1473  m_frame->OnModify();
1474  }
1475  }
1476  break;
1477 
1478  case SCH_JUNCTION_T:
1479  {
1480  std::deque<SCH_JUNCTION*> junctions;
1481 
1482  for( auto selItem : selection.Items() )
1483  {
1484  SCH_JUNCTION* junction = dynamic_cast<SCH_JUNCTION*>( selItem );
1485 
1486  wxCHECK( junction, 0 );
1487 
1488  junctions.push_back( junction );
1489  }
1490 
1491  DIALOG_JUNCTION_PROPS dlg( m_frame, junctions );
1492 
1493  if( dlg.ShowModal() == wxID_OK )
1494  {
1496  m_frame->OnModify();
1497  }
1498  }
1499  break;
1500 
1501  case SCH_MARKER_T: // These items have no properties to edit
1502  case SCH_NO_CONNECT_T:
1503  break;
1504 
1505  default: // Unexpected item
1506  wxFAIL_MSG( wxString( "Cannot edit schematic item type " ) + item->GetClass() );
1507  }
1508 
1509  updateItem( item, true );
1510 
1511  if( selection.IsHover() )
1513 
1514  return 0;
1515 }
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
KIGFX::SCH_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:49
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:53
bool IsHover() const
Definition: selection.h:73
std::deque< EDA_ITEM * > & Items()
Definition: selection.h:149
static TOOL_ACTION pageSettings
Definition: actions.h:56
void AutoAutoplaceFields(SCH_SCREEN *aScreen)
Autoplace fields only if correct to do so automatically.
Definition: sch_item.h:441
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
void RecacheAllItems()
Rebuild GAL display lists.
Definition: view.cpp:1395
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:382
bool HitTestDrawingSheetItems(KIGFX::VIEW *aView, const wxPoint &aPosition)
bool AreAllItemsIdentical() const
Checks if all items in the selection are the same KICAD_T type.
Definition: selection.cpp:133
SCH_SCREEN * GetScreen() const
Definition: sch_sheet.h:103
Dialog to update or change schematic library symbols.
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
Definition: actions.h:204
EESCHEMA_SETTINGS * eeconfig() const
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Return either an existing selection (filtered), or the selection at the current cursor if the existin...
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void editFieldText(SCH_FIELD *aField)
Set up handlers for various events.
AUTOPLACE_FIELDS m_AutoplaceFields
BITMAP_BASE * GetImage() const
Definition: sch_bitmap.h:54
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aType, bool aAppend=false)
Definition: ee_tool_base.h:134
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual bool HasLineStroke() const
Check if this schematic item has line stoke properties.
Definition: sch_item.h:458
SCHEMATIC & Schematic() const
void UpdateHierarchyNavigator(bool aForceUpdate=false)
Run the Hierarchy Navigator dialog.
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:177
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet_pin.h:65
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:53
EDA_ITEM_FLAGS GetEditFlags() const
Definition: eda_item.h:158
Object to handle a bitmap image that can be inserted in a schematic.
Definition: sch_bitmap.h:40
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:97
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:103
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:54
bool AllItemsHaveLineStroke() const
Checks if all items in the selection support line strokes.
SCH_SHEET & Root() const
Definition: schematic.h:92
Schematic symbol object.
Definition: sch_symbol.h:78
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
int Size() const
Returns the number of selected parts.
Definition: selection.h:103
virtual wxString GetClass() const override
Return the class name.
Definition: sch_item.h:202
bool EditSheetProperties(SCH_SHEET *aSheet, SCH_SHEET_PATH *aHierarchy, bool *aClearAnnotationNewItems)
Edit an existing sheet or add a new sheet to the schematic.
Definition: sheet.cpp:458
SCH_SHEET_PATH & GetCurrentSheet() const
void ClearAnnotation(SCH_SHEET_PATH *aSheetPath)
Clear the annotation for the symbols in aSheetPath on the screen.
Definition: sch_screen.cpp:916
DS_PROXY_VIEW_ITEM * GetDrawingSheet() const
Definition: sch_view.h:97
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
Definition: tool_base.cpp:42
void ClearAnnotationOfNewSheetPaths(SCH_SHEET_LIST &aInitialSheetPathList)
Clear the annotation for the symbols inside new sheetpaths when a complex hierarchy is modified and n...
int GetUnit() const
Definition: sch_symbol.h:195
void PostEvent(const TOOL_EVENT &aEvent)
Put an event to the event queue to be processed at the end of event processing cycle.
int GetConvert() const
Definition: sch_symbol.h:223
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:193
static const KICAD_T EditableItems[]
Definition: ee_collectors.h:43
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:557
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
EDA_ITEM * Front() const
Definition: selection.h:144
Dialog used to edit SCH_SYMBOL objects in a schematic.
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113
const LIB_ID & GetLibId() const
Definition: sch_symbol.h:147
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
Definition: view.h:405
The symbol library editor main window.

References EE_SELECTION::AllItemsHaveLineStroke(), SELECTION::AreAllItemsIdentical(), SCH_ITEM::AutoAutoplaceFields(), DIALOG_CHANGE_SYMBOLS::CHANGE, CHANGED, SCH_SCREEN::ClearAnnotation(), SCH_SCREENS::ClearAnnotationOfNewSheetPaths(), EE_ACTIONS::clearSelection, EE_COLLECTOR::EditableItems, editFieldText(), editor, SCH_EDIT_FRAME::EditSheetProperties(), SCH_BASE_FRAME::eeconfig(), SELECTION::Empty(), EESCHEMA_SETTINGS::AUTOPLACE_FIELDS::enable, FRAME_SCH_SYMBOL_EDITOR, SELECTION::Front(), SCH_BASE_FRAME::GetCanvas(), SCH_FIELD::GetClass(), SCH_SYMBOL::GetConvert(), SCH_EDIT_FRAME::GetCurrentSheet(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), KIGFX::SCH_VIEW::GetDrawingSheet(), EDA_ITEM::GetEditFlags(), SCH_BITMAP::GetImage(), SCH_SYMBOL::GetLibId(), SCH_SHEET::GetScreen(), SCH_EDIT_FRAME::GetScreen(), SCH_SYMBOL::GetUnit(), SCH_DRAW_PANEL::GetView(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), SCH_ITEM::HasLineStroke(), DS_PROXY_VIEW_ITEM::HitTestDrawingSheetItems(), SELECTION::IsHover(), KIGFX::VIEW::IsLayerVisible(), SELECTION::Items(), KIWAY_HOLDER::Kiway(), LAYER_SCHEMATIC_DRAWINGSHEET, EESCHEMA_SETTINGS::m_AutoplaceFields, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, SCH_EDIT_FRAME::OnModify(), ACTIONS::pageSettings, pin, KIWAY::Player(), TOOL_MANAGER::PostEvent(), KIGFX::VIEW::RecacheAllItems(), EDA_DRAW_PANEL_GAL::Refresh(), EE_SELECTION_TOOL::RequestSelection(), SCHEMATIC::Root(), TOOL_MANAGER::RunAction(), EE_TOOL_BASE< SCH_EDIT_FRAME >::saveCopyInUndoList(), SCH_BITMAP_T, SCH_BUS_WIRE_ENTRY_T, SCH_FIELD_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_JUNCTION_T, SCH_LABEL_T, SCH_LINE_T, SCH_MARKER_T, SCH_NO_CONNECT_T, SCH_SHEET_PIN_T, SCH_SHEET_T, SCH_SYMBOL_T, SCH_TEXT_T, SCH_EDIT_FRAME::Schematic(), EVENTS::SelectedItemsModified, DIALOG_SHIM::ShowQuasiModal(), SELECTION::Size(), SYMBOL_PROPS_EDIT_LIBRARY_SYMBOL, SYMBOL_PROPS_EDIT_OK, SYMBOL_PROPS_EDIT_SCHEMATIC_SYMBOL, SYMBOL_PROPS_WANT_EXCHANGE_SYMBOL, SYMBOL_PROPS_WANT_UPDATE_SYMBOL, EDA_ITEM::Type(), DIALOG_CHANGE_SYMBOLS::UPDATE, SCH_EDIT_FRAME::UpdateHierarchyNavigator(), and EE_TOOL_BASE< SCH_EDIT_FRAME >::updateItem().

Referenced by setTransitions().

◆ RepeatDrawItem()

int SCH_EDIT_TOOL::RepeatDrawItem ( const TOOL_EVENT aEvent)

Definition at line 833 of file sch_edit_tool.cpp.

834 {
835  SCH_ITEM* sourceItem = m_frame->GetRepeatItem();
836 
837  if( !sourceItem )
838  return 0;
839 
841 
842  SCH_ITEM* newItem = sourceItem->Duplicate();
843  bool performDrag = false;
844 
845  // If cloning a symbol then put into 'move' mode.
846  if( newItem->Type() == SCH_SYMBOL_T )
847  {
848  wxPoint cursorPos = (wxPoint) getViewControls()->GetCursorPosition( true );
849  newItem->Move( cursorPos - newItem->GetPosition() );
850  performDrag = true;
851  }
852  else
853  {
854  if( m_isSymbolEditor )
855  {
856  auto* cfg = Pgm().GetSettingsManager().GetAppSettings<SYMBOL_EDITOR_SETTINGS>();
857 
858  if( dynamic_cast<SCH_TEXT*>( newItem ) )
859  {
860  SCH_TEXT* text = static_cast<SCH_TEXT*>( newItem );
861  text->IncrementLabel( cfg->m_Repeat.label_delta );
862  }
863 
864  newItem->Move( wxPoint( Mils2iu( cfg->m_Repeat.x_step ),
865  Mils2iu( cfg->m_Repeat.y_step ) ) );
866  }
867  else
868  {
869  EESCHEMA_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EESCHEMA_SETTINGS>();
870 
871  if( dynamic_cast<SCH_TEXT*>( newItem ) )
872  {
873  SCH_TEXT* text = static_cast<SCH_TEXT*>( newItem );
874 
875  // If incrementing tries to go below zero, tell user why the value is repeated
876 
877  if( !text->IncrementLabel( cfg->m_Drawing.repeat_label_increment ) )
878  m_frame->ShowInfoBarWarning( _( "Label value cannot go below zero" ), true );
879  }
880 
881  newItem->Move( wxPoint( Mils2iu( cfg->m_Drawing.default_repeat_offset_x ),
882  Mils2iu( cfg->m_Drawing.default_repeat_offset_y ) ) );
883  }
884  }
885 
886  newItem->SetFlags( IS_NEW );
887  m_frame->AddToScreen( newItem, m_frame->GetScreen() );
889 
890  // Symbols need to be handled by the move tool. The move tool will handle schematic
891  // cleanup routines
892  if( performDrag )
894 
895  newItem->ClearFlags();
896 
897  if( !performDrag && newItem->IsConnectable() )
898  {
899  EE_SELECTION new_sel;
900  new_sel.Add( newItem );
901 
903 
906  }
907 
908  m_frame->GetCanvas()->Refresh();
909  m_frame->OnModify();
910 
911  // Save newItem at the new position.
912  m_frame->SaveCopyForRepeatItem( newItem );
913 
914  return 0;
915 }
virtual bool IsConnectable() const
Definition: sch_item.h:358
void RecalculateConnections(SCH_CLEANUP_FLAGS aCleanupFlags)
Generate the connection data for the entire schematic hierarchy.
#define IS_NEW
New item, just created.
virtual void Add(EDA_ITEM *aItem)
Definition: selection.cpp:31
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
void SetFlags(EDA_ITEM_FLAGS aMask)
Definition: eda_item.h:153
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
virtual wxPoint GetPosition() const
Definition: eda_item.h:252
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
void ShowInfoBarWarning(const wxString &aWarningMsg, bool aShowCloseButton=false)
Show the WX_INFOBAR displayed on the top of the canvas with a message and a warning icon on the left ...
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
SCH_ITEM * Duplicate(bool doClone=false) const
Routine to create a new copy of given item.
Definition: sch_item.cpp:78
void TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void SaveCopyForRepeatItem(const SCH_ITEM *aItem)
Clone aItem and owns that clone in this container.
#define _(s)
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:154
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:53
static TOOL_ACTION addNeededJunctions
Definition: ee_actions.h:72
SCH_ITEM * GetRepeatItem() const
Return the item which is to be repeated with the insert key.
void AddToScreen(EDA_ITEM *aItem, SCH_SCREEN *aScreen)
Add an item to the screen (and view) aScreen is the screen the item is located on,...
void SaveCopyInUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItemToCopy, UNDO_REDO aTypeCommand, bool aAppend)
Create a copy of the current schematic item, and put it in the undo list.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
static TOOL_ACTION move
Definition: ee_actions.h:110
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
Definition: tool_base.cpp:42
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:193
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113
virtual void Move(const wxPoint &aMoveVector)=0
Move the item by aMoveVector to a new position.

References _, SELECTION::Add(), EE_ACTIONS::addNeededJunctions, SCH_BASE_FRAME::AddToScreen(), EDA_ITEM::ClearFlags(), EE_ACTIONS::clearSelection, EESCHEMA_SETTINGS::DRAWING::default_repeat_offset_x, EESCHEMA_SETTINGS::DRAWING::default_repeat_offset_y, SCH_ITEM::Duplicate(), SCH_BASE_FRAME::GetCanvas(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), EDA_ITEM::GetPosition(), SCH_EDIT_FRAME::GetRepeatItem(), SCH_EDIT_FRAME::GetScreen(), TOOL_BASE::getViewControls(), IS_NEW, SCH_ITEM::IsConnectable(), LOCAL_CLEANUP, EESCHEMA_SETTINGS::m_Drawing, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_isSymbolEditor, TOOL_BASE::m_toolMgr, EE_ACTIONS::move, SCH_ITEM::Move(), NEWITEM, SCH_EDIT_FRAME::OnModify(), Pgm(), SCH_EDIT_FRAME::RecalculateConnections(), EDA_DRAW_PANEL_GAL::Refresh(), EESCHEMA_SETTINGS::DRAWING::repeat_label_increment, TOOL_MANAGER::RunAction(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), SCH_EDIT_FRAME::SaveCopyInUndoList(), SCH_SYMBOL_T, EDA_ITEM::SetFlags(), EDA_BASE_FRAME::ShowInfoBarWarning(), SCH_EDIT_FRAME::TestDanglingEnds(), text, and EDA_ITEM::Type().

Referenced by setTransitions().

◆ Reset()

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

Bring the tool to a known, initial state.

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

Parameters
aReasoncontains information about the reason of tool reset.

Implements TOOL_BASE.

Definition at line 86 of file ee_tool_base.h.

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

◆ Rotate()

int SCH_EDIT_TOOL::Rotate ( const TOOL_EVENT aEvent)

Definition at line 431 of file sch_edit_tool.cpp.

432 {
433  bool clockwise = ( aEvent.Matches( EE_ACTIONS::rotateCW.MakeEvent() ) );
435 
436  if( selection.GetSize() == 0 )
437  return 0;
438 
439  SCH_ITEM* head = nullptr;
440  int principalItemCount = 0; // User-selected items (as opposed to connected wires)
441  wxPoint rotPoint;
442  bool moving = false;
443  bool connections = false;
444 
445  for( unsigned ii = 0; ii < selection.GetSize(); ii++ )
446  {
447  SCH_ITEM* item = static_cast<SCH_ITEM*>( selection.GetItem( ii ) );
448 
449  if( item->HasFlag( TEMP_SELECTED ) )
450  continue;
451 
452  principalItemCount++;
453 
454  if( !head )
455  head = item;
456  }
457 
458  if( head && head->IsMoving() )
459  moving = true;
460 
461  if( principalItemCount == 1 )
462  {
463  rotPoint = head->GetPosition();
464 
465  if( !moving )
467 
468  switch( head->Type() )
469  {
470  case SCH_SYMBOL_T:
471  {
472  SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( head );
473 
474  if( clockwise )
476  else
478 
480  symbol->AutoAutoplaceFields( m_frame->GetScreen() );
481 
482  break;
483  }
484 
485  case SCH_TEXT_T:
486  case SCH_LABEL_T:
487  case SCH_GLOBAL_LABEL_T:
488  case SCH_HIER_LABEL_T:
489  {
490  SCH_TEXT* textItem = static_cast<SCH_TEXT*>( head );
491  textItem->Rotate90( clockwise );
492  break;
493  }
494 
495  case SCH_SHEET_PIN_T:
496  {
497  // Rotate pin within parent sheet
498  SCH_SHEET_PIN* pin = static_cast<SCH_SHEET_PIN*>( head );
499  SCH_SHEET* sheet = pin->GetParent();
500 
501  for( int i = 0; clockwise ? i < 3 : i < 1; ++i )
502  pin->Rotate( sheet->GetBoundingBox().GetCenter() );
503 
504  break;
505  }
506 
507  case SCH_LINE_T:
508  case SCH_BUS_BUS_ENTRY_T:
510  for( int i = 0; clockwise ? i < 3 : i < 1; ++i )
511  head->Rotate( rotPoint );
512 
513  break;
514 
515  case SCH_FIELD_T:
516  {
517  SCH_FIELD* field = static_cast<SCH_FIELD*>( head );
518 
519  if( field->GetTextAngle() == TEXT_ANGLE_HORIZ )
520  field->SetTextAngle( TEXT_ANGLE_VERT );
521  else
522  field->SetTextAngle( TEXT_ANGLE_HORIZ );
523 
524  // Now that we're moving a field, they're no longer autoplaced.
525  static_cast<SCH_ITEM*>( head->GetParent() )->ClearFieldsAutoplaced();
526 
527  break;
528  }
529 
530  case SCH_BITMAP_T:
531  for( int i = 0; clockwise ? i < 3 : i < 1; ++i )
532  head->Rotate( rotPoint );
533 
534  // The bitmap is cached in Opengl: clear the cache to redraw
536  break;
537 
538  case SCH_SHEET_T:
539  {
540  SCH_SHEET* sheet = static_cast<SCH_SHEET*>( head );
541  rotPoint = m_frame->GetNearestGridPosition( sheet->GetRotationCenter() );
542 
543  // Rotate the sheet on itself. Sheets do not have an anchor point.
544  for( int i = 0; clockwise ? i < 3 : i < 1; ++i )
545  sheet->Rotate( rotPoint );
546 
547  break;
548  }
549 
550  default:
551  break;
552  }
553 
554  connections = head->IsConnectable();
555  m_frame->UpdateItem( head );
556  }
557  else
558  {
559  rotPoint = m_frame->GetNearestGridPosition( (wxPoint)selection.GetCenter() );
560  }
561 
562  for( unsigned ii = 0; ii < selection.GetSize(); ii++ )
563  {
564  SCH_ITEM* item = static_cast<SCH_ITEM*>( selection.GetItem( ii ) );
565 
566  // We've already rotated the user selected item if there was only one. We're just
567  // here to rotate the ends of wires that were attached to it.
568  if( principalItemCount == 1 && !item->HasFlag( TEMP_SELECTED ) )
569  continue;
570 
571  if( !moving )
572  saveCopyInUndoList( item, UNDO_REDO::CHANGED, ii > 0 );
573 
574  for( int i = 0; clockwise ? i < 3 : i < 1; ++i )
575  {
576  if( item->Type() == SCH_LINE_T )
577  {
578  SCH_LINE* line = (SCH_LINE*) item;
579 
580  // If we are rotating more than one item, we do not have start/end
581  // points separately selected
582  if( item->HasFlag( STARTPOINT ) || principalItemCount > 1 )
583  line->RotateStart( rotPoint );
584 
585  if( item->HasFlag( ENDPOINT ) || principalItemCount > 1 )
586  line->RotateEnd( rotPoint );
587  }
588  else if( item->Type() == SCH_SHEET_PIN_T )
589  {
590  if( item->GetParent()->IsSelected() )
591  {
592  // parent will rotate us
593  }
594  else
595  {
596  // rotate within parent
597  SCH_SHEET_PIN* pin = static_cast<SCH_SHEET_PIN*>( item );
598  SCH_SHEET* sheet = pin->GetParent();
599 
600  pin->Rotate( sheet->GetBoundingBox().GetCenter() );
601  }
602  }
603  else if( item->Type() == SCH_FIELD_T )
604  {
605  if( item->GetParent()->IsSelected() )
606  {
607  // parent will rotate us
608  }
609  else
610  {
611  SCH_FIELD* field = static_cast<SCH_FIELD*>( item );
612 
613  field->Rotate( rotPoint );
614 
615  if( field->GetTextAngle() == TEXT_ANGLE_HORIZ )
616  field->SetTextAngle( TEXT_ANGLE_VERT );
617  else
618  field->SetTextAngle( TEXT_ANGLE_HORIZ );
619 
620  // Now that we're moving a field, they're no longer autoplaced.
621  static_cast<SCH_ITEM*>( field->GetParent() )->ClearFieldsAutoplaced();
622  }
623  }
624  else
625  {
626  item->Rotate( rotPoint );
627  }
628  }
629 
630  connections |= item->IsConnectable();
631  m_frame->UpdateItem( item );
632  updateItem( item, true );
633  }
634 
636 
637  if( moving )
638  {
640  }
641  else
642  {
643  if( selection.IsHover() )
645 
646  if( connections )
648 
649  m_frame->OnModify();
650  }
651 
652  return 0;
653 }
#define TEXT_ANGLE_HORIZ
Frequent text rotations, used with {Set,Get}TextAngle(), in 0.1 degrees for now, hoping to migrate to...
Definition: eda_text.h:50
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:49
virtual bool IsConnectable() const
Definition: sch_item.h:358
void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false)
Mark an item for refresh.
virtual VECTOR2I GetCenter() const
Returns the center point of the selection area bounding box.
Definition: selection.cpp:70
bool IsHover() const
Definition: selection.h:73
#define STARTPOINT
When a line is selected, these flags indicate which.
void SetOrientation(int aOrientation)
Compute the new transform matrix based on aOrientation for the symbol which is applied to the current...
bool IsSelected() const
Definition: eda_item.h:123
void AutoAutoplaceFields(SCH_SCREEN *aScreen)
Autoplace fields only if correct to do so automatically.
Definition: sch_item.h:441
bool IsMoving() const
Definition: eda_item.h:120
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
void RecacheAllItems()
Rebuild GAL display lists.
Definition: view.cpp:1395
bool HasFlag(EDA_ITEM_FLAGS aFlag) const
Definition: eda_item.h:156
double GetTextAngle() const
Definition: eda_text.h:174
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:143
#define ENDPOINT
ends. (Used to support dragging.)
virtual wxPoint GetPosition() const
Definition: eda_item.h:252
wxPoint GetNearestGridPosition(const wxPoint &aPosition) const
Return the nearest aGridSize location to aPosition.
virtual void Rotate(const wxPoint &aCenter)=0
Rotate the item around aCenter 90 degrees in the clockwise direction.
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
Definition: actions.h:204
void Rotate(const wxPoint &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition: sch_sheet.cpp:739
static TOOL_ACTION rotateCW
Definition: ee_actions.h:113
EESCHEMA_SETTINGS * eeconfig() const
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Return either an existing selection (filtered), or the selection at the current cursor if the existin...
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
AUTOPLACE_FIELDS m_AutoplaceFields
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_sheet.cpp:595
void TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aType, bool aAppend=false)
Definition: ee_tool_base.h:134
EDA_ITEM * GetParent() const
Definition: eda_item.h:115
const KICAD_T rotatableItems[]
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:177
bool Matches(const TOOL_EVENT &aEvent) const
Test whether two events match in terms of category & action or command.
Definition: tool_event.h:362
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet_pin.h:65
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:53
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
void Rotate(const wxPoint &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition: sch_field.cpp:466
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:103
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:54
virtual void Rotate90(bool aClockwise)
Definition: sch_text.cpp:301
virtual unsigned int GetSize() const override
Return the number of stored items.
Definition: selection.h:87
Schematic symbol object.
Definition: sch_symbol.h:78
#define TEMP_SELECTED
flag indicating that the structure has already selected
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:37
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
Definition: selection.cpp:52
void RotateEnd(const wxPoint &aCenter)
Definition: sch_line.cpp:408
wxPoint GetRotationCenter() const
Rotating around the boundingBox's center can cause walking when the sheetname or filename is longer t...
Definition: sch_sheet.cpp:606
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
#define TEXT_ANGLE_VERT
Definition: eda_text.h:51
virtual void SetTextAngle(double aAngle)
Definition: eda_text.h:167
void RotateStart(const wxPoint &aCenter)
Definition: sch_line.cpp:402
const wxPoint GetCenter() const
Definition: eda_rect.h:104
void PostEvent(const TOOL_EVENT &aEvent)
Put an event to the event queue to be processed at the end of event processing cycle.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:193
static TOOL_ACTION refreshPreview
Definition: actions.h:106
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113

References SCH_ITEM::AutoAutoplaceFields(), CHANGED, EE_ACTIONS::clearSelection, SCH_BASE_FRAME::eeconfig(), EESCHEMA_SETTINGS::AUTOPLACE_FIELDS::enable, ENDPOINT, SCH_SHEET::GetBoundingBox(), EDA_RECT::GetCenter(), SELECTION::GetCenter(), SELECTION::GetItem(), EDA_DRAW_FRAME::GetNearestGridPosition(), EDA_ITEM::GetParent(), EDA_ITEM::GetPosition(), SCH_SHEET::GetRotationCenter(), SCH_EDIT_FRAME::GetScreen(), SELECTION::GetSize(), EDA_TEXT::GetTextAngle(), TOOL_BASE::getView(), EDA_ITEM::HasFlag(), SCH_ITEM::IsConnectable(), SELECTION::IsHover(), EDA_ITEM::IsMoving(), EDA_ITEM::IsSelected(), EESCHEMA_SETTINGS::m_AutoplaceFields, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame, EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool, TOOL_BASE::m_toolMgr, TOOL_EVENT::Matches(), SCH_EDIT_FRAME::OnModify(), pin, TOOL_MANAGER::PostEvent(), KIGFX::VIEW::RecacheAllItems(), ACTIONS::refreshPreview, EE_SELECTION_TOOL::RequestSelection(), rotatableItems, SCH_FIELD::Rotate(), SCH_ITEM::Rotate(), SCH_SHEET::Rotate(), SCH_TEXT::Rotate90(), EE_ACTIONS::rotateCW, SCH_LINE::RotateEnd(), SCH_LINE::RotateStart(), TOOL_MANAGER::RunAction(), EE_TOOL_BASE< SCH_EDIT_FRAME >::saveCopyInUndoList(), SCH_BITMAP_T, SCH_BUS_BUS_ENTRY_T, SCH_BUS_WIRE_ENTRY_T, SCH_FIELD_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, SCH_LINE_T, SCH_SHEET_PIN_T, SCH_SHEET_T, SCH_SYMBOL_T, SCH_TEXT_T, EVENTS::SelectedItemsModified, SCH_SYMBOL::SetOrientation(), EDA_TEXT::SetTextAngle(), STARTPOINT, SYM_ROTATE_CLOCKWISE, SYM_ROTATE_COUNTERCLOCKWISE, TEMP_SELECTED, SCH_EDIT_FRAME::TestDanglingEnds(), TEXT_ANGLE_HORIZ, TEXT_ANGLE_VERT, EDA_ITEM::Type(), EE_TOOL_BASE< SCH_EDIT_FRAME >::updateItem(), and SCH_BASE_FRAME::UpdateItem().

Referenced by setTransitions().

◆ RunMainStack()

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

Call a function using the main stack.

Parameters
aFuncis the function to be calls.

Definition at line 87 of file tool_interactive.cpp.

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

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

Referenced by DRAWING_TOOL::PlaceText().

◆ saveCopyInUndoList()

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

Definition at line 134 of file ee_tool_base.h.

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

◆ SetContextMenu()

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

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

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

Definition at line 76 of file tool_interactive.cpp.

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

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

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

◆ setTransitions()

void SCH_EDIT_TOOL::setTransitions ( )
overrideprivatevirtual

This method is meant to be overridden in order to specify handlers for events.

It is called every time tool is reset or finished.

Implements TOOL_INTERACTIVE.

Definition at line 1752 of file sch_edit_tool.cpp.

1753 {
1757  Go( &SCH_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorV.MakeEvent() );
1758  Go( &SCH_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorH.MakeEvent() );
1759  Go( &SCH_EDIT_TOOL::DoDelete, ACTIONS::doDelete.MakeEvent() );
1761 
1778 
1781 
1785 }
static TOOL_ACTION editPageNumber
Definition: ee_actions.h:151
static TOOL_ACTION properties
Definition: ee_actions.h:117
static TOOL_ACTION toggleDeMorgan
Definition: ee_actions.h:122
static TOOL_ACTION breakBus
Definition: ee_actions.h:131
static TOOL_ACTION doDelete
Definition: actions.h:72
int Rotate(const TOOL_EVENT &aEvent)
static TOOL_ACTION changeSymbol
Definition: ee_actions.h:145
int EditPageNumber(const TOOL_EVENT &aEvent)
int BreakWire(const TOOL_EVENT &aEvent)
static TOOL_ACTION toText
Definition: ee_actions.h:129
static TOOL_ACTION autoplaceFields
Definition: ee_actions.h:121
int Properties(const TOOL_EVENT &aEvent)
static TOOL_ACTION updateSymbols
Definition: ee_actions.h:144
static TOOL_ACTION mirrorH
Definition: ee_actions.h:116
static TOOL_ACTION showDeMorganAlternate
Definition: ee_actions.h:124
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Define which state (aStateFunc) to go when a certain event arrives (aConditions).
static TOOL_ACTION breakWire
Definition: ee_actions.h:130
static TOOL_ACTION mirrorV
Definition: ee_actions.h:115
static TOOL_ACTION rotateCW
Definition: ee_actions.h:113
static TOOL_ACTION cleanupSheetPins
Definition: ee_actions.h:187
static TOOL_ACTION rotateCCW
Definition: ee_actions.h:114
int GlobalEdit(const TOOL_EVENT &aEvent)
Delete the selected items, or the item under the cursor.
static TOOL_ACTION editFootprint
Definition: ee_actions.h:120
static TOOL_ACTION updateSymbol
Definition: ee_actions.h:146
int AutoplaceFields(const TOOL_EVENT &aEvent)
static TOOL_ACTION repeatDrawItem
Definition: ee_actions.h:112
int CleanupSheetPins(const TOOL_EVENT &aEvent)
static TOOL_ACTION editTextAndGraphics
Definition: ee_actions.h:188
int DeleteItemCursor(const TOOL_EVENT &aEvent)
static TOOL_ACTION showDeMorganStandard
Definition: ee_actions.h:123
int Mirror(const TOOL_EVENT &aEvent)
int RepeatDrawItem(const TOOL_EVENT &aEvent)
static TOOL_ACTION editValue
Definition: ee_actions.h:119
int EditField(const TOOL_EVENT &aEvent)
static TOOL_ACTION changeSymbols
Definition: ee_actions.h:143
int ChangeSymbols(const TOOL_EVENT &aEvent)
static TOOL_ACTION deleteTool
Definition: actions.h:73
static TOOL_ACTION toLabel
Definition: ee_actions.h:126
static TOOL_ACTION toHLabel
Definition: ee_actions.h:127
static TOOL_ACTION editReference
Definition: ee_actions.h:118
int DoDelete(const TOOL_EVENT &aEvent)
Run the deletion tool.
static TOOL_ACTION toGLabel
Definition: ee_actions.h:128
int ConvertDeMorgan(const TOOL_EVENT &aEvent)
int ChangeTextType(const TOOL_EVENT &aEvent)
Change a text type to another one.

References AutoplaceFields(), EE_ACTIONS::autoplaceFields, EE_ACTIONS::breakBus, BreakWire(), EE_ACTIONS::breakWire, EE_ACTIONS::changeSymbol, ChangeSymbols(), EE_ACTIONS::changeSymbols, ChangeTextType(), CleanupSheetPins(), EE_ACTIONS::cleanupSheetPins, ConvertDeMorgan(), DeleteItemCursor(), ACTIONS::deleteTool, ACTIONS::doDelete, DoDelete(), EditField(), EE_ACTIONS::editFootprint, EditPageNumber(), EE_ACTIONS::editPageNumber, EE_ACTIONS::editReference, EE_ACTIONS::editTextAndGraphics, EE_ACTIONS::editValue, GlobalEdit(), TOOL_INTERACTIVE::Go(), Mirror(), EE_ACTIONS::mirrorH, EE_ACTIONS::mirrorV, Properties(), EE_ACTIONS::properties, RepeatDrawItem(), EE_ACTIONS::repeatDrawItem, Rotate(), EE_ACTIONS::rotateCCW, EE_ACTIONS::rotateCW, EE_ACTIONS::showDeMorganAlternate, EE_ACTIONS::showDeMorganStandard, EE_ACTIONS::toggleDeMorgan, EE_ACTIONS::toGLabel, EE_ACTIONS::toHLabel, EE_ACTIONS::toLabel, EE_ACTIONS::toText, EE_ACTIONS::updateSymbol, and EE_ACTIONS::updateSymbols.

◆ updateItem()

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

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

Definition at line 103 of file ee_tool_base.h.

◆ Wait()

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

Suspend execution of the tool until an event specified in aEventList arrives.

No parameters means waiting for any event.

Definition at line 57 of file tool_interactive.cpp.

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

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

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), PCB_SELECTION_TOOL::doSelectionMenu(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), ZOOM_TOOL::Main(), PCB_PICKER_TOOL::Main(), EE_POINT_EDITOR::Main(), PL_EDIT_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), CVPCB_CONTROL::Main(), PL_POINT_EDITOR::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), PL_SELECTION_TOOL::Main(), EDA_3D_CONTROLLER::Main(), GERBVIEW_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), PCB_SELECTION_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), PCB_POINT_EDITOR::OnSelectionChange(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), GROUP_TOOL::PickNewMember(), EDIT_TOOL::pickReferencePoint(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), GERBVIEW_SELECTION_TOOL::selectPoint(), PCB_SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), ZOOM_TOOL::selectRegion(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

Member Data Documentation

◆ m_frame

SCH_EDIT_FRAME * EE_TOOL_BASE< SCH_EDIT_FRAME >::m_frame
protectedinherited

Definition at line 175 of file ee_tool_base.h.

◆ m_isSymbolEditor

bool EE_TOOL_BASE< SCH_EDIT_FRAME >::m_isSymbolEditor
protectedinherited

Definition at line 178 of file ee_tool_base.h.

◆ m_menu

TOOL_MENU TOOL_INTERACTIVE::m_menu
protectedinherited

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

Definition at line 125 of file tool_interactive.h.

Referenced by SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), TOOL_INTERACTIVE::GetToolMenu(), ROUTER_TOOL::Init(), LENGTH_TUNER_TOOL::Init(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Init(), PL_EDIT_TOOL::Init(), Init(), PAD_TOOL::Init(), PL_DRAWING_TOOLS::Init(), SYMBOL_EDITOR_DRAWING_TOOLS::Init(), SYMBOL_EDITOR_CONTROL::Init(), PCB_VIEWER_TOOLS::Init(), FOOTPRINT_EDITOR_CONTROL::Init(), PL_SELECTION_TOOL::Init(), SCH_DRAWING_TOOLS::Init(), BOARD_EDITOR_CONTROL::Init(), GERBVIEW_SELECTION_TOOL::Init(), EDA_3D_CONTROLLER::Init(), DRAWING_TOOL::Init(), EE_SELECTION_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), PCB_SELECTION_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), PCB_TOOL_BASE::Init(), PICKER_TOOL::Init(), DRAWING_TOOL::InteractivePlaceWithPreview(), PCB_PICKER_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), PL_EDIT_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), EDA_3D_CONTROLLER::Main(), PL_SELECTION_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), PCB_SELECTION_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ m_pickerItem

EDA_ITEM* SCH_EDIT_TOOL::m_pickerItem
private

Definition at line 87 of file sch_edit_tool.h.

Referenced by DeleteItemCursor(), and SCH_EDIT_TOOL().

◆ m_selectionTool

EE_SELECTION_TOOL* EE_TOOL_BASE< SCH_EDIT_FRAME >::m_selectionTool
protectedinherited

Definition at line 177 of file ee_tool_base.h.

◆ m_toolId

TOOL_ID TOOL_BASE::m_toolId
protectedinherited

Name of the tool.

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

Definition at line 209 of file tool_base.h.

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

◆ m_toolMgr

TOOL_MANAGER* TOOL_BASE::m_toolMgr
protectedinherited

Definition at line 214 of file tool_base.h.

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

◆ m_toolName

std::string TOOL_BASE::m_toolName
protectedinherited

Definition at line 213 of file tool_base.h.

Referenced by TOOL_BASE::GetName().

◆ m_type

TOOL_TYPE TOOL_BASE::m_type
protectedinherited

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

Definition at line 206 of file tool_base.h.

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

◆ m_view

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

Definition at line 176 of file ee_tool_base.h.


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