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, EDA_UNITS_T aUnits );
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_SEGZONE_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  if( !trackFound )
397  {
398  msg = AddHotkeyName( _( "Begin Track" ), g_Board_Editor_Hotkeys_Descr, HK_ADD_NEW_TRACK );
399  AddMenuItem( aPopMenu, ID_POPUP_PCB_BEGIN_TRACK, msg, KiBitmap( add_tracks_xpm ) );
400 
402  ID_POPUP_PCB_SELECT_WIDTH, _( "Select Track Width" ),
403  KiBitmap( width_track_xpm ) );
404 
406  _( "Select Working Layer..." ), KiBitmap( select_w_layer_xpm ) );
407  aPopMenu->AppendSeparator();
408  }
409  break;
410  }
411  }
412 
413  return true;
414 }
415 
416 
417 /* Create Pop sub menu for block commands
418  */
420 {
421  AddMenuItem( menu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel Block" ),
422  KiBitmap( cancel_xpm ) );
423  AddMenuItem( menu, ID_POPUP_ZOOM_BLOCK, _( "Zoom Block" ), KiBitmap( zoom_area_xpm ) );
424  menu->AppendSeparator();
425  AddMenuItem( menu, ID_POPUP_PLACE_BLOCK, _( "Place Block" ), KiBitmap( checked_ok_xpm ) );
426  AddMenuItem( menu, ID_POPUP_DUPLICATE_BLOCK, _( "Duplicate" ), KiBitmap( duplicate_xpm ) );
427  AddMenuItem( menu, ID_POPUP_FLIP_BLOCK, _( "Flip" ), KiBitmap( mirror_v_xpm ) );
428  AddMenuItem( menu, ID_POPUP_ROTATE_BLOCK, _( "Rotate Counterclockwise" ), KiBitmap( rotate_ccw_xpm ) );
429  AddMenuItem( menu, ID_POPUP_DELETE_BLOCK, _( "Delete" ), KiBitmap( delete_xpm ) );
430 }
431 
432 
433 /* Create command lines for a popup menu, for track and via editing
434  * also update Netclass selection
435  */
436 void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
437 {
438  wxPoint cursorPosition = GetCrossHairPosition();
439  wxString msg;
440 
442 
443  int flags = Track->GetFlags();
444 
445  if( flags == 0 )
446  {
447  msg = AddHotkeyName( _( "Begin Track" ),
450  msg, KiBitmap( add_tracks_xpm ) );
451 
452  if( Track->Type() == PCB_VIA_T )
453  {
454  msg = AddHotkeyName( _( "Drag Via" ), g_Board_Editor_Hotkeys_Descr,
455  HK_DRAG_ITEM );
457  KiBitmap( move_xpm ) );
458  }
459  else
460  {
461  if( Track->IsPointOnEnds( cursorPosition, -1 ) != 0 )
462  {
465  msg, KiBitmap( move_xpm ) );
466  }
467  else
468  {
469  msg = AddHotkeyName( _( "Drag Segments, Keep Slope" ), g_Board_Editor_Hotkeys_Descr,
472  msg, KiBitmap( drag_segment_withslope_xpm ) );
473 
474  msg = AddHotkeyName( _( "Drag Segment" ), g_Board_Editor_Hotkeys_Descr,
475  HK_DRAG_ITEM );
477  msg, KiBitmap( drag_xpm ) );
478 
479  msg = AddHotkeyName( _( "Duplicate" ), g_Board_Editor_Hotkeys_Descr,
482  msg, KiBitmap( duplicate_xpm ) );
483 
484  msg = AddHotkeyName( _("Move Exactly..." ), g_Board_Editor_Hotkeys_Descr,
487  msg, KiBitmap( move_exactly_xpm ) );
488 
489  msg = AddHotkeyName( _("Create Track Array..." ), g_Board_Editor_Hotkeys_Descr,
490  HK_CREATE_ARRAY );
492  msg, KiBitmap( array_xpm ) );
493 
495  _( "Break Track" ), KiBitmap( break_line_xpm ) );
496  }
497  }
498 
500  _( "Select Working Layer..." ), KiBitmap( select_w_layer_xpm ) );
501  }
502  else if( flags & IS_DRAGGED ) // Drag via or node in progress
503  {
505  _( "Place Node" ), KiBitmap( checked_ok_xpm ) );
506  return;
507  }
508  else // Edit in progress
509  {
510  if( flags & IS_NEW )
511  {
512  msg = AddHotkeyName( _( "End Track" ), g_Board_Editor_Hotkeys_Descr, HK_LEFT_DCLICK );
513  AddMenuItem( PopMenu, ID_POPUP_PCB_END_TRACK, msg, KiBitmap( checked_ok_xpm ) );
514  }
515 
516  msg = AddHotkeyName( _( "Place Through Via" ), g_Board_Editor_Hotkeys_Descr, HK_ADD_THROUGH_VIA );
517  AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_THROUGH_VIA, msg, KiBitmap( via_xpm ) );
518 
519  msg = AddHotkeyName( _( "Select Layer and Place Through Via..." ),
522  msg, KiBitmap( select_w_layer_xpm ) );
523 
524  if( GetDesignSettings().m_BlindBuriedViaAllowed )
525  {
526  msg = AddHotkeyName( _( "Place Blind/Buried Via" ),
528  AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_BLIND_BURIED_VIA, msg, KiBitmap( via_buried_xpm ) );
529 
530  msg = AddHotkeyName( _( "Select Layer and Place Blind/Buried Via..." ),
533  msg, KiBitmap( select_w_layer_xpm ) );
534  }
535 
536  msg = AddHotkeyName( _( "Switch Track Posture" ), g_Board_Editor_Hotkeys_Descr,
539  KiBitmap( change_entry_orient_xpm ) );
540 
541  // See if we can place a Micro Via (4 or more layers, and start from an external layer):
542  if( IsMicroViaAcceptable() )
543  {
544  msg = AddHotkeyName( _( "Place Micro Via" ), g_Board_Editor_Hotkeys_Descr,
545  HK_ADD_MICROVIA );
546  AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_MICROVIA, msg, KiBitmap( via_microvia_xpm ) );
547  }
548  }
549 
550  // track Width control :
551  if( !flags )
552  {
553  if( Track->Type() == PCB_VIA_T )
554  {
555  msg = AddHotkeyName( _( "Change Via Size and Drill" ), g_Board_Editor_Hotkeys_Descr,
556  HK_EDIT_ITEM );
557  AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TRACKSEG, msg, KiBitmap( width_segment_xpm ) );
558  }
559  else
560  {
561  msg = AddHotkeyName( _( "Change Segment Width" ), g_Board_Editor_Hotkeys_Descr,
562  HK_EDIT_ITEM );
563  AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TRACKSEG, msg, KiBitmap( width_segment_xpm ) );
565  _( "Change Track Width" ), KiBitmap( width_track_xpm ) );
566  }
567  }
568 
569  // Allows switching to another track/via size when routing
572  _( "Select Track Width" ), KiBitmap( width_track_xpm ) );
573 
574  // Delete control:
575  PopMenu->AppendSeparator();
576  wxMenu* trackdel_mnu = new wxMenu;
577  AddMenuItem( PopMenu, trackdel_mnu, ID_POPUP_PCB_DELETE_TRACK_MNU, _( "Delete" ),
578  KiBitmap( delete_xpm ) );
579 
580  msg = AddHotkeyName( Track->Type()==PCB_VIA_T ?
581  _( "Delete Via" ) : _( "Delete Segment" ),
583 
584  AddMenuItem( trackdel_mnu, ID_POPUP_PCB_DELETE_TRACKSEG, msg, KiBitmap( delete_line_xpm ) );
585 
586  if( !flags )
587  {
588  msg = AddHotkeyName( _( "Delete Track" ), g_Board_Editor_Hotkeys_Descr, HK_DELETE );
589  AddMenuItem( trackdel_mnu, ID_POPUP_PCB_DELETE_TRACK, msg, KiBitmap( delete_track_xpm ) );
590  AddMenuItem( trackdel_mnu, ID_POPUP_PCB_DELETE_TRACKNET, _( "Delete Net" ),
591  KiBitmap( delete_net_xpm ) );
592  }
593 
594  // Add global editing commands:
595  if( !flags )
596  {
597  PopMenu->AppendSeparator();
599  _( "Set Track and Via Sizes..." ), KiBitmap( width_track_via_xpm ) );
600  }
601 
602  // Add lock/unlock flags menu:
603  wxMenu* trackflg_mnu = new wxMenu;
604 
605  AddMenuItem( PopMenu, trackflg_mnu, ID_POPUP_PCB_SETFLAGS_TRACK_MNU, _( "Set Flags" ),
606  KiBitmap( flag_xpm ) );
607  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_ON_TRACKSEG, _( "Locked: Yes" ), wxEmptyString, true );
608  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_OFF_TRACKSEG, _( "Locked: No" ), wxEmptyString, true );
609 
610  if( Track->GetState( TRACK_LOCKED ) )
611  trackflg_mnu->Check( ID_POPUP_PCB_LOCK_ON_TRACKSEG, true );
612  else
613  trackflg_mnu->Check( ID_POPUP_PCB_LOCK_OFF_TRACKSEG, true );
614 
615  if( !flags )
616  {
617  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_ON_TRACK, _( "Track Locked: Yes" ) );
618  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_OFF_TRACK, _( "Track Locked: No" ) );
619  trackflg_mnu->AppendSeparator();
620  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_ON_NET, _( "Net Locked: Yes" ) );
621  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_OFF_NET, _( "Net Locked: No" ) );
622  }
623 }
624 
625 
626 /* Create the wxMenuitem list for zone outlines editing and zone filling
627  */
628 void PCB_EDIT_FRAME::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu )
629 {
630  wxString msg;
631 
632  if( edge_zone->GetFlags() == IS_DRAGGED )
633  {
635  _( "Place Edge Outline" ), KiBitmap( checked_ok_xpm ) );
636  }
637  else if( edge_zone->GetFlags() )
638  {
639  if( (edge_zone->GetFlags() & IN_EDIT ) )
641  _( "Place Corner" ), KiBitmap( checked_ok_xpm ) );
642  else
644  _( "Place Zone" ), KiBitmap( checked_ok_xpm ) );
645  }
646  else
647  {
648  wxMenu* zones_menu = new wxMenu();
649 
650  AddMenuItem( aPopMenu, zones_menu, -1,
651  edge_zone->GetIsKeepout() ? _("Keepout Area") : _( "Zones" ),
652  KiBitmap( add_zone_xpm ) );
653 
654  if( edge_zone->HitTestForCorner( RefPos( true ) ) )
655  {
657  _( "Move" ), KiBitmap( move_xpm ) );
659  _( "Delete" ), KiBitmap( delete_xpm ) );
660  }
661  else if( edge_zone->HitTestForEdge( RefPos( true ) ) )
662  {
664  _( "Create Corner" ), KiBitmap( add_corner_xpm ) );
665  msg = AddHotkeyName( _( "Drag Outline Segment" ), g_Board_Editor_Hotkeys_Descr,
666  HK_DRAG_ITEM );
668  msg, KiBitmap( drag_outline_segment_xpm ) );
669  }
670 
671  zones_menu->AppendSeparator();
673  _( "Add Similar Zone" ), KiBitmap( add_zone_xpm ) );
674 
676  _( "Add Cutout Area" ), KiBitmap( add_zone_cutout_xpm ) );
677 
679  _( "Duplicate Zone onto Layer..." ), KiBitmap( zone_duplicate_xpm ) );
680 
681  zones_menu->AppendSeparator();
682 
683  if( ! edge_zone->GetIsKeepout() )
684  AddMenuItem( zones_menu, ID_POPUP_PCB_FILL_ZONE, _( "Fill Zone" ),
685  KiBitmap( fill_zone_xpm ) );
686 
687  if( !edge_zone->GetFilledPolysList().IsEmpty() )
688  {
690  _( "Remove Filled Areas in Zone" ), KiBitmap( zone_unfill_xpm ) );
691  }
692 
693  msg = AddHotkeyName( _( "Move Zone" ), g_Board_Editor_Hotkeys_Descr, HK_MOVE_ITEM );
694  AddMenuItem( zones_menu, ID_POPUP_PCB_MOVE_ZONE_OUTLINES, msg, KiBitmap( move_xpm ) );
695 
696  msg = AddHotkeyName( _("Move Zone Exactly..." ), g_Board_Editor_Hotkeys_Descr,
699  msg, KiBitmap( move_xpm ) );
700 
701  msg = AddHotkeyName( _( "Edit Zone Properties..." ), g_Board_Editor_Hotkeys_Descr,
702  HK_EDIT_ITEM );
704  msg, KiBitmap( edit_xpm ) );
705 
706  zones_menu->AppendSeparator();
707 
708  if( edge_zone->GetSelectedCorner() >= 0 &&
709  edge_zone->Outline()->IsVertexInHole( edge_zone->GetSelectedCorner() ) )
711  _( "Delete Cutout" ), KiBitmap( delete_xpm ) );
712 
714  _( "Delete Zone Outline" ), KiBitmap( delete_xpm ) );
715  }
716 }
717 
718 
719 /* Create the wxMenuitem list for footprint editing
720  */
722 {
723  wxMenu* sub_menu_footprint;
724  int flags = aModule->GetFlags();
725  wxString msg;
726 
727  sub_menu_footprint = new wxMenu;
728 
729  msg = aModule->GetSelectMenuText( m_UserUnits );
730  AddMenuItem( menu, sub_menu_footprint, -1, msg, KiBitmap( module_xpm ) );
731 
732  if( !flags )
733  {
735  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_MOVE_MODULE_REQUEST,
736  msg, KiBitmap( move_xpm ) );
737 
739  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_DRAG_MODULE_REQUEST,
740  msg, KiBitmap( drag_xpm ) );
741  }
742 
743  msg = AddHotkeyName( _( "Rotate Counterclockwise" ), g_Board_Editor_Hotkeys_Descr, HK_ROTATE_ITEM );
745  msg, KiBitmap( rotate_ccw_xpm ) );
747  _( "Rotate Clockwise" ), KiBitmap( rotate_cw_xpm ) );
749  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_CHANGE_SIDE_MODULE,
750  msg, KiBitmap( mirror_v_xpm ) );
751 
752  if( !flags )
753  {
754  msg = AddHotkeyName( _( "Edit Parameters..." ),
756  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_EDIT_MODULE_PRMS, msg,
757  KiBitmap( edit_module_xpm ) );
758 
759  msg = AddHotkeyName( _( "Edit with Footprint Editor" ),
762  msg, KiBitmap( module_editor_xpm ) );
763 
764  sub_menu_footprint->AppendSeparator();
765 
766  msg = AddHotkeyName( _( "Delete" ),
768  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_DELETE_MODULE,
769  msg, KiBitmap( delete_module_xpm ) );
770 
771  sub_menu_footprint->AppendSeparator();
772 
773  msg = AddHotkeyName( _("Move Exactly..." ), g_Board_Editor_Hotkeys_Descr,
775  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_MOVE_EXACT,
776  msg, KiBitmap( move_exactly_xpm ) );
777 
778  msg = AddHotkeyName( _( "Duplicate" ), g_Board_Editor_Hotkeys_Descr,
780  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_DUPLICATE_ITEM,
781  msg, KiBitmap( duplicate_xpm ) );
782 
783  msg = AddHotkeyName( _("Create Array..." ), g_Board_Editor_Hotkeys_Descr,
784  HK_CREATE_ARRAY );
785  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_CREATE_ARRAY,
786  msg, KiBitmap( array_xpm ) );
787 
788  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_UPDATE_FOOTPRINTS,
789  _( "Update Footprint..." ), KiBitmap( reload_xpm ) );
790 
791  AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_EXCHANGE_FOOTPRINTS,
792  _( "Change Footprint..." ), KiBitmap( exchange_xpm ) );
793  }
794 
795  sub_menu_footprint->AppendSeparator();
796 
797  if( !aModule->IsLocked() )
798  {
799  }
800  else
801  {
802  }
803 
804 }
805 
806 
807 /* Create the wxMenuitem list for editing texts on footprints
808  */
810 {
811  wxMenu* sub_menu_Fp_text;
812  int flags = FpText->GetFlags();
813 
814  wxString msg = FpText->GetSelectMenuText( m_UserUnits );
815 
816  sub_menu_Fp_text = new wxMenu;
817 
818  AddMenuItem( menu, sub_menu_Fp_text, -1, msg, KiBitmap( footprint_text_xpm ) );
819 
820  if( !flags )
821  {
824  msg, KiBitmap( move_xpm ) );
825 
826  msg = AddHotkeyName( _("Move Exactly..." ), g_Board_Editor_Hotkeys_Descr,
828  AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_MOVE_EXACT,
829  msg, KiBitmap( move_exactly_xpm ) );
830  }
831 
832  msg = AddHotkeyName( _( "Rotate Clockwise" ), g_Board_Editor_Hotkeys_Descr, HK_ROTATE_ITEM );
833  AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_ROTATE_TEXTMODULE,
834  msg, KiBitmap( rotate_cw_xpm ) );
835 
836  if( !flags )
837  {
838  msg = AddHotkeyName( _( "Edit..." ), g_Board_Editor_Hotkeys_Descr, HK_EDIT_ITEM );
839  AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_EDIT_TEXTMODULE,
840  msg, KiBitmap( edit_text_xpm ) );
841  AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_RESET_TEXT_SIZE,
842  _( "Reset Size" ), KiBitmap( reset_text_xpm ) );
843  }
844 
845  // Graphic texts can be deleted only if are not currently edited.
846  if( !flags && FpText->GetType() == TEXTE_MODULE::TEXT_is_DIVERS )
847  {
848  AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_DELETE_TEXTMODULE,
849  _( "Delete" ), KiBitmap( delete_xpm ) );
850  }
851 
852  if( !flags )
853  {
854  MODULE* module = (MODULE*) FpText->GetParent();
855 
856  if( module )
857  {
858  menu->AppendSeparator();
859  createPopUpMenuForFootprints( module, menu );
860  }
861  }
862 }
863 
864 
865 /* Create pop menu for pads
866  * also update Netclass selection
867  */
869 {
870  wxMenu* sub_menu_Pad;
871  int flags = Pad->GetFlags();
872 
873  if( flags ) // Currently in edit, no others commands possible
874  return;
875 
877 
878  wxString msg = Pad->GetSelectMenuText( m_UserUnits );
879 
880  sub_menu_Pad = new wxMenu;
881  AddMenuItem( menu, sub_menu_Pad, -1, msg, KiBitmap( pad_xpm ) );
882 
883  AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_MOVE_PAD_REQUEST, _( "Move Pad" ),
884  KiBitmap( move_pad_xpm ) );
885  AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_DRAG_PAD_REQUEST, _( "Drag Pad" ),
886  KiBitmap( drag_pad_xpm ) );
887 
888  msg = AddHotkeyName( _( "Edit Pad..." ), g_Board_Editor_Hotkeys_Descr, HK_EDIT_ITEM );
889  AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_EDIT_PAD, msg, KiBitmap( options_pad_xpm ) );
890  sub_menu_Pad->AppendSeparator();
891 
893  _( "Copy Pad Properties" ),
894  wxEmptyString,
895  KiBitmap( copy_pad_settings_xpm ) );
897  _( "Paste Pad Properties" ),
898  wxEmptyString,
899  KiBitmap( apply_pad_settings_xpm ) );
901  _( "Push Pad Properties..." ),
902  _( "Copy this pad's properties to all pads in this footprint (or similar footprints)" ),
903  KiBitmap( push_pad_settings_xpm ) );
904  sub_menu_Pad->AppendSeparator();
905 
906  AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_DELETE_PAD, _( "Delete" ), KiBitmap( delete_pad_xpm ) );
907 
908  MODULE* module = Pad->GetParent();
909 
910  if( module )
911  {
912  menu->AppendSeparator();
913  createPopUpMenuForFootprints( module, menu );
914  }
915 }
916 
917 
918 // Create pop menu for pcb texts
920 {
921  wxMenu* sub_menu_Text;
922  int flags = Text->GetFlags();
923 
924  wxString msg = Text->GetSelectMenuText( m_UserUnits );
925 
926  sub_menu_Text = new wxMenu;
927 
928  AddMenuItem( menu, sub_menu_Text, -1, msg, KiBitmap( text_xpm ) );
929 
930  if( !flags )
931  {
934  msg, KiBitmap( move_xpm ) );
936  AddMenuItem( sub_menu_Text, ID_POPUP_PCB_COPY_TEXTEPCB,
937  msg, KiBitmap( copy_xpm ) );
938  }
939 
941  AddMenuItem( sub_menu_Text, ID_POPUP_PCB_ROTATE_TEXTEPCB, msg, KiBitmap( rotate_ccw_xpm ) );
943  AddMenuItem( sub_menu_Text, ID_POPUP_PCB_FLIP_TEXTEPCB, msg, KiBitmap( mirror_h_xpm ) );
944  msg = AddHotkeyName( _( "Edit..." ), g_Board_Editor_Hotkeys_Descr, HK_EDIT_ITEM );
945  AddMenuItem( sub_menu_Text, ID_POPUP_PCB_EDIT_TEXTEPCB, msg, KiBitmap( edit_text_xpm ) );
946  if( !flags )
947  {
949  _( "Reset Size" ), KiBitmap( reset_text_xpm ) );
950 
951  sub_menu_Text->AppendSeparator();
952  msg = AddHotkeyName( _( "Delete" ), g_Board_Editor_Hotkeys_Descr, HK_DELETE );
953  AddMenuItem( sub_menu_Text, ID_POPUP_PCB_DELETE_TEXTEPCB, msg, KiBitmap( delete_xpm ) );
954  }
955 }
956 
957 
958 void PCB_EDIT_FRAME::createPopUpMenuForMarkers( MARKER_PCB* aMarker, wxMenu* aPopMenu )
959 {
960  AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_MARKER, _( "Delete Marker" ),
961  KiBitmap( delete_xpm ) );
962  AddMenuItem( aPopMenu, ID_POPUP_PCB_GETINFO_MARKER, _( "Marker Error Info" ),
963  KiBitmap( info_xpm ) );
964 }
965 
966 
972 static wxMenu* Append_Track_Width_List( BOARD* aBoard, EDA_UNITS_T aUnits )
973 {
974  wxString msg;
975  wxMenu* trackwidth_menu;
976  BOARD_DESIGN_SETTINGS& bds = aBoard->GetDesignSettings();
977 
978  trackwidth_menu = new wxMenu;
979 
980  trackwidth_menu->Append( ID_POPUP_PCB_SELECT_AUTO_WIDTH, _( "Auto Width" ),
981  _( "Use the track width when starting on a track, otherwise the current track width" ),
982  true );
983 
984  if( bds.m_UseConnectedTrackWidth )
985  trackwidth_menu->Check( ID_POPUP_PCB_SELECT_AUTO_WIDTH, true );
986 
987  if( bds.GetViaSizeIndex() != 0 || bds.GetTrackWidthIndex() != 0 || bds.m_UseConnectedTrackWidth )
988  trackwidth_menu->Append( ID_POPUP_PCB_SELECT_USE_NETCLASS_VALUES,
989  _( "Use Netclass Values" ),
990  _( "Use track and via sizes from their Netclass values" ),
991  true );
992 
993  for( unsigned ii = 0; ii < bds.m_TrackWidthList.size(); ii++ )
994  {
995  wxString value = StringFromValue( aUnits, bds.m_TrackWidthList[ii], true );
996  msg.Printf( _( "Track %s" ), GetChars( value ) );
997 
998  if( ii == 0 )
999  msg << _( " uses NetClass" );
1000 
1001  trackwidth_menu->Append( ID_POPUP_PCB_SELECT_WIDTH1 + ii, msg, wxEmptyString, true );
1002  }
1003 
1004  trackwidth_menu->AppendSeparator();
1005 
1006  for( unsigned ii = 0; ii < bds.m_ViasDimensionsList.size(); ii++ )
1007  {
1008  wxString value = StringFromValue( aUnits, bds.m_ViasDimensionsList[ii].m_Diameter, true );
1009  wxString drill = StringFromValue( aUnits, bds.m_ViasDimensionsList[ii].m_Drill, true );
1010 
1011  if( bds.m_ViasDimensionsList[ii].m_Drill <= 0 )
1012  {
1013  msg.Printf( _( "Via %s" ), GetChars( value ) );
1014  }
1015  else
1016  {
1017  msg.Printf( _( "Via %s, drill %s" ), GetChars( value ), GetChars( drill ) );
1018  }
1019 
1020  if( ii == 0 )
1021  msg << _( " uses NetClass" );
1022 
1023  trackwidth_menu->Append( ID_POPUP_PCB_SELECT_VIASIZE1 + ii, msg, wxEmptyString, true );
1024  }
1025 
1026  return trackwidth_menu;
1027 }
wxString GetSelectMenuText(EDA_UNITS_T aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
BOARD_ITEM_CONTAINER * GetParent() const
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:258
#define IN_EDIT
Item currently edited.
Definition: base_struct.h:112
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:231
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:693
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
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:223
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...
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:242
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.
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:240
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
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:608
GENERAL_COLLECTOR * m_Collector
#define IS_NEW
New item, just created.
Definition: base_struct.h:114
#define IS_DRAGGED
Item being dragged.
Definition: base_struct.h:116
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
class MODULE, a footprint
Definition: typeinfo.h:89
EDA_UNITS_T GetUserUnits() const override
Return the user units currently in use.
Definition: draw_frame.h:284
void createPopUpMenuForFootprints(MODULE *aModule, wxMenu *aPopMenu)
void createPopUpMenuForZones(ZONE_CONTAINER *edge_zone, wxMenu *aPopMenu)
unsigned STATUS_FLAGS
Definition: base_struct.h:147
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:538
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:129
class DIMENSION, a dimension (graphic item)
Definition: typeinfo.h:100
bool IsLocked() const override
Function IsLocked.
Definition: class_module.h:268
const SHAPE_POLY_SET & GetFilledPolysList() const
Function GetFilledPolysList returns a reference to the list of filled polygons.
Definition: class_zone.h:540
void SetAbortRequest(bool aAbortRequest)
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:101
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
static wxMenu * Append_Track_Width_List(BOARD *aBoard, EDA_UNITS_T aUnits)
Function Append_Track_Width_List creates a wxMenu * which shows the last used track widths and via di...
bool IsIdle() const
Function IsIdle returns true if there is currently no block operation in progress.
wxPoint RefPos(bool useMouse) const
Return the reference position, coming from either the mouse position or the cursor position...
wxString GetSelectMenuText(EDA_UNITS_T aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:123
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
Return 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:170
void createPopUpMenuForMarkers(MARKER_PCB *aMarker, wxMenu *aPopMenu)
int GetToolId() const
Definition: draw_frame.h:519
void createPopUpMenuForFpTexts(TEXTE_MODULE *aText, wxMenu *aPopMenu)
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
std::vector< VIA_DIMENSION > m_ViasDimensionsList
unsigned GetTrackWidthIndex() const
Function GetTrackWidthIndex.
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
wxString GetSelectMenuText(EDA_UNITS_T aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Definition: class_pad.cpp:1220
wxString StringFromValue(EDA_UNITS_T aUnits, int aValue, bool aAddUnitSymbol, bool aUseMils)
Function StringFromValue returns the string from aValue according to units (inch, mm ...
Definition: base_units.cpp:210
int GetSelectedCorner() const
Definition: class_zone.h:207
bool IsMicroViaAcceptable()
Function IsMicroViaAcceptable return true if a microvia can be placed on the board.
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
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)
wxString GetSelectMenuText(EDA_UNITS_T aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
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
class SEGZONE, a segment used to fill a zone area (segment on a
Definition: typeinfo.h:97
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:677
EDA_UNITS_T m_UserUnits
Definition: draw_frame.h:120
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Return the current cross hair position in logical (drawing) coordinates.
EDA_UNITS_T
Definition: common.h:159
Class BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.