KiCad PCB EDA Suite
modedit_onclick.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-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
29 #include <fctsys.h>
30 #include <class_drawpanel.h>
31 #include <confirm.h>
32 #include <wxPcbStruct.h>
33 #include <gr_basic.h>
34 
35 #include <class_board.h>
36 #include <class_module.h>
37 #include <class_edge_mod.h>
38 
39 #include <pcbnew.h>
40 #include <pcbnew_id.h>
41 #include <hotkeys.h>
42 #include <module_editor_frame.h>
44 #include <menus_helpers.h>
45 
46 
47 void FOOTPRINT_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
48 {
49  BOARD_ITEM* item = GetCurItem();
50 
51  m_canvas->CrossHairOff( DC );
52 
54  {
55  if( item && item->GetFlags() ) // Move item command in progress
56  {
57  switch( item->Type() )
58  {
59  case PCB_MODULE_TEXT_T:
60  PlaceTexteModule( static_cast<TEXTE_MODULE*>( item ), DC );
61  break;
62 
63  case PCB_MODULE_EDGE_T:
64  SaveCopyInUndoList( GetBoard()->m_Modules, UR_CHANGED );
65  Place_EdgeMod( static_cast<EDGE_MODULE*>( item ) );
66  break;
67 
68  case PCB_PAD_T:
69  PlacePad( static_cast<D_PAD*>( item ), DC );
70  break;
71 
72  default:
73  {
74  wxString msg;
75  msg.Printf( wxT( "WinEDA_ModEditFrame::OnLeftClick err:Struct %d, m_Flag %X" ),
76  item->Type(), item->GetFlags() );
77  DisplayError( this, msg );
78  item->ClearFlags();
79  break;
80  }
81  }
82  }
83 
84  else
85  {
86  if( !wxGetKeyState( WXK_SHIFT ) && !wxGetKeyState( WXK_ALT )
87  && !wxGetKeyState( WXK_CONTROL ) )
88  item = ModeditLocateAndDisplay();
89 
90  SetCurItem( item );
91  }
92  }
93 
94  item = GetCurItem();
95  bool no_item_edited = item == NULL || item->GetFlags() == 0;
96 
97  switch( GetToolId() )
98  {
100  break;
101 
103  case ID_MODEDIT_ARC_TOOL:
105  if( no_item_edited )
106  {
107  STROKE_T shape = S_SEGMENT;
108 
110  shape = S_CIRCLE;
111 
112  if( GetToolId() == ID_MODEDIT_ARC_TOOL )
113  shape = S_ARC;
114 
115  SetCurItem( Begin_Edge_Module( (EDGE_MODULE*) NULL, DC, shape ) );
116  }
117  else if( item->IsNew() )
118  {
119  if( ( (EDGE_MODULE*) item )->GetShape() == S_CIRCLE )
120  {
121  End_Edge_Module( (EDGE_MODULE*) item );
122  SetCurItem( NULL );
123  m_canvas->Refresh();
124  }
125  else if( ( (EDGE_MODULE*) item )->GetShape() == S_ARC )
126  {
127  End_Edge_Module( (EDGE_MODULE*) item );
128  SetCurItem( NULL );
129  m_canvas->Refresh();
130  }
131  else if( ( (EDGE_MODULE*) item )->GetShape() == S_SEGMENT )
132  {
134  }
135  else
136  {
137  wxMessageBox( wxT( "ProcessCommand error: unknown shape" ) );
138  }
139  }
140  break;
141 
143  if( ! no_item_edited ) // Item in edit, cannot delete it
144  break;
145 
146  item = ModeditLocateAndDisplay();
147 
148  if( item && item->Type() != PCB_MODULE_T ) // Cannot delete the module itself
149  {
150  SaveCopyInUndoList( GetBoard()->m_Modules, UR_CHANGED );
151  RemoveStruct( item );
152  SetCurItem( NULL );
153  }
154 
155  break;
156 
158  {
159  MODULE* module = GetBoard()->m_Modules;
160 
161  if( module == NULL // No module loaded
162  || (module->GetFlags() != 0) )
163  break;
164 
165  SaveCopyInUndoList( module, UR_CHANGED );
166 
167  // set the new relative internal local coordinates of footprint items
168  wxPoint moveVector = module->GetPosition() - GetCrossHairPosition();
169  module->MoveAnchorPosition( moveVector );
170 
171  // Usually, we do not need to change twice the anchor position,
172  // so deselect the active tool
174  SetCurItem( NULL );
175  m_canvas->Refresh();
176  }
177  break;
178 
183  GetScreen()->SetModify();
184  break;
185 
187  if( GetBoard()->m_Modules == NULL )
188  break;
189 
190  SaveCopyInUndoList( GetBoard()->m_Modules, UR_CHANGED );
191  CreateTextModule( GetBoard()->m_Modules, DC );
192  break;
193 
194  case ID_MODEDIT_PAD_TOOL:
195  if( GetBoard()->m_Modules )
196  {
197  SaveCopyInUndoList( GetBoard()->m_Modules, UR_CHANGED );
198  AddPad( GetBoard()->m_Modules, true );
199  }
200 
201  break;
202 
204  DisplayError( this, wxT( "Unsupported tool in legacy canvas" ) );
206  break;
207 
208  default:
209  DisplayError( this, wxT( "FOOTPRINT_EDIT_FRAME::ProcessCommand error" ) );
211  }
212 
213  m_canvas->CrossHairOn( DC );
214 }
215 
216 
217 bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
218 {
219  BOARD_ITEM* item = GetCurItem();
220  wxString msg;
221  bool blockActive = !GetScreen()->m_BlockLocate.IsIdle();
222 
223  // Simple location of elements where possible.
224  if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
225  {
227  }
228 
229  // End command in progress.
230  if( GetToolId() != ID_NO_TOOL_SELECTED )
231  {
232  if( item && item->GetFlags() )
233  AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel" ),
234  KiBitmap( cancel_xpm ) );
235  else
236  AddMenuItem( PopMenu, ID_POPUP_CLOSE_CURRENT_TOOL, _( "End Tool" ),
237  KiBitmap( cursor_xpm ) );
238 
239  PopMenu->AppendSeparator();
240  }
241  else
242  {
243  if( (item && item->GetFlags()) || blockActive )
244  {
245  if( blockActive ) // Put block commands in list
246  {
248  _( "Cancel Block" ), KiBitmap( cancel_xpm ) );
250  _( "Zoom Block (drag middle mouse)" ),
251  KiBitmap( zoom_area_xpm ) );
252  PopMenu->AppendSeparator();
254  _( "Place Block" ), KiBitmap( checked_ok_xpm ) );
256  _( "Copy Block (shift + drag mouse)" ),
257  KiBitmap( copy_xpm ) );
259  _( "Mirror Block (alt + drag mouse)" ),
260  KiBitmap( mirror_h_xpm ) );
262  _( "Rotate Block (ctrl + drag mouse)" ),
263  KiBitmap( rotate_ccw_xpm ) );
265  _( "Delete Block (shift+ctrl + drag mouse)" ),
266  KiBitmap( delete_xpm ) );
267 
268  msg = AddHotkeyName( _("Move Block Exactly" ),
271  msg, KiBitmap( move_xpm ) );
272  }
273  else
274  {
276  _( "Cancel" ), KiBitmap( cancel_xpm ) );
277  }
278 
279  PopMenu->AppendSeparator();
280  }
281  }
282 
283  if( blockActive )
284  return true;
285 
286  if( item )
287  {
288  STATUS_FLAGS flags = item->GetFlags();
289  switch( item->Type() )
290  {
291  case PCB_MODULE_T:
292  {
293  wxMenu* transform_choice = new wxMenu;
294  AddMenuItem( transform_choice, ID_MODEDIT_MODULE_ROTATE, _( "Rotate" ),
295  KiBitmap( rotate_ccw_xpm ) );
296  AddMenuItem( transform_choice, ID_MODEDIT_MODULE_MIRROR, _( "Mirror" ),
297  KiBitmap( mirror_footprint_axisY_xpm ) );
298  AddMenuItem( transform_choice, ID_MODEDIT_MODULE_MOVE_EXACT, _( "Move Exactly" ),
299  KiBitmap( move_module_xpm ) );
300 
301  msg = AddHotkeyName( _( "Edit Footprint" ), g_Module_Editor_Hokeys_Descr, HK_EDIT_ITEM );
302  AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_MODULE_PRMS, msg, KiBitmap( edit_module_xpm ) );
303  AddMenuItem( PopMenu, transform_choice, ID_MODEDIT_TRANSFORM_MODULE,
304  _( "Transform Footprint" ), KiBitmap( edit_xpm ) );
305 
306  break;
307  }
308 
309  case PCB_PAD_T:
310  if( !flags )
311  {
312  msg = AddHotkeyName( _("Move Pad" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM );
313  AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_PAD_REQUEST, msg, KiBitmap( move_pad_xpm ) );
314  }
315 
316  msg = AddHotkeyName( _("Edit Pad" ), g_Module_Editor_Hokeys_Descr, HK_EDIT_ITEM );
317  AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_PAD, msg, KiBitmap( options_pad_xpm ) );
319  _( "Copy Pad Settings" ), KiBitmap( copy_pad_settings_xpm ) );
321  _( "Apply Pad Settings" ), KiBitmap( apply_pad_settings_xpm ) );
322  msg = AddHotkeyName( _("Delete Pad" ), g_Module_Editor_Hokeys_Descr, HK_DELETE );
323  AddMenuItem( PopMenu, ID_POPUP_PCB_DELETE_PAD, msg, KiBitmap( delete_pad_xpm ) );
324 
325  msg = AddHotkeyName( _( "Duplicate Pad" ), g_Module_Editor_Hokeys_Descr, HK_DUPLICATE_ITEM );
326  AddMenuItem( PopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, msg, KiBitmap( duplicate_pad_xpm ) );
327 
328  msg = AddHotkeyName( _("Move Pad Exactly" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM_EXACT );
329  AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT, msg, KiBitmap( move_pad_xpm ) );
330 
331  msg = AddHotkeyName( _("Create Pad Array" ), g_Module_Editor_Hokeys_Descr, HK_CREATE_ARRAY );
332  AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY, msg, KiBitmap( array_pad_xpm ) );
333 
334 
335  if( !flags )
336  {
337  PopMenu->AppendSeparator();
339  _( "Push Pad Settings" ), KiBitmap( push_pad_settings_xpm ) );
340  }
341 
342  break;
343 
344  case PCB_MODULE_TEXT_T:
345  if( !flags )
346  {
347  msg = AddHotkeyName( _("Move Text" ), g_Module_Editor_Hokeys_Descr,
348  HK_MOVE_ITEM );
350  KiBitmap( move_field_xpm ) );
351  }
352 
353  msg = AddHotkeyName( _("Rotate Text" ), g_Module_Editor_Hokeys_Descr,
354  HK_ROTATE_ITEM );
355  AddMenuItem( PopMenu, ID_POPUP_PCB_ROTATE_TEXTMODULE, msg, KiBitmap( rotate_cw_xpm ) );
356 
357  {
358  // Do not show option to replicate value or reference fields
359  // (there can only be one of each)
360 
361  const MODULE* module = static_cast<MODULE*>( item->GetParent() );
362  const TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item );
363 
364  if( &module->Reference() != text && &module->Value() != text )
365  {
366  msg = AddHotkeyName( _( "Duplicate Text" ),
369  msg, KiBitmap( duplicate_text_xpm ) );
370 
371  msg = AddHotkeyName( _("Create Text Array" ),
374  msg, KiBitmap( array_text_xpm ) );
375  }
376  }
377 
378  msg = AddHotkeyName( _("Move Text Exactly" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM_EXACT );
379  AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT, msg, KiBitmap( move_field_xpm ) );
380 
381  if( !flags )
382  {
383  msg = AddHotkeyName( _("Edit Text" ), g_Module_Editor_Hokeys_Descr,
384  HK_EDIT_ITEM );
385  AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TEXTMODULE, msg, KiBitmap( edit_text_xpm ) );
386 
387  if( ( static_cast<TEXTE_MODULE*>( item ) )->GetType() == TEXTE_MODULE::TEXT_is_DIVERS )
388  {
389  msg = AddHotkeyName( _("Delete Text" ), g_Module_Editor_Hokeys_Descr,
390  HK_DELETE );
392  KiBitmap( delete_text_xpm ) );
393  }
394  }
395  break;
396 
397  case PCB_MODULE_EDGE_T:
398  {
399  if( (flags & IS_NEW) )
400  AddMenuItem( PopMenu, ID_POPUP_PCB_STOP_CURRENT_DRAWING, _( "End edge" ),
401  KiBitmap( checked_ok_xpm ) );
402 
403  if( !flags )
404  {
405  msg = AddHotkeyName( _("Move Edge" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM );
406  AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EDGE, msg, KiBitmap( move_line_xpm ) );
407  }
408 
409  msg = AddHotkeyName( _( "Duplicate Edge" ), g_Module_Editor_Hokeys_Descr, HK_DUPLICATE_ITEM );
410  AddMenuItem( PopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, msg, KiBitmap( duplicate_line_xpm ) );
411 
412  msg = AddHotkeyName( _("Move Edge Exactly" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM_EXACT );
413  AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT, msg, KiBitmap( move_line_xpm ) );
414 
415  msg = AddHotkeyName( _("Create Edge Array" ), g_Module_Editor_Hokeys_Descr, HK_CREATE_ARRAY );
416  AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY, msg, KiBitmap( array_line_xpm ) );
417 
418  if( ( flags & (IS_NEW | IS_MOVED) ) == IS_MOVED )
419  AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_EDGE, _( "Place edge" ),
420  KiBitmap( checked_ok_xpm ) );
421 
424  msg, KiBitmap( options_segment_xpm ) );
425 
426  msg = AddHotkeyName( _("Delete Edge" ), g_Module_Editor_Hokeys_Descr, HK_DELETE );
427  AddMenuItem( PopMenu, ID_POPUP_PCB_DELETE_EDGE, msg, KiBitmap( delete_xpm ) );
428 
429  wxMenu* edit_global_mnu = new wxMenu;
430  AddMenuItem( PopMenu, edit_global_mnu, ID_POPUP_MODEDIT_GLOBAL_EDIT_EDGE,
431  _( "Global Changes" ), KiBitmap( edit_xpm ) );
433  _( "Change Body Items Width" ), KiBitmap( width_segment_xpm ) );
435  _( "Change Body Items Layer" ), KiBitmap( select_layer_pair_xpm ) );
436  }
437  break;
438 
439  case PCB_LINE_T:
440  case PCB_TEXT_T:
441  case PCB_VIA_T:
442  case PCB_TRACE_T:
443  case PCB_ZONE_T:
444  case PCB_MARKER_T:
445  case PCB_DIMENSION_T:
446  case PCB_TARGET_T:
447  msg.Printf( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: Unexpected DrawType %d" ),
448  item->Type() );
449  DisplayError( this, msg );
450  break;
451 
452  case SCREEN_T:
453  case TYPE_NOT_INIT:
454  case PCB_T:
455  msg.Printf( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: illegal DrawType %d" ),
456  item->Type() );
457  DisplayError( this, msg );
458  break;
459 
460  default:
461  msg.Printf( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: unknown DrawType %d" ),
462  item->Type() );
463  DisplayError( this, msg );
464  break;
465  }
466  PopMenu->AppendSeparator();
467  }
468 
469  if( ( GetToolId() == ID_MODEDIT_LINE_TOOL ) ||
471  ( GetToolId() == ID_MODEDIT_ARC_TOOL ) )
472  {
473  AddMenuItem( PopMenu, ID_POPUP_MODEDIT_ENTER_EDGE_WIDTH, _("Set Line Width" ),
474  KiBitmap( width_segment_xpm ) );
475  PopMenu->AppendSeparator();
476  }
477 
478  return true;
479 }
480 
481 /*
482  * Called on a mouse left button double click
483  */
484 void FOOTPRINT_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
485 {
486  BOARD_ITEM* item = GetCurItem();
487 
488  switch( GetToolId() )
489  {
490  case ID_NO_TOOL_SELECTED:
491  if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
492  {
493  item = ModeditLocateAndDisplay();
494  }
495 
496  if( ( item == NULL ) || ( item->GetFlags() != 0 ) )
497  break;
498 
499  // Item found
500  SetCurItem( item );
501  OnEditItemRequest( DC, item );
502  break; // end case 0
503 
505  {
506  if( item && item->IsNew() )
507  {
508  End_Edge_Module( (EDGE_MODULE*) item );
509  SetCurItem( NULL );
510  m_canvas->Refresh();
511  }
512 
513  break;
514  }
515 
516  default:
517  break;
518  }
519 }
520 
521 
523 {
524  switch( aItem->Type() )
525  {
526  case PCB_PAD_T:
527  InstallPadOptionsFrame( static_cast<D_PAD*>( aItem ) );
529  break;
530 
531  case PCB_MODULE_T:
532  {
533  DIALOG_MODULE_MODULE_EDITOR dialog( this, static_cast<MODULE*>( aItem ) );
534  dialog.ShowModal();
537  m_canvas->Refresh();
538  }
539  break;
540 
541  case PCB_MODULE_TEXT_T:
542  InstallTextModOptionsFrame( static_cast<TEXTE_MODULE*>( aItem ), aDC );
544  break;
545 
546  case PCB_MODULE_EDGE_T :
548  InstallFootprintBodyItemPropertiesDlg( static_cast<EDGE_MODULE*>( aItem ) );
549  m_canvas->Refresh();
550  break;
551 
552  default:
553  break;
554  }
555 }
void OnLeftDClick(wxDC *DC, const wxPoint &MousePos) override
Function OnLeftDClick handles the double click in the footprint editor: If the double clicked item is...
BOARD_ITEM * ModeditLocateAndDisplay(int aHotKeyCode=0)
Definition: modedit.cpp:82
KICAD_T Type() const
Function Type()
Definition: base_struct.h:198
BOARD_ITEM_CONTAINER * GetParent() const
Definition of class FOOTPRINT_EDIT_FRAME.
STATUS_FLAGS GetFlags() const
Definition: base_struct.h:255
TEXTE_MODULE & Reference()
Definition: class_module.h:463
BLOCK_SELECTOR m_BlockLocate
Block description for block commands.
Definition: typeinfo.h:97
void SetGridOrigin(const wxPoint &aPoint) override
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Definition: draw_panel.cpp:326
void RemoveStruct(EDA_ITEM *Item)
Definition: editmod.cpp:99
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...
wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
Function AddMenuItem is an inline helper function to create and insert a menu item with an icon into ...
Definition: bitmap.cpp:55
Class BOARD to handle a board.
const wxPoint & GetPosition() const override
Definition: class_module.h:155
const wxPoint & GetGridOrigin() const override
Function GetGridOrigin returns the absolute coordinates of the origin of the snap grid...
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:104
BOARD * GetBoard() const
usual segment : line with rounded ends
class D_PAD, a pad in a footprint
Definition: typeinfo.h:102
TEXTE_MODULE * CreateTextModule(MODULE *aModule, wxDC *aDC)
Creates a new text for the footprint.
Definition: edtxtmod.cpp:66
void MoveCursorToCrossHair()
Function MoveCursorToCrossHair warps the cursor to the current cross hair position.
Definition: draw_panel.cpp:348
void MoveAnchorPosition(const wxPoint &aMoveVector)
Function MoveAnchorPosition Move the reference point of the footprint It looks like a move footprint:...
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:106
void PlacePad(D_PAD *Pad, wxDC *DC)
not really an item, used to identify a screen
Definition: typeinfo.h:98
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:107
Pcbnew hotkeys.
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
#define IS_NEW
New item, just created.
Definition: base_struct.h:113
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
class MODULE, a footprint
Definition: typeinfo.h:101
BOARD_ITEM * GetCurItem() const
Function GetCurItem returns the currently selected BOARD_ITEM, overriding BASE_SCREEN::GetCurItem().
void InstallTextModOptionsFrame(TEXTE_MODULE *TextMod, wxDC *DC)
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:462
Arcs (with rounded ends)
unsigned STATUS_FLAGS
Definition: base_struct.h:144
STROKE_T
Enum STROKE_T is the set of shapes for segments (graphic segments and tracks) which are often in the ...
EDGE_MODULE * Begin_Edge_Module(EDGE_MODULE *Edge, wxDC *DC, STROKE_T type_edge)
Function Begin_Edge_Module creates a new edge item (line, arc ..).
Definition: edgemod.cpp:322
class SEGZONE, a segment used to fill a zone area (segment on a copper layer)
Definition: typeinfo.h:109
void AddPad(MODULE *Module, bool draw)
void SaveCopyInUndoList(BOARD_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, const wxPoint &aTransformPoint=wxPoint(0, 0)) override
Function SaveCopyInUndoList Creates a new entry in undo list of commands.
Definition: undo_redo.cpp:172
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 PlaceTexteModule(TEXTE_MODULE *Text, wxDC *DC)
Definition: edtxtmod.cpp:227
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:105
bool IsIdle() const
Function IsIdle returns true if there is currently no block operation in progress.
virtual void SetNoToolSelected()
Select the ID_NO_TOOL_SELECTED id tool (Idle tool)
Definition: draw_frame.cpp:560
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
void CrossHairOn(wxDC *DC)
Definition: draw_panel.cpp:260
struct EDA_HOTKEY_CONFIG g_Module_Editor_Hokeys_Descr[]
class MARKER_PCB, a marker used to show something
Definition: typeinfo.h:111
wxString AddHotkeyName(const wxString &aText, EDA_HOTKEY **aList, int aCommandId, HOTKEY_ACTION_TYPE aShortCutType)
Function AddHotkeyName Add the key name from the Command id value ( m_Idcommand member value) ...
void Place_EdgeMod(EDGE_MODULE *drawitem)
Function to place a graphic item type EDGE_MODULE currently moved.
Definition: edgemod.cpp:76
DLIST< MODULE > m_Modules
Definition: class_board.h:245
int GetToolId() const
Definition: draw_frame.h:419
PCB_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
void End_Edge_Module(EDGE_MODULE *Edge)
Function End_Edge_Module terminates a move or create edge function.
Definition: edgemod.cpp:419
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:254
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)
void OnEditItemRequest(wxDC *aDC, BOARD_ITEM *aItem) override
>
EDGE_MODULE class definition.
class DRAWSEGMENT, a segment not on copper layers
Definition: typeinfo.h:103
BOARD_ITEM * GetCurItem()
void InstallFootprintBodyItemPropertiesDlg(EDGE_MODULE *aItem)
Function InstallFootprintBodyItemPropertiesDlg Install a dialog to edit a graphic item of a footprint...
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...
void OnLeftClick(wxDC *DC, const wxPoint &MousePos) override
#define IS_MOVED
Item being moved.
Definition: base_struct.h:112
bool OnRightClick(const wxPoint &MousePos, wxMenu *PopMenu) override
Function OnRightClick handles the right mouse click in the footprint editor: Create the pop up menu A...