KiCad PCB EDA Suite
pcbnew/onrightclick.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) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
6  * Copyright (C) 2007-2013 Wayne Stambaugh <stambaughw@verizon.net>
7  * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, you may find one here:
21  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22  * or you may search the http://www.gnu.org website for the version 2 license,
23  * or you may write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25  */
26 
32 #include <fctsys.h>
33 #include <class_drawpanel.h>
34 #include <macros.h>
35 #include <base_units.h>
36 #include <bitmaps.h>
37 
38 #include <class_board.h>
39 #include <class_module.h>
40 #include <class_track.h>
41 #include <class_pcb_text.h>
42 #include <class_zone.h>
43 
44 #include <pcbnew.h>
45 #include <wxPcbStruct.h>
46 #include <pcbnew_id.h>
47 #include <hotkeys.h>
48 #include <collectors.h>
49 #include <menus_helpers.h>
50 
51 
52 static wxMenu* Append_Track_Width_List( BOARD* aBoard );
53 
54 
55 bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
56 {
57  wxString msg;
58  STATUS_FLAGS flags = 0;
59  bool trackFound = false; // Flag set to true,
60  // if a track is being the cursor, to avoid
61  // to display menus relative to tracks twice
62  bool blockActive = !GetScreen()->m_BlockLocate.IsIdle();
63 
64  BOARD_ITEM* item = GetCurItem();
65 
66  m_canvas->SetCanStartBlock( -1 ); // Avoid to start a block command when clicking on menu
67 
68  // If a command or a block is in progress:
69  // Put the Cancel command (if needed) and the End command
70 
71  if( blockActive )
72  {
73  createPopUpBlockMenu( aPopMenu );
74  aPopMenu->AppendSeparator();
75  return true;
76  }
77 
79  {
80  if( item && item->GetFlags() )
81  {
82  AddMenuItem( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel" ),
83  KiBitmap( cancel_xpm ) );
84  }
85  else
86  {
88  _( "End Tool" ), KiBitmap( cursor_xpm ) );
89  }
90 
91  aPopMenu->AppendSeparator();
92  }
93  else
94  {
95  if( item && item->GetFlags() )
96  {
98  _( "Cancel" ), KiBitmap( cancel_xpm ) );
99  aPopMenu->AppendSeparator();
100  }
101  }
102 
103  // Select a proper item
104 
105  wxPoint cursorPos = GetCrossHairPosition();
106  wxPoint selectPos = m_Collector->GetRefPos();
107 
108  selectPos = GetNearestGridPosition( selectPos );
109 
110  /* We can reselect another item only if there are no item being edited
111  * because ALL moving functions use GetCurItem(), therefore GetCurItem()
112  * must return the same item during moving. We know an item is moving
113  * if( item && (item->m_Flags != 0)) is true and after calling
114  * PcbGeneralLocateAndDisplay(), GetCurItem() is any arbitrary BOARD_ITEM,
115  * not the current item being edited. In such case we cannot call
116  * PcbGeneralLocateAndDisplay().
117  */
118  if( !item || (item->GetFlags() == 0) )
119  {
120  // show the "item selector" menu if no item selected or
121  // if there is a selected item but the mouse has moved
122  // (therefore a new item is perhaps under the cursor)
123  if( !item || cursorPos != selectPos )
124  {
125  m_canvas->SetAbortRequest( false );
127 
128  if( m_canvas->GetAbortRequest() )
129  {
130  return false;
131  }
132  }
133  }
134 
135  item = GetCurItem();
136  flags = item ? item->GetFlags() : 0;
137 
138  // Add the context menu, which depends on the picked item:
139  if( item )
140  {
141  switch( item->Type() )
142  {
143  case PCB_MODULE_T:
144  createPopUpMenuForFootprints( (MODULE*) item, aPopMenu );
145 
146  if( m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_MODULE ) )
147  {
148  aPopMenu->AppendSeparator();
149 
150  if( !( (MODULE*) item )->IsLocked() )
151  {
152  msg = AddHotkeyName( _("Lock Footprint" ), g_Board_Editor_Hokeys_Descr,
155  KiBitmap( locked_xpm ) );
156  }
157  else
158  {
159  msg = AddHotkeyName( _( "Unlock Footprint" ), g_Board_Editor_Hokeys_Descr,
162  KiBitmap( unlocked_xpm ) );
163  }
164 
165  if( !flags )
166  aPopMenu->Append( ID_POPUP_PCB_AUTOPLACE_CURRENT_MODULE,
167  _( "Automatically Place Footprint" ) );
168  }
169 
170  if( m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_TRACKS ) )
171  {
172  if( !flags )
173  aPopMenu->Append( ID_POPUP_PCB_AUTOROUTE_MODULE,
174  _( "Automatically Route Footprint" ) );
175  }
176  break;
177 
178  case PCB_PAD_T:
179  createPopUpMenuForFpPads( static_cast<D_PAD*>( item ), aPopMenu );
180  break;
181 
182  case PCB_MODULE_TEXT_T:
183  createPopUpMenuForFpTexts( static_cast<TEXTE_MODULE*>( item ), aPopMenu );
184  break;
185 
186  case PCB_LINE_T: // Some graphic items on technical layers
187  if( (flags & IS_NEW) )
188  {
190  _( "End Drawing" ), KiBitmap( checked_ok_xpm ) );
191  }
192 
193  if( !flags )
194  {
195  msg = AddHotkeyName( _( "Move" ), g_Board_Editor_Hokeys_Descr,
196  HK_MOVE_ITEM );
198  msg, KiBitmap( move_xpm ) );
199 
200  msg = AddHotkeyName( _( "Duplicate" ), g_Board_Editor_Hokeys_Descr,
203  msg, KiBitmap( duplicate_xpm ) );
204 
205  msg = AddHotkeyName( _("Move Exactly" ), g_Board_Editor_Hokeys_Descr,
208  msg, KiBitmap( move_exactly_xpm ) );
209 
210  msg = AddHotkeyName( _("Create Array" ), g_Board_Editor_Hokeys_Descr,
211  HK_CREATE_ARRAY );
213  msg, KiBitmap( array_xpm ) );
214 
215  msg = AddHotkeyName( _( "Edit" ), g_Board_Editor_Hokeys_Descr,
216  HK_EDIT_ITEM );
218  msg, KiBitmap( edit_xpm ) );
219 
221  _( "Delete" ), KiBitmap( delete_xpm ) );
222 
223  if( !IsCopperLayer( item->GetLayer() ) )
225  _( "Delete All Drawings on Layer" ), KiBitmap( delete_xpm ) );
226  }
227 
228  break;
229 
230  case PCB_ZONE_T: // Item used to fill a zone
232  _( "Delete Zone Filling" ), KiBitmap( delete_xpm ) );
233  break;
234 
235  case PCB_ZONE_AREA_T: // Item used to handle a zone area (outlines, holes ...)
236  if( flags & IS_NEW )
237  {
239  _( "Close Zone Outline" ), KiBitmap( checked_ok_xpm ) );
241  _( "Delete Last Corner" ), KiBitmap( delete_xpm ) );
242  }
243  else
244  {
245  createPopUpMenuForZones( (ZONE_CONTAINER*) item, aPopMenu );
246  }
247 
248  break;
249 
250  case PCB_TEXT_T:
251  createPopUpMenuForTexts( (TEXTE_PCB*) item, aPopMenu );
252  break;
253 
254  case PCB_TRACE_T:
255  case PCB_VIA_T:
256  trackFound = true;
257  createPopupMenuForTracks( (TRACK*) item, aPopMenu );
258  break;
259 
260  case PCB_MARKER_T:
261  createPopUpMenuForMarkers( (MARKER_PCB*) item, aPopMenu );
262  break;
263 
264  case PCB_DIMENSION_T:
265  if( !flags )
266  {
267  msg = AddHotkeyName( _( "Edit" ), g_Board_Editor_Hokeys_Descr,
268  HK_EDIT_ITEM );
269  AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_DIMENSION, msg, KiBitmap( edit_xpm ) );
270 
271  msg = AddHotkeyName( _( "Move" ), g_Board_Editor_Hokeys_Descr,
272  HK_MOVE_ITEM );
274  msg, KiBitmap( move_xpm ) );
275 
276  msg = AddHotkeyName( _( "Duplicate" ), g_Board_Editor_Hokeys_Descr,
279  msg, KiBitmap( duplicate_xpm ) );
280 
281  msg = AddHotkeyName( _("Move Exactly" ), g_Board_Editor_Hokeys_Descr,
284  msg, KiBitmap( move_exactly_xpm ) );
285 
286  msg = AddHotkeyName( _( "Delete" ), g_Board_Editor_Hokeys_Descr,
287  HK_DELETE );
288 
290  msg, KiBitmap( delete_dimension_xpm ) );
291  }
292  break;
293 
294  case PCB_TARGET_T:
295  if( !flags )
296  {
297  msg = AddHotkeyName( _( "Move" ), g_Board_Editor_Hokeys_Descr,
298  HK_MOVE_ITEM );
300  msg, KiBitmap( move_target_xpm ) );
301 
302  msg = AddHotkeyName( _("Move Exactly" ), g_Board_Editor_Hokeys_Descr,
305  msg, KiBitmap( move_exactly_xpm ) );
306 
307  msg = AddHotkeyName( _( "Duplicate" ), g_Board_Editor_Hokeys_Descr,
310  msg, KiBitmap( duplicate_xpm ) );
311 
312  msg = AddHotkeyName( _( "Edit" ), g_Board_Editor_Hokeys_Descr,
313  HK_EDIT_ITEM );
314  AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_MIRE, msg, KiBitmap( edit_xpm ) );
315 
316  msg = AddHotkeyName( _( "Delete" ), g_Board_Editor_Hokeys_Descr, HK_DELETE );
318  msg, KiBitmap( delete_xpm ) );
319  }
320 
321  break;
322 
323  case PCB_MODULE_EDGE_T:
324  case SCREEN_T:
325  case TYPE_NOT_INIT:
326  case PCB_T:
327  msg.Printf( wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unexpected DrawType %d" ),
328  item->Type() );
329  wxMessageBox( msg );
330  SetCurItem( NULL );
331  break;
332 
333  default:
334  msg.Printf( wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unknown DrawType %d" ),
335  item->Type() );
336  wxMessageBox( msg );
337 
338  // Attempt to clear error (but should no occurs )
339  if( item->Type() >= MAX_STRUCT_TYPE_ID )
340  SetCurItem( NULL );
341 
342  break;
343  }
344 
345  aPopMenu->AppendSeparator();
346  }
347 
348  if( !flags )
349  {
350  msg = AddHotkeyName( _( "Get and Move Footprint" ),
353  msg, KiBitmap( move_xpm ) );
354  }
355 
356  // Display context sensitive commands:
357  switch( GetToolId() )
358  {
359  case ID_PCB_ZONES_BUTT:
360  if( GetBoard()->m_ZoneDescriptorList.size() > 0 )
361  {
362  aPopMenu->AppendSeparator();
363  msg = AddHotkeyName( _( "Fill or Refill All Zones" ),
366  msg, KiBitmap( fill_zone_xpm ) );
367  msg = AddHotkeyName( _( "Remove Filled Areas in All Zones" ),
370  msg, KiBitmap( zone_unfill_xpm ) );
371  aPopMenu->AppendSeparator();
372  }
373 
375  _( "Select Working Layer" ), KiBitmap( select_w_layer_xpm ) );
376  aPopMenu->AppendSeparator();
377  break;
378 
381  _( "Select Working Layer" ), KiBitmap( select_w_layer_xpm ) );
382  aPopMenu->AppendSeparator();
383  break;
384 
385  case ID_TRACK_BUTT:
386  if ( ! trackFound ) // This menu is already added when a track is located
387  {
388  aPopMenu->AppendSeparator();
389  msg = AddHotkeyName( _( "Begin Track" ),
392  msg, KiBitmap( add_tracks_xpm ) );
393 
395  ID_POPUP_PCB_SELECT_WIDTH, _( "Select Track Width" ),
396  KiBitmap( width_track_xpm ) );
397 
399  _( "Select Working Layer" ), KiBitmap( select_w_layer_xpm ) );
401  _( "Select Layer Pair for Vias" ), KiBitmap( select_layer_pair_xpm ) );
402  aPopMenu->AppendSeparator();
403  }
404  break;
405 
406  case ID_PCB_CIRCLE_BUTT:
407  case ID_PCB_ARC_BUTT:
412  _( "Select Working Layer" ), KiBitmap( select_w_layer_xpm ) );
413  aPopMenu->AppendSeparator();
414  break;
415 
416  case ID_PCB_MODULE_BUTT:
417  if( !flags )
418  {
420  _( "Footprint Documentation" ), KiBitmap( book_xpm ) );
421  aPopMenu->AppendSeparator();
422  }
423  break;
424 
425  case ID_NO_TOOL_SELECTED:
426  if( m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_MODULE ) )
427  {
428  wxMenu* commands = new wxMenu;
429  AddMenuItem( aPopMenu, commands, ID_POPUP_PCB_AUTOPLACE_COMMANDS,
430  _( "Global Spread and Place" ), KiBitmap( move_xpm ) );
432  _( "Unlock All Footprints" ), KiBitmap( unlocked_xpm ) );
434  _( "Lock All Footprints" ), KiBitmap( locked_xpm ) );
435  commands->AppendSeparator();
437  _( "Spread out All Footprints" ), KiBitmap( move_xpm ) );
438  commands->Append( ID_POPUP_PCB_SPREAD_NEW_MODULES,
439  _( "Spread out Footprints not Already on Board" ) );
440  commands->AppendSeparator();
441  commands->Append( ID_POPUP_PCB_AUTOPLACE_ALL_MODULES,
442  _( "Automatically Place All Footprints" ) );
443  commands->Append( ID_POPUP_PCB_AUTOPLACE_NEW_MODULES,
444  _( "Automatically Place New Footprints" ) );
445  commands->Append( ID_POPUP_PCB_AUTOPLACE_NEXT_MODULE,
446  _( "Automatically Place Next Footprints" ) );
447  }
448 
449  if( m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_TRACKS ) )
450  {
451  wxMenu* commands = new wxMenu;
452  aPopMenu->Append( ID_POPUP_PCB_AUTOROUTE_COMMANDS, _( "Autoroute" ), commands );
454  _( "Select Layer Pair" ), KiBitmap( select_layer_pair_xpm ) );
455  commands->AppendSeparator();
456  commands->Append( ID_POPUP_PCB_AUTOROUTE_ALL_MODULES,
457  _( "Automatically Route All Footprints" ) );
458  commands->AppendSeparator();
459  commands->Append( ID_POPUP_PCB_AUTOROUTE_RESET_UNROUTED, _( "Reset Unrouted" ) );
460  aPopMenu->AppendSeparator();
461  }
462 
463  if( !trackFound )
464  {
465  msg = AddHotkeyName( _( "Begin Track" ), g_Board_Editor_Hokeys_Descr, HK_ADD_NEW_TRACK );
466  AddMenuItem( aPopMenu, ID_POPUP_PCB_BEGIN_TRACK, msg, KiBitmap( add_tracks_xpm ) );
467 
469  ID_POPUP_PCB_SELECT_WIDTH, _( "Select Track Width" ),
470  KiBitmap( width_track_xpm ) );
471 
473  _( "Select Working Layer" ), KiBitmap( select_w_layer_xpm ) );
474  aPopMenu->AppendSeparator();
475  }
476  break;
477  }
478 
479  return true;
480 }
481 
482 
483 /* Create Pop sub menu for block commands
484  */
486 {
487  AddMenuItem( menu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel Block" ),
488  KiBitmap( cancel_xpm ) );
489  AddMenuItem( menu, ID_POPUP_ZOOM_BLOCK, _( "Zoom Block" ), KiBitmap( zoom_area_xpm ) );
490  menu->AppendSeparator();
491  AddMenuItem( menu, ID_POPUP_PLACE_BLOCK, _( "Place Block" ), KiBitmap( checked_ok_xpm ) );
492  AddMenuItem( menu, ID_POPUP_DUPLICATE_BLOCK, _( "Duplicate" ), KiBitmap( duplicate_xpm ) );
493  AddMenuItem( menu, ID_POPUP_FLIP_BLOCK, _( "Flip" ), KiBitmap( mirror_v_xpm ) );
494  AddMenuItem( menu, ID_POPUP_ROTATE_BLOCK, _( "Rotate Counterclockwise" ), KiBitmap( rotate_ccw_xpm ) );
495  AddMenuItem( menu, ID_POPUP_DELETE_BLOCK, _( "Delete" ), KiBitmap( delete_xpm ) );
496 }
497 
498 
499 /* Create command lines for a popup menu, for track and via editing
500  * also update Netclass selection
501  */
502 void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
503 {
504  wxPoint cursorPosition = GetCrossHairPosition();
505  wxString msg;
506 
508 
509  int flags = Track->GetFlags();
510 
511  if( flags == 0 )
512  {
513  msg = AddHotkeyName( _( "Begin Track" ),
516  msg, KiBitmap( add_tracks_xpm ) );
517 
518  if( Track->Type() == PCB_VIA_T )
519  {
520  msg = AddHotkeyName( _( "Drag Via" ), g_Board_Editor_Hokeys_Descr,
521  HK_DRAG_ITEM );
523  KiBitmap( move_xpm ) );
524  }
525  else
526  {
527  if( Track->IsPointOnEnds( cursorPosition, -1 ) != 0 )
528  {
531  msg, KiBitmap( move_xpm ) );
532  }
533  else
534  {
535  msg = AddHotkeyName( _( "Drag Segments, Keep Slope" ), g_Board_Editor_Hokeys_Descr,
538  msg, KiBitmap( drag_segment_withslope_xpm ) );
539 
540  msg = AddHotkeyName( _( "Drag Segment" ), g_Board_Editor_Hokeys_Descr,
541  HK_DRAG_ITEM );
543  msg, KiBitmap( drag_xpm ) );
544 
545  msg = AddHotkeyName( _( "Duplicate" ), g_Board_Editor_Hokeys_Descr,
548  msg, KiBitmap( duplicate_xpm ) );
549 
550  msg = AddHotkeyName( _("Move Exactly" ), g_Board_Editor_Hokeys_Descr,
553  msg, KiBitmap( move_exactly_xpm ) );
554 
555  msg = AddHotkeyName( _("Create Track Array" ), g_Board_Editor_Hokeys_Descr,
556  HK_CREATE_ARRAY );
558  msg, KiBitmap( array_xpm ) );
559 
561  _( "Break Track" ), KiBitmap( break_line_xpm ) );
562  }
563  }
564 
566  _( "Select Working Layer" ), KiBitmap( select_w_layer_xpm ) );
567  }
568  else if( flags & IS_DRAGGED ) // Drag via or node in progress
569  {
571  _( "Place Node" ), KiBitmap( checked_ok_xpm ) );
572  return;
573  }
574  else // Edition in progress
575  {
576  if( flags & IS_NEW )
577  {
578  msg = AddHotkeyName( _( "End Track" ), g_Board_Editor_Hokeys_Descr, HK_LEFT_DCLICK );
579  AddMenuItem( PopMenu, ID_POPUP_PCB_END_TRACK, msg, KiBitmap( checked_ok_xpm ) );
580  }
581 
582  msg = AddHotkeyName( _( "Place Through Via" ), g_Board_Editor_Hokeys_Descr, HK_ADD_THROUGH_VIA );
583  AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_THROUGH_VIA, msg, KiBitmap( via_xpm ) );
584 
585  msg = AddHotkeyName( _( "Select Layer and Place Through Via" ),
588  msg, KiBitmap( select_w_layer_xpm ) );
589 
590  if( GetDesignSettings().m_BlindBuriedViaAllowed )
591  {
592  msg = AddHotkeyName( _( "Place Blind/Buried Via" ),
594  AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_BLIND_BURIED_VIA, msg, KiBitmap( via_buried_xpm ) );
595 
596  msg = AddHotkeyName( _( "Select Layer and Place Blind/Buried Via" ),
599  msg, KiBitmap( select_w_layer_xpm ) );
600  }
601 
602  msg = AddHotkeyName( _( "Switch Track Posture" ), g_Board_Editor_Hokeys_Descr,
605  KiBitmap( change_entry_orient_xpm ) );
606 
607  // See if we can place a Micro Via (4 or more layers, and start from an external layer):
608  if( IsMicroViaAcceptable() )
609  {
610  msg = AddHotkeyName( _( "Place Micro Via" ), g_Board_Editor_Hokeys_Descr,
611  HK_ADD_MICROVIA );
612  AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_MICROVIA, msg, KiBitmap( via_microvia_xpm ) );
613  }
614  }
615 
616  // track Width control :
617  if( !flags )
618  {
619  if( Track->Type() == PCB_VIA_T )
620  {
621  msg = AddHotkeyName( _( "Change Via Size and Drill" ), g_Board_Editor_Hokeys_Descr,
622  HK_EDIT_ITEM );
623  AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TRACKSEG, msg, KiBitmap( width_segment_xpm ) );
624  }
625  else
626  {
627  msg = AddHotkeyName( _( "Change Segment Width" ), g_Board_Editor_Hokeys_Descr,
628  HK_EDIT_ITEM );
629  AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TRACKSEG, msg, KiBitmap( width_segment_xpm ) );
631  _( "Change Track Width" ), KiBitmap( width_track_xpm ) );
632  }
633  }
634 
635  // Allows switching to an other track/via size when routing
637  _( "Select Track Width" ), KiBitmap( width_track_xpm ) );
638 
639  // Delete control:
640  PopMenu->AppendSeparator();
641  wxMenu* trackdel_mnu = new wxMenu;
642  AddMenuItem( PopMenu, trackdel_mnu, ID_POPUP_PCB_DELETE_TRACK_MNU, _( "Delete" ),
643  KiBitmap( delete_xpm ) );
644 
645  msg = AddHotkeyName( Track->Type()==PCB_VIA_T ?
646  _( "Delete Via" ) : _( "Delete Segment" ),
648 
649  AddMenuItem( trackdel_mnu, ID_POPUP_PCB_DELETE_TRACKSEG, msg, KiBitmap( delete_line_xpm ) );
650 
651  if( !flags )
652  {
653  msg = AddHotkeyName( _( "Delete Track" ), g_Board_Editor_Hokeys_Descr, HK_DELETE );
654  AddMenuItem( trackdel_mnu, ID_POPUP_PCB_DELETE_TRACK, msg, KiBitmap( delete_track_xpm ) );
655  AddMenuItem( trackdel_mnu, ID_POPUP_PCB_DELETE_TRACKNET, _( "Delete Net" ),
656  KiBitmap( delete_net_xpm ) );
657  }
658 
659  // Add global edition command
660  if( !flags )
661  {
662  PopMenu->AppendSeparator();
664  _( "Edit All Tracks and Vias" ), KiBitmap( width_track_via_xpm ) );
665  }
666 
667  // Add lock/unlock flags menu:
668  wxMenu* trackflg_mnu = new wxMenu;
669 
670  AddMenuItem( PopMenu, trackflg_mnu, ID_POPUP_PCB_SETFLAGS_TRACK_MNU, _( "Set Flags" ),
671  KiBitmap( flag_xpm ) );
672  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_ON_TRACKSEG, _( "Locked: Yes" ), wxEmptyString, true );
673  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_OFF_TRACKSEG, _( "Locked: No" ), wxEmptyString, true );
674 
675  if( Track->GetState( TRACK_LOCKED ) )
676  trackflg_mnu->Check( ID_POPUP_PCB_LOCK_ON_TRACKSEG, true );
677  else
678  trackflg_mnu->Check( ID_POPUP_PCB_LOCK_OFF_TRACKSEG, true );
679 
680  if( !flags )
681  {
682  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_ON_TRACK, _( "Track Locked: Yes" ) );
683  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_OFF_TRACK, _( "Track Locked: No" ) );
684  trackflg_mnu->AppendSeparator();
685  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_ON_NET, _( "Net Locked: Yes" ) );
686  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_OFF_NET, _( "Net Locked: No" ) );
687  }
688 }
689 
690 
691 /* Create the wxMenuitem list for zone outlines editing and zone filling
692  */
693 void PCB_EDIT_FRAME::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu )
694 {
695  wxString msg;
696 
697  if( edge_zone->GetFlags() == IS_DRAGGED )
698  {
700  _( "Place Edge Outline" ), KiBitmap( checked_ok_xpm ) );
701  }
702  else if( edge_zone->GetFlags() )
703  {
704  if( (edge_zone->GetFlags() & IN_EDIT ) )
706  _( "Place Corner" ), KiBitmap( checked_ok_xpm ) );
707  else
709  _( "Place Zone" ), KiBitmap( checked_ok_xpm ) );
710  }
711  else
712  {
713  wxMenu* zones_menu = new wxMenu();
714 
715  AddMenuItem( aPopMenu, zones_menu, -1,
716  edge_zone->GetIsKeepout() ? _("Keepout Area") : _( "Zones" ),
717  KiBitmap( add_zone_xpm ) );
718 
719  if( edge_zone->HitTestForCorner( RefPos( true ) ) )
720  {
722  _( "Move" ), KiBitmap( move_xpm ) );
724  _( "Delete" ), KiBitmap( delete_xpm ) );
725  }
726  else if( edge_zone->HitTestForEdge( RefPos( true ) ) )
727  {
729  _( "Create Corner" ), KiBitmap( add_corner_xpm ) );
730  msg = AddHotkeyName( _( "Drag Outline Segment" ), g_Board_Editor_Hokeys_Descr,
731  HK_DRAG_ITEM );
733  msg, KiBitmap( drag_outline_segment_xpm ) );
734  }
735 
736  zones_menu->AppendSeparator();
738  _( "Add Similar Zone" ), KiBitmap( add_zone_xpm ) );
739 
741  _( "Add Cutout Area" ), KiBitmap( add_zone_cutout_xpm ) );
742 
744  _( "Duplicate Zone Onto Layer" ), KiBitmap( zone_duplicate_xpm ) );
745 
746  zones_menu->AppendSeparator();
747 
748  if( ! edge_zone->GetIsKeepout() )
749  AddMenuItem( zones_menu, ID_POPUP_PCB_FILL_ZONE, _( "Fill Zone" ),
750  KiBitmap( fill_zone_xpm ) );
751 
752  if( !edge_zone->GetFilledPolysList().IsEmpty() )
753  {
755  _( "Remove Filled Areas in Zone" ), KiBitmap( zone_unfill_xpm ) );
756  }
757 
758  msg = AddHotkeyName( _( "Move Zone" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM );
759  AddMenuItem( zones_menu, ID_POPUP_PCB_MOVE_ZONE_OUTLINES, msg, KiBitmap( move_xpm ) );
760 
761  msg = AddHotkeyName( _("Move Zone Exactly" ), g_Board_Editor_Hokeys_Descr,
764  msg, KiBitmap( move_zone_xpm ) );
765 
766  msg = AddHotkeyName( _( "Edit Zone Properties" ), g_Board_Editor_Hokeys_Descr,
767  HK_EDIT_ITEM );
769  msg, KiBitmap( edit_xpm ) );
770 
771  zones_menu->AppendSeparator();
772 
773  if( edge_zone->GetSelectedCorner() >= 0 &&
774  edge_zone->Outline()->IsVertexInHole( edge_zone->GetSelectedCorner() ) )
776  _( "Delete Cutout" ), KiBitmap( delete_xpm ) );
777 
779  _( "Delete Zone Outline" ), KiBitmap( delete_xpm ) );
780  }
781 }
782 
783 
784 /* Create the wxMenuitem list for footprint editing
785  */
787 {
788  wxMenu* sub_menu_footprint;
789  int flags = aModule->GetFlags();
790  wxString msg;
791 
792  sub_menu_footprint = new wxMenu;
793 
794  msg = aModule->GetSelectMenuText();
795  AddMenuItem( menu, sub_menu_footprint, -1, msg, KiBitmap( module_xpm ) );
796 
797  if( !flags )
798  {
800  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_MOVE_MODULE_REQUEST,
801  msg, KiBitmap( move_xpm ) );
802 
804  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_DRAG_MODULE_REQUEST,
805  msg, KiBitmap( drag_xpm ) );
806  }
807 
808  msg = AddHotkeyName( _( "Rotate Counterclockwise" ), g_Board_Editor_Hokeys_Descr, HK_ROTATE_ITEM );
810  msg, KiBitmap( rotate_ccw_xpm ) );
812  _( "Rotate Clockwise" ), KiBitmap( rotate_cw_xpm ) );
814  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_CHANGE_SIDE_MODULE,
815  msg, KiBitmap( mirror_v_xpm ) );
816 
817  if( !flags )
818  {
819  msg = AddHotkeyName( _( "Edit Parameters" ),
821  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_EDIT_MODULE_PRMS, msg,
822  KiBitmap( edit_module_xpm ) );
823 
824  msg = AddHotkeyName( _( "Edit with Footprint Editor" ),
827  msg, KiBitmap( module_editor_xpm ) );
828 
829  sub_menu_footprint->AppendSeparator();
830 
831  msg = AddHotkeyName( _( "Delete" ),
833  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_DELETE_MODULE,
834  msg, KiBitmap( delete_module_xpm ) );
835 
836  sub_menu_footprint->AppendSeparator();
837 
838  msg = AddHotkeyName( _("Move Exactly" ), g_Board_Editor_Hokeys_Descr,
840  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_MOVE_EXACT,
841  msg, KiBitmap( move_exactly_xpm ) );
842 
843  msg = AddHotkeyName( _( "Duplicate" ), g_Board_Editor_Hokeys_Descr,
845  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_DUPLICATE_ITEM,
846  msg, KiBitmap( duplicate_xpm ) );
847 
848  msg = AddHotkeyName( _("Create Array" ), g_Board_Editor_Hokeys_Descr,
849  HK_CREATE_ARRAY );
850  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_CREATE_ARRAY,
851  msg, KiBitmap( array_xpm ) );
852 
853  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_EXCHANGE_FOOTPRINTS,
854  _( "Exchange Footprint" ), KiBitmap( exchange_xpm ) );
855  }
856 }
857 
858 
859 /* Create the wxMenuitem list for editing texts on footprints
860  */
862 {
863  wxMenu* sub_menu_Fp_text;
864  int flags = FpText->GetFlags();
865 
866  wxString msg = FpText->GetSelectMenuText();
867 
868  sub_menu_Fp_text = new wxMenu;
869 
870  AddMenuItem( menu, sub_menu_Fp_text, -1, msg, KiBitmap( footprint_text_xpm ) );
871 
872  if( !flags )
873  {
876  msg, KiBitmap( move_xpm ) );
877 
878  msg = AddHotkeyName( _("Move Exactly" ), g_Board_Editor_Hokeys_Descr,
880  AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_MOVE_EXACT,
881  msg, KiBitmap( move_exactly_xpm ) );
882  }
883 
884  msg = AddHotkeyName( _( "Rotate Clockwise" ), g_Board_Editor_Hokeys_Descr, HK_ROTATE_ITEM );
885  AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_ROTATE_TEXTMODULE,
886  msg, KiBitmap( rotate_cw_xpm ) );
887 
888  if( !flags )
889  {
891  AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_EDIT_TEXTMODULE,
892  msg, KiBitmap( edit_text_xpm ) );
893  AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_RESET_TEXT_SIZE,
894  _( "Reset Size" ), KiBitmap( reset_text_xpm ) );
895  }
896 
897  // Graphic texts can be deleted only if are not currently edited.
898  if( !flags && FpText->GetType() == TEXTE_MODULE::TEXT_is_DIVERS )
899  {
900  AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_DELETE_TEXTMODULE,
901  _( "Delete" ), KiBitmap( delete_xpm ) );
902  }
903 
904  if( !flags )
905  {
906  MODULE* module = (MODULE*) FpText->GetParent();
907 
908  if( module )
909  {
910  menu->AppendSeparator();
911  createPopUpMenuForFootprints( module, menu );
912  }
913  }
914 }
915 
916 
917 /* Create pop menu for pads
918  * also update Netclass selection
919  */
921 {
922  wxMenu* sub_menu_Pad;
923  int flags = Pad->GetFlags();
924 
925  if( flags ) // Currently in edit, no others commands possible
926  return;
927 
929 
930  wxString msg = Pad->GetSelectMenuText();
931 
932  sub_menu_Pad = new wxMenu;
933  AddMenuItem( menu, sub_menu_Pad, -1, msg, KiBitmap( pad_xpm ) );
934 
935  AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_MOVE_PAD_REQUEST, _( "Move Pad" ),
936  KiBitmap( move_pad_xpm ) );
937  AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_DRAG_PAD_REQUEST, _( "Drag Pad" ),
938  KiBitmap( drag_pad_xpm ) );
939 
940  msg = AddHotkeyName( _( "Edit Pad" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM );
941  AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_EDIT_PAD, msg, KiBitmap( options_pad_xpm ) );
942  sub_menu_Pad->AppendSeparator();
943 
945  _( "Copy Pad Settings" ),
946  wxEmptyString,
947  KiBitmap( copy_pad_settings_xpm ) );
949  _( "Apply Pad Settings" ),
950  wxEmptyString,
951  KiBitmap( apply_pad_settings_xpm ) );
953  _( "Push Pad Settings" ),
954  _( "Copy this pad's settings to all pads in this footprint (or similar footprints)" ),
955  KiBitmap( push_pad_settings_xpm ) );
956  sub_menu_Pad->AppendSeparator();
957 
958  AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_DELETE_PAD, _( "Delete" ), KiBitmap( delete_pad_xpm ) );
959 
960  if( m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_TRACKS ) )
961  {
962  menu->Append( ID_POPUP_PCB_AUTOROUTE_PAD, _( "Automatically Route Pad" ) );
963  menu->Append( ID_POPUP_PCB_AUTOROUTE_NET, _( "Automatically Route Net" ) );
964  }
965 
966  MODULE* module = Pad->GetParent();
967 
968  if( module )
969  {
970  menu->AppendSeparator();
971  createPopUpMenuForFootprints( module, menu );
972  }
973 }
974 
975 
976 // Create pop menu for pcb texts
978 {
979  wxMenu* sub_menu_Text;
980  int flags = Text->GetFlags();
981 
982  wxString msg = Text->GetSelectMenuText();
983 
984  sub_menu_Text = new wxMenu;
985 
986  AddMenuItem( menu, sub_menu_Text, -1, msg, KiBitmap( text_xpm ) );
987 
988  if( !flags )
989  {
992  msg, KiBitmap( move_xpm ) );
994  AddMenuItem( sub_menu_Text, ID_POPUP_PCB_COPY_TEXTEPCB,
995  msg, KiBitmap( copy_xpm ) );
996  }
997 
999  AddMenuItem( sub_menu_Text, ID_POPUP_PCB_ROTATE_TEXTEPCB, msg, KiBitmap( rotate_ccw_xpm ) );
1001  AddMenuItem( sub_menu_Text, ID_POPUP_PCB_FLIP_TEXTEPCB, msg, KiBitmap( mirror_h_xpm ) );
1003  AddMenuItem( sub_menu_Text, ID_POPUP_PCB_EDIT_TEXTEPCB, msg, KiBitmap( edit_text_xpm ) );
1004  if( !flags )
1005  {
1006  AddMenuItem( sub_menu_Text, ID_POPUP_PCB_RESET_TEXT_SIZE,
1007  _( "Reset Size" ), KiBitmap( reset_text_xpm ) );
1008 
1009  sub_menu_Text->AppendSeparator();
1010  msg = AddHotkeyName( _( "Delete" ), g_Board_Editor_Hokeys_Descr, HK_DELETE );
1011  AddMenuItem( sub_menu_Text, ID_POPUP_PCB_DELETE_TEXTEPCB, msg, KiBitmap( delete_xpm ) );
1012  }
1013 }
1014 
1015 
1016 void PCB_EDIT_FRAME::createPopUpMenuForMarkers( MARKER_PCB* aMarker, wxMenu* aPopMenu )
1017 {
1018  AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_MARKER, _( "Delete Marker" ),
1019  KiBitmap( delete_xpm ) );
1020  AddMenuItem( aPopMenu, ID_POPUP_PCB_GETINFO_MARKER, _( "Marker Error Info" ),
1021  KiBitmap( info_xpm ) );
1022 }
1023 
1024 
1030 static wxMenu* Append_Track_Width_List( BOARD* aBoard )
1031 {
1032  wxString msg;
1033  wxMenu* trackwidth_menu;
1034  wxString value;
1035 
1036  trackwidth_menu = new wxMenu;
1037 
1038  trackwidth_menu->Append( ID_POPUP_PCB_SELECT_AUTO_WIDTH, _( "Auto Width" ),
1039  _( "Use the track width when starting on a track, otherwise the current track width" ),
1040  true );
1041 
1043  trackwidth_menu->Check( ID_POPUP_PCB_SELECT_AUTO_WIDTH, true );
1044 
1045  if( aBoard->GetDesignSettings().GetViaSizeIndex() != 0
1046  || aBoard->GetDesignSettings().GetTrackWidthIndex() != 0
1048  trackwidth_menu->Append( ID_POPUP_PCB_SELECT_USE_NETCLASS_VALUES,
1049  _( "Use Netclass Values" ),
1050  _( "Use track and via sizes from their Netclass values" ),
1051  true );
1052 
1053  for( unsigned ii = 0; ii < aBoard->GetDesignSettings().m_TrackWidthList.size(); ii++ )
1054  {
1055  value = StringFromValue( g_UserUnit, aBoard->GetDesignSettings().m_TrackWidthList[ii], true );
1056  msg.Printf( _( "Track %s" ), GetChars( value ) );
1057 
1058  if( ii == 0 )
1059  msg << _( " uses NetClass" );
1060 
1061  trackwidth_menu->Append( ID_POPUP_PCB_SELECT_WIDTH1 + ii, msg, wxEmptyString, true );
1062  }
1063 
1064  trackwidth_menu->AppendSeparator();
1065 
1066  for( unsigned ii = 0; ii < aBoard->GetDesignSettings().m_ViasDimensionsList.size(); ii++ )
1067  {
1068  value = StringFromValue( g_UserUnit,
1069  aBoard->GetDesignSettings().m_ViasDimensionsList[ii].m_Diameter,
1070  true );
1071  wxString drill = StringFromValue( g_UserUnit,
1072  aBoard->GetDesignSettings().m_ViasDimensionsList[ii].m_Drill,
1073  true );
1074 
1075  if( aBoard->GetDesignSettings().m_ViasDimensionsList[ii].m_Drill <= 0 )
1076  {
1077  msg.Printf( _( "Via %s" ), GetChars( value ) );
1078  }
1079  else
1080  {
1081  msg.Printf( _( "Via %s, drill %s" ), GetChars( value ), GetChars( drill ) );
1082  }
1083 
1084  if( ii == 0 )
1085  msg << _( " uses NetClass" );
1086 
1087  trackwidth_menu->Append( ID_POPUP_PCB_SELECT_VIASIZE1 + ii, msg, wxEmptyString, true );
1088  }
1089 
1090  return trackwidth_menu;
1091 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:198
BOARD_ITEM_CONTAINER * GetParent() const
wxString GetSelectMenuText() const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Class ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:78
STATUS_FLAGS GetFlags() const
Definition: base_struct.h:255
#define IN_EDIT
Item currently edited.
Definition: base_struct.h:111
BLOCK_SELECTOR m_BlockLocate
Block description for block commands.
Definition: typeinfo.h:97
const wxPoint & GetRefPos() const
wxString GetSelectMenuText() const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Definition: class_pad.cpp:1127
TEXTE_PCB class definition.
bool HitTestForEdge(const wxPoint &refPos, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Function HitTestForEdge tests if the given wxPoint is near a segment defined by 2 corners...
Definition: class_zone.cpp:530
Implementation of conversion functions that require both schematic and board internal units...
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
std::vector< int > m_TrackWidthList
Track width list.
TEXT_TYPE GetType() const
wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
Function AddMenuItem is an inline helper function to create and insert a menu item with an icon into ...
Definition: bitmap.cpp:55
Class BOARD to handle a board.
STATUS_FLAGS IsPointOnEnds(const wxPoint &point, int min_dist=0)
Function IsPointOnEnds returns STARTPOINT if point if near (dist = min_dist) start point...
wxString GetSelectMenuText() const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
wxString StringFromValue(EDA_UNITS_T aUnit, int aValue, bool aAddUnitSymbol)
Function StringFromValue returns the string from aValue according to units (inch, mm ...
Definition: base_units.cpp:203
MODULE * GetParent() const
Definition: class_pad.h:108
class ZONE_CONTAINER, a zone area
Definition: typeinfo.h:114
void SetCurItem(BOARD_ITEM *aItem, bool aDisplayInfo=true)
Function SetCurItem sets the currently selected item and displays it in the MsgPanel.
SHAPE_POLY_SET * Outline()
Definition: class_zone.h:247
class TEXTE_PCB, text on a layer
Definition: typeinfo.h:104
void SetCanStartBlock(int aStartBlock)
bool OnRightClick(const wxPoint &aMousePos, wxMenu *aPopMenu) override
Function OnRightClick populates a popup menu with the choices appropriate for the current context...
BOARD * GetBoard() const
Classes to handle copper zones.
wxString GetSelectMenuText() const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
class D_PAD, a pad in a footprint
Definition: typeinfo.h:102
bool SetCurrentNetClass(const wxString &aNetClassName)
Function SetCurrentNetClass Must be called after a netclass selection (or after a netclass parameter ...
Definition: pcbframe.cpp:1130
int GetState(int type) const
Definition: base_struct.h:237
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:106
bool m_UseConnectedTrackWidth
if true, when creating a new track starting on an existing track, use this track width ...
Functions relatives to tracks, vias and segments used to fill zones.
not really an item, used to identify a screen
Definition: typeinfo.h:98
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:107
Pcbnew hotkeys.
This file contains miscellaneous commonly used macros and functions.
void createPopUpBlockMenu(wxMenu *menu)
bool IsVertexInHole(int aGlobalIdx)
Function IsVertexInHole.
unsigned GetViaSizeIndex() const
Function GetViaSizeIndex.
struct EDA_HOTKEY_CONFIG g_Board_Editor_Hokeys_Descr[]
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:654
GENERAL_COLLECTOR * m_Collector
#define IS_NEW
New item, just created.
Definition: base_struct.h:113
#define IS_DRAGGED
Item being dragged.
Definition: base_struct.h:115
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
class MODULE, a footprint
Definition: typeinfo.h:101
static wxMenu * Append_Track_Width_List(BOARD *aBoard)
Function Append_Track_Width_List creates a wxMenu * which shows the last used track widths and via di...
void createPopUpMenuForFootprints(MODULE *aModule, wxMenu *aPopMenu)
void createPopUpMenuForZones(ZONE_CONTAINER *edge_zone, wxMenu *aPopMenu)
unsigned STATUS_FLAGS
Definition: base_struct.h:144
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:532
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame...
#define TRACK_LOCKED
Pcbnew: track locked: protected from global deletion.
Definition: base_struct.h:128
class SEGZONE, a segment used to fill a zone area (segment on a copper layer)
Definition: typeinfo.h:109
class DIMENSION, a dimension (graphic item)
Definition: typeinfo.h:112
wxAuiToolBar * m_mainToolBar
Standard horizontal Toolbar.
Definition: wxstruct.h:136
const SHAPE_POLY_SET & GetFilledPolysList() const
Function GetFilledPolysList returns a reference to the list of filled polygons.
Definition: class_zone.h:582
void SetAbortRequest(bool aAbortRequest)
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:113
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:105
bool IsIdle() const
Function IsIdle returns true if there is currently no block operation in progress.
wxPoint RefPos(bool useMouse) const
Function RefPos Return the reference position, coming from either the mouse position or the cursor po...
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
bool GetAbortRequest() const
PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
void createPopUpMenuForFpPads(D_PAD *aPad, wxMenu *aPopMenu)
class MARKER_PCB, a marker used to show something
Definition: typeinfo.h:111
wxPoint GetNearestGridPosition(const wxPoint &aPosition, wxRealPoint *aGridSize=NULL) const
Function GetNearestGridPosition returns the nearest aGridSize location to aPosition.
void createPopUpMenuForTexts(TEXTE_PCB *Text, wxMenu *menu)
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
wxString AddHotkeyName(const wxString &aText, EDA_HOTKEY **aList, int aCommandId, HOTKEY_ACTION_TYPE aShortCutType)
Function AddHotkeyName Add the key name from the Command id value ( m_Idcommand member value) ...
void createPopupMenuForTracks(TRACK *aTrack, wxMenu *aPopMenu)
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:169
void createPopUpMenuForMarkers(MARKER_PCB *aMarker, wxMenu *aPopMenu)
int GetToolId() const
Definition: draw_frame.h:419
void createPopUpMenuForFpTexts(TEXTE_MODULE *aText, wxMenu *aPopMenu)
PCB_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
std::vector< VIA_DIMENSION > m_ViasDimensionsList
Vias size and drill list.
unsigned GetTrackWidthIndex() const
Function GetTrackWidthIndex.
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
int GetSelectedCorner() const
Definition: class_zone.h:212
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:108
bool IsMicroViaAcceptable(void)
Function IsMicroViaAcceptable return true if a microvia can be placed on the board.
Definition: pcbframe.cpp:862
static const char * text_xpm[]
wxString GetNetClassName() const
Function GetNetClassName returns a pointer to the netclass of the zone.
Module description (excepted pads)
bool IsEmpty() const
Returns true if the set is empty (no polygons at all)
BOARD_ITEM * PcbGeneralLocateAndDisplay(int aHotKeyCode=0)
Function PcbGeneralLocateAndDisplay searches for an item under the mouse cursor.
class DRAWSEGMENT, a segment not on copper layers
Definition: typeinfo.h:103
BOARD_ITEM * GetCurItem()
bool HitTestForCorner(const wxPoint &refPos, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Function HitTestForCorner tests if the given wxPoint is near a corner.
Definition: class_zone.cpp:514
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...