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->GetEditFlags() ) )
64  {
65  m_canvas->SetAutoPanRequest( false );
66 
67  if( curr_item && curr_item->GetEditFlags() ) // 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->GetEditFlags() ) );
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( m_UserUnits, 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->GetEditFlags() == 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  wxLogDebug( 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( curr_item == NULL || curr_item->GetEditFlags() == 0 )
261  {
262  curr_item = (BOARD_ITEM*) Begin_DrawSegment( NULL, shape, aDC );
263  SetCurItem( curr_item );
264  m_canvas->SetAutoPanRequest( true );
265  }
266  else if( curr_item
267  && (curr_item->Type() == PCB_LINE_T)
268  && curr_item->IsNew() )
269  {
270  curr_item = (BOARD_ITEM*) Begin_DrawSegment( (DRAWSEGMENT*) curr_item, shape, aDC );
271  SetCurItem( curr_item );
272  m_canvas->SetAutoPanRequest( true );
273  }
274  }
275  break;
276 
277  case ID_TRACK_BUTT:
278  if( !IsCopperLayer( GetActiveLayer() ) )
279  {
280  DisplayError( this, _( "Tracks on Copper layers only" ) );
281  break;
282  }
283 
284  if( curr_item == NULL || curr_item->GetEditFlags() == 0 )
285  {
286  curr_item = (BOARD_ITEM*) Begin_Route( NULL, aDC );
287  SetCurItem( curr_item );
288 
289  if( curr_item )
290  m_canvas->SetAutoPanRequest( true );
291  }
292  else if( curr_item && curr_item->IsNew() )
293  {
294  TRACK* track = Begin_Route( (TRACK*) curr_item, aDC );
295 
296  // SetCurItem() must not write to the msg panel
297  // because a track info is displayed while moving the mouse cursor
298  if( track ) // A new segment was created
299  SetCurItem( curr_item = (BOARD_ITEM*) track, false );
300 
301  m_canvas->SetAutoPanRequest( true );
302  }
303 
304  break;
305 
306  case ID_PCB_ZONES_BUTT:
308  /* ZONE or KEEPOUT Tool is selected. Determine action for a left click:
309  * this can be start a new zone or select and move an existing zone outline corner
310  * if found near the mouse cursor
311  */
312  if( curr_item == NULL || curr_item->GetEditFlags() == 0 )
313  {
314  if( Begin_Zone( aDC ) )
315  {
316  m_canvas->SetAutoPanRequest( true );
317  curr_item = GetBoard()->m_CurrentZoneContour;
318  GetScreen()->SetCurItem( curr_item );
319  }
320  }
321  else if( curr_item && (curr_item->Type() == PCB_ZONE_AREA_T) && curr_item->IsNew() )
322  { // Add a new corner to the current outline being created:
323  m_canvas->SetAutoPanRequest( true );
324  Begin_Zone( aDC );
325  curr_item = GetBoard()->m_CurrentZoneContour;
326  GetScreen()->SetCurItem( curr_item );
327  }
328  else
329  {
330  wxLogDebug( wxT( "PCB_EDIT_FRAME::OnLeftClick() zone internal error" ) );
331  }
332 
333  break;
334 
336  if( Edge_Cuts == GetActiveLayer() )
337  {
338  DisplayError( this,
339  _( "Texts not allowed on Edge Cut layer" ) );
340  break;
341  }
342 
343  if( curr_item == NULL || curr_item->GetEditFlags() == 0 )
344  {
345  SetCurItem( CreateTextePcb( aDC ) );
347  m_canvas->SetAutoPanRequest( true );
348  }
349  else if( curr_item->Type() == PCB_TEXT_T )
350  {
351  Place_Texte_Pcb( (TEXTE_PCB*) curr_item, aDC );
352  m_canvas->SetAutoPanRequest( false );
353  }
354  else
355  {
356  wxLogDebug( wxT( "OnLeftClick err: not a PCB_TEXT_T" ) );
357  }
358 
359  break;
360 
361  case ID_PCB_MODULE_BUTT:
362  if( curr_item == NULL || curr_item->GetEditFlags() == 0 )
363  {
366 
367  SetCurItem( (BOARD_ITEM*) module );
368 
369  if( module )
370  {
372  module->SetLink( 0 );
373  AddModuleToBoard( module );
374 
375  if( aDC )
376  module->Draw( m_canvas, aDC, GR_OR );
377 
378  StartMoveModule( module, aDC, false );
379  }
380  }
381  else if( curr_item->Type() == PCB_MODULE_T )
382  {
383  PlaceModule( (MODULE*) curr_item, aDC );
384  m_canvas->SetAutoPanRequest( false );
385  }
386  else
387  {
388  wxLogDebug( wxT( "Internal err: Struct not PCB_MODULE_T" ) );
389  }
390 
391  break;
392 
395  {
396  DisplayError( this, _( "Dimension not allowed on Copper or Edge Cut layers" ) );
397  break;
398  }
399 
400  if( !curr_item || !curr_item->GetEditFlags() )
401  {
402  curr_item = (BOARD_ITEM*) EditDimension( NULL, aDC );
403  SetCurItem( curr_item );
404  m_canvas->SetAutoPanRequest( true );
405  }
406  else if( curr_item && (curr_item->Type() == PCB_DIMENSION_T) && curr_item->IsNew() )
407  {
408  curr_item = (BOARD_ITEM*) EditDimension( (DIMENSION*) curr_item, aDC );
409  SetCurItem( curr_item );
410  m_canvas->SetAutoPanRequest( true );
411  }
412  else
413  {
414  wxLogDebug( wxT( "PCB_EDIT_FRAME::OnLeftClick() error item is not a DIMENSION" ) );
415  }
416 
417  break;
418 
420  if( !curr_item || !curr_item->GetEditFlags() )
421  {
422  curr_item = PcbGeneralLocateAndDisplay();
423 
424  if( curr_item && curr_item->GetEditFlags() == 0 )
425  {
426  RemoveStruct( curr_item, aDC );
427  SetCurItem( curr_item = NULL );
428  }
429  }
430 
431  break;
432 
437  m_canvas->Refresh();
438  break;
439 
441  PCBNEW_CONTROL::SetGridOrigin( GetGalCanvas()->GetView(), this,
444  m_canvas->Refresh();
445  break;
446 
448  DisplayError( this, _( "Via Tool not available in Legacy Toolset" ) );
450  break;
451 
453  DisplayError( this, _( "Measurement Tool not available in Legacy Toolset" ) );
455  break;
456 
457  default:
458  wxLogDebug( wxT( "PCB_EDIT_FRAME::OnLeftClick() id error" ) );
460  break;
461  }
462 }
463 
464 
465 /* handle the double click on the mouse left button
466  */
467 void PCB_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition )
468 {
469  BOARD_ITEM* curr_item = GetCurItem();
470 
471  switch( GetToolId() )
472  {
473  case ID_NO_TOOL_SELECTED:
474  if( curr_item == NULL || curr_item->GetEditFlags() == 0 )
475  curr_item = PcbGeneralLocateAndDisplay();
476 
477  if( curr_item == NULL || curr_item->GetEditFlags() != 0 )
478  break;
479 
480  SendMessageToEESCHEMA( curr_item );
481 
482  // An item is found
483  SetCurItem( curr_item );
484 
485  switch( curr_item->Type() )
486  {
487  case PCB_TRACE_T:
488  case PCB_VIA_T:
489  if( curr_item->IsNew() )
490  {
491  if( End_Route( (TRACK*) curr_item, aDC ) )
492  m_canvas->SetAutoPanRequest( false );
493  }
494  else if( curr_item->GetEditFlags() == 0 )
495  {
496  Edit_TrackSegm_Width( aDC, (TRACK*) curr_item );
497  }
498 
499  break;
500 
501  case PCB_TEXT_T:
502  case PCB_PAD_T:
503  case PCB_MODULE_T:
504  case PCB_TARGET_T:
505  case PCB_DIMENSION_T:
506  case PCB_MODULE_TEXT_T:
507  OnEditItemRequest( aDC, curr_item );
509  break;
510 
511  case PCB_LINE_T:
512  OnEditItemRequest( aDC, curr_item );
513  break;
514 
515  case PCB_ZONE_AREA_T:
516  if( curr_item->GetEditFlags() )
517  break;
518 
519  OnEditItemRequest( aDC, curr_item );
520  break;
521 
522  default:
523  break;
524  }
525 
526  break; // end case 0
527 
528  case ID_TRACK_BUTT:
529  if( curr_item && curr_item->IsNew() )
530  {
531  if( End_Route( (TRACK*) curr_item, aDC ) )
532  m_canvas->SetAutoPanRequest( false );
533  }
534 
535  break;
536 
537  case ID_PCB_ZONES_BUTT:
539  if( End_Zone( aDC ) )
540  {
541  m_canvas->SetAutoPanRequest( false );
542  SetCurItem( NULL );
543  }
544 
545  break;
546 
548  case ID_PCB_ARC_BUTT:
549  case ID_PCB_CIRCLE_BUTT:
550  if( curr_item == NULL )
551  break;
552 
553  if( curr_item->Type() != PCB_LINE_T )
554  {
555  DisplayErrorMessage( this, "Item type is incorrect",
556  wxString::Format( "Selected item type is %d\n"
557  "Expected: %d", curr_item->Type(), PCB_LINE_T ) );
558  m_canvas->SetAutoPanRequest( false );
559  break;
560  }
561 
562  if( curr_item->IsNew() )
563  {
564  End_Edge( (DRAWSEGMENT*) curr_item, aDC );
565  m_canvas->SetAutoPanRequest( false );
566  SetCurItem( NULL );
567  }
568 
569  break;
570  }
571 }
572 
573 
575 {
576  switch( aItem->Type() )
577  {
578  case PCB_TRACE_T:
579  case PCB_VIA_T:
580  Edit_TrackSegm_Width( aDC, static_cast<TRACK*>( aItem ) );
581  break;
582 
583  case PCB_TEXT_T:
584  InstallTextOptionsFrame( aItem, aDC );
585  break;
586 
587  case PCB_PAD_T:
588  InstallPadOptionsFrame( static_cast<D_PAD*>( aItem ) );
589  break;
590 
591  case PCB_MODULE_T:
592  InstallFootprintPropertiesDialog( static_cast<MODULE*>( aItem ), aDC );
593  break;
594 
595  case PCB_TARGET_T:
596  ShowTargetOptionsDialog( static_cast<PCB_TARGET*>( aItem ), aDC );
597  break;
598 
599  case PCB_DIMENSION_T:
600  ShowDimensionPropertyDialog( static_cast<DIMENSION*>( aItem ), aDC );
601  break;
602 
603  case PCB_MODULE_TEXT_T:
604  InstallTextOptionsFrame( aItem, aDC );
605  break;
606 
607  case PCB_LINE_T:
609  break;
610 
611  case PCB_ZONE_AREA_T:
612  Edit_Zone_Params( aDC, static_cast<ZONE_CONTAINER*>( aItem ) );
613  break;
614 
615  default:
616  break;
617  }
618 }
void Place_DrawItem(DRAWSEGMENT *drawitem, wxDC *DC)
Definition: editedge.cpp:74
NETINFO_ITEM * FindNet(int aNetcode) const
Function FindNet searches for a net with the given netcode.
void MuWaveCommand(wxDC *DC, const wxPoint &MousePos)
void SetCurItem(BOARD_ITEM *aItem)
Function SetCurItem sets the currently selected object, m_CurrentItem.
Definition: pcb_screen.h:82
TEXTE_PCB class definition.
bool End_Zone(wxDC *DC)
Function End_Zone terminates (if no DRC error ) the zone edge creation process.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Function DisplayErrorMessage displays an error message with aMessage.
Definition: confirm.cpp:258
DRAWSEGMENT * Begin_DrawSegment(DRAWSEGMENT *Segment, STROKE_T shape, wxDC *DC)
Definition: editedge.cpp:238
virtual void AddModuleToBoard(MODULE *module)
Adds the given module to the board.
This file is part of the common library.
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:278
Class BOARD to handle a board.
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:931
void ShowDimensionPropertyDialog(DIMENSION *aDimension, wxDC *aDC)
Definition: dimension.cpp:186
void InstallGraphicItemPropertiesDialog(BOARD_ITEM *aItem)
const wxPoint & GetGridOrigin() const override
Return the absolute coordinates of the origin of the snap grid.
class ZONE_CONTAINER, a zone area
Definition: typeinfo.h:100
ZONE_CONTAINER * m_CurrentZoneContour
zone contour currently in progress
Definition: class_board.h:261
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
Classes to handle copper zones.
usual segment : line with rounded ends
class D_PAD, a pad in a footprint
Definition: typeinfo.h:90
virtual void SetAutoPanRequest(bool aEnable)=0
DIMENSION * EditDimension(DIMENSION *aDimension, wxDC *aDC)
Definition: dimension.cpp:97
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
virtual void MoveCursorToCrossHair()
Function MoveCursorToCrossHair warps the cursor to the current cross hair position.
bool SetCurrentNetClass(const wxString &aNetClassName)
Function SetCurrentNetClass Must be called after a netclass selection (or after a netclass parameter ...
virtual void Draw(EDA_DRAW_PANEL *panel, wxDC *DC, GR_DRAWMODE aDrawMode, const wxPoint &offset=ZeroOffset)=0
Function Draw BOARD_ITEMs have their own color information.
void InstallTextOptionsFrame(BOARD_ITEM *aText, wxDC *aDC)
Routine for main window class to launch text properties dialog.
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:1242
bool End_Route(TRACK *aTrack, wxDC *aDC)
Function End_Route Terminates a track currently being created.
Definition: editrack.cpp:413
const wxPoint & GetAuxOrigin() const override
Return the origin of the axis used for plotting and various exports.
bool IsDragging() const
Definition: base_struct.h:225
void PlacePad(D_PAD *Pad, wxDC *DC)
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
bool IsNew() const
Definition: base_struct.h:222
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)
virtual PCB_LAYER_ID GetActiveLayer() const
Function GetActiveLayer returns the active layer.
DIMENSION class definition.
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:268
TEXTE_PCB * CreateTextePcb(wxDC *aDC, TEXTE_PCB *aText=NULL)
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
int Begin_Zone(wxDC *DC)
Function Begin_Zone either initializes the first segment of a new zone, or adds an intermediate segme...
STATUS_FLAGS GetEditFlags() const
Definition: base_struct.h:263
void PlaceModule(MODULE *aModule, wxDC *aDC, bool aRecreateRatsnest=true)
Function PlaceModule places aModule at the current cursor position and updates module coordinates wit...
virtual void CrossHairOn(wxDC *DC=nullptr)
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,...
MODULE * SelectFootprintFromLibTree(LIB_ID aPreselect=LIB_ID(), bool aAllowBroswer=true)
Function SelectFootprintFromLibTree opens a dialog to select a footprint.
virtual void CrossHairOff(wxDC *DC=nullptr)
STROKE_T
Enum STROKE_T is the set of shapes for segments (graphic segments and tracks) which are often in the ...
PCB_EDIT_FRAME::OnSelectOptionToolbar ID_PCB_MEASUREMENT_TOOL
bool PlaceDraggedOrMovedTrackSegment(TRACK *Track, wxDC *DC)
class DIMENSION, a dimension (graphic item)
Definition: typeinfo.h:98
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:99
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:218
Definition: gr_basic.h:38
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
virtual void SetNoToolSelected()
Select the ID_NO_TOOL_SELECTED id tool (Idle tool)
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:128
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:65
void ShowTargetOptionsDialog(PCB_TARGET *aTarget, wxDC *DC)
Definition: target_edit.cpp:83
class MARKER_PCB, a marker used to show something
Definition: typeinfo.h:97
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.
void SetIgnoreMouseEvents(bool aIgnore)
static bool SetGridOrigin(KIGFX::VIEW *aView, PCB_BASE_FRAME *aFrame, BOARD_ITEM *originViewItem, const VECTOR2D &aPoint)
PCB_SCREEN * GetScreen() const override
Return 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:260
#define UR_TRANSIENT
indicates the item is owned by the undo/redo stack
Definition: base_struct.h:141
void GetMsgPanelInfo(EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList) override
Function GetMsgPanelInfo returns the information about the NETINFO_ITEM in aList to display in the me...
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 * GetBoard() const
BOARD_ITEM * PcbGeneralLocateAndDisplay(int aHotKeyCode=0)
Function PcbGeneralLocateAndDisplay searches for an item under the mouse cursor.
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL)
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()
EDA_UNITS_T m_UserUnits
Definition: draw_frame.h:125
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:244
Class DIMENSION.
void OnLeftClick(wxDC *DC, const wxPoint &MousePos) override
int GetToolId() const
Definition: draw_frame.h:524
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).
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:204
void End_Edge(DRAWSEGMENT *Segment, wxDC *DC)
Definition: editedge.cpp:299