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 <pcb_edit_frame.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  break;
146 
147  case PCB_PAD_T:
148  createPopUpMenuForFpPads( static_cast<D_PAD*>( item ), aPopMenu );
149  break;
150 
151  case PCB_MODULE_TEXT_T:
152  createPopUpMenuForFpTexts( static_cast<TEXTE_MODULE*>( item ), aPopMenu );
153  break;
154 
155  case PCB_LINE_T: // Some graphic items on technical layers
156  if( (flags & IS_NEW) )
157  {
159  _( "End Drawing" ), KiBitmap( checked_ok_xpm ) );
160  }
161 
162  if( !flags )
163  {
164  msg = AddHotkeyName( _( "Move" ), g_Board_Editor_Hotkeys_Descr,
165  HK_MOVE_ITEM );
167  msg, KiBitmap( move_xpm ) );
168 
169  msg = AddHotkeyName( _( "Duplicate" ), g_Board_Editor_Hotkeys_Descr,
172  msg, KiBitmap( duplicate_xpm ) );
173 
174  msg = AddHotkeyName( _("Move Exactly..." ), g_Board_Editor_Hotkeys_Descr,
177  msg, KiBitmap( move_exactly_xpm ) );
178 
179  msg = AddHotkeyName( _("Create Array..." ), g_Board_Editor_Hotkeys_Descr,
180  HK_CREATE_ARRAY );
182  msg, KiBitmap( array_xpm ) );
183 
184  msg = AddHotkeyName( _( "Edit..." ), g_Board_Editor_Hotkeys_Descr,
185  HK_EDIT_ITEM );
187  msg, KiBitmap( edit_xpm ) );
188 
190  _( "Delete" ), KiBitmap( delete_xpm ) );
191 
192  if( !IsCopperLayer( item->GetLayer() ) )
194  _( "Delete All Drawings on Layer" ), KiBitmap( delete_xpm ) );
195  }
196 
197  break;
198 
199  case PCB_ZONE_T: // Item used to fill a zone
201  _( "Delete Zone Filling" ), KiBitmap( delete_xpm ) );
202  break;
203 
204  case PCB_ZONE_AREA_T: // Item used to handle a zone area (outlines, holes ...)
205  if( flags & IS_NEW )
206  {
208  _( "Close Zone Outline" ), KiBitmap( checked_ok_xpm ) );
210  _( "Delete Last Corner" ), KiBitmap( delete_xpm ) );
211  }
212  else
213  {
214  createPopUpMenuForZones( (ZONE_CONTAINER*) item, aPopMenu );
215  }
216 
217  break;
218 
219  case PCB_TEXT_T:
220  createPopUpMenuForTexts( (TEXTE_PCB*) item, aPopMenu );
221  break;
222 
223  case PCB_TRACE_T:
224  case PCB_VIA_T:
225  trackFound = true;
226  createPopupMenuForTracks( (TRACK*) item, aPopMenu );
227  break;
228 
229  case PCB_MARKER_T:
230  createPopUpMenuForMarkers( (MARKER_PCB*) item, aPopMenu );
231  break;
232 
233  case PCB_DIMENSION_T:
234  if( !flags )
235  {
236  msg = AddHotkeyName( _( "Edit..." ), g_Board_Editor_Hotkeys_Descr,
237  HK_EDIT_ITEM );
238  AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_DIMENSION, msg, KiBitmap( edit_xpm ) );
239 
240  msg = AddHotkeyName( _( "Move" ), g_Board_Editor_Hotkeys_Descr,
241  HK_MOVE_ITEM );
243  msg, KiBitmap( move_xpm ) );
244 
245  msg = AddHotkeyName( _( "Duplicate" ), g_Board_Editor_Hotkeys_Descr,
248  msg, KiBitmap( duplicate_xpm ) );
249 
250  msg = AddHotkeyName( _("Move Exactly..." ), g_Board_Editor_Hotkeys_Descr,
253  msg, KiBitmap( move_exactly_xpm ) );
254 
255  msg = AddHotkeyName( _( "Delete" ), g_Board_Editor_Hotkeys_Descr,
256  HK_DELETE );
257 
259  msg, KiBitmap( delete_dimension_xpm ) );
260  }
261  break;
262 
263  case PCB_TARGET_T:
264  if( !flags )
265  {
266  msg = AddHotkeyName( _( "Move" ), g_Board_Editor_Hotkeys_Descr,
267  HK_MOVE_ITEM );
269  msg, KiBitmap( move_target_xpm ) );
270 
271  msg = AddHotkeyName( _("Move Exactly..." ), g_Board_Editor_Hotkeys_Descr,
274  msg, KiBitmap( move_exactly_xpm ) );
275 
276  msg = AddHotkeyName( _( "Duplicate" ), g_Board_Editor_Hotkeys_Descr,
279  msg, KiBitmap( duplicate_xpm ) );
280 
281  msg = AddHotkeyName( _( "Edit..." ), g_Board_Editor_Hotkeys_Descr,
282  HK_EDIT_ITEM );
283  AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_PCB_TARGET, msg, KiBitmap( edit_xpm ) );
284 
285  msg = AddHotkeyName( _( "Delete" ), g_Board_Editor_Hotkeys_Descr, HK_DELETE );
287  msg, KiBitmap( delete_xpm ) );
288  }
289 
290  break;
291 
292  case PCB_MODULE_EDGE_T:
293  case SCREEN_T:
294  case TYPE_NOT_INIT:
295  case PCB_T:
296  msg.Printf( wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unexpected DrawType %d" ),
297  item->Type() );
298  wxMessageBox( msg );
299  SetCurItem( NULL );
300  break;
301 
302  default:
303  msg.Printf( wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unknown DrawType %d" ),
304  item->Type() );
305  wxMessageBox( msg );
306 
307  // Attempt to clear error (but should no occurs )
308  if( item->Type() >= MAX_STRUCT_TYPE_ID )
309  SetCurItem( NULL );
310 
311  break;
312  }
313 
314  aPopMenu->AppendSeparator();
315  }
316 
317  if( !flags )
318  {
319  msg = AddHotkeyName( _( "Get and Move Footprint..." ),
322  msg, KiBitmap( move_xpm ) );
323  }
324 
325  // Display context sensitive commands:
326  switch( GetToolId() )
327  {
328  case ID_PCB_ZONES_BUTT:
329  if( GetBoard()->m_ZoneDescriptorList.size() > 0 )
330  {
331  aPopMenu->AppendSeparator();
332  msg = AddHotkeyName( _( "Fill or Refill All Zones" ),
335  msg, KiBitmap( fill_zone_xpm ) );
336  msg = AddHotkeyName( _( "Remove Filled Areas in All Zones" ),
339  msg, KiBitmap( zone_unfill_xpm ) );
340  aPopMenu->AppendSeparator();
341  }
342 
344  _( "Select Working Layer..." ), KiBitmap( select_w_layer_xpm ) );
345  aPopMenu->AppendSeparator();
346  break;
347 
350  _( "Select Working Layer..." ), KiBitmap( select_w_layer_xpm ) );
351  aPopMenu->AppendSeparator();
352  break;
353 
354  case ID_TRACK_BUTT:
355  if ( ! trackFound ) // This menu is already added when a track is located
356  {
357  aPopMenu->AppendSeparator();
358  msg = AddHotkeyName( _( "Begin Track" ),
361  msg, KiBitmap( add_tracks_xpm ) );
362 
364  ID_POPUP_PCB_SELECT_WIDTH, _( "Select Track Width" ),
365  KiBitmap( width_track_xpm ) );
366 
368  _( "Select Working Layer..." ), KiBitmap( select_w_layer_xpm ) );
370  _( "Select Layer Pair for Vias..." ), KiBitmap( select_layer_pair_xpm ) );
371  aPopMenu->AppendSeparator();
372  }
373  break;
374 
375  case ID_PCB_CIRCLE_BUTT:
376  case ID_PCB_ARC_BUTT:
381  _( "Select Working Layer..." ), KiBitmap( select_w_layer_xpm ) );
382  aPopMenu->AppendSeparator();
383  break;
384 
385  case ID_PCB_MODULE_BUTT:
386  if( !flags )
387  {
389  _( "Footprint Documentation" ), KiBitmap( book_xpm ) );
390  aPopMenu->AppendSeparator();
391  }
392  break;
393 
394  case ID_NO_TOOL_SELECTED:
395  {
396  wxMenu* commands = new wxMenu;
397  AddMenuItem( aPopMenu, commands, ID_POPUP_PCB_AUTOPLACE_COMMANDS,
398  _( "Global Spread and Place" ), KiBitmap( move_xpm ) );
400  _( "Spread out All Footprints" ), KiBitmap( move_xpm ) );
401  commands->Append( ID_POPUP_PCB_SPREAD_NEW_MODULES,
402  _( "Spread out Footprints not Already on Board" ) );
404  _( "Unlock All Footprints" ), KiBitmap( unlocked_xpm ) );
406  _( "Lock All Footprints" ), KiBitmap( locked_xpm ) );
407 
408  if( !trackFound )
409  {
410  msg = AddHotkeyName( _( "Begin Track" ), g_Board_Editor_Hotkeys_Descr, HK_ADD_NEW_TRACK );
411  AddMenuItem( aPopMenu, ID_POPUP_PCB_BEGIN_TRACK, msg, KiBitmap( add_tracks_xpm ) );
412 
414  ID_POPUP_PCB_SELECT_WIDTH, _( "Select Track Width" ),
415  KiBitmap( width_track_xpm ) );
416 
418  _( "Select Working Layer..." ), KiBitmap( select_w_layer_xpm ) );
419  aPopMenu->AppendSeparator();
420  }
421  break;
422  }
423  }
424 
425  return true;
426 }
427 
428 
429 /* Create Pop sub menu for block commands
430  */
432 {
433  AddMenuItem( menu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel Block" ),
434  KiBitmap( cancel_xpm ) );
435  AddMenuItem( menu, ID_POPUP_ZOOM_BLOCK, _( "Zoom Block" ), KiBitmap( zoom_area_xpm ) );
436  menu->AppendSeparator();
437  AddMenuItem( menu, ID_POPUP_PLACE_BLOCK, _( "Place Block" ), KiBitmap( checked_ok_xpm ) );
438  AddMenuItem( menu, ID_POPUP_DUPLICATE_BLOCK, _( "Duplicate" ), KiBitmap( duplicate_xpm ) );
439  AddMenuItem( menu, ID_POPUP_FLIP_BLOCK, _( "Flip" ), KiBitmap( mirror_v_xpm ) );
440  AddMenuItem( menu, ID_POPUP_ROTATE_BLOCK, _( "Rotate Counterclockwise" ), KiBitmap( rotate_ccw_xpm ) );
441  AddMenuItem( menu, ID_POPUP_DELETE_BLOCK, _( "Delete" ), KiBitmap( delete_xpm ) );
442 }
443 
444 
445 /* Create command lines for a popup menu, for track and via editing
446  * also update Netclass selection
447  */
448 void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
449 {
450  wxPoint cursorPosition = GetCrossHairPosition();
451  wxString msg;
452 
454 
455  int flags = Track->GetFlags();
456 
457  if( flags == 0 )
458  {
459  msg = AddHotkeyName( _( "Begin Track" ),
462  msg, KiBitmap( add_tracks_xpm ) );
463 
464  if( Track->Type() == PCB_VIA_T )
465  {
466  msg = AddHotkeyName( _( "Drag Via" ), g_Board_Editor_Hotkeys_Descr,
467  HK_DRAG_ITEM );
469  KiBitmap( move_xpm ) );
470  }
471  else
472  {
473  if( Track->IsPointOnEnds( cursorPosition, -1 ) != 0 )
474  {
477  msg, KiBitmap( move_xpm ) );
478  }
479  else
480  {
481  msg = AddHotkeyName( _( "Drag Segments, Keep Slope" ), g_Board_Editor_Hotkeys_Descr,
484  msg, KiBitmap( drag_segment_withslope_xpm ) );
485 
486  msg = AddHotkeyName( _( "Drag Segment" ), g_Board_Editor_Hotkeys_Descr,
487  HK_DRAG_ITEM );
489  msg, KiBitmap( drag_xpm ) );
490 
491  msg = AddHotkeyName( _( "Duplicate" ), g_Board_Editor_Hotkeys_Descr,
494  msg, KiBitmap( duplicate_xpm ) );
495 
496  msg = AddHotkeyName( _("Move Exactly..." ), g_Board_Editor_Hotkeys_Descr,
499  msg, KiBitmap( move_exactly_xpm ) );
500 
501  msg = AddHotkeyName( _("Create Track Array..." ), g_Board_Editor_Hotkeys_Descr,
502  HK_CREATE_ARRAY );
504  msg, KiBitmap( array_xpm ) );
505 
507  _( "Break Track" ), KiBitmap( break_line_xpm ) );
508  }
509  }
510 
512  _( "Select Working Layer..." ), KiBitmap( select_w_layer_xpm ) );
513  }
514  else if( flags & IS_DRAGGED ) // Drag via or node in progress
515  {
517  _( "Place Node" ), KiBitmap( checked_ok_xpm ) );
518  return;
519  }
520  else // Edition in progress
521  {
522  if( flags & IS_NEW )
523  {
524  msg = AddHotkeyName( _( "End Track" ), g_Board_Editor_Hotkeys_Descr, HK_LEFT_DCLICK );
525  AddMenuItem( PopMenu, ID_POPUP_PCB_END_TRACK, msg, KiBitmap( checked_ok_xpm ) );
526  }
527 
528  msg = AddHotkeyName( _( "Place Through Via" ), g_Board_Editor_Hotkeys_Descr, HK_ADD_THROUGH_VIA );
529  AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_THROUGH_VIA, msg, KiBitmap( via_xpm ) );
530 
531  msg = AddHotkeyName( _( "Select Layer and Place Through Via..." ),
534  msg, KiBitmap( select_w_layer_xpm ) );
535 
536  if( GetDesignSettings().m_BlindBuriedViaAllowed )
537  {
538  msg = AddHotkeyName( _( "Place Blind/Buried Via" ),
540  AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_BLIND_BURIED_VIA, msg, KiBitmap( via_buried_xpm ) );
541 
542  msg = AddHotkeyName( _( "Select Layer and Place Blind/Buried Via..." ),
545  msg, KiBitmap( select_w_layer_xpm ) );
546  }
547 
548  msg = AddHotkeyName( _( "Switch Track Posture" ), g_Board_Editor_Hotkeys_Descr,
551  KiBitmap( change_entry_orient_xpm ) );
552 
553  // See if we can place a Micro Via (4 or more layers, and start from an external layer):
554  if( IsMicroViaAcceptable() )
555  {
556  msg = AddHotkeyName( _( "Place Micro Via" ), g_Board_Editor_Hotkeys_Descr,
557  HK_ADD_MICROVIA );
558  AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_MICROVIA, msg, KiBitmap( via_microvia_xpm ) );
559  }
560  }
561 
562  // track Width control :
563  if( !flags )
564  {
565  if( Track->Type() == PCB_VIA_T )
566  {
567  msg = AddHotkeyName( _( "Change Via Size and Drill" ), g_Board_Editor_Hotkeys_Descr,
568  HK_EDIT_ITEM );
569  AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TRACKSEG, msg, KiBitmap( width_segment_xpm ) );
570  }
571  else
572  {
573  msg = AddHotkeyName( _( "Change Segment Width" ), g_Board_Editor_Hotkeys_Descr,
574  HK_EDIT_ITEM );
575  AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TRACKSEG, msg, KiBitmap( width_segment_xpm ) );
577  _( "Change Track Width" ), KiBitmap( width_track_xpm ) );
578  }
579  }
580 
581  // Allows switching to another track/via size when routing
583  _( "Select Track Width" ), KiBitmap( width_track_xpm ) );
584 
585  // Delete control:
586  PopMenu->AppendSeparator();
587  wxMenu* trackdel_mnu = new wxMenu;
588  AddMenuItem( PopMenu, trackdel_mnu, ID_POPUP_PCB_DELETE_TRACK_MNU, _( "Delete" ),
589  KiBitmap( delete_xpm ) );
590 
591  msg = AddHotkeyName( Track->Type()==PCB_VIA_T ?
592  _( "Delete Via" ) : _( "Delete Segment" ),
594 
595  AddMenuItem( trackdel_mnu, ID_POPUP_PCB_DELETE_TRACKSEG, msg, KiBitmap( delete_line_xpm ) );
596 
597  if( !flags )
598  {
599  msg = AddHotkeyName( _( "Delete Track" ), g_Board_Editor_Hotkeys_Descr, HK_DELETE );
600  AddMenuItem( trackdel_mnu, ID_POPUP_PCB_DELETE_TRACK, msg, KiBitmap( delete_track_xpm ) );
601  AddMenuItem( trackdel_mnu, ID_POPUP_PCB_DELETE_TRACKNET, _( "Delete Net" ),
602  KiBitmap( delete_net_xpm ) );
603  }
604 
605  // Add global edition command
606  if( !flags )
607  {
608  PopMenu->AppendSeparator();
610  _( "Edit All Tracks and Vias..." ), KiBitmap( width_track_via_xpm ) );
611  }
612 
613  // Add lock/unlock flags menu:
614  wxMenu* trackflg_mnu = new wxMenu;
615 
616  AddMenuItem( PopMenu, trackflg_mnu, ID_POPUP_PCB_SETFLAGS_TRACK_MNU, _( "Set Flags" ),
617  KiBitmap( flag_xpm ) );
618  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_ON_TRACKSEG, _( "Locked: Yes" ), wxEmptyString, true );
619  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_OFF_TRACKSEG, _( "Locked: No" ), wxEmptyString, true );
620 
621  if( Track->GetState( TRACK_LOCKED ) )
622  trackflg_mnu->Check( ID_POPUP_PCB_LOCK_ON_TRACKSEG, true );
623  else
624  trackflg_mnu->Check( ID_POPUP_PCB_LOCK_OFF_TRACKSEG, true );
625 
626  if( !flags )
627  {
628  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_ON_TRACK, _( "Track Locked: Yes" ) );
629  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_OFF_TRACK, _( "Track Locked: No" ) );
630  trackflg_mnu->AppendSeparator();
631  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_ON_NET, _( "Net Locked: Yes" ) );
632  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_OFF_NET, _( "Net Locked: No" ) );
633  }
634 }
635 
636 
637 /* Create the wxMenuitem list for zone outlines editing and zone filling
638  */
639 void PCB_EDIT_FRAME::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu )
640 {
641  wxString msg;
642 
643  if( edge_zone->GetFlags() == IS_DRAGGED )
644  {
646  _( "Place Edge Outline" ), KiBitmap( checked_ok_xpm ) );
647  }
648  else if( edge_zone->GetFlags() )
649  {
650  if( (edge_zone->GetFlags() & IN_EDIT ) )
652  _( "Place Corner" ), KiBitmap( checked_ok_xpm ) );
653  else
655  _( "Place Zone" ), KiBitmap( checked_ok_xpm ) );
656  }
657  else
658  {
659  wxMenu* zones_menu = new wxMenu();
660 
661  AddMenuItem( aPopMenu, zones_menu, -1,
662  edge_zone->GetIsKeepout() ? _("Keepout Area") : _( "Zones" ),
663  KiBitmap( add_zone_xpm ) );
664 
665  if( edge_zone->HitTestForCorner( RefPos( true ) ) )
666  {
668  _( "Move" ), KiBitmap( move_xpm ) );
670  _( "Delete" ), KiBitmap( delete_xpm ) );
671  }
672  else if( edge_zone->HitTestForEdge( RefPos( true ) ) )
673  {
675  _( "Create Corner" ), KiBitmap( add_corner_xpm ) );
676  msg = AddHotkeyName( _( "Drag Outline Segment" ), g_Board_Editor_Hotkeys_Descr,
677  HK_DRAG_ITEM );
679  msg, KiBitmap( drag_outline_segment_xpm ) );
680  }
681 
682  zones_menu->AppendSeparator();
684  _( "Add Similar Zone" ), KiBitmap( add_zone_xpm ) );
685 
687  _( "Add Cutout Area" ), KiBitmap( add_zone_cutout_xpm ) );
688 
690  _( "Duplicate Zone onto Layer..." ), KiBitmap( zone_duplicate_xpm ) );
691 
692  zones_menu->AppendSeparator();
693 
694  if( ! edge_zone->GetIsKeepout() )
695  AddMenuItem( zones_menu, ID_POPUP_PCB_FILL_ZONE, _( "Fill Zone" ),
696  KiBitmap( fill_zone_xpm ) );
697 
698  if( !edge_zone->GetFilledPolysList().IsEmpty() )
699  {
701  _( "Remove Filled Areas in Zone" ), KiBitmap( zone_unfill_xpm ) );
702  }
703 
704  msg = AddHotkeyName( _( "Move Zone" ), g_Board_Editor_Hotkeys_Descr, HK_MOVE_ITEM );
705  AddMenuItem( zones_menu, ID_POPUP_PCB_MOVE_ZONE_OUTLINES, msg, KiBitmap( move_xpm ) );
706 
707  msg = AddHotkeyName( _("Move Zone Exactly..." ), g_Board_Editor_Hotkeys_Descr,
710  msg, KiBitmap( move_xpm ) );
711 
712  msg = AddHotkeyName( _( "Edit Zone Properties..." ), g_Board_Editor_Hotkeys_Descr,
713  HK_EDIT_ITEM );
715  msg, KiBitmap( edit_xpm ) );
716 
717  zones_menu->AppendSeparator();
718 
719  if( edge_zone->GetSelectedCorner() >= 0 &&
720  edge_zone->Outline()->IsVertexInHole( edge_zone->GetSelectedCorner() ) )
722  _( "Delete Cutout" ), KiBitmap( delete_xpm ) );
723 
725  _( "Delete Zone Outline" ), KiBitmap( delete_xpm ) );
726  }
727 }
728 
729 
730 /* Create the wxMenuitem list for footprint editing
731  */
733 {
734  wxMenu* sub_menu_footprint;
735  int flags = aModule->GetFlags();
736  wxString msg;
737 
738  sub_menu_footprint = new wxMenu;
739 
740  msg = aModule->GetSelectMenuText();
741  AddMenuItem( menu, sub_menu_footprint, -1, msg, KiBitmap( module_xpm ) );
742 
743  if( !flags )
744  {
746  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_MOVE_MODULE_REQUEST,
747  msg, KiBitmap( move_xpm ) );
748 
750  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_DRAG_MODULE_REQUEST,
751  msg, KiBitmap( drag_xpm ) );
752  }
753 
754  msg = AddHotkeyName( _( "Rotate Counterclockwise" ), g_Board_Editor_Hotkeys_Descr, HK_ROTATE_ITEM );
756  msg, KiBitmap( rotate_ccw_xpm ) );
758  _( "Rotate Clockwise" ), KiBitmap( rotate_cw_xpm ) );
760  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_CHANGE_SIDE_MODULE,
761  msg, KiBitmap( mirror_v_xpm ) );
762 
763  if( !flags )
764  {
765  msg = AddHotkeyName( _( "Edit Parameters..." ),
767  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_EDIT_MODULE_PRMS, msg,
768  KiBitmap( edit_module_xpm ) );
769 
770  msg = AddHotkeyName( _( "Edit with Footprint Editor" ),
773  msg, KiBitmap( module_editor_xpm ) );
774 
775  sub_menu_footprint->AppendSeparator();
776 
777  msg = AddHotkeyName( _( "Delete" ),
779  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_DELETE_MODULE,
780  msg, KiBitmap( delete_module_xpm ) );
781 
782  sub_menu_footprint->AppendSeparator();
783 
784  msg = AddHotkeyName( _("Move Exactly..." ), g_Board_Editor_Hotkeys_Descr,
786  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_MOVE_EXACT,
787  msg, KiBitmap( move_exactly_xpm ) );
788 
789  msg = AddHotkeyName( _( "Duplicate" ), g_Board_Editor_Hotkeys_Descr,
791  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_DUPLICATE_ITEM,
792  msg, KiBitmap( duplicate_xpm ) );
793 
794  msg = AddHotkeyName( _("Create Array..." ), g_Board_Editor_Hotkeys_Descr,
795  HK_CREATE_ARRAY );
796  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_CREATE_ARRAY,
797  msg, KiBitmap( array_xpm ) );
798 
799  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_UPDATE_FOOTPRINTS,
800  _( "Update Footprint..." ), KiBitmap( reload_xpm ) );
801 
802  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_EXCHANGE_FOOTPRINTS,
803  _( "Change Footprint..." ), KiBitmap( exchange_xpm ) );
804  }
805 
806  sub_menu_footprint->AppendSeparator();
807 
808  if( !aModule->IsLocked() )
809  {
810  msg = AddHotkeyName( _("Lock Footprint" ), g_Board_Editor_Hotkeys_Descr,
812  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE, msg,
813  KiBitmap( locked_xpm ) );
814  }
815  else
816  {
817  msg = AddHotkeyName( _( "Unlock Footprint" ), g_Board_Editor_Hotkeys_Descr,
819  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_AUTOPLACE_FREE_MODULE, msg,
820  KiBitmap( unlocked_xpm ) );
821  }
822 
823 }
824 
825 
826 /* Create the wxMenuitem list for editing texts on footprints
827  */
829 {
830  wxMenu* sub_menu_Fp_text;
831  int flags = FpText->GetFlags();
832 
833  wxString msg = FpText->GetSelectMenuText();
834 
835  sub_menu_Fp_text = new wxMenu;
836 
837  AddMenuItem( menu, sub_menu_Fp_text, -1, msg, KiBitmap( footprint_text_xpm ) );
838 
839  if( !flags )
840  {
843  msg, KiBitmap( move_xpm ) );
844 
845  msg = AddHotkeyName( _("Move Exactly..." ), g_Board_Editor_Hotkeys_Descr,
847  AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_MOVE_EXACT,
848  msg, KiBitmap( move_exactly_xpm ) );
849  }
850 
851  msg = AddHotkeyName( _( "Rotate Clockwise" ), g_Board_Editor_Hotkeys_Descr, HK_ROTATE_ITEM );
852  AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_ROTATE_TEXTMODULE,
853  msg, KiBitmap( rotate_cw_xpm ) );
854 
855  if( !flags )
856  {
857  msg = AddHotkeyName( _( "Edit..." ), g_Board_Editor_Hotkeys_Descr, HK_EDIT_ITEM );
858  AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_EDIT_TEXTMODULE,
859  msg, KiBitmap( edit_text_xpm ) );
860  AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_RESET_TEXT_SIZE,
861  _( "Reset Size" ), KiBitmap( reset_text_xpm ) );
862  }
863 
864  // Graphic texts can be deleted only if are not currently edited.
865  if( !flags && FpText->GetType() == TEXTE_MODULE::TEXT_is_DIVERS )
866  {
867  AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_DELETE_TEXTMODULE,
868  _( "Delete" ), KiBitmap( delete_xpm ) );
869  }
870 
871  if( !flags )
872  {
873  MODULE* module = (MODULE*) FpText->GetParent();
874 
875  if( module )
876  {
877  menu->AppendSeparator();
878  createPopUpMenuForFootprints( module, menu );
879  }
880  }
881 }
882 
883 
884 /* Create pop menu for pads
885  * also update Netclass selection
886  */
888 {
889  wxMenu* sub_menu_Pad;
890  int flags = Pad->GetFlags();
891 
892  if( flags ) // Currently in edit, no others commands possible
893  return;
894 
896 
897  wxString msg = Pad->GetSelectMenuText();
898 
899  sub_menu_Pad = new wxMenu;
900  AddMenuItem( menu, sub_menu_Pad, -1, msg, KiBitmap( pad_xpm ) );
901 
902  AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_MOVE_PAD_REQUEST, _( "Move Pad" ),
903  KiBitmap( move_pad_xpm ) );
904  AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_DRAG_PAD_REQUEST, _( "Drag Pad" ),
905  KiBitmap( drag_pad_xpm ) );
906 
907  msg = AddHotkeyName( _( "Edit Pad..." ), g_Board_Editor_Hotkeys_Descr, HK_EDIT_ITEM );
908  AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_EDIT_PAD, msg, KiBitmap( options_pad_xpm ) );
909  sub_menu_Pad->AppendSeparator();
910 
912  _( "Copy Pad Properties" ),
913  wxEmptyString,
914  KiBitmap( copy_pad_settings_xpm ) );
916  _( "Apply Pad Properties" ),
917  wxEmptyString,
918  KiBitmap( apply_pad_settings_xpm ) );
920  _( "Push Pad Properties..." ),
921  _( "Copy this pad's properties to all pads in this footprint (or similar footprints)" ),
922  KiBitmap( push_pad_settings_xpm ) );
923  sub_menu_Pad->AppendSeparator();
924 
925  AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_DELETE_PAD, _( "Delete" ), KiBitmap( delete_pad_xpm ) );
926 
927  MODULE* module = Pad->GetParent();
928 
929  if( module )
930  {
931  menu->AppendSeparator();
932  createPopUpMenuForFootprints( module, menu );
933  }
934 }
935 
936 
937 // Create pop menu for pcb texts
939 {
940  wxMenu* sub_menu_Text;
941  int flags = Text->GetFlags();
942 
943  wxString msg = Text->GetSelectMenuText();
944 
945  sub_menu_Text = new wxMenu;
946 
947  AddMenuItem( menu, sub_menu_Text, -1, msg, KiBitmap( text_xpm ) );
948 
949  if( !flags )
950  {
953  msg, KiBitmap( move_xpm ) );
955  AddMenuItem( sub_menu_Text, ID_POPUP_PCB_COPY_TEXTEPCB,
956  msg, KiBitmap( copy_xpm ) );
957  }
958 
960  AddMenuItem( sub_menu_Text, ID_POPUP_PCB_ROTATE_TEXTEPCB, msg, KiBitmap( rotate_ccw_xpm ) );
962  AddMenuItem( sub_menu_Text, ID_POPUP_PCB_FLIP_TEXTEPCB, msg, KiBitmap( mirror_h_xpm ) );
963  msg = AddHotkeyName( _( "Edit..." ), g_Board_Editor_Hotkeys_Descr, HK_EDIT_ITEM );
964  AddMenuItem( sub_menu_Text, ID_POPUP_PCB_EDIT_TEXTEPCB, msg, KiBitmap( edit_text_xpm ) );
965  if( !flags )
966  {
968  _( "Reset Size" ), KiBitmap( reset_text_xpm ) );
969 
970  sub_menu_Text->AppendSeparator();
971  msg = AddHotkeyName( _( "Delete" ), g_Board_Editor_Hotkeys_Descr, HK_DELETE );
972  AddMenuItem( sub_menu_Text, ID_POPUP_PCB_DELETE_TEXTEPCB, msg, KiBitmap( delete_xpm ) );
973  }
974 }
975 
976 
977 void PCB_EDIT_FRAME::createPopUpMenuForMarkers( MARKER_PCB* aMarker, wxMenu* aPopMenu )
978 {
979  AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_MARKER, _( "Delete Marker" ),
980  KiBitmap( delete_xpm ) );
981  AddMenuItem( aPopMenu, ID_POPUP_PCB_GETINFO_MARKER, _( "Marker Error Info" ),
982  KiBitmap( info_xpm ) );
983 }
984 
985 
991 static wxMenu* Append_Track_Width_List( BOARD* aBoard )
992 {
993  wxString msg;
994  wxMenu* trackwidth_menu;
995  wxString value;
996 
997  trackwidth_menu = new wxMenu;
998 
999  trackwidth_menu->Append( ID_POPUP_PCB_SELECT_AUTO_WIDTH, _( "Auto Width" ),
1000  _( "Use the track width when starting on a track, otherwise the current track width" ),
1001  true );
1002 
1004  trackwidth_menu->Check( ID_POPUP_PCB_SELECT_AUTO_WIDTH, true );
1005 
1006  if( aBoard->GetDesignSettings().GetViaSizeIndex() != 0
1007  || aBoard->GetDesignSettings().GetTrackWidthIndex() != 0
1009  trackwidth_menu->Append( ID_POPUP_PCB_SELECT_USE_NETCLASS_VALUES,
1010  _( "Use Netclass Values" ),
1011  _( "Use track and via sizes from their Netclass values" ),
1012  true );
1013 
1014  for( unsigned ii = 0; ii < aBoard->GetDesignSettings().m_TrackWidthList.size(); ii++ )
1015  {
1016  value = StringFromValue( g_UserUnit, aBoard->GetDesignSettings().m_TrackWidthList[ii], true );
1017  msg.Printf( _( "Track %s" ), GetChars( value ) );
1018 
1019  if( ii == 0 )
1020  msg << _( " uses NetClass" );
1021 
1022  trackwidth_menu->Append( ID_POPUP_PCB_SELECT_WIDTH1 + ii, msg, wxEmptyString, true );
1023  }
1024 
1025  trackwidth_menu->AppendSeparator();
1026 
1027  for( unsigned ii = 0; ii < aBoard->GetDesignSettings().m_ViasDimensionsList.size(); ii++ )
1028  {
1029  value = StringFromValue( g_UserUnit,
1030  aBoard->GetDesignSettings().m_ViasDimensionsList[ii].m_Diameter,
1031  true );
1032  wxString drill = StringFromValue( g_UserUnit,
1033  aBoard->GetDesignSettings().m_ViasDimensionsList[ii].m_Drill,
1034  true );
1035 
1036  if( aBoard->GetDesignSettings().m_ViasDimensionsList[ii].m_Drill <= 0 )
1037  {
1038  msg.Printf( _( "Via %s" ), GetChars( value ) );
1039  }
1040  else
1041  {
1042  msg.Printf( _( "Via %s, drill %s" ), GetChars( value ), GetChars( drill ) );
1043  }
1044 
1045  if( ii == 0 )
1046  msg << _( " uses NetClass" );
1047 
1048  trackwidth_menu->Append( ID_POPUP_PCB_SELECT_VIASIZE1 + ii, msg, wxEmptyString, true );
1049  }
1050 
1051  return trackwidth_menu;
1052 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:209
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:60
STATUS_FLAGS GetFlags() const
Definition: base_struct.h:266
#define IN_EDIT
Item currently edited.
Definition: base_struct.h:107
BLOCK_SELECTOR m_BlockLocate
Block description for block commands.
Definition: base_screen.h:214
Definition: typeinfo.h:85
const wxPoint & GetRefPos() const
Definition: collector.h:223
wxString GetSelectMenuText() const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Definition: class_pad.cpp:1202
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:695
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
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
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:174
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:205
MODULE * GetParent() const
Definition: class_pad.h:162
class ZONE_CONTAINER, a zone area
Definition: typeinfo.h:102
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:236
class TEXTE_PCB, text on a layer
Definition: typeinfo.h:92
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:90
bool SetCurrentNetClass(const wxString &aNetClassName)
Function SetCurrentNetClass Must be called after a netclass selection (or after a netclass parameter ...
int GetState(int type) const
Definition: base_struct.h:248
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
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:86
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
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.
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:602
GENERAL_COLLECTOR * m_Collector
#define IS_NEW
New item, just created.
Definition: base_struct.h:109
#define IS_DRAGGED
Item being dragged.
Definition: base_struct.h:111
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:78
class MODULE, a footprint
Definition: typeinfo.h:89
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:142
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:533
struct EDA_HOTKEY_CONFIG g_Board_Editor_Hotkeys_Descr[]
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:124
class SEGZONE, a segment used to fill a zone area (segment on a copper layer)
Definition: typeinfo.h:97
class DIMENSION, a dimension (graphic item)
Definition: typeinfo.h:100
bool IsLocked() const override
Function IsLocked.
Definition: class_module.h:263
const SHAPE_POLY_SET & GetFilledPolysList() const
Function GetFilledPolysList returns a reference to the list of filled polygons.
Definition: class_zone.h:534
void SetAbortRequest(bool aAbortRequest)
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:101
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:57
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
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:106
bool GetAbortRequest() const
void createPopUpMenuForFpPads(D_PAD *aPad, wxMenu *aPopMenu)
class MARKER_PCB, a marker used to show something
Definition: typeinfo.h:99
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:496
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:201
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
bool IsMicroViaAcceptable(void)
Function IsMicroViaAcceptable return true if a microvia can be placed on the board.
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:91
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:679
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...