KiCad PCB EDA Suite
pcbnew/onleftclick.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) 2007 Jean-Pierre Charras, jean-pierre.charras@gipsa-lab.inpg.fr
5  * Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
6  * Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
31 #include <fctsys.h>
32 #include <class_drawpanel.h>
33 #include <confirm.h>
34 #include <pcb_edit_frame.h>
35 #include <msgpanel.h>
36 
37 #include <class_board.h>
38 #include <class_drawsegment.h>
39 #include <class_dimension.h>
40 #include <class_zone.h>
41 #include <class_pcb_text.h>
42 #include <class_text_mod.h>
43 #include <class_module.h>
44 #include <class_pcb_target.h>
45 #include <origin_viewitem.h>
46 #include <project.h>
47 
48 #include <pcbnew.h>
49 #include <pcbnew_id.h>
50 #include <menus_helpers.h>
52 #include <tools/pcbnew_control.h>
53 
54 
55 /* Handle the left button mouse click, when a tool is active
56  */
57 void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
58 {
59  BOARD_ITEM* curr_item = GetCurItem();
60  bool exit = false;
61  bool no_tool = GetToolId() == ID_NO_TOOL_SELECTED;
62 
63  if( no_tool || ( curr_item && curr_item->GetFlags() ) )
64  {
65  m_canvas->SetAutoPanRequest( false );
66 
67  if( curr_item && curr_item->GetFlags() ) // Command in progress
68  {
70  m_canvas->CrossHairOff( aDC );
71 
72  switch( curr_item->Type() )
73  {
74  case PCB_ZONE_AREA_T:
75  if( curr_item->IsNew() )
76  {
77  m_canvas->SetAutoPanRequest( true );
78  Begin_Zone( aDC );
79  }
80  else
81  {
82  End_Move_Zone_Corner_Or_Outlines( aDC, static_cast<ZONE_CONTAINER*>( curr_item ) );
83  }
84 
85  exit = true;
86  break;
87 
88  case PCB_TRACE_T:
89  case PCB_VIA_T:
90  if( curr_item->IsDragging() )
91  {
92  PlaceDraggedOrMovedTrackSegment( static_cast<TRACK*>( curr_item ), aDC );
93  exit = true;
94  }
95 
96  break;
97 
98  case PCB_TEXT_T:
99  Place_Texte_Pcb( static_cast<TEXTE_PCB*>( curr_item ), aDC );
100  exit = true;
101  break;
102 
103  case PCB_MODULE_TEXT_T:
104  PlaceTexteModule( static_cast<TEXTE_MODULE*>( curr_item ), aDC );
105  exit = true;
106  break;
107 
108  case PCB_PAD_T:
109  PlacePad( static_cast<D_PAD*>( curr_item ), aDC );
110  exit = true;
111  break;
112 
113  case PCB_MODULE_T:
114  PlaceModule( static_cast<MODULE*>( curr_item ), aDC );
115  exit = true;
116  break;
117 
118  case PCB_TARGET_T:
119  PlaceTarget( static_cast<PCB_TARGET*>( curr_item ), aDC );
120  exit = true;
121  break;
122 
123  case PCB_LINE_T:
124  if( no_tool ) // when no tools: existing item moving.
125  {
126  Place_DrawItem( static_cast<DRAWSEGMENT*>( curr_item ), aDC );
127  exit = true;
128  }
129 
130  break;
131 
132  case PCB_DIMENSION_T:
133  if( ! curr_item->IsNew() )
134  { // We are moving the text of an existing dimension. Place it
135  PlaceDimensionText( static_cast<DIMENSION*>( curr_item ), aDC );
136  exit = true;
137  }
138  break;
139 
140  case PCB_MARKER_T: // MARKER_PCB, a marker used to show something
141  curr_item->ClearFlags(); // Not reason to have flags set
142  exit = true;
143  break;
144 
145  default:
146  DisplayError( this,
148  "PCB_EDIT_FRAME::OnLeftClick() err: curr_item type %d m_Flags != 0 (%X)",
149  curr_item->Type(), curr_item->GetFlags() ) );
150  exit = true;
151  break;
152  }
153 
154  m_canvas->SetIgnoreMouseEvents( false );
155  m_canvas->CrossHairOn( aDC );
156 
157  if( exit )
158  return;
159  }
160  else if( !wxGetKeyState( WXK_SHIFT ) && !wxGetKeyState( WXK_ALT )
161  && !wxGetKeyState( WXK_CONTROL ) )
162  {
163  curr_item = PcbGeneralLocateAndDisplay();
164 
165  if( curr_item )
166  SendMessageToEESCHEMA( curr_item );
167  }
168  }
169 
170  if( curr_item ) // display netclass info for zones, tracks and pads
171  {
172  switch( curr_item->Type() )
173  {
174  case PCB_ZONE_AREA_T:
175  case PCB_TRACE_T:
176  case PCB_VIA_T:
177  case PCB_PAD_T:
179  ((BOARD_CONNECTED_ITEM*)curr_item)->GetNetClassName() );
180  break;
181 
182  default:
183  break;
184  }
185  }
186 
187  switch( GetToolId() )
188  {
189  case ID_MAIN_MENUBAR:
190  case ID_NO_TOOL_SELECTED:
191  case ID_ZOOM_SELECTION:
192  break;
193 
199  MuWaveCommand( aDC, aPosition );
200  break;
201 
203  {
204  int netcode = SelectHighLight( aDC );
205 
206  if( netcode < 0 )
207  SetMsgPanel( GetBoard() );
208  else
209  {
210  NETINFO_ITEM* net = GetBoard()->FindNet( netcode );
211 
212  if( net )
213  {
214  MSG_PANEL_ITEMS items;
215  net->GetMsgPanelInfo( items );
216  SetMsgPanel( items );
217  }
218  }
219  }
220  break;
221 
223  curr_item = PcbGeneralLocateAndDisplay();
224  Show_1_Ratsnest( curr_item, aDC );
225 
226  if( curr_item )
227  SendMessageToEESCHEMA( curr_item );
228 
229  break;
230 
231  case ID_PCB_TARGET_BUTT:
232  if( (curr_item == NULL) || (curr_item->GetFlags() == 0) )
233  {
234  SetCurItem( (BOARD_ITEM*) CreateTarget( aDC ) );
236  }
237  else if( curr_item->Type() == PCB_TARGET_T )
238  {
239  PlaceTarget( (PCB_TARGET*) curr_item, aDC );
240  }
241  else
242  {
243  DisplayError( this, wxT( "OnLeftClick err: not a PCB_TARGET_T" ) );
244  }
245 
246  break;
247 
248  case ID_PCB_CIRCLE_BUTT:
249  case ID_PCB_ARC_BUTT:
251  {
252  STROKE_T shape = S_SEGMENT;
253 
254  if( GetToolId() == ID_PCB_CIRCLE_BUTT )
255  shape = S_CIRCLE;
256 
257  if( GetToolId() == ID_PCB_ARC_BUTT )
258  shape = S_ARC;
259 
260  if( IsCopperLayer( GetActiveLayer() ) )
261  {
262  DisplayError( this, _( "Graphic not allowed on Copper layers" ) );
263  break;
264  }
265 
266  if( (curr_item == NULL) || (curr_item->GetFlags() == 0) )
267  {
268  curr_item = (BOARD_ITEM*) Begin_DrawSegment( NULL, shape, aDC );
269  SetCurItem( curr_item );
270  m_canvas->SetAutoPanRequest( true );
271  }
272  else if( curr_item
273  && (curr_item->Type() == PCB_LINE_T)
274  && curr_item->IsNew() )
275  {
276  curr_item = (BOARD_ITEM*) Begin_DrawSegment( (DRAWSEGMENT*) curr_item, shape, aDC );
277  SetCurItem( curr_item );
278  m_canvas->SetAutoPanRequest( true );
279  }
280  }
281  break;
282 
283  case ID_TRACK_BUTT:
284  if( !IsCopperLayer( GetActiveLayer() ) )
285  {
286  DisplayError( this, _( "Tracks on Copper layers only" ) );
287  break;
288  }
289 
290  if( (curr_item == NULL) || (curr_item->GetFlags() == 0) )
291  {
292  curr_item = (BOARD_ITEM*) Begin_Route( NULL, aDC );
293  SetCurItem( curr_item );
294 
295  if( curr_item )
296  m_canvas->SetAutoPanRequest( true );
297  }
298  else if( curr_item && curr_item->IsNew() )
299  {
300  TRACK* track = Begin_Route( (TRACK*) curr_item, aDC );
301 
302  // SetCurItem() must not write to the msg panel
303  // because a track info is displayed while moving the mouse cursor
304  if( track ) // A new segment was created
305  SetCurItem( curr_item = (BOARD_ITEM*) track, false );
306 
307  m_canvas->SetAutoPanRequest( true );
308  }
309 
310  break;
311 
312  case ID_PCB_ZONES_BUTT:
314  /* ZONE or KEEPOUT Tool is selected. Determine action for a left click:
315  * this can be start a new zone or select and move an existing zone outline corner
316  * if found near the mouse cursor
317  */
318  if( (curr_item == NULL) || (curr_item->GetFlags() == 0) )
319  {
320  if( Begin_Zone( aDC ) )
321  {
322  m_canvas->SetAutoPanRequest( true );
323  curr_item = GetBoard()->m_CurrentZoneContour;
324  GetScreen()->SetCurItem( curr_item );
325  }
326  }
327  else if( curr_item && (curr_item->Type() == PCB_ZONE_AREA_T) && curr_item->IsNew() )
328  { // Add a new corner to the current outline being created:
329  m_canvas->SetAutoPanRequest( true );
330  Begin_Zone( aDC );
331  curr_item = GetBoard()->m_CurrentZoneContour;
332  GetScreen()->SetCurItem( curr_item );
333  }
334  else
335  {
336  DisplayError( this, wxT( "PCB_EDIT_FRAME::OnLeftClick() zone internal error" ) );
337  }
338 
339  break;
340 
342  if( Edge_Cuts == GetActiveLayer() )
343  {
344  DisplayError( this,
345  _( "Texts not allowed on Edge Cut layer" ) );
346  break;
347  }
348 
349  if( (curr_item == NULL) || (curr_item->GetFlags() == 0) )
350  {
351  SetCurItem( CreateTextePcb( aDC ) );
353  m_canvas->SetAutoPanRequest( true );
354  }
355  else if( curr_item->Type() == PCB_TEXT_T )
356  {
357  Place_Texte_Pcb( (TEXTE_PCB*) curr_item, aDC );
358  m_canvas->SetAutoPanRequest( false );
359  }
360  else
361  {
362  DisplayError( this, wxT( "OnLeftClick err: not a PCB_TEXT_T" ) );
363  }
364 
365  break;
366 
367  case ID_PCB_MODULE_BUTT:
368  if( (curr_item == NULL) || (curr_item->GetFlags() == 0) )
369  {
371  MODULE* module = LoadModuleFromLibrary( wxEmptyString, Prj().PcbFootprintLibs() );
372 
373  SetCurItem( (BOARD_ITEM*) module );
374 
375  if( module )
376  {
378  AddModuleToBoard( module, aDC );
379  StartMoveModule( module, aDC, false );
380  }
381  }
382  else if( curr_item->Type() == PCB_MODULE_T )
383  {
384  PlaceModule( (MODULE*) curr_item, aDC );
385  m_canvas->SetAutoPanRequest( false );
386  }
387  else
388  {
389  DisplayError( this, wxT( "Internal err: Struct not PCB_MODULE_T" ) );
390  }
391 
392  break;
393 
396  {
397  DisplayError( this, _( "Dimension not allowed on Copper or Edge Cut layers" ) );
398  break;
399  }
400 
401  if( !curr_item || !curr_item->GetFlags() )
402  {
403  curr_item = (BOARD_ITEM*) EditDimension( NULL, aDC );
404  SetCurItem( curr_item );
405  m_canvas->SetAutoPanRequest( true );
406  }
407  else if( curr_item && (curr_item->Type() == PCB_DIMENSION_T) && curr_item->IsNew() )
408  {
409  curr_item = (BOARD_ITEM*) EditDimension( (DIMENSION*) curr_item, aDC );
410  SetCurItem( curr_item );
411  m_canvas->SetAutoPanRequest( true );
412  }
413  else
414  {
415  DisplayError( this,
416  wxT( "PCB_EDIT_FRAME::OnLeftClick() error item is not a DIMENSION" ) );
417  }
418 
419  break;
420 
422  if( !curr_item || !curr_item->GetFlags() )
423  {
424  curr_item = PcbGeneralLocateAndDisplay();
425 
426  if( curr_item && (curr_item->GetFlags() == 0) )
427  {
428  RemoveStruct( curr_item, aDC );
429  SetCurItem( curr_item = NULL );
430  }
431  }
432 
433  break;
434 
439  m_canvas->Refresh();
440  break;
441 
443  PCBNEW_CONTROL::SetGridOrigin( GetGalCanvas()->GetView(), this,
446  m_canvas->Refresh();
447  break;
448 
450  DisplayError( this, _( "Via Tool not available in Legacy Toolset" ) );
452  break;
453 
455  DisplayError( this, _( "Measurement Tool not available in Legacy Toolset" ) );
457  break;
458 
459  default:
460  DisplayError( this, wxT( "PCB_EDIT_FRAME::OnLeftClick() id error" ) );
462  break;
463  }
464 }
465 
466 
467 /* handle the double click on the mouse left button
468  */
469 void PCB_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition )
470 {
471  BOARD_ITEM* curr_item = GetCurItem();
472 
473  switch( GetToolId() )
474  {
475  case ID_NO_TOOL_SELECTED:
476  if( (curr_item == NULL) || (curr_item->GetFlags() == 0) )
477  {
478  curr_item = PcbGeneralLocateAndDisplay();
479  }
480 
481  if( (curr_item == NULL) || (curr_item->GetFlags() != 0) )
482  break;
483 
484  SendMessageToEESCHEMA( curr_item );
485 
486  // An item is found
487  SetCurItem( curr_item );
488 
489  switch( curr_item->Type() )
490  {
491  case PCB_TRACE_T:
492  case PCB_VIA_T:
493  if( curr_item->IsNew() )
494  {
495  if( End_Route( (TRACK*) curr_item, aDC ) )
496  m_canvas->SetAutoPanRequest( false );
497  }
498  else if( curr_item->GetFlags() == 0 )
499  {
500  Edit_TrackSegm_Width( aDC, (TRACK*) curr_item );
501  }
502 
503  break;
504 
505  case PCB_TEXT_T:
506  case PCB_PAD_T:
507  case PCB_MODULE_T:
508  case PCB_TARGET_T:
509  case PCB_DIMENSION_T:
510  case PCB_MODULE_TEXT_T:
511  OnEditItemRequest( aDC, curr_item );
513  break;
514 
515  case PCB_LINE_T:
516  OnEditItemRequest( aDC, curr_item );
517  break;
518 
519  case PCB_ZONE_AREA_T:
520  if( curr_item->GetFlags() )
521  break;
522 
523  OnEditItemRequest( aDC, curr_item );
524  break;
525 
526  default:
527  break;
528  }
529 
530  break; // end case 0
531 
532  case ID_TRACK_BUTT:
533  if( curr_item && curr_item->IsNew() )
534  {
535  if( End_Route( (TRACK*) curr_item, aDC ) )
536  m_canvas->SetAutoPanRequest( false );
537  }
538 
539  break;
540 
541  case ID_PCB_ZONES_BUTT:
543  if( End_Zone( aDC ) )
544  {
545  m_canvas->SetAutoPanRequest( false );
546  SetCurItem( NULL );
547  }
548 
549  break;
550 
552  case ID_PCB_ARC_BUTT:
553  case ID_PCB_CIRCLE_BUTT:
554  if( curr_item == NULL )
555  break;
556 
557  if( curr_item->Type() != PCB_LINE_T )
558  {
559  DisplayErrorMessage( this, "Item type is incorrect",
560  wxString::Format( "Selected item type is %d\n"
561  "Expected: %d", curr_item->Type(), PCB_LINE_T ) );
562  m_canvas->SetAutoPanRequest( false );
563  break;
564  }
565 
566  if( curr_item->IsNew() )
567  {
568  End_Edge( (DRAWSEGMENT*) curr_item, aDC );
569  m_canvas->SetAutoPanRequest( false );
570  SetCurItem( NULL );
571  }
572 
573  break;
574  }
575 }
576 
577 
579 {
580  switch( aItem->Type() )
581  {
582  case PCB_TRACE_T:
583  case PCB_VIA_T:
584  Edit_TrackSegm_Width( aDC, static_cast<TRACK*>( aItem ) );
585  break;
586 
587  case PCB_TEXT_T:
588  InstallTextPCBOptionsFrame( static_cast<TEXTE_PCB*>( aItem ), aDC );
589  break;
590 
591  case PCB_PAD_T:
592  InstallPadOptionsFrame( static_cast<D_PAD*>( aItem ) );
593  break;
594 
595  case PCB_MODULE_T:
596  InstallFootprintPropertiesDialog( static_cast<MODULE*>( aItem ), aDC );
597  break;
598 
599  case PCB_TARGET_T:
600  ShowTargetOptionsDialog( static_cast<PCB_TARGET*>( aItem ), aDC );
601  break;
602 
603  case PCB_DIMENSION_T:
604  ShowDimensionPropertyDialog( static_cast<DIMENSION*>( aItem ), aDC );
605  break;
606 
607  case PCB_MODULE_TEXT_T:
608  InstallTextModOptionsFrame( static_cast<TEXTE_MODULE*>( aItem ), aDC );
609  break;
610 
611  case PCB_LINE_T:
612  InstallGraphicItemPropertiesDialog( static_cast<DRAWSEGMENT*>( aItem ), aDC );
613  break;
614 
615  case PCB_ZONE_AREA_T:
616  Edit_Zone_Params( aDC, static_cast<ZONE_CONTAINER*>( aItem ) );
617  break;
618 
619  default:
620  break;
621  }
622 }
void Place_DrawItem(DRAWSEGMENT *drawitem, wxDC *DC)
Definition: editedge.cpp:74
KICAD_T Type() const
Function Type()
Definition: base_struct.h:209
void MuWaveCommand(wxDC *DC, const wxPoint &MousePos)
STATUS_FLAGS GetFlags() const
Definition: base_struct.h:266
void SetCurItem(BOARD_ITEM *aItem)
Function SetCurItem sets the currently selected object, m_CurrentItem.
Definition: pcb_screen.h:82
MODULE * LoadModuleFromLibrary(const wxString &aLibrary, bool aUseFootprintViewer=true)
Function LoadModuleFromLibrary opens a dialog to select a footprint.
TEXTE_PCB class definition.
bool End_Zone(wxDC *DC)
Function End_Zone terminates (if no DRC error ) the zone edge creation process.
void InstallTextPCBOptionsFrame(TEXTE_PCB *TextPCB, wxDC *DC)
Routine for main window class to launch text properties dialog.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Function DisplayErrorMessage displays an error message with aMessage.
Definition: confirm.cpp:199
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Update the board display after modifying it bu a python script (note: it is automatically called by a...
Definition: draw_panel.cpp:338
DRAWSEGMENT * Begin_DrawSegment(DRAWSEGMENT *Segment, STROKE_T shape, wxDC *DC)
Definition: editedge.cpp:249
This file is part of the common library.
bool IsNew() const
Definition: base_struct.h:227
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
void PlaceDimensionText(DIMENSION *aItem, wxDC *DC)
Definition: dimension.cpp:446
Class BOARD to handle a board.
void InstallGraphicItemPropertiesDialog(DRAWSEGMENT *aItem, wxDC *aDC)
void ShowDimensionPropertyDialog(DIMENSION *aDimension, wxDC *aDC)
Definition: dimension.cpp:354
const wxPoint & GetGridOrigin() const override
Function GetGridOrigin returns the absolute coordinates of the origin of the snap grid...
class ZONE_CONTAINER, a zone area
Definition: typeinfo.h:102
ZONE_CONTAINER * m_CurrentZoneContour
zone contour currently in progress
Definition: class_board.h:259
void SetCurItem(BOARD_ITEM *aItem, bool aDisplayInfo=true)
Function SetCurItem sets the currently selected item and displays it in the MsgPanel.
class TEXTE_PCB, text on a layer
Definition: typeinfo.h:92
BOARD * GetBoard() const
Classes to handle copper zones.
usual segment : line with rounded ends
class D_PAD, a pad in a footprint
Definition: typeinfo.h:90
DIMENSION * EditDimension(DIMENSION *aDimension, wxDC *aDC)
Definition: dimension.cpp:260
TRACK * Begin_Route(TRACK *aTrack, wxDC *aDC)
Function Begin_Route Starts a new track and/or establish of a new track point.
Definition: editrack.cpp:98
void MoveCursorToCrossHair()
Function MoveCursorToCrossHair warps the cursor to the current cross hair position.
Definition: draw_panel.cpp:360
bool SetCurrentNetClass(const wxString &aNetClassName)
Function SetCurrentNetClass Must be called after a netclass selection (or after a netclass parameter ...
void GetMsgPanelInfo(std::vector< MSG_PANEL_ITEM > &aList) override
Function GetMsgPanelInfo returns the information about the NETINFO_ITEM in aList to display in the me...
Class BOARD_CONNECTED_ITEM is a base class derived from BOARD_ITEM for items that can be connected an...
void RemoveStruct(BOARD_ITEM *Item, wxDC *DC)
Definition: edit.cpp:1294
bool End_Route(TRACK *aTrack, wxDC *aDC)
Function End_Route Terminates a track currently being created.
Definition: editrack.cpp:410
const wxPoint & GetAuxOrigin() const override
Function GetAuxOrigin returns the origin of the axis used for plotting and various exports...
void PlacePad(D_PAD *Pad, wxDC *DC)
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
void InstallFootprintPropertiesDialog(MODULE *Module, wxDC *DC)
void PlaceTarget(PCB_TARGET *aTarget, wxDC *DC)
void Place_Texte_Pcb(TEXTE_PCB *TextePcb, wxDC *DC)
PCB_TARGET * CreateTarget(wxDC *DC)
DIMENSION class definition.
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
class MODULE, a footprint
Definition: typeinfo.h:89
Footprint text class description.
void Show_1_Ratsnest(EDA_ITEM *item, wxDC *DC)
Function Show_1_Ratsnest draw ratsnest.
Definition: ratsnest.cpp:249
void InstallTextModOptionsFrame(TEXTE_MODULE *TextMod, wxDC *DC)
TEXTE_PCB * CreateTextePcb(wxDC *aDC, TEXTE_PCB *aText=NULL)
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Function SetMsgPanel clears the message panel and populates it with the contents of aList...
Definition: draw_frame.cpp:832
int Begin_Zone(wxDC *DC)
Function Begin_Zone either initializes the first segment of a new zone, or adds an intermediate segme...
void PlaceModule(MODULE *aModule, wxDC *aDC, bool aRecreateRatsnest=true)
Function PlaceModule places aModule at the current cursor position and updates module coordinates wit...
void OnLeftDClick(wxDC *DC, const wxPoint &MousePos) override
Arcs (with rounded ends)
void End_Move_Zone_Corner_Or_Outlines(wxDC *DC, ZONE_CONTAINER *zone_container)
Function End_Move_Zone_Corner_Or_Outlines Terminates a move corner in a zone outline, or a move zone outlines.
STROKE_T
Enum STROKE_T is the set of shapes for segments (graphic segments and tracks) which are often in the ...
void SetAutoPanRequest(bool aEnable)
bool PlaceDraggedOrMovedTrackSegment(TRACK *Track, wxDC *DC)
void CrossHairOff(wxDC *DC)
Definition: draw_panel.cpp:265
class DIMENSION, a dimension (graphic item)
Definition: typeinfo.h:100
void AddModuleToBoard(MODULE *module, wxDC *aDC=nullptr)
Adds the given module to the board.
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:101
void Edit_Zone_Params(wxDC *DC, ZONE_CONTAINER *zone_container)
Function Edit_Zone_Params Edit params (layer, clearance, ...) for a zone outline. ...
void PlaceTexteModule(TEXTE_MODULE *Text, wxDC *DC)
Definition: edtxtmod.cpp:227
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
virtual void SetNoToolSelected()
Select the ID_NO_TOOL_SELECTED id tool (Idle tool)
Definition: draw_frame.cpp:616
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:98
void SendMessageToEESCHEMA(BOARD_ITEM *objectToSync)
Function SendMessageToEESCHEMA sends a message to the schematic editor so that it may move its cursor...
Class NETINFO_ITEM handles the data for a net.
Definition: netinfo.h:69
void ShowTargetOptionsDialog(PCB_TARGET *aTarget, wxDC *DC)
Definition: target_edit.cpp:83
void CrossHairOn(wxDC *DC)
Definition: draw_panel.cpp:272
class MARKER_PCB, a marker used to show something
Definition: typeinfo.h:99
Class to handle a graphic segment.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
void OnEditItemRequest(wxDC *aDC, BOARD_ITEM *aItem) override
Function OnEditItemRequest Install the corresponding dialog editor for the given item.
void StartMoveModule(MODULE *aModule, wxDC *aDC, bool aDragConnectedTracks)
Function StartMoveModule Initialize a drag or move pad command.
int GetToolId() const
Definition: draw_frame.h:488
void SetIgnoreMouseEvents(bool aIgnore)
static bool SetGridOrigin(KIGFX::VIEW *aView, PCB_BASE_FRAME *aFrame, BOARD_ITEM *originViewItem, const VECTOR2D &aPoint)
NETINFO_ITEM * FindNet(int aNetcode) const
Function FindNet searches for a net with the given netcode.
PCB_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
Definition: msgpanel.h:102
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:265
#define UR_TRANSIENT
indicates the item is owned by the undo/redo stack
Definition: base_struct.h:137
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:895
PCB_TARGET class definition.
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
void InstallPadOptionsFrame(D_PAD *pad)
Module description (excepted pads)
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
Message panel definition file.
static bool SetDrillOrigin(KIGFX::VIEW *aView, PCB_BASE_FRAME *aFrame, BOARD_ITEM *aItem, const VECTOR2D &aPoint)
UI-level access (including undo) to setting the drill origin
BOARD_ITEM * GetCurItem()
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:185
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
virtual PCB_LAYER_ID GetActiveLayer() const
Function GetActiveLayer returns the active layer.
Class DIMENSION.
void OnLeftClick(wxDC *DC, const wxPoint &MousePos) override
int SelectHighLight(wxDC *DC)
Locate track or pad and highlight the corresponding net.
Definition: highlight.cpp:44
void Edit_TrackSegm_Width(wxDC *aDC, TRACK *aTrackItem)
Function Edit_TrackSegm_Width Modify one track segment width or one via diameter (using DRC control)...
void End_Edge(DRAWSEGMENT *Segment, wxDC *DC)
Definition: editedge.cpp:316
bool IsDragging() const
Definition: base_struct.h:230