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-2016 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 <wxPcbStruct.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_mire.h>
45 #include <project.h>
46 
47 #include <pcbnew.h>
48 #include <pcbnew_id.h>
49 #include <menus_helpers.h>
50 
51 
52 /* Handle the left button mouse click, when a tool is active
53  */
54 void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
55 {
56  BOARD_ITEM* curr_item = GetCurItem();
57  bool exit = false;
58  bool no_tool = GetToolId() == ID_NO_TOOL_SELECTED;
59 
60  if( no_tool || ( curr_item && curr_item->GetFlags() ) )
61  {
62  m_canvas->SetAutoPanRequest( false );
63 
64  if( curr_item && curr_item->GetFlags() ) // Command in progress
65  {
67  m_canvas->CrossHairOff( aDC );
68 
69  switch( curr_item->Type() )
70  {
71  case PCB_ZONE_AREA_T:
72  if( curr_item->IsNew() )
73  {
74  m_canvas->SetAutoPanRequest( true );
75  Begin_Zone( aDC );
76  }
77  else
78  {
79  End_Move_Zone_Corner_Or_Outlines( aDC, static_cast<ZONE_CONTAINER*>( curr_item ) );
80  }
81 
82  exit = true;
83  break;
84 
85  case PCB_TRACE_T:
86  case PCB_VIA_T:
87  if( curr_item->IsDragging() )
88  {
89  PlaceDraggedOrMovedTrackSegment( static_cast<TRACK*>( curr_item ), aDC );
90  exit = true;
91  }
92 
93  break;
94 
95  case PCB_TEXT_T:
96  Place_Texte_Pcb( static_cast<TEXTE_PCB*>( curr_item ), aDC );
97  exit = true;
98  break;
99 
100  case PCB_MODULE_TEXT_T:
101  PlaceTexteModule( static_cast<TEXTE_MODULE*>( curr_item ), aDC );
102  exit = true;
103  break;
104 
105  case PCB_PAD_T:
106  PlacePad( static_cast<D_PAD*>( curr_item ), aDC );
107  exit = true;
108  break;
109 
110  case PCB_MODULE_T:
111  PlaceModule( static_cast<MODULE*>( curr_item ), aDC );
112  exit = true;
113  break;
114 
115  case PCB_TARGET_T:
116  PlaceTarget( static_cast<PCB_TARGET*>( curr_item ), aDC );
117  exit = true;
118  break;
119 
120  case PCB_LINE_T:
121  if( no_tool ) // when no tools: existing item moving.
122  {
123  Place_DrawItem( static_cast<DRAWSEGMENT*>( curr_item ), aDC );
124  exit = true;
125  }
126 
127  break;
128 
129  case PCB_DIMENSION_T:
130  if( ! curr_item->IsNew() )
131  { // We are moving the text of an existing dimension. Place it
132  PlaceDimensionText( static_cast<DIMENSION*>( curr_item ), aDC );
133  exit = true;
134  }
135  break;
136 
137  case PCB_MARKER_T: // MARKER_PCB, a marker used to show something
138  curr_item->ClearFlags(); // Not reason to have flags set
139  exit = true;
140  break;
141 
142  default:
143  DisplayError( this,
145  "PCB_EDIT_FRAME::OnLeftClick() err: curr_item type %d m_Flags != 0 (%X)",
146  curr_item->Type(), curr_item->GetFlags() ) );
147  exit = true;
148  break;
149  }
150 
151  m_canvas->SetIgnoreMouseEvents( false );
152  m_canvas->CrossHairOn( aDC );
153 
154  if( exit )
155  return;
156  }
157  else if( !wxGetKeyState( WXK_SHIFT ) && !wxGetKeyState( WXK_ALT )
158  && !wxGetKeyState( WXK_CONTROL ) )
159  {
160  curr_item = PcbGeneralLocateAndDisplay();
161 
162  if( curr_item )
163  SendMessageToEESCHEMA( curr_item );
164  }
165  }
166 
167  if( curr_item ) // display netclass info for zones, tracks and pads
168  {
169  switch( curr_item->Type() )
170  {
171  case PCB_ZONE_AREA_T:
172  case PCB_TRACE_T:
173  case PCB_VIA_T:
174  case PCB_PAD_T:
176  ((BOARD_CONNECTED_ITEM*)curr_item)->GetNetClassName() );
177  break;
178 
179  default:
180  break;
181  }
182  }
183 
184  switch( GetToolId() )
185  {
186  case ID_MAIN_MENUBAR:
187  case ID_NO_TOOL_SELECTED:
188  case ID_ZOOM_SELECTION:
189  break;
190 
196  MuWaveCommand( aDC, aPosition );
197  break;
198 
200  {
201  int netcode = SelectHighLight( aDC );
202 
203  if( netcode < 0 )
204  SetMsgPanel( GetBoard() );
205  else
206  {
207  NETINFO_ITEM* net = GetBoard()->FindNet( netcode );
208 
209  if( net )
210  {
211  MSG_PANEL_ITEMS items;
212  net->GetMsgPanelInfo( items );
213  SetMsgPanel( items );
214  }
215  }
216  }
217  break;
218 
220  curr_item = PcbGeneralLocateAndDisplay();
221  Show_1_Ratsnest( curr_item, aDC );
222 
223  if( curr_item )
224  SendMessageToEESCHEMA( curr_item );
225 
226  break;
227 
228  case ID_PCB_MIRE_BUTT:
229  if( (curr_item == NULL) || (curr_item->GetFlags() == 0) )
230  {
231  SetCurItem( (BOARD_ITEM*) CreateTarget( aDC ) );
233  }
234  else if( curr_item->Type() == PCB_TARGET_T )
235  {
236  PlaceTarget( (PCB_TARGET*) curr_item, aDC );
237  }
238  else
239  {
240  DisplayError( this, wxT( "OnLeftClick err: not a PCB_TARGET_T" ) );
241  }
242 
243  break;
244 
245  case ID_PCB_CIRCLE_BUTT:
246  case ID_PCB_ARC_BUTT:
248  {
249  STROKE_T shape = S_SEGMENT;
250 
251  if( GetToolId() == ID_PCB_CIRCLE_BUTT )
252  shape = S_CIRCLE;
253 
254  if( GetToolId() == ID_PCB_ARC_BUTT )
255  shape = S_ARC;
256 
257  if( IsCopperLayer( GetActiveLayer() ) )
258  {
259  DisplayError( this, _( "Graphic not allowed on Copper layers" ) );
260  break;
261  }
262 
263  if( (curr_item == NULL) || (curr_item->GetFlags() == 0) )
264  {
265  curr_item = (BOARD_ITEM*) Begin_DrawSegment( NULL, shape, aDC );
266  SetCurItem( curr_item );
267  m_canvas->SetAutoPanRequest( true );
268  }
269  else if( curr_item
270  && (curr_item->Type() == PCB_LINE_T)
271  && curr_item->IsNew() )
272  {
273  curr_item = (BOARD_ITEM*) Begin_DrawSegment( (DRAWSEGMENT*) curr_item, shape, aDC );
274  SetCurItem( curr_item );
275  m_canvas->SetAutoPanRequest( true );
276  }
277  }
278  break;
279 
280  case ID_TRACK_BUTT:
281  if( !IsCopperLayer( GetActiveLayer() ) )
282  {
283  DisplayError( this, _( "Tracks on Copper layers only" ) );
284  break;
285  }
286 
287  if( (curr_item == NULL) || (curr_item->GetFlags() == 0) )
288  {
289  curr_item = (BOARD_ITEM*) Begin_Route( NULL, aDC );
290  SetCurItem( curr_item );
291 
292  if( curr_item )
293  m_canvas->SetAutoPanRequest( true );
294  }
295  else if( curr_item && curr_item->IsNew() )
296  {
297  TRACK* track = Begin_Route( (TRACK*) curr_item, aDC );
298 
299  // SetCurItem() must not write to the msg panel
300  // because a track info is displayed while moving the mouse cursor
301  if( track ) // A new segment was created
302  SetCurItem( curr_item = (BOARD_ITEM*) track, false );
303 
304  m_canvas->SetAutoPanRequest( true );
305  }
306 
307  break;
308 
309  case ID_PCB_ZONES_BUTT:
311  /* ZONE or KEEPOUT Tool is selected. Determine action for a left click:
312  * this can be start a new zone or select and move an existing zone outline corner
313  * if found near the mouse cursor
314  */
315  if( (curr_item == NULL) || (curr_item->GetFlags() == 0) )
316  {
317  if( Begin_Zone( aDC ) )
318  {
319  m_canvas->SetAutoPanRequest( true );
320  curr_item = GetBoard()->m_CurrentZoneContour;
321  GetScreen()->SetCurItem( curr_item );
322  }
323  }
324  else if( curr_item && (curr_item->Type() == PCB_ZONE_AREA_T) && curr_item->IsNew() )
325  { // Add a new corner to the current outline being created:
326  m_canvas->SetAutoPanRequest( true );
327  Begin_Zone( aDC );
328  curr_item = GetBoard()->m_CurrentZoneContour;
329  GetScreen()->SetCurItem( curr_item );
330  }
331  else
332  {
333  DisplayError( this, wxT( "PCB_EDIT_FRAME::OnLeftClick() zone internal error" ) );
334  }
335 
336  break;
337 
339  if( Edge_Cuts == GetActiveLayer() )
340  {
341  DisplayError( this,
342  _( "Texts not allowed on Edge Cut layer" ) );
343  break;
344  }
345 
346  if( (curr_item == NULL) || (curr_item->GetFlags() == 0) )
347  {
348  SetCurItem( CreateTextePcb( aDC ) );
350  m_canvas->SetAutoPanRequest( true );
351  }
352  else if( curr_item->Type() == PCB_TEXT_T )
353  {
354  Place_Texte_Pcb( (TEXTE_PCB*) curr_item, aDC );
355  m_canvas->SetAutoPanRequest( false );
356  }
357  else
358  {
359  DisplayError( this, wxT( "OnLeftClick err: not a PCB_TEXT_T" ) );
360  }
361 
362  break;
363 
364  case ID_PCB_MODULE_BUTT:
365  if( (curr_item == NULL) || (curr_item->GetFlags() == 0) )
366  {
368  curr_item = (BOARD_ITEM*) LoadModuleFromLibrary(
369  wxEmptyString, Prj().PcbFootprintLibs(), true, aDC );
370 
371  SetCurItem( curr_item );
372 
373  if( curr_item )
374  StartMoveModule( (MODULE*) curr_item, aDC, false );
375  }
376  else if( curr_item->Type() == PCB_MODULE_T )
377  {
378  PlaceModule( (MODULE*) curr_item, aDC );
379  m_canvas->SetAutoPanRequest( false );
380  }
381  else
382  {
383  DisplayError( this, wxT( "Internal err: Struct not PCB_MODULE_T" ) );
384  }
385 
386  break;
387 
390  {
391  DisplayError( this, _( "Dimension not allowed on Copper or Edge Cut layers" ) );
392  break;
393  }
394 
395  if( !curr_item || !curr_item->GetFlags() )
396  {
397  curr_item = (BOARD_ITEM*) EditDimension( NULL, aDC );
398  SetCurItem( curr_item );
399  m_canvas->SetAutoPanRequest( true );
400  }
401  else if( curr_item && (curr_item->Type() == PCB_DIMENSION_T) && curr_item->IsNew() )
402  {
403  curr_item = (BOARD_ITEM*) EditDimension( (DIMENSION*) curr_item, aDC );
404  SetCurItem( curr_item );
405  m_canvas->SetAutoPanRequest( true );
406  }
407  else
408  {
409  DisplayError( this,
410  wxT( "PCB_EDIT_FRAME::OnLeftClick() error item is not a DIMENSION" ) );
411  }
412 
413  break;
414 
416  if( !curr_item || !curr_item->GetFlags() )
417  {
418  curr_item = PcbGeneralLocateAndDisplay();
419 
420  if( curr_item && (curr_item->GetFlags() == 0) )
421  {
422  RemoveStruct( curr_item, aDC );
423  SetCurItem( curr_item = NULL );
424  }
425  }
426 
427  break;
428 
433  OnModify();
434  break;
435 
440  break;
441 
443  DisplayError( this, wxT( "This tool is not available in the legacy canvas" ) );
445  break;
446 
447  default:
448  DisplayError( this, wxT( "PCB_EDIT_FRAME::OnLeftClick() id error" ) );
450  break;
451  }
452 }
453 
454 
455 /* handle the double click on the mouse left button
456  */
457 void PCB_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition )
458 {
459  BOARD_ITEM* curr_item = GetCurItem();
460 
461  switch( GetToolId() )
462  {
463  case ID_NO_TOOL_SELECTED:
464  if( (curr_item == NULL) || (curr_item->GetFlags() == 0) )
465  {
466  curr_item = PcbGeneralLocateAndDisplay();
467  }
468 
469  if( (curr_item == NULL) || (curr_item->GetFlags() != 0) )
470  break;
471 
472  SendMessageToEESCHEMA( curr_item );
473 
474  // An item is found
475  SetCurItem( curr_item );
476 
477  switch( curr_item->Type() )
478  {
479  case PCB_TRACE_T:
480  case PCB_VIA_T:
481  if( curr_item->IsNew() )
482  {
483  if( End_Route( (TRACK*) curr_item, aDC ) )
484  m_canvas->SetAutoPanRequest( false );
485  }
486  else if( curr_item->GetFlags() == 0 )
487  {
488  Edit_TrackSegm_Width( aDC, (TRACK*) curr_item );
489  }
490 
491  break;
492 
493  case PCB_TEXT_T:
494  case PCB_PAD_T:
495  case PCB_MODULE_T:
496  case PCB_TARGET_T:
497  case PCB_DIMENSION_T:
498  case PCB_MODULE_TEXT_T:
499  OnEditItemRequest( aDC, curr_item );
501  break;
502 
503  case PCB_LINE_T:
504  OnEditItemRequest( aDC, curr_item );
505  break;
506 
507  case PCB_ZONE_AREA_T:
508  if( curr_item->GetFlags() )
509  break;
510 
511  OnEditItemRequest( aDC, curr_item );
512  break;
513 
514  default:
515  break;
516  }
517 
518  break; // end case 0
519 
520  case ID_TRACK_BUTT:
521  if( curr_item && curr_item->IsNew() )
522  {
523  if( End_Route( (TRACK*) curr_item, aDC ) )
524  m_canvas->SetAutoPanRequest( false );
525  }
526 
527  break;
528 
529  case ID_PCB_ZONES_BUTT:
531  if( End_Zone( aDC ) )
532  {
533  m_canvas->SetAutoPanRequest( false );
534  SetCurItem( NULL );
535  }
536 
537  break;
538 
540  case ID_PCB_ARC_BUTT:
541  case ID_PCB_CIRCLE_BUTT:
542  if( curr_item == NULL )
543  break;
544 
545  if( curr_item->Type() != PCB_LINE_T )
546  {
547  DisplayError( this, wxT( "curr_item Type error" ) );
548  m_canvas->SetAutoPanRequest( false );
549  break;
550  }
551 
552  if( curr_item->IsNew() )
553  {
554  End_Edge( (DRAWSEGMENT*) curr_item, aDC );
555  m_canvas->SetAutoPanRequest( false );
556  SetCurItem( NULL );
557  }
558 
559  break;
560  }
561 }
562 
563 
565 {
566  switch( aItem->Type() )
567  {
568  case PCB_TRACE_T:
569  case PCB_VIA_T:
570  Edit_TrackSegm_Width( aDC, static_cast<TRACK*>( aItem ) );
571  break;
572 
573  case PCB_TEXT_T:
574  InstallTextPCBOptionsFrame( static_cast<TEXTE_PCB*>( aItem ), aDC );
575  break;
576 
577  case PCB_PAD_T:
578  InstallPadOptionsFrame( static_cast<D_PAD*>( aItem ) );
579  break;
580 
581  case PCB_MODULE_T:
582  InstallModuleOptionsFrame( static_cast<MODULE*>( aItem ), aDC );
583  break;
584 
585  case PCB_TARGET_T:
586  ShowTargetOptionsDialog( static_cast<PCB_TARGET*>( aItem ), aDC );
587  break;
588 
589  case PCB_DIMENSION_T:
590  ShowDimensionPropertyDialog( static_cast<DIMENSION*>( aItem ), aDC );
591  break;
592 
593  case PCB_MODULE_TEXT_T:
594  InstallTextModOptionsFrame( static_cast<TEXTE_MODULE*>( aItem ), aDC );
595  break;
596 
597  case PCB_LINE_T:
598  InstallGraphicItemPropertiesDialog( static_cast<DRAWSEGMENT*>( aItem ), aDC );
599  break;
600 
601  case PCB_ZONE_AREA_T:
602  Edit_Zone_Params( aDC, static_cast<ZONE_CONTAINER*>( aItem ) );
603  break;
604 
605  default:
606  break;
607  }
608 }
void Place_DrawItem(DRAWSEGMENT *drawitem, wxDC *DC)
Definition: editedge.cpp:74
KICAD_T Type() const
Function Type()
Definition: base_struct.h:198
virtual void OnModify() override
Function OnModify must be called after a board change to set the modified flag.
Definition: pcbframe.cpp:996
void MuWaveCommand(wxDC *DC, const wxPoint &MousePos)
STATUS_FLAGS GetFlags() const
Definition: base_struct.h:255
void SetCurItem(BOARD_ITEM *aItem)
Function SetCurItem sets the currently selected object, m_CurrentItem.
virtual void SetToolID(int aId, int aCursor, const wxString &aToolMsg) override
Function SetToolID sets the tool command ID to aId and sets the cursor to aCursor.
PCB_TARGET class definition.
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.
PCB_EDIT_FRAME::OnResetModuleTextSizes PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar PCB_EDIT_FRAME::OnSelectOptionToolbar ID_PCB_MEASUREMENT_TOOL
Definition: pcbframe.cpp:262
void SetGridOrigin(const wxPoint &aPoint) override
DRAWSEGMENT * Begin_DrawSegment(DRAWSEGMENT *Segment, STROKE_T shape, wxDC *DC)
Definition: editedge.cpp:241
This file is part of the common library.
bool IsNew() const
Definition: base_struct.h:216
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:445
Class BOARD to handle a board.
void InstallGraphicItemPropertiesDialog(DRAWSEGMENT *aItem, wxDC *aDC)
void ShowDimensionPropertyDialog(DIMENSION *aDimension, wxDC *aDC)
Definition: dimension.cpp:353
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:114
ZONE_CONTAINER * m_CurrentZoneContour
zone contour currently in progress
Definition: class_board.h:254
void SetCurItem(BOARD_ITEM *aItem, bool aDisplayInfo=true)
Function SetCurItem sets the currently selected item and displays it in the MsgPanel.
MODULE * LoadModuleFromLibrary(const wxString &aLibrary, FP_LIB_TABLE *aTable, bool aUseFootprintViewer=true, wxDC *aDC=NULL)
Function LoadModuleFromLibrary opens a dialog to select a footprint, and loads it into current board...
Definition: loadcmp.cpp:163
class TEXTE_PCB, text on a layer
Definition: typeinfo.h:104
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:102
DIMENSION * EditDimension(DIMENSION *aDimension, wxDC *aDC)
Definition: dimension.cpp:259
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:348
bool SetCurrentNetClass(const wxString &aNetClassName)
Function SetCurrentNetClass Must be called after a netclass selection (or after a netclass parameter ...
Definition: pcbframe.cpp:1115
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:1274
bool End_Route(TRACK *aTrack, wxDC *aDC)
Function End_Route Terminates a track currently being created.
Definition: editrack.cpp:415
void PlacePad(D_PAD *Pad, wxDC *DC)
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:107
void PlaceTarget(PCB_TARGET *aTarget, wxDC *DC)
void PlaceModule(MODULE *aModule, wxDC *aDC, bool aDoNotRecreateRatsnest=false)
Function PlaceModule places aModule at the current cursor position and updates module coordinates wit...
Definition: modules.cpp:351
void DrawGridAxis(wxDC *aDC, GR_DRAWMODE aDrawMode, const wxPoint &aGridOrigin)
Function DrawGridAxis Draw on auxiliary axis, used in Pcbnew to show grid origin, when the grid origi...
Definition: draw_panel.cpp:834
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:101
Footprint text class description.
void Show_1_Ratsnest(EDA_ITEM *item, wxDC *DC)
Function Show_1_Ratsnest draw ratsnest.
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:754
int Begin_Zone(wxDC *DC)
Function Begin_Zone either initializes the first segment of a new zone, or adds an intermediate segme...
void OnLeftDClick(wxDC *DC, const wxPoint &MousePos) override
void InstallModuleOptionsFrame(MODULE *Module, wxDC *DC)
Definition: editmod.cpp:49
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:253
class DIMENSION, a dimension (graphic item)
Definition: typeinfo.h:112
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:113
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
VTBL_ENTRY FP_LIB_TABLE * PcbFootprintLibs(KIWAY &aKiway)
Return the table of footprint libraries.
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:105
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
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.
void ShowTargetOptionsDialog(PCB_TARGET *aTarget, wxDC *DC)
Definition: target_edit.cpp:83
void CrossHairOn(wxDC *DC)
Definition: draw_panel.cpp:260
class MARKER_PCB, a marker used to show something
Definition: typeinfo.h:111
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.
Definition: modules.cpp:98
int GetToolId() const
Definition: draw_frame.h:406
void SetIgnoreMouseEvents(bool aIgnore)
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
void DrawAuxiliaryAxis(wxDC *aDC, GR_DRAWMODE aDrawMode)
Function DrawAuxiliaryAxis Draw the Auxiliary Axis, used in Pcbnew which as origin coordinates for ge...
Definition: draw_panel.cpp:796
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:254
void SetAuxOrigin(const wxPoint &aPoint) override
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:108
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:103
Message panel definition file.
int GetDefaultCursor() const
Function GetDefaultCursor return the default cursor shape.
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:69
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:308
bool IsDragging() const
Definition: base_struct.h:219