KiCad PCB EDA Suite
sch_edit_tool.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2019 CERN
5  * Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #include <tool/picker_tool.h>
26 #include <tools/sch_edit_tool.h>
29 #include <tools/sch_move_tool.h>
30 #include <ee_actions.h>
31 #include <bitmaps.h>
32 #include <confirm.h>
33 #include <base_struct.h>
34 #include <sch_item.h>
35 #include <sch_component.h>
36 #include <sch_sheet.h>
37 #include <sch_text.h>
38 #include <sch_bitmap.h>
39 #include <sch_view.h>
40 #include <sch_line.h>
41 #include <sch_bus_entry.h>
42 #include <sch_edit_frame.h>
43 #include <eeschema_id.h>
44 #include <status_popup.h>
45 #include <wx/gdicmn.h>
46 #include <invoke_sch_dialog.h>
52 #include "sch_drawing_tools.h"
53 #include <math/util.h> // for KiROUND
54 
55 
57 
58 
60 {
61 public:
63  ACTION_MENU( true )
64  {
66  SetTitle( _( "Symbol Unit" ) );
67  }
68 
69 protected:
70  ACTION_MENU* create() const override
71  {
72  return new SYMBOL_UNIT_MENU();
73  }
74 
75 private:
76  void update() override
77  {
79  EE_SELECTION& selection = selTool->GetSelection();
80  SCH_COMPONENT* component = dynamic_cast<SCH_COMPONENT*>( selection.Front() );
81 
82  Clear();
83 
84  if( !component )
85  {
86  Append( ID_POPUP_SCH_UNFOLD_BUS, _( "no symbol selected" ), wxEmptyString );
87  Enable( ID_POPUP_SCH_UNFOLD_BUS, false );
88  return;
89  }
90 
91  int unit = component->GetUnit();
92 
93  if( !component->GetPartRef() || component->GetPartRef()->GetUnitCount() < 2 )
94  {
95  Append( ID_POPUP_SCH_UNFOLD_BUS, _( "symbol is not multi-unit" ), wxEmptyString );
96  Enable( ID_POPUP_SCH_UNFOLD_BUS, false );
97  return;
98  }
99 
100  for( int ii = 0; ii < component->GetPartRef()->GetUnitCount(); ii++ )
101  {
102  wxString num_unit;
103  num_unit.Printf( _( "Unit %s" ), LIB_PART::SubReference( ii + 1, false ) );
104 
105  wxMenuItem * item = Append( ID_POPUP_SCH_SELECT_UNIT1 + ii, num_unit, wxEmptyString,
106  wxITEM_CHECK );
107  if( unit == ii + 1 )
108  item->Check(true);
109 
110  // The ID max for these submenus is ID_POPUP_SCH_SELECT_UNIT_CMP_MAX
111  // See eeschema_id to modify this value.
113  break; // We have used all IDs for these submenus
114  }
115  }
116 };
117 
118 
120  EE_TOOL_BASE<SCH_EDIT_FRAME>( "eeschema.InteractiveEdit" )
121 {
122  m_pickerItem = nullptr;
123 }
124 
125 
127 
129 {
131 
134 
135  wxASSERT_MSG( drawingTools, "eeshema.InteractiveDrawing tool is not available" );
136 
137  auto sheetTool = [ this ] ( const SELECTION& aSel ) {
139  };
140 
141  auto anyTextTool = [ this ] ( const SELECTION& aSel ) {
146  };
147 
148  auto duplicateCondition = [] ( const SELECTION& aSel ) {
150  return false;
151 
152  return true;
153  };
154 
155  auto orientCondition = [] ( const SELECTION& aSel ) {
156  if( aSel.Empty() )
157  return false;
158 
160  return false;
161 
162  SCH_ITEM* item = (SCH_ITEM*) aSel.Front();
163 
164  if( aSel.GetSize() > 1 )
165  return true;
166 
167  switch( item->Type() )
168  {
169  case SCH_MARKER_T:
170  case SCH_JUNCTION_T:
171  case SCH_NO_CONNECT_T:
172  case SCH_LINE_T:
173  case SCH_PIN_T:
174  return false;
175  default:
176  return true;
177  }
178  };
179 
180  auto propertiesCondition = []( const SELECTION& aSel ) {
181  if( aSel.GetSize() != 1
182  && !( aSel.GetSize() >= 1 && aSel.Front()->Type() == SCH_LINE_T
183  && aSel.AreAllItemsIdentical() ) )
184  return false;
185 
186  auto item = static_cast<EDA_ITEM*>( aSel.Front() );
187  switch( item->Type() )
188  {
189  case SCH_MARKER_T:
190  case SCH_JUNCTION_T:
191  case SCH_NO_CONNECT_T:
193  case SCH_BUS_BUS_ENTRY_T:
194  case SCH_SHEET_PIN_T:
195  case SCH_PIN_T:
196  return false;
197  case SCH_LINE_T:
198  {
199  const std::deque<EDA_ITEM*> items = aSel.GetItems();
200  if( !std::all_of( items.begin(), items.end(),
201  [&]( const EDA_ITEM* selItem )
202  {
203  const SCH_LINE* line = dynamic_cast<const SCH_LINE*>( selItem );
204  if ( line == nullptr )
205  {
206  wxLogWarning(
207  "Non-line object encountered in selection, this shouldn't have bypassed the preceeding check" );
208  return false;
209  }
210  return line->IsGraphicLine();
211  } ) )
212  {
213  return false;
214  }
215 
216  // Only graphic lines support properties in the file format
217  return true;
218  }
219  default:
220  return true;
221  }
222  };
223 
224  static KICAD_T toLabelTypes[] = { SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_TEXT_T, EOT };
225  auto toLabelCondition = E_C::Count( 1 ) && E_C::OnlyTypes( toLabelTypes );
226 
227  static KICAD_T toHLableTypes[] = { SCH_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_TEXT_T, EOT };
228  auto toHLabelCondition = E_C::Count( 1 ) && E_C::OnlyTypes( toHLableTypes );
229 
230  static KICAD_T toGLableTypes[] = { SCH_LABEL_T, SCH_HIER_LABEL_T, SCH_TEXT_T, EOT };
231  auto toGLabelCondition = E_C::Count( 1 ) && E_C::OnlyTypes( toGLableTypes );
232 
233  static KICAD_T toTextTypes[] = { SCH_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, EOT };
234  auto toTextlCondition = E_C::Count( 1 ) && E_C::OnlyTypes( toTextTypes );
235 
236  static KICAD_T entryTypes[] = { SCH_BUS_WIRE_ENTRY_T, SCH_BUS_BUS_ENTRY_T, EOT };
237  auto entryCondition = E_C::MoreThan( 0 ) && E_C::OnlyTypes( entryTypes );
238 
239  auto singleComponentCondition = E_C::Count( 1 ) && E_C::OnlyType( SCH_COMPONENT_T );
240  auto wireSelectionCondition = E_C::MoreThan( 0 ) && E_C::OnlyType( SCH_LINE_LOCATE_WIRE_T );
241  auto busSelectionCondition = E_C::MoreThan( 0 ) && E_C::OnlyType( SCH_LINE_LOCATE_BUS_T );
242  auto singleSheetCondition = E_C::Count( 1 ) && E_C::OnlyType( SCH_SHEET_T );
243 
244  //
245  // Add edit actions to the move tool menu
246  //
247  if( moveTool )
248  {
249  CONDITIONAL_MENU& moveMenu = moveTool->GetToolMenu().GetMenu();
250 
251  moveMenu.AddSeparator();
252  moveMenu.AddItem( EE_ACTIONS::rotateCCW, orientCondition );
253  moveMenu.AddItem( EE_ACTIONS::rotateCW, orientCondition );
254  moveMenu.AddItem( EE_ACTIONS::mirrorX, orientCondition );
255  moveMenu.AddItem( EE_ACTIONS::mirrorY, orientCondition );
257 
258  moveMenu.AddItem( EE_ACTIONS::properties, propertiesCondition );
259  moveMenu.AddItem( EE_ACTIONS::editReference, singleComponentCondition );
260  moveMenu.AddItem( EE_ACTIONS::editValue, singleComponentCondition );
261  moveMenu.AddItem( EE_ACTIONS::editFootprint, singleComponentCondition );
263 
264  std::shared_ptr<SYMBOL_UNIT_MENU> symUnitMenu = std::make_shared<SYMBOL_UNIT_MENU>();
265  symUnitMenu->SetTool( this );
266  m_menu.AddSubMenu( symUnitMenu );
267  moveMenu.AddMenu( symUnitMenu.get(), E_C::SingleMultiUnitSymbol, 1 );
268 
269  moveMenu.AddSeparator();
272  moveMenu.AddItem( ACTIONS::duplicate, duplicateCondition );
273  }
274 
275  //
276  // Add editing actions to the drawing tool menu
277  //
278  CONDITIONAL_MENU& drawMenu = drawingTools->GetToolMenu().GetMenu();
279 
280  drawMenu.AddItem( EE_ACTIONS::rotateCCW, orientCondition, 200 );
281  drawMenu.AddItem( EE_ACTIONS::rotateCW, orientCondition, 200 );
282  drawMenu.AddItem( EE_ACTIONS::mirrorX, orientCondition, 200 );
283  drawMenu.AddItem( EE_ACTIONS::mirrorY, orientCondition, 200 );
284 
285  drawMenu.AddItem( EE_ACTIONS::properties, propertiesCondition, 200 );
286  drawMenu.AddItem( EE_ACTIONS::editReference, singleComponentCondition, 200 );
287  drawMenu.AddItem( EE_ACTIONS::editValue, singleComponentCondition, 200 );
288  drawMenu.AddItem( EE_ACTIONS::editFootprint, singleComponentCondition, 200 );
289  drawMenu.AddItem( EE_ACTIONS::autoplaceFields, singleComponentCondition, 200 );
291 
292  std::shared_ptr<SYMBOL_UNIT_MENU> symUnitMenu2 = std::make_shared<SYMBOL_UNIT_MENU>();
293  symUnitMenu2->SetTool( drawingTools );
294  drawingTools->GetToolMenu().AddSubMenu( symUnitMenu2 );
295  drawMenu.AddMenu( symUnitMenu2.get(), E_C::SingleMultiUnitSymbol, 1 );
296 
297  drawMenu.AddItem( EE_ACTIONS::editWithLibEdit, singleComponentCondition && E_C::Idle, 200 );
298 
299  drawMenu.AddItem( EE_ACTIONS::toShapeSlash, entryCondition, 200 );
300  drawMenu.AddItem( EE_ACTIONS::toShapeBackslash, entryCondition, 200 );
301  drawMenu.AddItem( EE_ACTIONS::toLabel, anyTextTool && E_C::Idle, 200 );
302  drawMenu.AddItem( EE_ACTIONS::toHLabel, anyTextTool && E_C::Idle, 200 );
303  drawMenu.AddItem( EE_ACTIONS::toGLabel, anyTextTool && E_C::Idle, 200 );
304  drawMenu.AddItem( EE_ACTIONS::toText, anyTextTool && E_C::Idle, 200 );
305  drawMenu.AddItem( EE_ACTIONS::cleanupSheetPins, sheetTool && E_C::Idle, 250 );
306 
307  //
308  // Add editing actions to the selection tool menu
309  //
311 
312  selToolMenu.AddItem( EE_ACTIONS::rotateCCW, orientCondition, 200 );
313  selToolMenu.AddItem( EE_ACTIONS::rotateCW, orientCondition, 200 );
314  selToolMenu.AddItem( EE_ACTIONS::mirrorX, orientCondition, 200 );
315  selToolMenu.AddItem( EE_ACTIONS::mirrorY, orientCondition, 200 );
316  selToolMenu.AddItem( ACTIONS::doDelete, E_C::NotEmpty, 200 );
317 
318  selToolMenu.AddItem( EE_ACTIONS::properties, propertiesCondition, 200 );
320  selToolMenu.AddItem( EE_ACTIONS::editValue, E_C::SingleSymbol, 200 );
322  selToolMenu.AddItem( EE_ACTIONS::autoplaceFields, singleComponentCondition, 200 );
324 
325  std::shared_ptr<SYMBOL_UNIT_MENU> symUnitMenu3 = std::make_shared<SYMBOL_UNIT_MENU>();
326  symUnitMenu3->SetTool( m_selectionTool );
327  m_selectionTool->GetToolMenu().AddSubMenu( symUnitMenu3 );
328  selToolMenu.AddMenu( symUnitMenu3.get(), E_C::SingleMultiUnitSymbol, 1 );
329 
330  selToolMenu.AddItem( EE_ACTIONS::editWithLibEdit, singleComponentCondition && E_C::Idle, 200 );
331 
332  selToolMenu.AddItem( EE_ACTIONS::toShapeSlash, entryCondition, 200 );
333  selToolMenu.AddItem( EE_ACTIONS::toShapeBackslash, entryCondition, 200 );
334  selToolMenu.AddItem( EE_ACTIONS::toLabel, toLabelCondition, 200 );
335  selToolMenu.AddItem( EE_ACTIONS::toHLabel, toHLabelCondition, 200 );
336  selToolMenu.AddItem( EE_ACTIONS::toGLabel, toGLabelCondition, 200 );
337  selToolMenu.AddItem( EE_ACTIONS::toText, toTextlCondition, 200 );
338  selToolMenu.AddItem( EE_ACTIONS::cleanupSheetPins, singleSheetCondition, 250 );
339 
340  selToolMenu.AddSeparator( 300 );
341  selToolMenu.AddItem( ACTIONS::cut, E_C::IdleSelection, 300 );
342  selToolMenu.AddItem( ACTIONS::copy, E_C::IdleSelection, 300 );
343  selToolMenu.AddItem( ACTIONS::paste, E_C::Idle, 300 );
344  selToolMenu.AddItem( ACTIONS::pasteSpecial, E_C::Idle, 300 );
345  selToolMenu.AddItem( ACTIONS::duplicate, duplicateCondition, 300 );
346 
347  return true;
348 }
349 
350 
352  SCH_TEXT_T,
353  SCH_LABEL_T,
356  SCH_FIELD_T,
359  SCH_SHEET_T,
360  SCH_BITMAP_T,
363  SCH_LINE_T,
365  EOT
366 };
367 
368 
369 int SCH_EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent )
370 {
372 
373  if( selection.GetSize() == 0 )
374  return 0;
375 
376  wxPoint rotPoint;
377  bool clockwise = ( aEvent.Matches( EE_ACTIONS::rotateCW.MakeEvent() ) );
378  SCH_ITEM* item = static_cast<SCH_ITEM*>( selection.Front() );
379  bool connections = false;
380  bool moving = item->IsMoving();
381 
382  if( selection.GetSize() == 1 )
383  {
384  if( !moving )
386 
387  switch( item->Type() )
388  {
389  case SCH_COMPONENT_T:
390  {
391  SCH_COMPONENT* component = static_cast<SCH_COMPONENT*>( item );
392 
393  if( clockwise )
394  component->SetOrientation( CMP_ROTATE_CLOCKWISE );
395  else
397 
398  if( m_frame->GetAutoplaceFields() )
399  component->AutoAutoplaceFields( m_frame->GetScreen() );
400 
401  break;
402  }
403 
404  case SCH_TEXT_T:
405  case SCH_LABEL_T:
406  case SCH_GLOBAL_LABEL_T:
407  case SCH_HIER_LABEL_T:
408  {
409  SCH_TEXT* textItem = static_cast<SCH_TEXT*>( item );
410 
411  if( clockwise )
412  textItem->SetLabelSpinStyle( textItem->GetLabelSpinStyle().RotateCW() );
413  else
414  textItem->SetLabelSpinStyle( textItem->GetLabelSpinStyle().RotateCCW() );
415 
416  break;
417  }
418 
419  case SCH_SHEET_PIN_T:
420  {
421  // Rotate pin within parent sheet
422  SCH_SHEET_PIN* pin = static_cast<SCH_SHEET_PIN*>( item );
423  SCH_SHEET* sheet = pin->GetParent();
424  for( int i = 0; clockwise ? i < 1 : i < 3; ++i )
425  {
426  pin->Rotate( sheet->GetBoundingBox().GetCenter() );
427  }
428  break;
429  }
430 
431  case SCH_BUS_BUS_ENTRY_T:
433  for( int i = 0; clockwise ? i < 1 : i < 3; ++i )
434  {
435  item->Rotate( item->GetPosition() );
436  }
437  break;
438 
439  case SCH_FIELD_T:
440  {
441  SCH_FIELD* field = static_cast<SCH_FIELD*>( item );
442 
443  if( field->GetTextAngle() == TEXT_ANGLE_HORIZ )
444  field->SetTextAngle( TEXT_ANGLE_VERT );
445  else
446  field->SetTextAngle( TEXT_ANGLE_HORIZ );
447 
448  // Now that we're moving a field, they're no longer autoplaced.
449  static_cast<SCH_ITEM*>( item->GetParent() )->ClearFieldsAutoplaced();
450 
451  break;
452  }
453 
454  case SCH_BITMAP_T:
455  for( int i = 0; clockwise ? i < 1 : i < 3; ++i )
456  {
457  item->Rotate( item->GetPosition() );
458  }
459  // The bitmap is cached in Opengl: clear the cache to redraw
461  break;
462 
463  case SCH_SHEET_T:
464  {
465  SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
466 
467  // Rotate the sheet on itself. Sheets do not have an anchor point.
468  for( int i = 0; clockwise ? i < 3 : i < 1; ++i )
469  {
470  rotPoint = m_frame->GetNearestGridPosition( sheet->GetRotationCenter() );
471  sheet->Rotate( rotPoint );
472  }
473  break;
474  }
475 
476  default:
477  break;
478  }
479 
480  connections = item->IsConnectable();
481  m_frame->RefreshItem( item );
482  }
483  else if( selection.GetSize() > 1 )
484  {
485  rotPoint = m_frame->GetNearestGridPosition( (wxPoint)selection.GetCenter() );
486 
487  for( unsigned ii = 0; ii < selection.GetSize(); ii++ )
488  {
489  item = static_cast<SCH_ITEM*>( selection.GetItem( ii ) );
490 
491  if( !moving )
492  saveCopyInUndoList( item, UR_CHANGED, ii > 0 );
493 
494  for( int i = 0; clockwise ? i < 1 : i < 3; ++i )
495  {
496  if( item->Type() == SCH_LINE_T )
497  {
498  SCH_LINE* line = (SCH_LINE*) item;
499 
500  if( item->HasFlag( STARTPOINT ) )
501  line->RotateStart( rotPoint );
502 
503  if( item->HasFlag( ENDPOINT ) )
504  line->RotateEnd( rotPoint );
505  }
506  else if( item->Type() == SCH_SHEET_PIN_T )
507  {
508  if( item->GetParent()->IsSelected() )
509  {
510  // parent will rotate us
511  }
512  else
513  {
514  // rotate within parent
515  SCH_SHEET_PIN* pin = static_cast<SCH_SHEET_PIN*>( item );
516  SCH_SHEET* sheet = pin->GetParent();
517 
518  pin->Rotate( sheet->GetBoundingBox().GetCenter() );
519  }
520  }
521  else
522  {
523  item->Rotate( rotPoint );
524  }
525  }
526 
527  connections |= item->IsConnectable();
528  m_frame->RefreshItem( item );
529  }
530  }
531 
533 
534  if( item->IsMoving() )
535  {
537  }
538  else
539  {
540  if( selection.IsHover() )
542 
543  if( connections )
545 
546  m_frame->OnModify();
547  }
548 
549  return 0;
550 }
551 
552 
553 int SCH_EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent )
554 {
556 
557  if( selection.GetSize() == 0 )
558  return 0;
559 
560  wxPoint mirrorPoint;
561  bool xAxis = ( aEvent.Matches( EE_ACTIONS::mirrorX.MakeEvent() ) );
562  SCH_ITEM* item = static_cast<SCH_ITEM*>( selection.Front() );
563  bool connections = false;
564  bool moving = item->IsMoving();
565 
566  if( selection.GetSize() == 1 )
567  {
568  if( !moving )
570 
571  switch( item->Type() )
572  {
573  case SCH_COMPONENT_T:
574  {
575  SCH_COMPONENT* component = static_cast<SCH_COMPONENT*>( item );
576 
577  if( xAxis )
578  component->SetOrientation( CMP_MIRROR_X );
579  else
580  component->SetOrientation( CMP_MIRROR_Y );
581 
582  if( m_frame->GetAutoplaceFields() )
583  component->AutoAutoplaceFields( m_frame->GetScreen() );
584 
585  break;
586  }
587 
588  case SCH_TEXT_T:
589  case SCH_LABEL_T:
590  case SCH_GLOBAL_LABEL_T:
591  case SCH_HIER_LABEL_T:
592  {
593  SCH_TEXT* textItem = static_cast<SCH_TEXT*>( item );
594 
595  if( xAxis )
596  textItem->SetLabelSpinStyle( textItem->GetLabelSpinStyle().MirrorX() );
597  else
598  textItem->SetLabelSpinStyle( textItem->GetLabelSpinStyle().MirrorY() );
599  break;
600  }
601 
602  case SCH_SHEET_PIN_T:
603  {
604  // mirror within parent sheet
605  SCH_SHEET_PIN* pin = static_cast<SCH_SHEET_PIN*>( item );
606  SCH_SHEET* sheet = pin->GetParent();
607 
608  if( xAxis )
609  pin->MirrorX( sheet->GetBoundingBox().GetCenter().y );
610  else
611  pin->MirrorY( sheet->GetBoundingBox().GetCenter().x );
612 
613  break;
614  }
615 
616  case SCH_BUS_BUS_ENTRY_T:
618  if( xAxis )
619  item->MirrorX( item->GetPosition().y );
620  else
621  item->MirrorY( item->GetPosition().x );
622  break;
623 
624  case SCH_FIELD_T:
625  {
626  SCH_FIELD* field = static_cast<SCH_FIELD*>( item );
627 
628  if( xAxis )
630  else
632 
633  // Now that we're re-justifying a field, they're no longer autoplaced.
634  static_cast<SCH_ITEM*>( item->GetParent() )->ClearFieldsAutoplaced();
635 
636  break;
637  }
638 
639  case SCH_BITMAP_T:
640  if( xAxis )
641  item->MirrorX( item->GetPosition().y );
642  else
643  item->MirrorY( item->GetPosition().x );
644 
645  // The bitmap is cached in Opengl: clear the cache to redraw
647  break;
648 
649  case SCH_SHEET_T:
650  // Mirror the sheet on itself. Sheets do not have a anchor point.
651  mirrorPoint = m_frame->GetNearestGridPosition( item->GetBoundingBox().Centre() );
652 
653  if( xAxis )
654  item->MirrorX( mirrorPoint.y );
655  else
656  item->MirrorY( mirrorPoint.x );
657 
658  break;
659 
660  default:
661  break;
662  }
663 
664  connections = item->IsConnectable();
665  m_frame->RefreshItem( item );
666  }
667  else if( selection.GetSize() > 1 )
668  {
669  mirrorPoint = (wxPoint)selection.GetReferencePoint();
670 
671  for( unsigned ii = 0; ii < selection.GetSize(); ii++ )
672  {
673  item = static_cast<SCH_ITEM*>( selection.GetItem( ii ) );
674 
675  if( !moving )
676  saveCopyInUndoList( item, UR_CHANGED, ii > 0 );
677 
678  if( item->Type() == SCH_SHEET_PIN_T )
679  {
680  if( item->GetParent()->IsSelected() )
681  {
682  // parent will mirror us
683  }
684  else
685  {
686  // mirror within parent sheet
687  SCH_SHEET_PIN* pin = static_cast<SCH_SHEET_PIN*>( item );
688  SCH_SHEET* sheet = pin->GetParent();
689 
690  if( xAxis )
691  pin->MirrorX( sheet->GetBoundingBox().GetCenter().y );
692  else
693  pin->MirrorY( sheet->GetBoundingBox().GetCenter().x );
694  }
695  }
696  else
697  {
698  if( xAxis )
699  item->MirrorX( mirrorPoint.y );
700  else
701  item->MirrorY( mirrorPoint.x );
702  }
703 
704  connections |= item->IsConnectable();
705  m_frame->RefreshItem( item );
706  }
707  }
708 
710 
711  if( item->IsMoving() )
712  {
714  }
715  else
716  {
717  if( selection.IsHover() )
719 
720  if( connections )
722 
723  m_frame->OnModify();
724  }
725 
726  return 0;
727 }
728 
729 
731 {
733  SCH_LINE_T,
736  SCH_TEXT_T,
737  SCH_LABEL_T,
741  SCH_SHEET_T,
743  EOT
744 };
745 
746 
748 {
750 
751  if( selection.GetSize() == 0 )
752  return 0;
753 
754  // Doing a duplicate of a new object doesn't really make any sense; we'd just end
755  // up dragging around a stack of objects...
756  if( selection.Front()->IsNew() )
757  return 0;
758 
759  EDA_ITEMS newItems;
760 
761  // Keep track of existing sheet paths. Duplicating a selection can modify this list
762  bool copiedSheets = false;
763  SCH_SHEET_LIST initial_sheetpathList( g_RootSheet );
764 
765  for( unsigned ii = 0; ii < selection.GetSize(); ++ii )
766  {
767  SCH_ITEM* oldItem = static_cast<SCH_ITEM*>( selection.GetItem( ii ) );
768  SCH_ITEM* newItem = oldItem->Duplicate();
769  newItem->SetFlags( IS_NEW );
770  newItems.push_back( newItem );
771  saveCopyInUndoList( newItem, UR_NEW, ii > 0 );
772 
773  switch( newItem->Type() )
774  {
775  case SCH_JUNCTION_T:
776  case SCH_LINE_T:
777  case SCH_BUS_BUS_ENTRY_T:
779  case SCH_TEXT_T:
780  case SCH_LABEL_T:
781  case SCH_GLOBAL_LABEL_T:
782  case SCH_HIER_LABEL_T:
783  case SCH_NO_CONNECT_T:
784  newItem->SetParent( m_frame->GetScreen() );
785  m_frame->AddToScreen( newItem );
786  break;
787 
788  case SCH_SHEET_T:
789  {
790  SCH_SHEET_LIST hierarchy( g_RootSheet );
791  SCH_SHEET* sheet = (SCH_SHEET*) newItem;
792  SCH_FIELD& nameField = sheet->GetFields()[SHEETNAME];
793  wxString baseName = nameField.GetText();
794  wxString candidateName = baseName;
795  int uniquifier = 1;
796 
797  while( hierarchy.NameExists( candidateName ) )
798  candidateName = wxString::Format( wxT( "%s%d" ), baseName, uniquifier++ );
799 
800  nameField.SetText( candidateName );
801 
802  sheet->SetParent( m_frame->GetScreen() );
803  m_frame->AddToScreen( sheet );
804 
805  copiedSheets = true;
806  break;
807  }
808 
809  case SCH_COMPONENT_T:
810  {
811  SCH_COMPONENT* component = (SCH_COMPONENT*) newItem;
812  component->ClearAnnotation( NULL );
813  component->SetParent( m_frame->GetScreen() );
814  m_frame->AddToScreen( component );
815  break;
816  }
817 
818  default:
819  break;
820  }
821  }
822 
823  if( copiedSheets )
824  {
825  // We clear annotation of new sheet paths.
826  // Annotation of new components added in current sheet is already cleared.
827  SCH_SCREENS screensList( g_RootSheet );
828  screensList.ClearAnnotationOfNewSheetPaths( initial_sheetpathList );
830  }
831 
833  m_toolMgr->RunAction( EE_ACTIONS::addItemsToSel, true, &newItems );
835 
836  return 0;
837 }
838 
839 
841 {
842  SCH_ITEM* sourceItem = m_frame->GetRepeatItem();
843 
844  if( !sourceItem )
845  return 0;
846 
848 
849  SCH_ITEM* newItem = sourceItem->Duplicate();
850  bool performDrag = false;
851 
852  // If cloning a component then put into 'move' mode.
853  if( newItem->Type() == SCH_COMPONENT_T )
854  {
855  wxPoint cursorPos = (wxPoint) getViewControls()->GetCursorPosition( true );
856  newItem->Move( cursorPos - newItem->GetPosition() );
857  performDrag = true;
858  }
859  else
860  {
861  if( newItem->CanIncrementLabel() )
862  ( (SCH_TEXT*) newItem )->IncrementLabel( m_frame->GetRepeatDeltaLabel() );
863 
864  newItem->Move( m_frame->GetRepeatStep() );
865  }
866 
867  newItem->SetFlags( IS_NEW );
868  m_frame->AddToScreen( newItem );
869  m_frame->SaveCopyInUndoList( newItem, UR_NEW );
870 
871  m_selectionTool->AddItemToSel( newItem );
872 
873  if( performDrag )
875 
876  newItem->ClearFlags();
877 
878  if( newItem->IsConnectable() )
879  {
880  auto selection = m_selectionTool->GetSelection();
881 
882  m_toolMgr->RunAction( EE_ACTIONS::addNeededJunctions, true, &selection );
885  }
886 
887  // newItem newItem, now that it has been moved, thus saving new position.
888  m_frame->SaveCopyForRepeatItem( newItem );
889 
890  return 0;
891 }
892 
893 
895 {
896  SCH_MARKER_T,
898  SCH_LINE_T,
901  SCH_TEXT_T,
902  SCH_LABEL_T,
906  SCH_SHEET_T,
909  SCH_BITMAP_T,
910  EOT
911 };
912 
913 
915 {
916  SCH_SCREEN* screen = m_frame->GetScreen();
918  bool appendToUndo = false;
919  std::vector<wxPoint> pts;
920 
921  if( items.empty() )
922  return 0;
923 
924  // Don't leave a freed pointer in the selection
926 
927  for( EDA_ITEM* item : items )
928  item->ClearFlags( STRUCT_DELETED );
929 
930  for( EDA_ITEM* item : items )
931  {
932  SCH_ITEM* sch_item = dynamic_cast<SCH_ITEM*>( item );
933 
934  if( !sch_item )
935  continue;
936 
937  if( sch_item->Type() == SCH_JUNCTION_T )
938  {
939  sch_item->SetFlags( STRUCT_DELETED );
940  sch_item->GetConnectionPoints( pts );
941 
942  // clean up junctions at the end
943  }
944  else
945  {
946  sch_item->SetFlags( STRUCT_DELETED );
947  saveCopyInUndoList( item, UR_DELETED, appendToUndo );
948  appendToUndo = true;
949 
950  if( sch_item && sch_item->IsConnectable() )
951  sch_item->GetConnectionPoints( pts );
952 
953  updateView( sch_item );
954 
955  if( sch_item->Type() == SCH_SHEET_PIN_T )
956  {
957  SCH_SHEET_PIN* pin = (SCH_SHEET_PIN*) sch_item;
958  SCH_SHEET* sheet = pin->GetParent();
959 
960  sheet->RemovePin( pin );
961  }
962  else
963  m_frame->RemoveFromScreen( sch_item );
964 
965  if( sch_item->Type() == SCH_SHEET_T )
967  }
968  }
969 
970  for( auto point : pts )
971  {
972  SCH_ITEM* junction = screen->GetItem( point, 0, SCH_JUNCTION_T );
973 
974  if( !junction )
975  continue;
976 
977  if( junction->HasFlag( STRUCT_DELETED ) || !screen->IsJunctionNeeded( point ) )
978  m_frame->DeleteJunction( junction, appendToUndo );
979  }
980 
982 
983  m_frame->GetCanvas()->Refresh();
984  m_frame->OnModify();
985 
986  return 0;
987 }
988 
989 
990 #define HITTEST_THRESHOLD_PIXELS 5
991 
992 
994 {
995  std::string tool = aEvent.GetCommandStr().get();
997 
999  m_pickerItem = nullptr;
1000 
1001  // Deactivate other tools; particularly important if another PICKER is currently running
1002  Activate();
1003 
1004  picker->SetCursor( wxStockCursor( wxCURSOR_BULLSEYE ) );
1005 
1006  picker->SetClickHandler(
1007  [this] ( const VECTOR2D& aPosition ) -> bool
1008  {
1009  if( m_pickerItem )
1010  {
1011  SCH_ITEM* sch_item = dynamic_cast<SCH_ITEM*>( m_pickerItem );
1012 
1013  if( sch_item && sch_item->IsLocked() )
1014  {
1015  STATUS_TEXT_POPUP statusPopup( m_frame );
1016  statusPopup.SetText( _( "Item locked." ) );
1017  statusPopup.PopupFor( 2000 );
1018  statusPopup.Move( wxGetMousePosition() + wxPoint( 20, 20 ) );
1019  return true;
1020  }
1021 
1023  selectionTool->UnbrightenItem( m_pickerItem );
1024  selectionTool->AddItemToSel( m_pickerItem, true /*quiet mode*/ );
1026  m_pickerItem = nullptr;
1027  }
1028 
1029  return true;
1030  } );
1031 
1032  picker->SetMotionHandler(
1033  [this] ( const VECTOR2D& aPos )
1034  {
1035  EE_COLLECTOR collector;
1036  collector.m_Threshold = KiROUND( getView()->ToWorld( HITTEST_THRESHOLD_PIXELS ) );
1037  collector.Collect( m_frame->GetScreen(), deletableItems, (wxPoint) aPos );
1038 
1040  selectionTool->GuessSelectionCandidates( collector, aPos );
1041 
1042  EDA_ITEM* item = collector.GetCount() == 1 ? collector[ 0 ] : nullptr;
1043 
1044  if( m_pickerItem != item )
1045  {
1046  if( m_pickerItem )
1047  selectionTool->UnbrightenItem( m_pickerItem );
1048 
1049  m_pickerItem = item;
1050 
1051  if( m_pickerItem )
1052  selectionTool->BrightenItem( m_pickerItem );
1053  }
1054  } );
1055 
1056  picker->SetFinalizeHandler(
1057  [this] ( const int& aFinalState )
1058  {
1059  if( m_pickerItem )
1061  } );
1062 
1063  m_toolMgr->RunAction( ACTIONS::pickerTool, true, &tool );
1064 
1065  return 0;
1066 }
1067 
1068 
1070 {
1071  // Save old component in undo list if not already in edit, or moving.
1072  if( aField->GetEditFlags() == 0 ) // i.e. not edited, or moved
1074 
1075  wxString title = wxString::Format( _( "Edit %s Field" ), aField->GetName() );
1076 
1077  DIALOG_SCH_EDIT_ONE_FIELD dlg( m_frame, title, aField );
1078 
1079  // The footprint field dialog can invoke a KIWAY_PLAYER so we must use a quasi-modal
1080  if( dlg.ShowQuasiModal() != wxID_OK )
1081  return;
1082 
1083  dlg.UpdateField( aField, g_CurrentSheet );
1084 
1085  if( m_frame->GetAutoplaceFields() || aField->GetParent()->Type() == SCH_SHEET_T )
1086  static_cast<SCH_ITEM*>( aField->GetParent() )->AutoAutoplaceFields( m_frame->GetScreen() );
1087 
1089  m_frame->RefreshItem( aField );
1090  m_frame->OnModify();
1091 }
1092 
1093 
1095 {
1096  static KICAD_T Nothing[] = { EOT };
1097  static KICAD_T CmpOrReference[] = { SCH_FIELD_LOCATE_REFERENCE_T, SCH_COMPONENT_T, EOT };
1098  static KICAD_T CmpOrValue[] = { SCH_FIELD_LOCATE_VALUE_T, SCH_COMPONENT_T, EOT };
1099  static KICAD_T CmpOrFootprint[] = { SCH_FIELD_LOCATE_FOOTPRINT_T, SCH_COMPONENT_T, EOT };
1100 
1101  KICAD_T* filter = Nothing;
1102 
1103  if( aEvent.IsAction( &EE_ACTIONS::editReference ) )
1104  filter = CmpOrReference;
1105  else if( aEvent.IsAction( &EE_ACTIONS::editValue ) )
1106  filter = CmpOrValue;
1107  else if( aEvent.IsAction( &EE_ACTIONS::editFootprint ) )
1108  filter = CmpOrFootprint;
1109 
1110  EE_SELECTION& selection = m_selectionTool->RequestSelection( filter );
1111 
1112  if( selection.Empty() )
1113  return 0;
1114 
1115  SCH_ITEM* item = (SCH_ITEM*) selection.Front();
1116 
1117  if( item->Type() == SCH_COMPONENT_T )
1118  {
1119  SCH_COMPONENT* component = (SCH_COMPONENT*) item;
1120 
1121  if( aEvent.IsAction( &EE_ACTIONS::editReference ) )
1122  editFieldText( component->GetField( REFERENCE ) );
1123  else if( aEvent.IsAction( &EE_ACTIONS::editValue ) )
1124  editFieldText( component->GetField( VALUE ) );
1125  else if( aEvent.IsAction( &EE_ACTIONS::editFootprint ) )
1126  editFieldText( component->GetField( FOOTPRINT ) );
1127  }
1128  else if( item->Type() == SCH_FIELD_T )
1129  {
1130  editFieldText( (SCH_FIELD*) item );
1131  }
1132 
1133  return 0;
1134 }
1135 
1136 
1138 {
1140 
1141  if( selection.Empty() )
1142  return 0;
1143 
1144  SCH_COMPONENT* component = (SCH_COMPONENT*) selection.Front();
1145 
1146  if( !component->IsNew() )
1147  m_frame->SaveCopyInUndoList( component, UR_CHANGED );
1148 
1149  component->AutoplaceFields( m_frame->GetScreen(), /* aManual */ true );
1150 
1151  m_frame->GetScreen()->Update( component );
1152  updateView( component );
1153  m_frame->OnModify();
1154 
1155  return 0;
1156 }
1157 
1158 
1160 {
1161  std::list<SCH_COMPONENT*> components;
1162 
1163  for( auto item : m_frame->GetScreen()->Items().OfType( SCH_COMPONENT_T ) )
1164  components.push_back( static_cast<SCH_COMPONENT*>( item ) );
1165 
1166 
1167  if( InvokeDialogUpdateFields( m_frame, components, true ) == wxID_OK )
1168  m_frame->GetCanvas()->Refresh();
1169 
1170  return 0;
1171 }
1172 
1173 
1175 {
1177 
1178  if( selection.Empty() )
1179  return 0;
1180 
1181  SCH_COMPONENT* component = (SCH_COMPONENT*) selection.Front();
1182 
1184  && component->GetConvert() == LIB_ITEM::LIB_CONVERT::BASE )
1185  return 0;
1186 
1188  && component->GetConvert() != LIB_ITEM::LIB_CONVERT::DEMORGAN )
1189  return 0;
1190 
1191  if( !component->IsNew() )
1192  m_frame->SaveCopyInUndoList( component, UR_CHANGED );
1193 
1194  m_frame->ConvertPart( component );
1195 
1196  if( component->IsNew() )
1198 
1199  return 0;
1200 }
1201 
1202 
1204 {
1206 
1207  if( selection.Empty() )
1208  return 0;
1209 
1210  SCH_ITEM* item = (SCH_ITEM*) selection.Front();
1211 
1212  switch( item->Type() )
1213  {
1214  case SCH_COMPONENT_T:
1215  {
1216  SCH_COMPONENT* component = (SCH_COMPONENT*) item;
1217  DIALOG_EDIT_COMPONENT_IN_SCHEMATIC dlg( m_frame, component );
1218 
1219  // This dialog itself subsequently can invoke a KIWAY_PLAYER as a quasimodal
1220  // frame. Therefore this dialog as a modal frame parent, MUST be run under
1221  // quasimodal mode for the quasimodal frame support to work. So don't use
1222  // the QUASIMODAL macros here.
1223  if( dlg.ShowQuasiModal() == wxID_OK )
1224  {
1225  if( m_frame->GetAutoplaceFields() )
1226  component->AutoAutoplaceFields( m_frame->GetScreen() );
1227 
1229  m_frame->OnModify();
1230  }
1231  }
1232  break;
1233 
1234  case SCH_SHEET_T:
1235  {
1236  SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
1237  bool doClearAnnotation;
1238  bool doRefresh = false;
1239  // Keep track of existing sheet paths. EditSheet() can modify this list
1240  SCH_SHEET_LIST initial_sheetpathList( g_RootSheet );
1241 
1242  doRefresh = m_frame->EditSheetProperties( sheet, g_CurrentSheet, &doClearAnnotation );
1243 
1244  if( doClearAnnotation ) // happens when the current sheet load a existing file
1245  { // we must clear "new" components annotation
1246  SCH_SCREENS screensList( g_RootSheet );
1247  // We clear annotation of new sheet paths here:
1248  screensList.ClearAnnotationOfNewSheetPaths( initial_sheetpathList );
1249  // Clear annotation of g_CurrentSheet itself, because its sheetpath
1250  // is not a new path, but components managed by its sheet path must have
1251  // their annotation cleared, because they are new:
1253  }
1254 
1255  if( doRefresh )
1256  {
1258  m_frame->GetCanvas()->Refresh();
1260  }
1261 
1262  break;
1263  }
1264 
1265  case SCH_SHEET_PIN_T:
1266  {
1267  SCH_SHEET_PIN* pin = (SCH_SHEET_PIN*) item;
1268  DIALOG_EDIT_SHEET_PIN dlg( m_frame, pin );
1269 
1270  if( dlg.ShowModal() == wxID_OK )
1271  {
1273  m_frame->OnModify();
1274  }
1275  }
1276  break;
1277 
1278  case SCH_TEXT_T:
1279  case SCH_LABEL_T:
1280  case SCH_GLOBAL_LABEL_T:
1281  case SCH_HIER_LABEL_T:
1282  if( InvokeDialogLabelEditor( m_frame, (SCH_TEXT*) item ) == wxID_OK )
1283  {
1285  m_frame->OnModify();
1286  }
1287 
1288  break;
1289 
1290  case SCH_FIELD_T:
1291  editFieldText( (SCH_FIELD*) item );
1292  break;
1293 
1294  case SCH_BITMAP_T:
1295  {
1296  SCH_BITMAP* bitmap = (SCH_BITMAP*) item;
1297  DIALOG_IMAGE_EDITOR dlg( m_frame, bitmap->GetImage() );
1298 
1299  if( dlg.ShowModal() == wxID_OK )
1300  {
1301  // save old image in undo list if not already in edit
1302  if( bitmap->GetEditFlags() == 0 )
1304 
1305  dlg.TransferToImage( bitmap->GetImage() );
1306 
1307  // The bitmap is cached in Opengl: clear the cache in case it has become invalid
1308  getView()->RecacheAllItems();
1310  m_frame->OnModify();
1311  }
1312  }
1313  break;
1314 
1315  case SCH_LINE_T:
1316  {
1317  if( !selection.AreAllItemsIdentical() )
1318  break;
1319 
1320  std::deque<SCH_LINE*> lines;
1321  for( auto selItem : selection.Items() )
1322  {
1323  SCH_LINE* line = dynamic_cast<SCH_LINE*>( selItem );
1324 
1325  if( line )
1326  lines.push_back( line );
1327  }
1328 
1329  // Verify we are only editing graphic lines
1330  if( !std::all_of( lines.begin(), lines.end(),
1331  [&]( const SCH_LINE* r ) { return r->IsGraphicLine(); } ) )
1332  break;
1333 
1334  DIALOG_EDIT_LINE_STYLE dlg( m_frame, lines );
1335 
1336  if( dlg.ShowModal() == wxID_OK )
1337  {
1339  m_frame->OnModify();
1340  }
1341  }
1342  break;
1343 
1344  case SCH_MARKER_T: // These items have no properties to edit
1345  case SCH_JUNCTION_T:
1346  case SCH_NO_CONNECT_T:
1347  break;
1348 
1349  default: // Unexpected item
1350  wxFAIL_MSG( wxString( "Cannot edit schematic item type " ) + item->GetClass() );
1351  }
1352 
1353  m_frame->GetScreen()->Update( item );
1354  updateView( item );
1355 
1356  if( selection.IsHover() )
1357  {
1359  }
1360 
1361  return 0;
1362 }
1363 
1364 
1366 {
1367  EE_SELECTION& selection = m_selectionTool->GetSelection();
1368  char shape = aEvent.Parameter<char>();
1369 
1370  for( unsigned int i = 0; i < selection.GetSize(); ++i )
1371  {
1372  SCH_BUS_ENTRY_BASE* entry = dynamic_cast<SCH_BUS_ENTRY_BASE*>( selection.GetItem( i ) );
1373 
1374  if( entry )
1375  {
1376  if( entry->GetEditFlags() == 0 )
1378 
1379  entry->SetBusEntryShape( shape );
1381 
1382  m_frame->GetScreen()->Update( entry );
1383  updateView( entry );
1384  m_frame->OnModify( );
1385  }
1386  }
1387 
1388  g_lastBusEntryShape = shape;
1389 
1390  return 0;
1391 }
1392 
1393 
1395 {
1396  KICAD_T convertTo = aEvent.Parameter<KICAD_T>();
1398  EE_SELECTION& selection = m_selectionTool->RequestSelection( allTextTypes );
1399 
1400  for( unsigned int i = 0; i < selection.GetSize(); ++i )
1401  {
1402  SCH_TEXT* text = dynamic_cast<SCH_TEXT*>( selection.GetItem( i ) );
1403 
1404  if( text )
1405  m_frame->ConvertTextType( text, convertTo );
1406  }
1407 
1408  return 0;
1409 }
1410 
1411 
1413 {
1414  auto cursorPos = wxPoint( getViewControls()->GetCursorPosition( !aEvent.Modifier( MD_ALT ) ) );
1415 
1416  if( m_frame->BreakSegments( cursorPos ) )
1417  {
1418  if( m_frame->GetScreen()->IsJunctionNeeded( cursorPos, true ) )
1419  m_frame->AddJunction( cursorPos, true, false );
1420 
1422 
1423  m_frame->OnModify();
1424  m_frame->GetCanvas()->Refresh();
1425  }
1426 
1427  return 0;
1428 }
1429 
1430 
1432 {
1434  SCH_SHEET* sheet = (SCH_SHEET*) selection.Front();
1435 
1436  if( !sheet )
1437  return 0;
1438 
1439  if( !sheet->HasUndefinedPins() )
1440  {
1441  DisplayInfoMessage( m_frame, _( "There are no unreferenced pins in this sheet to remove." ) );
1442  return 0;
1443  }
1444 
1445  if( !IsOK( m_frame, _( "Do you wish to delete the unreferenced pins from this sheet?" ) ) )
1446  return 0;
1447 
1449 
1450  sheet->CleanupSheet();
1451 
1452  m_frame->GetScreen()->Update( sheet );
1453  updateView( sheet );
1454  m_frame->OnModify();
1455 
1456  return 0;
1457 }
1458 
1459 
1461 {
1466  Go( &SCH_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorX.MakeEvent() );
1467  Go( &SCH_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorY.MakeEvent() );
1468  Go( &SCH_EDIT_TOOL::DoDelete, ACTIONS::doDelete.MakeEvent() );
1470 
1480 
1487 
1490 
1493 }
void SetTextAngle(double aAngle)
Definition: eda_text.h:150
const BITMAP_OPAQUE component_select_unit_xpm[1]
#define TEXT_ANGLE_HORIZ
VECTOR2I GetReferencePoint() const
Definition: selection.h:239
SCH_SHEET_LIST.
void AddMenu(ACTION_MENU *aMenu, const SELECTION_CONDITION &aCondition=SELECTION_CONDITIONS::ShowAlways, int aOrder=ANY_ORDER)
Function AddMenu()
static TOOL_ACTION properties
Definition: ee_actions.h:122
SCH_FIELD instances are attached to a component and provide a place for the component's value,...
Definition: sch_field.h:52
void SetCursor(const wxCursor &aCursor)
Definition: picker_tool.h:65
bool SchematicCleanUp(SCH_SCREEN *aScreen=nullptr)
Performs routine schematic cleaning including breaking wire and buses and deleting identical objects ...
#define HITTEST_THRESHOLD_PIXELS
TOOL_MENU m_menu
functions below are not yet implemented - their interface may change
int m_Threshold
Definition: collector.h:66
virtual bool IsConnectable() const
Function IsConnectable returns true if the schematic item can connect to another schematic item.
Definition: sch_item.h:337
EDA_TEXT_HJUSTIFY_T
Definition: eda_text.h:44
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:184
bool IsGraphicLine() const
Returns if the line is a graphic (non electrical line)
Definition: sch_line.cpp:809
bool IsHover() const
Definition: selection.h:70
SCH_SHEET * GetParent() const
Get the parent sheet object of this sheet pin.
Definition: sch_sheet.h:167
std::deque< EDA_ITEM * > & Items()
Definition: selection.h:188
static TOOL_ACTION toggleDeMorgan
Definition: ee_actions.h:127
void SetMotionHandler(MOTION_HANDLER aHandler)
Function SetMotionHandler() Sets a handler for mouse motion.
Definition: picker_tool.h:82
static TOOL_ACTION breakBus
Definition: ee_actions.h:138
static SELECTION_CONDITION SingleSymbol
static KICAD_T duplicatableItems[]
bool IsSelected() const
Definition: base_struct.h:225
#define TEXT_ANGLE_VERT
void AddToScreen(EDA_ITEM *aItem, SCH_SCREEN *aScreen=nullptr)
Add an item to the screen (and view) aScreen is the screen the item is located on,...
ACTION_MENU.
Definition: action_menu.h:43
This file is part of the common library.
static TOOL_ACTION doDelete
Definition: actions.h:74
bool IsJunctionNeeded(const wxPoint &aPosition, bool aNew=false)
Test if a junction is required for the items at aPosition on the screen.
Definition: sch_screen.cpp:335
SCH_DRAWING_TOOLS.
void SetClickHandler(CLICK_HANDLER aHandler)
Function SetClickHandler() Sets a handler for mouse click event.
Definition: picker_tool.h:72
static TOOL_ACTION toShapeBackslash
Definition: ee_actions.h:132
void MirrorY(int aYaxis_position) override
Function MirrorY mirrors item relative to the Y axis about aYaxis_position.
bool BreakSegments(const wxPoint &aPoint, SCH_SCREEN *aScreen=nullptr)
Checks every wire and bus for a intersection at aPoint and break into two segments at aPoint if an in...
static SELECTION_CONDITION MoreThan(int aNumber)
Function MoreThan Creates a functor that tests if the number of selected items is greater than the va...
void Collect(SCH_SCREEN *aScreen, const KICAD_T aFilterList[], const wxPoint &aPos, int aUnit=0, int aConvert=0)
Function Collect scans a EDA_ITEM using this class's Inspector method, which does the collection.
static TOOL_ACTION addItemsToSel
Selects a list of items (specified as the event parameter)
Definition: ee_actions.h:65
void AutoAutoplaceFields(SCH_SCREEN *aScreen)
Autoplace fields only if correct to do so automatically.
Definition: sch_item.h:419
static SELECTION_CONDITION OnlyTypes(const KICAD_T aTypes[])
Function OnlyTypes Creates a functor that tests if the selected items are only of given types.
void RotateEnd(wxPoint aPosition)
Definition: sch_line.cpp:354
STATUS_TEXT_POPUP.
Definition: status_popup.h:79
virtual VECTOR2I GetCenter() const
Returns the center point of the selection area bounding box.
Definition: selection.h:137
bool IsMoving() const
Definition: base_struct.h:222
CONDITIONAL_MENU & GetMenu()
Function GetMenu.
Definition: tool_menu.cpp:46
int Rotate(const TOOL_EVENT &aEvent)
static TOOL_ACTION mirrorY
Definition: ee_actions.h:121
static TOOL_ACTION placeHierLabel
Definition: ee_actions.h:90
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:218
void RecacheAllItems()
Function RecacheAllItems() Rebuilds GAL display lists.
Definition: view.cpp:1402
EE_TYPE OfType(KICAD_T aType)
Definition: sch_rtree.h:219
int BreakWire(const TOOL_EVENT &aEvent)
static SELECTION_CONDITION IdleSelection
virtual void GetConnectionPoints(std::vector< wxPoint > &aPoints) const
Function GetConnectionPoints add all the connection points for this item to aPoints.
Definition: sch_item.h:347
virtual bool CanIncrementLabel() const
Definition: sch_item.h:399
TOOL_MENU & GetToolMenu()
double GetTextAngle() const
Definition: eda_text.h:158
char g_lastBusEntryShape
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:139
EE_COLLECTOR.
Definition: ee_collectors.h:39
static TOOL_ACTION toText
Definition: ee_actions.h:136
static TOOL_ACTION autoplaceFields
Definition: ee_actions.h:126
Schematic editor (Eeschema) main window.
int Properties(const TOOL_EVENT &aEvent)
bool TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
bool AreAllItemsIdentical() const
Checks if all items in the selection are the same KICAD_T type.
Definition: selection.h:259
void RemoveFromScreen(EDA_ITEM *aItem, SCH_SCREEN *aScreen=nullptr)
Remove an item from the screen (and view) aScreen is the screen the item is located on,...
int UpdateFields(const TOOL_EVENT &aEvent)
static const KICAD_T ComponentsOnly[]
Definition: ee_collectors.h:44
static SELECTION_CONDITION Idle
static const KICAD_T SheetsOnly[]
Definition: ee_collectors.h:45
wxPoint GetNearestGridPosition(const wxPoint &aPosition) const
Return the nearest aGridSize location to aPosition.
static SELECTION_CONDITION Count(int aNumber)
Function Count Creates a functor that tests if the number of selected items is equal to the value giv...
void setTransitions() override
Sets up handlers for various events.
void update() override
Update menu state stub.
void MirrorX(int aXaxis_position) override
Function MirrorX mirrors item relative to the X axis about aXaxis_position.
bool GetAutoplaceFields() const
static TOOL_ACTION showDeMorganAlternate
Definition: ee_actions.h:129
SCH_SCREEN * GetScreen()
Definition: sch_sheet.h:282
static bool NotEmpty(const SELECTION &aSelection)
Function NotEmpty Tests if there are any items selected.
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Function Go()
Field Reference of part, i.e. "IC21".
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
static const TOOL_EVENT SelectedItemsModified
Definition: actions.h:205
void GuessSelectionCandidates(EE_COLLECTOR &collector, const VECTOR2I &aPos)
Apply heuristics to try and determine a single object when multiple are found under the cursor.
void RotateStart(wxPoint aPosition)
Definition: sch_line.cpp:348
static TOOL_ACTION breakWire
Definition: ee_actions.h:137
static TOOL_ACTION rotateCW
Definition: ee_actions.h:118
bool IsAction(const TOOL_ACTION *aAction) const
Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_AC...
Definition: tool_event.cpp:67
bool IsNew() const
Definition: base_struct.h:220
SCH_FIELD * GetField(int aFieldNdx) const
Returns a field in this symbol.
static TOOL_ACTION pickerTool
Definition: actions.h:148
Base class for a bus or wire entry.
Definition: sch_bus_entry.h:41
bool Init() override
Function Init() Init() is called once upon a registration of the tool.
Definition: ee_tool_base.h:69
int InvokeDialogLabelEditor(SCH_EDIT_FRAME *aCaller, SCH_TEXT *aTextItem)
Launches the "Edit Text/Label" dialog.
void SetFinalizeHandler(FINALIZE_HANDLER aHandler)
Function SetFinalizeHandler() Sets a handler for the finalize event.
Definition: picker_tool.h:102
virtual void Rotate(wxPoint aPosition)=0
Function Rotate rotates the item around aPosition 90 degrees in the clockwise direction.
EE_SELECTION & GetSelection()
Function GetSelection()
#define IS_NEW
New item, just created.
Definition: base_struct.h:120
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Function RequestSelection()
std::vector< SCH_FIELD > & GetFields()
Definition: sch_sheet.h:268
int Duplicate(const TOOL_EVENT &aEvent)
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
static TOOL_ACTION drawSheet
Definition: ee_actions.h:91
static SELECTION_CONDITION SingleDeMorganSymbol
int GetCount() const
Function GetCount returns the number of objects in the list.
Definition: collector.h:100
static TOOL_ACTION copy
Definition: actions.h:70
void editFieldText(SCH_FIELD *aField)
static TOOL_ACTION cleanupSheetPins
Definition: ee_actions.h:181
#define VALUE
static TOOL_ACTION rotateCCW
Definition: ee_actions.h:119
int GetUnit() const
void BrightenItem(EDA_ITEM *aItem)
void RemovePin(SCH_SHEET_PIN *aSheetPin)
Remove aSheetPin from the sheet.
Definition: sch_sheet.cpp:240
virtual wxPoint GetPosition() const =0
Function GetPosition.
static TOOL_ACTION editFootprint
Definition: ee_actions.h:125
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:257
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:183
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:111
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: sch_sheet.cpp:544
SCH_ITEM * Duplicate(bool doClone=false) const
Routine to create a new copy of given item.
Definition: sch_item.cpp:75
#define NULL
SCH_SHEET_PATH * g_CurrentSheet
With the new connectivity algorithm, many more places than before want to know what the current sheet...
BITMAP_BASE * GetImage()
Definition: sch_bitmap.h:59
int ChangeShape(const TOOL_EVENT &aEvent)
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:218
STATUS_FLAGS GetEditFlags() const
Definition: base_struct.h:262
int ShowQuasiModal()
std::vector< EDA_ITEM * > EDA_ITEMS
Define list of drawing items for screens.
Definition: base_struct.h:603
T Parameter() const
Function Parameter() Returns a non-standard parameter assigned to the event.
Definition: tool_event.h:435
void SetVertJustify(EDA_TEXT_VJUSTIFY_T aType)
Definition: eda_text.h:187
static TOOL_ACTION placeSchematicText
Definition: ee_actions.h:94
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void SetIcon(const BITMAP_OPAQUE *aIcon)
Function SetIcon() Assigns an icon for the entry.
Definition: action_menu.cpp:68
TOOL_EVENT.
Definition: tool_event.h:171
void SaveCopyInUndoList(SCH_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, bool aAppend=false, const wxPoint &aTransformPoint=wxPoint(0, 0))
Create a copy of the current schematic item, and put it in the undo list.
int AutoplaceFields(const TOOL_EVENT &aEvent)
ACTION_MENU * create() const override
Returns an instance of this class. It has to be overridden in inheriting classes.
static TOOL_ACTION repeatDrawItem
Definition: ee_actions.h:117
const std::deque< EDA_ITEM * > GetItems() const
Definition: selection.h:131
static TOOL_ACTION cut
Definition: actions.h:69
void UpdateHierarchyNavigator(bool aForceUpdate=false)
Run the Hierarchy Navigator dialog.
void SaveCopyForRepeatItem(SCH_ITEM *aItem)
Clone aItem and owns that clone in this container.
const wxPoint GetRepeatStep() const
#define STRUCT_DELETED
flag indication structures to be erased
Definition: base_struct.h:129
SCH_JUNCTION * AddJunction(const wxPoint &aPos, bool aAppendToUndo=false, bool aFinal=true)
EDA_ITEM * GetParent() const
Definition: base_struct.h:217
const KICAD_T rotatableItems[]
static TOOL_ACTION mirrorX
Definition: ee_actions.h:120
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:153
LABEL_SPIN_STYLE GetLabelSpinStyle() const
Definition: sch_text.h:237
bool Matches(const TOOL_EVENT &aEvent) const
Function Matches() Tests whether two events match in terms of category & action or command.
Definition: tool_event.h:364
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:84
virtual void MirrorX(int aXaxis_position)=0
Function MirrorX mirrors item relative to the X axis about aXaxis_position.
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:58
void SetBusEntryShape(char aShape)
std::unique_ptr< LIB_PART > & GetPartRef()
virtual void Move(const wxPoint &aWhere)
bool Init() override
Function Init() Init() is called once upon a registration of the tool.
static TOOL_ACTION addNeededJunctions
Definition: ee_actions.h:77
int CleanupSheetPins(const TOOL_EVENT &aEvent)
static SELECTION_CONDITION SingleMultiUnitSymbol
virtual void MirrorY(int aYaxis_position)=0
Function MirrorY mirrors item relative to the Y axis about aYaxis_position.
static TOOL_ACTION editTextAndGraphics
Definition: ee_actions.h:182
void ClearAnnotation(SCH_SHEET_PATH *aSheetPath)
Clear exiting component annotation.
void CleanupSheet()
Delete sheet label which do not have a corresponding hierarchical label.
Definition: sch_sheet.cpp:407
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
Definition: selection.h:104
LABEL_SPIN_STYLE MirrorY()
Definition: sch_text.h:140
virtual void PopupFor(int aMsecs)
void Rotate(wxPoint aPosition) override
Function Rotate rotates the item around aPosition 90 degrees in the clockwise direction.
Definition: sch_sheet.cpp:675
int DeleteItemCursor(const TOOL_EVENT &aEvent)
Runs the deletion tool.
void UnbrightenItem(EDA_ITEM *aItem)
static TOOL_ACTION showDeMorganStandard
Definition: ee_actions.h:128
DIALOG_SCH_EDIT_ONE_FIELD is a the class to handle editing a single component field in the schematic ...
Object to handle a bitmap image that can be inserted in a schematic.
Definition: sch_bitmap.h:42
int InvokeDialogUpdateFields(SCH_EDIT_FRAME *aCaller, const list< SCH_COMPONENT * > aComponents, bool aCreateUndoEntry)
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
bool NameExists(const wxString &aSheetName)
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:120
LABEL_SPIN_STYLE RotateCCW()
Definition: sch_text.h:100
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:215
int Mirror(const TOOL_EVENT &aEvent)
void AddSeparator(int aOrder=ANY_ORDER)
Function AddSeparator()
static TOOL_ACTION pasteSpecial
Definition: actions.h:72
EDA_TEXT_VJUSTIFY_T
Definition: eda_text.h:51
EDA_ITEM * m_pickerItem
Definition: sch_edit_tool.h:78
virtual unsigned int GetSize() const override
Function GetSize() Returns the number of stored items.
Definition: selection.h:99
virtual bool IsLocked() const
Function IsLocked.
Definition: sch_item.h:212
int RepeatDrawItem(const TOOL_EVENT &aEvent)
int Modifier(int aMask=MD_MODIFIER_MASK) const
Returns information about key modifiers state (Ctrl, Alt, etc.)
Definition: tool_event.h:342
static TOOL_ACTION updateFieldsFromLibrary
Definition: ee_actions.h:150
static TOOL_ACTION placeLabel
Definition: ee_actions.h:88
OPT< std::string > GetCommandStr() const
Definition: tool_event.h:463
static bool IsDrawingLineWireOrBus(const SELECTION &aSelection)
bool HasUndefinedPins()
Check all sheet labels against schematic for undefined hierarchical labels.
Definition: sch_sheet.cpp:305
static TOOL_ACTION editValue
Definition: ee_actions.h:124
static KICAD_T deletableItems[]
LABEL_SPIN_STYLE MirrorX()
Definition: sch_text.h:120
SCH_ITEM * GetRepeatItem() const
Return the item which is to be repeated with the insert key.
void updateView(EDA_ITEM *aItem) const
Similar to getView()->Update(), but handles items that are redrawn by their parents.
Definition: ee_tool_base.h:104
void SetTitle(const wxString &aTitle) override
Function SetTitle() Sets title for the menu.
Definition: action_menu.cpp:86
void ConvertTextType(SCH_TEXT *aText, KICAD_T aNewType)
Change a text type to another one.
Definition: edit_label.cpp:190
LABEL_SPIN_STYLE RotateCW()
Definition: sch_text.h:83
int AddItemToSel(const TOOL_EVENT &aEvent)
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:38
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
void RefreshItem(EDA_ITEM *aItem, bool isAddOrDelete=false)
Mark an item for refresh.
void SetHorizJustify(EDA_TEXT_HJUSTIFY_T aType)
Definition: eda_text.h:186
#define _(s)
Definition: 3d_actions.cpp:33
TOOL_MANAGER * getToolManager() const
Returns an instance of TOOL_MANAGER class.
void DeleteJunction(SCH_ITEM *aItem, bool aAppend=false)
Removes a given junction and heals any wire segments under the junction.
void AddSubMenu(std::shared_ptr< ACTION_MENU > aSubMenu)
Function CreateSubMenu.
Definition: tool_menu.cpp:52
Dialog used to edit SCH_COMPONENT objects in a schematic.
wxString GetName(bool aUseDefaultName=true) const
Function GetName returns the field name.
Definition: sch_field.cpp:403
EE_RTREE & Items()
Definition: sch_screen.h:127
#define ENDPOINT
ends. (Used to support dragging.)
Definition: base_struct.h:126
static SELECTION_CONDITION OnlyType(KICAD_T aType)
Function OnlyType Creates a functor that tests if the selected items are only of given type.
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Automatically orient all the fields in the component.
static wxString SubReference(int aUnit, bool aAddSeparator=true)
int EditField(const TOOL_EVENT &aEvent)
void Clear()
Function Clear() Removes all the entries from the menu (as well as its title).
SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:99
int GetRepeatDeltaLabel() const
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:61
void saveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO_T aType, bool aAppend=false)
Similar to m_frame->SaveCopyInUndoList(), but handles items that are owned by their parents.
Definition: ee_tool_base.h:117
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:166
wxString GetClass() const override
Function GetClass returns the class name.
Definition: sch_field.h:71
wxPoint Centre() const
Definition: eda_rect.h:62
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:258
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:479
void Activate()
Function Activate() Runs the tool.
wxPoint GetRotationCenter() const
Rotating around the boundingBox's center can cause walking when the sheetname or filename is longer t...
Definition: sch_sheet.cpp:555
void Rotate(wxPoint aPosition) override
Function Rotate rotates the item around aPosition 90 degrees in the clockwise direction.
static TOOL_ACTION deleteTool
Definition: actions.h:75
void ClearAnnotation(SCH_SHEET_PATH *aSheetPath)
Clear the annotation for the components in aSheetPath on the screen.
Definition: sch_screen.cpp:732
static TOOL_ACTION editWithLibEdit
Definition: ee_actions.h:156
static TOOL_ACTION move
Definition: ee_actions.h:115
EE_TOOL_BASE.
Definition: ee_tool_base.h:50
SCH_ITEM * GetItem(const wxPoint &aPosition, int aAccuracy=0, KICAD_T aType=SCH_LOCATE_ANY_T)
Check aPosition within a distance of aAccuracy for items of type aFilter.
Definition: sch_screen.cpp:273
static TOOL_ACTION toLabel
Definition: ee_actions.h:133
int GetConvert() const
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
SCH_SHEET * g_RootSheet
void Update(SCH_ITEM *aItem)
Updates aItem's bounding box in the tree.
Definition: sch_screen.cpp:231
static TOOL_ACTION toHLabel
Definition: ee_actions.h:134
virtual const EDA_RECT GetBoundingBox() const
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:42
static TOOL_ACTION editReference
Definition: ee_actions.h:123
void ClearAnnotationOfNewSheetPaths(SCH_SHEET_LIST &aInitialSheetPathList)
Clear the annotation for the components inside new sheetpaths when a complex hierarchy is modified an...
bool HasFlag(STATUS_FLAGS aFlag)
Definition: base_struct.h:260
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:206
const wxPoint GetCenter() const
Definition: eda_rect.h:117
static TOOL_ACTION placeGlobalLabel
Definition: ee_actions.h:89
int DoDelete(const TOOL_EVENT &aEvent)
Deletes the selected items, or the item under the cursor.
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
Definition: confirm.cpp:267
void PostEvent(const TOOL_EVENT &aEvent)
Puts an event to the event queue to be processed at the end of event processing cycle.
Definition: tool_manager.h:267
void ConvertPart(SCH_COMPONENT *aComponent)
Definition: getpart.cpp:243
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Function AddItem()
bool IsCurrentTool(const TOOL_ACTION &aAction) const
SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:147
static TOOL_ACTION toGLabel
Definition: ee_actions.h:135
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:283
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:123
int ConvertDeMorgan(const TOOL_EVENT &aEvent)
static TOOL_ACTION paste
Definition: actions.h:71
static const KICAD_T EditableItems[]
Definition: ee_collectors.h:43
static TOOL_ACTION duplicate
Definition: actions.h:73
int ChangeTextType(const TOOL_EVENT &aEvent)
void SetText(const wxString &aText)
Display a text.
static TOOL_ACTION toShapeSlash
Definition: ee_actions.h:131
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:491
static TOOL_ACTION refreshPreview
Definition: actions.h:101
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.
EDA_ITEM * Front() const
Definition: selection.h:183
KICAD_T Type() const
Function Type()
Definition: base_struct.h:212
#define STARTPOINT
When a line is selected, these flags indicate which.
Definition: base_struct.h:125
void SetOrientation(int aOrientation)
Compute the new transform matrix based on aOrientation for the symbol which is applied to the current...
virtual void Move(const wxPoint &aMoveVector)=0
Function Move moves the item by aMoveVector to a new position.