KiCad PCB EDA Suite
footprint_editor_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 <gr_basic.h>
33 
34 #include <class_board.h>
35 #include <class_module.h>
36 #include <class_edge_mod.h>
37 #include <origin_viewitem.h>
38 
39 #include <pcbnew.h>
40 #include <pcbnew_id.h>
41 #include <tools/pcbnew_control.h>
42 #include <hotkeys.h>
43 #include <footprint_edit_frame.h>
45 #include <menus_helpers.h>
46 
47 
48 void FOOTPRINT_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
49 {
50  BOARD_ITEM* item = GetCurItem();
51 
52  m_canvas->CrossHairOff( DC );
53 
55  {
56  if( item && item->GetFlags() ) // Move item command in progress
57  {
58  switch( item->Type() )
59  {
60  case PCB_MODULE_TEXT_T:
61  PlaceTexteModule( static_cast<TEXTE_MODULE*>( item ), DC );
62  break;
63 
64  case PCB_MODULE_EDGE_T:
65  SaveCopyInUndoList( GetBoard()->m_Modules, UR_CHANGED );
66  Place_EdgeMod( static_cast<EDGE_MODULE*>( item ) );
67  break;
68 
69  case PCB_PAD_T:
70  PlacePad( static_cast<D_PAD*>( item ), DC );
71  break;
72 
73  default:
74  wxLogDebug( wxT( "WinEDA_ModEditFrame::OnLeftClick err:Struct %d, m_Flag %X" ),
75  item->Type(), item->GetFlags() );
76  item->ClearFlags();
77  }
78  }
79 
80  else
81  {
82  if( !wxGetKeyState( WXK_SHIFT ) && !wxGetKeyState( WXK_ALT )
83  && !wxGetKeyState( WXK_CONTROL ) )
84  item = ModeditLocateAndDisplay();
85 
86  SetCurItem( item );
87  }
88  }
89 
90  item = GetCurItem();
91  bool no_item_edited = item == NULL || item->GetFlags() == 0;
92 
93  switch( GetToolId() )
94  {
96  break;
97 
101  if( no_item_edited )
102  {
103  STROKE_T shape = S_SEGMENT;
104 
106  shape = S_CIRCLE;
107 
108  if( GetToolId() == ID_MODEDIT_ARC_TOOL )
109  shape = S_ARC;
110 
111  SetCurItem( Begin_Edge_Module( (EDGE_MODULE*) NULL, DC, shape ) );
112  }
113  else if( item->IsNew() )
114  {
115  if( ( (EDGE_MODULE*) item )->GetShape() == S_CIRCLE )
116  {
117  End_Edge_Module( (EDGE_MODULE*) item );
118  SetCurItem( NULL );
119  m_canvas->Refresh();
120  }
121  else if( ( (EDGE_MODULE*) item )->GetShape() == S_ARC )
122  {
123  End_Edge_Module( (EDGE_MODULE*) item );
124  SetCurItem( NULL );
125  m_canvas->Refresh();
126  }
127  else if( ( (EDGE_MODULE*) item )->GetShape() == S_SEGMENT )
128  {
130  }
131  else
132  wxLogDebug( wxT( "ProcessCommand error: unknown shape" ) );
133  }
134  break;
135 
137  if( ! no_item_edited ) // Item in edit, cannot delete it
138  break;
139 
140  item = ModeditLocateAndDisplay();
141 
142  if( item && item->Type() != PCB_MODULE_T ) // Cannot delete the module itself
143  {
144  SaveCopyInUndoList( GetBoard()->m_Modules, UR_CHANGED );
145  RemoveStruct( item );
146  SetCurItem( NULL );
147  }
148 
149  break;
150 
152  {
153  MODULE* module = GetBoard()->m_Modules;
154 
155  if( module == NULL // No module loaded
156  || (module->GetFlags() != 0) )
157  break;
158 
159  SaveCopyInUndoList( module, UR_CHANGED );
160 
161  // set the new relative internal local coordinates of footprint items
162  wxPoint moveVector = module->GetPosition() - GetCrossHairPosition();
163  module->MoveAnchorPosition( moveVector );
164 
165  // Usually, we do not need to change twice the anchor position,
166  // so deselect the active tool
168  SetCurItem( NULL );
169  m_canvas->Refresh();
170  }
171  break;
172 
174  PCBNEW_CONTROL::SetGridOrigin( GetGalCanvas()->GetView(), this,
177  m_canvas->Refresh();
178  break;
179 
181  if( GetBoard()->m_Modules == NULL )
182  break;
183 
184  SaveCopyInUndoList( GetBoard()->m_Modules, UR_CHANGED );
185  CreateTextModule( GetBoard()->m_Modules, DC );
186  break;
187 
188  case ID_MODEDIT_PAD_TOOL:
189  if( GetBoard()->m_Modules )
190  {
191  SaveCopyInUndoList( GetBoard()->m_Modules, UR_CHANGED );
192  AddPad( GetBoard()->m_Modules, true );
193  }
194 
195  break;
196 
198  DisplayError( this, _( "Measurement Tool not available in Legacy Toolset" ) );
200  break;
201 
202  default:
203  wxLogDebug( wxT( "FOOTPRINT_EDIT_FRAME::ProcessCommand error" ) );
205  }
206 
207  m_canvas->CrossHairOn( DC );
208 }
209 
210 
211 bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
212 {
213  BOARD_ITEM* item = GetCurItem();
214  wxString msg;
215  bool blockActive = !GetScreen()->m_BlockLocate.IsIdle();
216 
217  // Simple location of elements where possible.
218  if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
219  {
221  }
222 
223  // End command in progress.
224  if( GetToolId() != ID_NO_TOOL_SELECTED )
225  {
226  if( item && item->GetFlags() )
227  AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel" ),
228  KiBitmap( cancel_xpm ) );
229  else
230  AddMenuItem( PopMenu, ID_POPUP_CLOSE_CURRENT_TOOL, _( "End Tool" ),
231  KiBitmap( cursor_xpm ) );
232 
233  PopMenu->AppendSeparator();
234  }
235  else
236  {
237  if( (item && item->GetFlags()) || blockActive )
238  {
239  if( blockActive ) // Put block commands in list
240  {
242  _( "Cancel Block" ), KiBitmap( cancel_xpm ) );
244  _( "Zoom Block" ),
245  KiBitmap( zoom_area_xpm ) );
246  PopMenu->AppendSeparator();
248  _( "Place Block" ), KiBitmap( checked_ok_xpm ) );
250  _( "Duplicate Block (shift + drag mouse)" ),
251  KiBitmap( copy_xpm ) );
253  _( "Mirror Block (alt + drag mouse)" ),
254  KiBitmap( mirror_h_xpm ) );
256  _( "Rotate Block (ctrl + drag mouse)" ),
257  KiBitmap( rotate_ccw_xpm ) );
259  _( "Delete Block (shift+ctrl + drag mouse)" ),
260  KiBitmap( delete_xpm ) );
261 
262  msg = AddHotkeyName( _("Move Block Exactly..." ),
265  msg, KiBitmap( move_xpm ) );
266  }
267  else
268  {
270  _( "Cancel" ), KiBitmap( cancel_xpm ) );
271  }
272 
273  PopMenu->AppendSeparator();
274  }
275  }
276 
277  if( blockActive )
278  return true;
279 
280  if( item )
281  {
282  STATUS_FLAGS flags = item->GetFlags();
283  switch( item->Type() )
284  {
285  case PCB_MODULE_T:
286  {
287  wxMenu* transform_choice = new wxMenu;
288  AddMenuItem( transform_choice, ID_MODEDIT_MODULE_ROTATE, _( "Rotate Counterclockwise" ),
289  KiBitmap( rotate_ccw_xpm ) );
290  AddMenuItem( transform_choice, ID_MODEDIT_MODULE_MIRROR, _( "Mirror" ),
291  KiBitmap( mirror_h_xpm ) );
292  AddMenuItem( transform_choice, ID_MODEDIT_MODULE_MOVE_EXACT, _( "Move Exactly..." ),
293  KiBitmap( move_exactly_xpm ) );
294 
295  msg = AddHotkeyName( _( "Edit Footprint" ), g_Module_Editor_Hotkeys_Descr, HK_EDIT_ITEM );
296  AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_MODULE_PRMS, msg, KiBitmap( edit_module_xpm ) );
297  AddMenuItem( PopMenu, transform_choice, ID_MODEDIT_TRANSFORM_MODULE,
298  _( "Transform Footprint" ), KiBitmap( edit_xpm ) );
299 
300  break;
301  }
302 
303  case PCB_PAD_T:
304  if( !flags )
305  {
306  msg = AddHotkeyName( _("Move Pad" ), g_Module_Editor_Hotkeys_Descr, HK_MOVE_ITEM );
307  AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_PAD_REQUEST, msg, KiBitmap( move_pad_xpm ) );
308  }
309 
310  msg = AddHotkeyName( _("Edit Pad..." ), g_Module_Editor_Hotkeys_Descr, HK_EDIT_ITEM );
311  AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_PAD, msg, KiBitmap( options_pad_xpm ) );
313  _( "Copy Pad Properties" ), KiBitmap( copy_pad_settings_xpm ) );
315  _( "Paste Pad Properties" ), KiBitmap( apply_pad_settings_xpm ) );
316  msg = AddHotkeyName( _("Delete Pad" ), g_Module_Editor_Hotkeys_Descr, HK_DELETE );
317  AddMenuItem( PopMenu, ID_POPUP_PCB_DELETE_PAD, msg, KiBitmap( delete_pad_xpm ) );
318 
319  msg = AddHotkeyName( _( "Duplicate Pad" ), g_Module_Editor_Hotkeys_Descr, HK_DUPLICATE_ITEM );
320  AddMenuItem( PopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, msg, KiBitmap( duplicate_xpm ) );
321 
322  msg = AddHotkeyName( _("Move Pad Exactly..." ), g_Module_Editor_Hotkeys_Descr, HK_MOVE_ITEM_EXACT );
323  AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT, msg, KiBitmap( move_pad_xpm ) );
324 
325  msg = AddHotkeyName( _("Create Pad Array..." ), g_Module_Editor_Hotkeys_Descr, HK_CREATE_ARRAY );
326  AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY, msg, KiBitmap( array_xpm ) );
327 
328 
329  if( !flags )
330  {
331  PopMenu->AppendSeparator();
333  _( "Push Pad Properties..." ), KiBitmap( push_pad_settings_xpm ) );
334  }
335 
336  break;
337 
338  case PCB_MODULE_TEXT_T:
339  if( !flags )
340  {
341  msg = AddHotkeyName( _("Move" ), g_Module_Editor_Hotkeys_Descr,
342  HK_MOVE_ITEM );
344  KiBitmap( move_xpm ) );
345  }
346 
347  msg = AddHotkeyName( _("Rotate Clockwise" ), g_Module_Editor_Hotkeys_Descr,
348  HK_ROTATE_ITEM );
349  AddMenuItem( PopMenu, ID_POPUP_PCB_ROTATE_TEXTMODULE, msg, KiBitmap( rotate_cw_xpm ) );
350 
351  {
352  // Do not show option to replicate value or reference fields
353  // (there can only be one of each)
354 
355  const MODULE* module = static_cast<MODULE*>( item->GetParent() );
356  const TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item );
357 
358  if( &module->Reference() != text && &module->Value() != text )
359  {
360  msg = AddHotkeyName( _( "Duplicate" ),
363  msg, KiBitmap( duplicate_xpm ) );
364 
365  msg = AddHotkeyName( _("Create Array..." ),
368  msg, KiBitmap( array_xpm ) );
369  }
370  }
371 
372  msg = AddHotkeyName( _("Move Exactly..." ), g_Module_Editor_Hotkeys_Descr, HK_MOVE_ITEM_EXACT );
373  AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT, msg, KiBitmap( move_exactly_xpm ) );
374 
375  if( !flags )
376  {
377  msg = AddHotkeyName( _("Edit..." ), g_Module_Editor_Hotkeys_Descr,
378  HK_EDIT_ITEM );
379  AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TEXTMODULE, msg, KiBitmap( edit_text_xpm ) );
380 
381  if( ( static_cast<TEXTE_MODULE*>( item ) )->GetType() == TEXTE_MODULE::TEXT_is_DIVERS )
382  {
383  msg = AddHotkeyName( _("Delete" ), g_Module_Editor_Hotkeys_Descr,
384  HK_DELETE );
386  KiBitmap( delete_xpm ) );
387  }
388  }
389  break;
390 
391  case PCB_MODULE_EDGE_T:
392  {
393  if( (flags & IS_NEW) )
394  AddMenuItem( PopMenu, ID_POPUP_PCB_STOP_CURRENT_DRAWING, _( "End Edge" ),
395  KiBitmap( checked_ok_xpm ) );
396 
397  if( !flags )
398  {
400  AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EDGE, msg, KiBitmap( move_xpm ) );
401 
403  AddMenuItem( PopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, msg, KiBitmap( duplicate_xpm ) );
404 
405  msg = AddHotkeyName( _("Move Exactly..." ), g_Module_Editor_Hotkeys_Descr, HK_MOVE_ITEM_EXACT );
406  AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT, msg, KiBitmap( move_exactly_xpm ) );
407 
408  msg = AddHotkeyName( _("Create Array..." ), g_Module_Editor_Hotkeys_Descr, HK_CREATE_ARRAY );
409  AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY, msg, KiBitmap( array_xpm ) );
410  }
411 
412  if( ( flags & (IS_NEW | IS_MOVED) ) == IS_MOVED )
413  AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_EDGE, _( "Place Edge" ),
414  KiBitmap( checked_ok_xpm ) );
415 
416  if( !flags )
417  {
420  msg, KiBitmap( options_segment_xpm ) );
421 
422  msg = AddHotkeyName( _("Delete" ), g_Module_Editor_Hotkeys_Descr, HK_DELETE );
423  AddMenuItem( PopMenu, ID_POPUP_PCB_DELETE_EDGE, msg, KiBitmap( delete_xpm ) );
424 
425  wxMenu* edit_global_mnu = new wxMenu;
426  AddMenuItem( PopMenu, edit_global_mnu, ID_POPUP_MODEDIT_GLOBAL_EDIT_EDGE,
427  _( "Global Changes" ), KiBitmap( edit_xpm ) );
429  _( "Change Body Items Width" ), KiBitmap( width_segment_xpm ) );
431  _( "Change Body Items Layer..." ), KiBitmap( select_layer_pair_xpm ) );
432  }
433  }
434  break;
435 
436  case PCB_LINE_T:
437  case PCB_TEXT_T:
438  case PCB_VIA_T:
439  case PCB_TRACE_T:
440  case PCB_SEGZONE_T:
441  case PCB_MARKER_T:
442  case PCB_DIMENSION_T:
443  case PCB_TARGET_T:
444  wxLogDebug( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: Unexpected DrawType %d" ),
445  item->Type() );
446  break;
447 
448  case SCREEN_T:
449  case TYPE_NOT_INIT:
450  case PCB_T:
451  wxLogDebug( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: illegal DrawType %d" ),
452  item->Type() );
453  break;
454 
455  default:
456  wxLogDebug( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: unknown DrawType %d" ),
457  item->Type() );
458  break;
459  }
460  PopMenu->AppendSeparator();
461  }
462 
463  return true;
464 }
465 
466 /*
467  * Called on a mouse left button double click
468  */
469 void FOOTPRINT_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
470 {
471  BOARD_ITEM* item = GetCurItem();
472 
473  switch( GetToolId() )
474  {
475  case ID_NO_TOOL_SELECTED:
476  if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
477  {
478  item = ModeditLocateAndDisplay();
479  }
480 
481  if( ( item == NULL ) || ( item->GetFlags() != 0 ) )
482  break;
483 
484  // Item found
485  SetCurItem( item );
486  OnEditItemRequest( DC, item );
487  break; // end case 0
488 
490  {
491  if( item && item->IsNew() )
492  {
493  End_Edge_Module( (EDGE_MODULE*) item );
494  SetCurItem( NULL );
495  m_canvas->Refresh();
496  }
497 
498  break;
499  }
500 
501  default:
502  break;
503  }
504 }
505 
506 
508 {
509  switch( aItem->Type() )
510  {
511  case PCB_PAD_T:
512  InstallPadOptionsFrame( static_cast<D_PAD*>( aItem ) );
514  break;
515 
516  case PCB_MODULE_T:
517  editFootprintProperties( (MODULE*) aItem );
519  m_canvas->Refresh();
520  break;
521 
522  case PCB_MODULE_TEXT_T:
523  InstallTextOptionsFrame( aItem, aDC );
524  break;
525 
526  case PCB_MODULE_EDGE_T :
528  break;
529 
530  default:
531  break;
532  }
533 }
void OnLeftDClick(wxDC *DC, const wxPoint &MousePos) override
Handle the double click in the footprint editor.
BOARD_ITEM * ModeditLocateAndDisplay(int aHotKeyCode=0)
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
BOARD_ITEM_CONTAINER * GetParent() const
STATUS_FLAGS GetFlags() const
Definition: base_struct.h:258
TEXTE_MODULE & Reference()
Definition: class_module.h:512
BLOCK_SELECTOR m_BlockLocate
Block description for block commands.
Definition: base_screen.h:214
Definition: typeinfo.h:85
void RemoveStruct(EDA_ITEM *Item)
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...
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:223
struct EDA_HOTKEY_CONFIG g_Module_Editor_Hotkeys_Descr[]
Class BOARD to handle a board.
void InstallGraphicItemPropertiesDialog(BOARD_ITEM *aItem)
const wxPoint & GetGridOrigin() const override
Return 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:92
BOARD * GetBoard() const
usual segment : line with rounded ends
class D_PAD, a pad in a footprint
Definition: typeinfo.h:90
TEXTE_MODULE * CreateTextModule(MODULE *aModule, wxDC *aDC)
Creates a new text for the footprint.
Definition: edtxtmod.cpp:66
virtual void MoveCursorToCrossHair()
Function MoveCursorToCrossHair warps the cursor to the current cross hair position.
void MoveAnchorPosition(const wxPoint &aMoveVector)
Function MoveAnchorPosition Move the reference point of the footprint It looks like a move footprint:...
void InstallTextOptionsFrame(BOARD_ITEM *aText, wxDC *aDC)
Routine for main window class to launch text properties dialog.
Definition of class FOOTPRINT_EDIT_FRAME.
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
void PlacePad(D_PAD *Pad, wxDC *DC)
not really an item, used to identify a screen
Definition: typeinfo.h:86
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
Pcbnew hotkeys.
#define IS_NEW
New item, just created.
Definition: base_struct.h:114
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
class MODULE, a footprint
Definition: typeinfo.h:89
void editFootprintProperties(MODULE *aFootprint)
Run the Footprint Properties dialog and handle changes made in it.
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:511
virtual void CrossHairOn(wxDC *DC=nullptr)
Arcs (with rounded ends)
unsigned STATUS_FLAGS
Definition: base_struct.h:147
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 ...
EDGE_MODULE * Begin_Edge_Module(EDGE_MODULE *Edge, wxDC *DC, STROKE_T type_edge)
Creates a new edge item (line, arc ..).
Definition: edgemod.cpp:294
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:202
class DIMENSION, a dimension (graphic item)
Definition: typeinfo.h:100
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:101
void PlaceTexteModule(TEXTE_MODULE *Text, wxDC *DC)
Definition: edtxtmod.cpp:213
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
bool IsIdle() const
Function IsIdle returns true if there is currently no block operation in progress.
ID_MODEDIT_MEASUREMENT_TOOL
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
class MARKER_PCB, a marker used to show something
Definition: typeinfo.h:99
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:77
DLIST< MODULE > m_Modules
Definition: class_board.h:249
int GetToolId() const
Definition: draw_frame.h:516
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.
void End_Edge_Module(EDGE_MODULE *Edge)
Terminate a move or create edge function.
Definition: edgemod.cpp:391
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
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:925
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)
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL)
void OnEditItemRequest(wxDC *aDC, BOARD_ITEM *aItem) override
>
EDGE_MODULE class definition.
class DRAWSEGMENT, a segment not on copper layers
Definition: typeinfo.h:91
class SEGZONE, a segment used to fill a zone area (segment on a
Definition: typeinfo.h:97
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:245
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Return the current cross hair position in logical (drawing) coordinates.
const wxPoint GetPosition() const override
Definition: class_module.h:183
void OnLeftClick(wxDC *DC, const wxPoint &MousePos) override
#define IS_MOVED
Item being moved.
Definition: base_struct.h:113
bool OnRightClick(const wxPoint &MousePos, wxMenu *PopMenu) override
Handle the right mouse click in the footprint editor.