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  wxLogDebug( wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unexpected DrawType %d" ),
297  item->Type() );
298  SetCurItem( NULL );
299  break;
300 
301  default:
302  wxLogDebug( wxT( "PCB_EDIT_FRAME::OnRightClick() Error: unknown DrawType %d" ),
303  item->Type() );
304 
305  // Attempt to clear error (but should no occurs )
306  if( item->Type() >= MAX_STRUCT_TYPE_ID )
307  SetCurItem( NULL );
308 
309  break;
310  }
311 
312  aPopMenu->AppendSeparator();
313  }
314 
315  if( !flags )
316  {
317  msg = AddHotkeyName( _( "Get and Move Footprint..." ),
320  msg, KiBitmap( move_xpm ) );
321  }
322 
323  // Display context sensitive commands:
324  switch( GetToolId() )
325  {
326  case ID_PCB_ZONES_BUTT:
327  if( GetBoard()->m_ZoneDescriptorList.size() > 0 )
328  {
329  aPopMenu->AppendSeparator();
330  msg = AddHotkeyName( _( "Fill or Refill All Zones" ),
333  msg, KiBitmap( fill_zone_xpm ) );
334  msg = AddHotkeyName( _( "Remove Filled Areas in All Zones" ),
337  msg, KiBitmap( zone_unfill_xpm ) );
338  aPopMenu->AppendSeparator();
339  }
340 
342  _( "Select Working Layer..." ), KiBitmap( select_w_layer_xpm ) );
343  aPopMenu->AppendSeparator();
344  break;
345 
348  _( "Select Working Layer..." ), KiBitmap( select_w_layer_xpm ) );
349  aPopMenu->AppendSeparator();
350  break;
351 
352  case ID_TRACK_BUTT:
353  if ( ! trackFound ) // This menu is already added when a track is located
354  {
355  aPopMenu->AppendSeparator();
356  msg = AddHotkeyName( _( "Begin Track" ),
359  msg, KiBitmap( add_tracks_xpm ) );
360 
362  ID_POPUP_PCB_SELECT_WIDTH, _( "Select Track Width" ),
363  KiBitmap( width_track_xpm ) );
364 
366  _( "Select Working Layer..." ), KiBitmap( select_w_layer_xpm ) );
368  _( "Select Layer Pair for Vias..." ), KiBitmap( select_layer_pair_xpm ) );
369  aPopMenu->AppendSeparator();
370  }
371  break;
372 
373  case ID_PCB_CIRCLE_BUTT:
374  case ID_PCB_ARC_BUTT:
379  _( "Select Working Layer..." ), KiBitmap( select_w_layer_xpm ) );
380  aPopMenu->AppendSeparator();
381  break;
382 
383  case ID_PCB_MODULE_BUTT:
384  if( !flags )
385  {
387  _( "Footprint Documentation" ), KiBitmap( book_xpm ) );
388  aPopMenu->AppendSeparator();
389  }
390  break;
391 
392  case ID_NO_TOOL_SELECTED:
393  {
394  if( !trackFound )
395  {
396  msg = AddHotkeyName( _( "Begin Track" ), g_Board_Editor_Hotkeys_Descr, HK_ADD_NEW_TRACK );
397  AddMenuItem( aPopMenu, ID_POPUP_PCB_BEGIN_TRACK, msg, KiBitmap( add_tracks_xpm ) );
398 
400  ID_POPUP_PCB_SELECT_WIDTH, _( "Select Track Width" ),
401  KiBitmap( width_track_xpm ) );
402 
404  _( "Select Working Layer..." ), KiBitmap( select_w_layer_xpm ) );
405  aPopMenu->AppendSeparator();
406  }
407  break;
408  }
409  }
410 
411  return true;
412 }
413 
414 
415 /* Create Pop sub menu for block commands
416  */
418 {
419  AddMenuItem( menu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel Block" ),
420  KiBitmap( cancel_xpm ) );
421  AddMenuItem( menu, ID_POPUP_ZOOM_BLOCK, _( "Zoom Block" ), KiBitmap( zoom_area_xpm ) );
422  menu->AppendSeparator();
423  AddMenuItem( menu, ID_POPUP_PLACE_BLOCK, _( "Place Block" ), KiBitmap( checked_ok_xpm ) );
424  AddMenuItem( menu, ID_POPUP_DUPLICATE_BLOCK, _( "Duplicate" ), KiBitmap( duplicate_xpm ) );
425  AddMenuItem( menu, ID_POPUP_FLIP_BLOCK, _( "Flip" ), KiBitmap( mirror_v_xpm ) );
426  AddMenuItem( menu, ID_POPUP_ROTATE_BLOCK, _( "Rotate Counterclockwise" ), KiBitmap( rotate_ccw_xpm ) );
427  AddMenuItem( menu, ID_POPUP_DELETE_BLOCK, _( "Delete" ), KiBitmap( delete_xpm ) );
428 }
429 
430 
431 /* Create command lines for a popup menu, for track and via editing
432  * also update Netclass selection
433  */
434 void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
435 {
436  wxPoint cursorPosition = GetCrossHairPosition();
437  wxString msg;
438 
440 
441  int flags = Track->GetFlags();
442 
443  if( flags == 0 )
444  {
445  msg = AddHotkeyName( _( "Begin Track" ),
448  msg, KiBitmap( add_tracks_xpm ) );
449 
450  if( Track->Type() == PCB_VIA_T )
451  {
452  msg = AddHotkeyName( _( "Drag Via" ), g_Board_Editor_Hotkeys_Descr,
453  HK_DRAG_ITEM );
455  KiBitmap( move_xpm ) );
456  }
457  else
458  {
459  if( Track->IsPointOnEnds( cursorPosition, -1 ) != 0 )
460  {
463  msg, KiBitmap( move_xpm ) );
464  }
465  else
466  {
467  msg = AddHotkeyName( _( "Drag Segments, Keep Slope" ), g_Board_Editor_Hotkeys_Descr,
470  msg, KiBitmap( drag_segment_withslope_xpm ) );
471 
472  msg = AddHotkeyName( _( "Drag Segment" ), g_Board_Editor_Hotkeys_Descr,
473  HK_DRAG_ITEM );
475  msg, KiBitmap( drag_xpm ) );
476 
477  msg = AddHotkeyName( _( "Duplicate" ), g_Board_Editor_Hotkeys_Descr,
480  msg, KiBitmap( duplicate_xpm ) );
481 
482  msg = AddHotkeyName( _("Move Exactly..." ), g_Board_Editor_Hotkeys_Descr,
485  msg, KiBitmap( move_exactly_xpm ) );
486 
487  msg = AddHotkeyName( _("Create Track Array..." ), g_Board_Editor_Hotkeys_Descr,
488  HK_CREATE_ARRAY );
490  msg, KiBitmap( array_xpm ) );
491 
493  _( "Break Track" ), KiBitmap( break_line_xpm ) );
494  }
495  }
496 
498  _( "Select Working Layer..." ), KiBitmap( select_w_layer_xpm ) );
499  }
500  else if( flags & IS_DRAGGED ) // Drag via or node in progress
501  {
503  _( "Place Node" ), KiBitmap( checked_ok_xpm ) );
504  return;
505  }
506  else // Edit in progress
507  {
508  if( flags & IS_NEW )
509  {
510  msg = AddHotkeyName( _( "End Track" ), g_Board_Editor_Hotkeys_Descr, HK_LEFT_DCLICK );
511  AddMenuItem( PopMenu, ID_POPUP_PCB_END_TRACK, msg, KiBitmap( checked_ok_xpm ) );
512  }
513 
514  msg = AddHotkeyName( _( "Place Through Via" ), g_Board_Editor_Hotkeys_Descr, HK_ADD_THROUGH_VIA );
515  AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_THROUGH_VIA, msg, KiBitmap( via_xpm ) );
516 
517  msg = AddHotkeyName( _( "Select Layer and Place Through Via..." ),
520  msg, KiBitmap( select_w_layer_xpm ) );
521 
522  if( GetDesignSettings().m_BlindBuriedViaAllowed )
523  {
524  msg = AddHotkeyName( _( "Place Blind/Buried Via" ),
526  AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_BLIND_BURIED_VIA, msg, KiBitmap( via_buried_xpm ) );
527 
528  msg = AddHotkeyName( _( "Select Layer and Place Blind/Buried Via..." ),
531  msg, KiBitmap( select_w_layer_xpm ) );
532  }
533 
534  msg = AddHotkeyName( _( "Switch Track Posture" ), g_Board_Editor_Hotkeys_Descr,
537  KiBitmap( change_entry_orient_xpm ) );
538 
539  // See if we can place a Micro Via (4 or more layers, and start from an external layer):
540  if( IsMicroViaAcceptable() )
541  {
542  msg = AddHotkeyName( _( "Place Micro Via" ), g_Board_Editor_Hotkeys_Descr,
543  HK_ADD_MICROVIA );
544  AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_MICROVIA, msg, KiBitmap( via_microvia_xpm ) );
545  }
546  }
547 
548  // track Width control :
549  if( !flags )
550  {
551  if( Track->Type() == PCB_VIA_T )
552  {
553  msg = AddHotkeyName( _( "Change Via Size and Drill" ), g_Board_Editor_Hotkeys_Descr,
554  HK_EDIT_ITEM );
555  AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TRACKSEG, msg, KiBitmap( width_segment_xpm ) );
556  }
557  else
558  {
559  msg = AddHotkeyName( _( "Change Segment Width" ), g_Board_Editor_Hotkeys_Descr,
560  HK_EDIT_ITEM );
561  AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TRACKSEG, msg, KiBitmap( width_segment_xpm ) );
563  _( "Change Track Width" ), KiBitmap( width_track_xpm ) );
564  }
565  }
566 
567  // Allows switching to another track/via size when routing
570  _( "Select Track Width" ), KiBitmap( width_track_xpm ) );
571 
572  // Delete control:
573  PopMenu->AppendSeparator();
574  wxMenu* trackdel_mnu = new wxMenu;
575  AddMenuItem( PopMenu, trackdel_mnu, ID_POPUP_PCB_DELETE_TRACK_MNU, _( "Delete" ),
576  KiBitmap( delete_xpm ) );
577 
578  msg = AddHotkeyName( Track->Type()==PCB_VIA_T ?
579  _( "Delete Via" ) : _( "Delete Segment" ),
581 
582  AddMenuItem( trackdel_mnu, ID_POPUP_PCB_DELETE_TRACKSEG, msg, KiBitmap( delete_line_xpm ) );
583 
584  if( !flags )
585  {
586  msg = AddHotkeyName( _( "Delete Track" ), g_Board_Editor_Hotkeys_Descr, HK_DELETE );
587  AddMenuItem( trackdel_mnu, ID_POPUP_PCB_DELETE_TRACK, msg, KiBitmap( delete_track_xpm ) );
588  AddMenuItem( trackdel_mnu, ID_POPUP_PCB_DELETE_TRACKNET, _( "Delete Net" ),
589  KiBitmap( delete_net_xpm ) );
590  }
591 
592  // Add global editing commands:
593  if( !flags )
594  {
595  PopMenu->AppendSeparator();
597  _( "Set Track and Via Sizes..." ), KiBitmap( width_track_via_xpm ) );
598  }
599 
600  // Add lock/unlock flags menu:
601  wxMenu* trackflg_mnu = new wxMenu;
602 
603  AddMenuItem( PopMenu, trackflg_mnu, ID_POPUP_PCB_SETFLAGS_TRACK_MNU, _( "Set Flags" ),
604  KiBitmap( flag_xpm ) );
605  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_ON_TRACKSEG, _( "Locked: Yes" ), wxEmptyString, true );
606  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_OFF_TRACKSEG, _( "Locked: No" ), wxEmptyString, true );
607 
608  if( Track->GetState( TRACK_LOCKED ) )
609  trackflg_mnu->Check( ID_POPUP_PCB_LOCK_ON_TRACKSEG, true );
610  else
611  trackflg_mnu->Check( ID_POPUP_PCB_LOCK_OFF_TRACKSEG, true );
612 
613  if( !flags )
614  {
615  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_ON_TRACK, _( "Track Locked: Yes" ) );
616  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_OFF_TRACK, _( "Track Locked: No" ) );
617  trackflg_mnu->AppendSeparator();
618  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_ON_NET, _( "Net Locked: Yes" ) );
619  trackflg_mnu->Append( ID_POPUP_PCB_LOCK_OFF_NET, _( "Net Locked: No" ) );
620  }
621 }
622 
623 
624 /* Create the wxMenuitem list for zone outlines editing and zone filling
625  */
626 void PCB_EDIT_FRAME::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu )
627 {
628  wxString msg;
630 
631  if( edge_zone->GetFlags() == IS_DRAGGED )
632  {
634  _( "Place Edge Outline" ), KiBitmap( checked_ok_xpm ) );
635  }
636  else if( edge_zone->GetFlags() )
637  {
638  if( (edge_zone->GetFlags() & IN_EDIT ) )
640  _( "Place Corner" ), KiBitmap( checked_ok_xpm ) );
641  else
643  _( "Place Zone" ), KiBitmap( checked_ok_xpm ) );
644  }
645  else
646  {
647  wxMenu* zones_menu = new wxMenu();
648  int accuracy = KiROUND( 5 * guide.OnePixelInIU() );
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 ), accuracy * 2 ) )
655  {
657  _( "Move Corner" ), KiBitmap( move_xpm ) );
659  _( "Delete Corner" ), KiBitmap( delete_xpm ) );
660  }
661  else if( edge_zone->HitTestForEdge( RefPos( true ), accuracy ) )
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...
Class ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:59
#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
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame...
Definition: typeinfo.h:85
TEXTE_PCB class definition.
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:121
const wxPoint & GetRefPos() const
Definition: collector.h:231
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
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
int GetSelectedCorner() const
Definition: class_zone.h:206
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...
bool HitTestForCorner(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Function HitTestForCorner tests if the given wxPoint is near a corner.
Definition: class_zone.cpp:677
bool IsEmpty() const
Returns true if the set is empty (no polygons at all)
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:243
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...
Classes to handle copper zones.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:539
class D_PAD, a pad in a footprint
Definition: typeinfo.h:90
double OnePixelInIU() const override
Definition: collectors.h:618
bool SetCurrentNetClass(const wxString &aNetClassName)
Function SetCurrentNetClass Must be called after a netclass selection (or after a netclass parameter ...
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
wxString GetNetClassName() const
Function GetNetClassName returns a pointer to the netclass of the zone.
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.
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
GENERAL_COLLECTORS_GUIDE GetCollectorsGuide()
Function GetCollectorsGuide.
unsigned GetViaSizeIndex() const
Function GetViaSizeIndex.
EDA_UNITS_T GetUserUnits() const override
Return the user units currently in use.
Definition: draw_frame.h:290
TEXT_TYPE GetType() const
void createPopUpMenuForFootprints(MODULE *aModule, wxMenu *aPopMenu)
void createPopUpMenuForZones(ZONE_CONTAINER *edge_zone, wxMenu *aPopMenu)
unsigned GetTrackWidthIndex() const
Function GetTrackWidthIndex.
unsigned STATUS_FLAGS
Definition: base_struct.h:147
struct EDA_HOTKEY_CONFIG g_Board_Editor_Hotkeys_Descr[]
#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:267
void SetAbortRequest(bool aAbortRequest)
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:630
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:101
MODULE * GetParent() const
Definition: class_pad.h:162
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...
wxPoint GetNearestGridPosition(const wxPoint &aPosition, wxRealPoint *aGridSize=NULL) const
Return the nearest aGridSize location to aPosition.
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:126
void createPopUpMenuForFpPads(D_PAD *aPad, wxMenu *aPopMenu)
class MARKER_PCB, a marker used to show something
Definition: typeinfo.h:99
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:171
void createPopUpMenuForMarkers(MARKER_PCB *aMarker, wxMenu *aPopMenu)
void createPopUpMenuForFpTexts(TEXTE_MODULE *aText, wxMenu *aPopMenu)
wxPoint RefPos(bool useMouse) const
Return the reference position, coming from either the mouse position or the cursor position...
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
std::vector< VIA_DIMENSION > m_ViasDimensionsList
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:1258
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
bool IsMicroViaAcceptable()
Function IsMicroViaAcceptable return true if a microvia can be placed on the board.
bool HitTestForEdge(const wxPoint &refPos, int aAccuracy, 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:691
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
static const char * text_xpm[]
Module description (excepted pads)
wxString GetSelectMenuText(EDA_UNITS_T aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
BOARD * GetBoard() const
BOARD_ITEM * PcbGeneralLocateAndDisplay(int aHotKeyCode=0)
Function PcbGeneralLocateAndDisplay searches for an item under the mouse cursor.
A general implementation of a COLLECTORS_GUIDE.
Definition: collectors.h:391
bool IsIdle() const
Function IsIdle returns true if there is currently no block operation in progress.
class DRAWSEGMENT, a segment not on copper layers
Definition: typeinfo.h:91
STATUS_FLAGS GetFlags() const
Definition: base_struct.h:258
BOARD_ITEM_CONTAINER * GetParent() const
class SEGZONE, a segment used to fill a zone area (segment on a
Definition: typeinfo.h:97
BOARD_ITEM * GetCurItem()
EDA_UNITS_T m_UserUnits
Definition: draw_frame.h:123
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
int GetState(int type) const
Definition: base_struct.h:240
EDA_UNITS_T
Definition: common.h:160
int GetToolId() const
Definition: draw_frame.h:525
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Return the current cross hair position in logical (drawing) coordinates.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
const SHAPE_POLY_SET & GetFilledPolysList() const
Function GetFilledPolysList returns a reference to the list of filled polygons.
Definition: class_zone.h:559
Class BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.