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( 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->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( (curr_item == NULL) || (curr_item->GetFlags() == 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->GetFlags() == 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->GetFlags() == 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  DisplayError( this, 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->GetFlags() == 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  DisplayError( this, 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->GetFlags() == 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  DisplayError( this, 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->GetFlags() )
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  DisplayError( this,
415  wxT( "PCB_EDIT_FRAME::OnLeftClick() error item is not a DIMENSION" ) );
416  }
417 
418  break;
419 
421  if( !curr_item || !curr_item->GetFlags() )
422  {
423  curr_item = PcbGeneralLocateAndDisplay();
424 
425  if( curr_item && (curr_item->GetFlags() == 0) )
426  {
427  RemoveStruct( curr_item, aDC );
428  SetCurItem( curr_item = NULL );
429  }
430  }
431 
432  break;
433 
438  m_canvas->Refresh();
439  break;
440 
442  PCBNEW_CONTROL::SetGridOrigin( GetGalCanvas()->GetView(), this,
445  m_canvas->Refresh();
446  break;
447 
449  DisplayError( this, _( "Via Tool not available in Legacy Toolset" ) );
451  break;
452 
454  DisplayError( this, _( "Measurement Tool not available in Legacy Toolset" ) );
456  break;
457 
458  default:
459  DisplayError( this, wxT( "PCB_EDIT_FRAME::OnLeftClick() id error" ) );
461  break;
462  }
463 }
464 
465 
466 /* handle the double click on the mouse left button
467  */
468 void PCB_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition )
469 {
470  BOARD_ITEM* curr_item = GetCurItem();
471 
472  switch( GetToolId() )
473  {
474  case ID_NO_TOOL_SELECTED:
475  if( (curr_item == NULL) || (curr_item->GetFlags() == 0) )
476  {
477  curr_item = PcbGeneralLocateAndDisplay();
478  }
479 
480  if( (curr_item == NULL) || (curr_item->GetFlags() != 0) )
481  break;
482 
483  SendMessageToEESCHEMA( curr_item );
484 
485  // An item is found
486  SetCurItem( curr_item );
487 
488  switch( curr_item->Type() )
489  {
490  case PCB_TRACE_T:
491  case PCB_VIA_T:
492  if( curr_item->IsNew() )
493  {
494  if( End_Route( (TRACK*) curr_item, aDC ) )
495  m_canvas->SetAutoPanRequest( false );
496  }
497  else if( curr_item->GetFlags() == 0 )
498  {
499  Edit_TrackSegm_Width( aDC, (TRACK*) curr_item );
500  }
501 
502  break;
503 
504  case PCB_TEXT_T:
505  case PCB_PAD_T:
506  case PCB_MODULE_T:
507  case PCB_TARGET_T:
508  case PCB_DIMENSION_T:
509  case PCB_MODULE_TEXT_T:
510  OnEditItemRequest( aDC, curr_item );
512  break;
513 
514  case PCB_LINE_T:
515  OnEditItemRequest( aDC, curr_item );
516  break;
517 
518  case PCB_ZONE_AREA_T:
519  if( curr_item->GetFlags() )
520  break;
521 
522  OnEditItemRequest( aDC, curr_item );
523  break;
524 
525  default:
526  break;
527  }
528 
529  break; // end case 0
530 
531  case ID_TRACK_BUTT:
532  if( curr_item && curr_item->IsNew() )
533  {
534  if( End_Route( (TRACK*) curr_item, aDC ) )
535  m_canvas->SetAutoPanRequest( false );
536  }
537 
538  break;
539 
540  case ID_PCB_ZONES_BUTT:
542  if( End_Zone( aDC ) )
543  {
544  m_canvas->SetAutoPanRequest( false );
545  SetCurItem( NULL );
546  }
547 
548  break;
549 
551  case ID_PCB_ARC_BUTT:
552  case ID_PCB_CIRCLE_BUTT:
553  if( curr_item == NULL )
554  break;
555 
556  if( curr_item->Type() != PCB_LINE_T )
557  {
558  DisplayErrorMessage( this, "Item type is incorrect",
559  wxString::Format( "Selected item type is %d\n"
560  "Expected: %d", curr_item->Type(), PCB_LINE_T ) );
561  m_canvas->SetAutoPanRequest( false );
562  break;
563  }
564 
565  if( curr_item->IsNew() )
566  {
567  End_Edge( (DRAWSEGMENT*) curr_item, aDC );
568  m_canvas->SetAutoPanRequest( false );
569  SetCurItem( NULL );
570  }
571 
572  break;
573  }
574 }
575 
576 
578 {
579  switch( aItem->Type() )
580  {
581  case PCB_TRACE_T:
582  case PCB_VIA_T:
583  Edit_TrackSegm_Width( aDC, static_cast<TRACK*>( aItem ) );
584  break;
585 
586  case PCB_TEXT_T:
587  InstallTextOptionsFrame( aItem, aDC );
588  break;
589 
590  case PCB_PAD_T:
591  InstallPadOptionsFrame( static_cast<D_PAD*>( aItem ) );
592  break;
593 
594  case PCB_MODULE_T:
595  InstallFootprintPropertiesDialog( static_cast<MODULE*>( aItem ), aDC );
596  break;
597 
598  case PCB_TARGET_T:
599  ShowTargetOptionsDialog( static_cast<PCB_TARGET*>( aItem ), aDC );
600  break;
601 
602  case PCB_DIMENSION_T:
603  ShowDimensionPropertyDialog( static_cast<DIMENSION*>( aItem ), aDC );
604  break;
605 
606  case PCB_MODULE_TEXT_T:
607  InstallTextOptionsFrame( aItem, aDC );
608  break;
609 
610  case PCB_LINE_T:
612  break;
613 
614  case PCB_ZONE_AREA_T:
615  Edit_Zone_Params( aDC, static_cast<ZONE_CONTAINER*>( aItem ) );
616  break;
617 
618  default:
619  break;
620  }
621 }
void Place_DrawItem(DRAWSEGMENT *drawitem, wxDC *DC)
Definition: editedge.cpp:74
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
void MuWaveCommand(wxDC *DC, const wxPoint &MousePos)
STATUS_FLAGS GetFlags() const
Definition: base_struct.h:258
void SetCurItem(BOARD_ITEM *aItem)
Function SetCurItem sets the currently selected object, m_CurrentItem.
Definition: pcb_screen.h:82
MODULE * SelectFootprintFromLibTree(bool aUseFootprintViewer=true)
Function SelectFootprintFromLibTree 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 DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Function DisplayErrorMessage displays an error message with aMessage.
Definition: confirm.cpp:259
DRAWSEGMENT * Begin_DrawSegment(DRAWSEGMENT *Segment, STROKE_T shape, wxDC *DC)
Definition: editedge.cpp:243
virtual void AddModuleToBoard(MODULE *module)
Adds the given module to the board.
This file is part of the common library.
bool IsNew() const
Definition: base_struct.h:219
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
void Draw(EDA_DRAW_PANEL *aPanel, wxDC *aDC, GR_DRAWMODE aDrawMode, const wxPoint &aOffset=ZeroOffset) override
Function Draw draws the footprint to the aDC.
Class BOARD to handle a board.
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:102
ZONE_CONTAINER * m_CurrentZoneContour
zone contour currently in progress
Definition: class_board.h:263
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: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 ...
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:1263
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.
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.
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:255
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.
void SetLink(timestamp_t aLink)
Definition: class_module.h:578
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...
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, or a move zone outlines.
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 ...
void SetAutoPanRequest(bool aEnable)
bool PlaceDraggedOrMovedTrackSegment(TRACK *Track, wxDC *DC)
class DIMENSION, a dimension (graphic item)
Definition: typeinfo.h:100
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:213
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:123
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
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:519
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
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:257
#define UR_TRANSIENT
indicates the item is owned by the undo/redo stack
Definition: base_struct.h:142
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...
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:928
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.
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:120
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:245
wxPoint GetCrossHairPosition(bool aInvertY=false) const
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:304
bool IsDragging() const
Definition: base_struct.h:222