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  {
75  wxString msg;
76  msg.Printf( wxT( "WinEDA_ModEditFrame::OnLeftClick err:Struct %d, m_Flag %X" ),
77  item->Type(), item->GetFlags() );
78  DisplayError( this, msg );
79  item->ClearFlags();
80  break;
81  }
82  }
83  }
84 
85  else
86  {
87  if( !wxGetKeyState( WXK_SHIFT ) && !wxGetKeyState( WXK_ALT )
88  && !wxGetKeyState( WXK_CONTROL ) )
89  item = ModeditLocateAndDisplay();
90 
91  SetCurItem( item );
92  }
93  }
94 
95  item = GetCurItem();
96  bool no_item_edited = item == NULL || item->GetFlags() == 0;
97 
98  switch( GetToolId() )
99  {
100  case ID_NO_TOOL_SELECTED:
101  break;
102 
104  case ID_MODEDIT_ARC_TOOL:
106  if( no_item_edited )
107  {
108  STROKE_T shape = S_SEGMENT;
109 
111  shape = S_CIRCLE;
112 
113  if( GetToolId() == ID_MODEDIT_ARC_TOOL )
114  shape = S_ARC;
115 
116  SetCurItem( Begin_Edge_Module( (EDGE_MODULE*) NULL, DC, shape ) );
117  }
118  else if( item->IsNew() )
119  {
120  if( ( (EDGE_MODULE*) item )->GetShape() == S_CIRCLE )
121  {
122  End_Edge_Module( (EDGE_MODULE*) item );
123  SetCurItem( NULL );
124  m_canvas->Refresh();
125  }
126  else if( ( (EDGE_MODULE*) item )->GetShape() == S_ARC )
127  {
128  End_Edge_Module( (EDGE_MODULE*) item );
129  SetCurItem( NULL );
130  m_canvas->Refresh();
131  }
132  else if( ( (EDGE_MODULE*) item )->GetShape() == S_SEGMENT )
133  {
135  }
136  else
137  {
138  wxMessageBox( wxT( "ProcessCommand error: unknown shape" ) );
139  }
140  }
141  break;
142 
144  if( ! no_item_edited ) // Item in edit, cannot delete it
145  break;
146 
147  item = ModeditLocateAndDisplay();
148 
149  if( item && item->Type() != PCB_MODULE_T ) // Cannot delete the module itself
150  {
151  SaveCopyInUndoList( GetBoard()->m_Modules, UR_CHANGED );
152  RemoveStruct( item );
153  SetCurItem( NULL );
154  }
155 
156  break;
157 
159  {
160  MODULE* module = GetBoard()->m_Modules;
161 
162  if( module == NULL // No module loaded
163  || (module->GetFlags() != 0) )
164  break;
165 
166  SaveCopyInUndoList( module, UR_CHANGED );
167 
168  // set the new relative internal local coordinates of footprint items
169  wxPoint moveVector = module->GetPosition() - GetCrossHairPosition();
170  module->MoveAnchorPosition( moveVector );
171 
172  // Usually, we do not need to change twice the anchor position,
173  // so deselect the active tool
175  SetCurItem( NULL );
176  m_canvas->Refresh();
177  }
178  break;
179 
181  PCBNEW_CONTROL::SetGridOrigin( GetGalCanvas()->GetView(), this,
184  m_canvas->Refresh();
185  break;
186 
188  if( GetBoard()->m_Modules == NULL )
189  break;
190 
191  SaveCopyInUndoList( GetBoard()->m_Modules, UR_CHANGED );
192  CreateTextModule( GetBoard()->m_Modules, DC );
193  break;
194 
195  case ID_MODEDIT_PAD_TOOL:
196  if( GetBoard()->m_Modules )
197  {
198  SaveCopyInUndoList( GetBoard()->m_Modules, UR_CHANGED );
199  AddPad( GetBoard()->m_Modules, true );
200  }
201 
202  break;
203 
205  DisplayError( this, wxT( "Measurement Tool not available in Legacy Toolset" ) );
207  break;
208 
209  default:
210  DisplayError( this, wxT( "FOOTPRINT_EDIT_FRAME::ProcessCommand error" ) );
212  }
213 
214  m_canvas->CrossHairOn( DC );
215 }
216 
217 
218 bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
219 {
220  BOARD_ITEM* item = GetCurItem();
221  wxString msg;
222  bool blockActive = !GetScreen()->m_BlockLocate.IsIdle();
223 
224  // Simple location of elements where possible.
225  if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
226  {
228  }
229 
230  // End command in progress.
231  if( GetToolId() != ID_NO_TOOL_SELECTED )
232  {
233  if( item && item->GetFlags() )
234  AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel" ),
235  KiBitmap( cancel_xpm ) );
236  else
237  AddMenuItem( PopMenu, ID_POPUP_CLOSE_CURRENT_TOOL, _( "End Tool" ),
238  KiBitmap( cursor_xpm ) );
239 
240  PopMenu->AppendSeparator();
241  }
242  else
243  {
244  if( (item && item->GetFlags()) || blockActive )
245  {
246  if( blockActive ) // Put block commands in list
247  {
249  _( "Cancel Block" ), KiBitmap( cancel_xpm ) );
251  _( "Zoom Block" ),
252  KiBitmap( zoom_area_xpm ) );
253  PopMenu->AppendSeparator();
255  _( "Place Block" ), KiBitmap( checked_ok_xpm ) );
257  _( "Duplicate Block (shift + drag mouse)" ),
258  KiBitmap( copy_xpm ) );
260  _( "Mirror Block (alt + drag mouse)" ),
261  KiBitmap( mirror_h_xpm ) );
263  _( "Rotate Block (ctrl + drag mouse)" ),
264  KiBitmap( rotate_ccw_xpm ) );
266  _( "Delete Block (shift+ctrl + drag mouse)" ),
267  KiBitmap( delete_xpm ) );
268 
269  msg = AddHotkeyName( _("Move Block Exactly..." ),
272  msg, KiBitmap( move_xpm ) );
273  }
274  else
275  {
277  _( "Cancel" ), KiBitmap( cancel_xpm ) );
278  }
279 
280  PopMenu->AppendSeparator();
281  }
282  }
283 
284  if( blockActive )
285  return true;
286 
287  if( item )
288  {
289  STATUS_FLAGS flags = item->GetFlags();
290  switch( item->Type() )
291  {
292  case PCB_MODULE_T:
293  {
294  wxMenu* transform_choice = new wxMenu;
295  AddMenuItem( transform_choice, ID_MODEDIT_MODULE_ROTATE, _( "Rotate Counterclockwise" ),
296  KiBitmap( rotate_ccw_xpm ) );
297  AddMenuItem( transform_choice, ID_MODEDIT_MODULE_MIRROR, _( "Mirror" ),
298  KiBitmap( mirror_h_xpm ) );
299  AddMenuItem( transform_choice, ID_MODEDIT_MODULE_MOVE_EXACT, _( "Move Exactly..." ),
300  KiBitmap( move_exactly_xpm ) );
301 
302  msg = AddHotkeyName( _( "Edit Footprint" ), g_Module_Editor_Hotkeys_Descr, HK_EDIT_ITEM );
303  AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_MODULE_PRMS, msg, KiBitmap( edit_module_xpm ) );
304  AddMenuItem( PopMenu, transform_choice, ID_MODEDIT_TRANSFORM_MODULE,
305  _( "Transform Footprint" ), KiBitmap( edit_xpm ) );
306 
307  break;
308  }
309 
310  case PCB_PAD_T:
311  if( !flags )
312  {
313  msg = AddHotkeyName( _("Move Pad" ), g_Module_Editor_Hotkeys_Descr, HK_MOVE_ITEM );
314  AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_PAD_REQUEST, msg, KiBitmap( move_pad_xpm ) );
315  }
316 
317  msg = AddHotkeyName( _("Edit Pad..." ), g_Module_Editor_Hotkeys_Descr, HK_EDIT_ITEM );
318  AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_PAD, msg, KiBitmap( options_pad_xpm ) );
320  _( "Copy Pad Properties" ), KiBitmap( copy_pad_settings_xpm ) );
322  _( "Paste Pad Properties" ), KiBitmap( apply_pad_settings_xpm ) );
323  msg = AddHotkeyName( _("Delete Pad" ), g_Module_Editor_Hotkeys_Descr, HK_DELETE );
324  AddMenuItem( PopMenu, ID_POPUP_PCB_DELETE_PAD, msg, KiBitmap( delete_pad_xpm ) );
325 
326  msg = AddHotkeyName( _( "Duplicate Pad" ), g_Module_Editor_Hotkeys_Descr, HK_DUPLICATE_ITEM );
327  AddMenuItem( PopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, msg, KiBitmap( duplicate_xpm ) );
328 
329  msg = AddHotkeyName( _("Move Pad Exactly..." ), g_Module_Editor_Hotkeys_Descr, HK_MOVE_ITEM_EXACT );
330  AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT, msg, KiBitmap( move_pad_xpm ) );
331 
332  msg = AddHotkeyName( _("Create Pad Array..." ), g_Module_Editor_Hotkeys_Descr, HK_CREATE_ARRAY );
333  AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY, msg, KiBitmap( array_xpm ) );
334 
335 
336  if( !flags )
337  {
338  PopMenu->AppendSeparator();
340  _( "Push Pad Properties..." ), KiBitmap( push_pad_settings_xpm ) );
341  }
342 
343  break;
344 
345  case PCB_MODULE_TEXT_T:
346  if( !flags )
347  {
348  msg = AddHotkeyName( _("Move" ), g_Module_Editor_Hotkeys_Descr,
349  HK_MOVE_ITEM );
351  KiBitmap( move_xpm ) );
352  }
353 
354  msg = AddHotkeyName( _("Rotate Clockwise" ), g_Module_Editor_Hotkeys_Descr,
355  HK_ROTATE_ITEM );
356  AddMenuItem( PopMenu, ID_POPUP_PCB_ROTATE_TEXTMODULE, msg, KiBitmap( rotate_cw_xpm ) );
357 
358  {
359  // Do not show option to replicate value or reference fields
360  // (there can only be one of each)
361 
362  const MODULE* module = static_cast<MODULE*>( item->GetParent() );
363  const TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item );
364 
365  if( &module->Reference() != text && &module->Value() != text )
366  {
367  msg = AddHotkeyName( _( "Duplicate" ),
370  msg, KiBitmap( duplicate_xpm ) );
371 
372  msg = AddHotkeyName( _("Create Array..." ),
375  msg, KiBitmap( array_xpm ) );
376  }
377  }
378 
379  msg = AddHotkeyName( _("Move Exactly..." ), g_Module_Editor_Hotkeys_Descr, HK_MOVE_ITEM_EXACT );
380  AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT, msg, KiBitmap( move_exactly_xpm ) );
381 
382  if( !flags )
383  {
384  msg = AddHotkeyName( _("Edit..." ), g_Module_Editor_Hotkeys_Descr,
385  HK_EDIT_ITEM );
386  AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_TEXTMODULE, msg, KiBitmap( edit_text_xpm ) );
387 
388  if( ( static_cast<TEXTE_MODULE*>( item ) )->GetType() == TEXTE_MODULE::TEXT_is_DIVERS )
389  {
390  msg = AddHotkeyName( _("Delete" ), g_Module_Editor_Hotkeys_Descr,
391  HK_DELETE );
393  KiBitmap( delete_xpm ) );
394  }
395  }
396  break;
397 
398  case PCB_MODULE_EDGE_T:
399  {
400  if( (flags & IS_NEW) )
401  AddMenuItem( PopMenu, ID_POPUP_PCB_STOP_CURRENT_DRAWING, _( "End Edge" ),
402  KiBitmap( checked_ok_xpm ) );
403 
404  if( !flags )
405  {
407  AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EDGE, msg, KiBitmap( move_xpm ) );
408 
410  AddMenuItem( PopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, msg, KiBitmap( duplicate_xpm ) );
411 
412  msg = AddHotkeyName( _("Move Exactly..." ), g_Module_Editor_Hotkeys_Descr, HK_MOVE_ITEM_EXACT );
413  AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT, msg, KiBitmap( move_exactly_xpm ) );
414 
415  msg = AddHotkeyName( _("Create Array..." ), g_Module_Editor_Hotkeys_Descr, HK_CREATE_ARRAY );
416  AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY, msg, KiBitmap( array_xpm ) );
417  }
418 
419  if( ( flags & (IS_NEW | IS_MOVED) ) == IS_MOVED )
420  AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_EDGE, _( "Place Edge" ),
421  KiBitmap( checked_ok_xpm ) );
422 
423  if( !flags )
424  {
427  msg, KiBitmap( options_segment_xpm ) );
428 
429  msg = AddHotkeyName( _("Delete" ), g_Module_Editor_Hotkeys_Descr, HK_DELETE );
430  AddMenuItem( PopMenu, ID_POPUP_PCB_DELETE_EDGE, msg, KiBitmap( delete_xpm ) );
431 
432  wxMenu* edit_global_mnu = new wxMenu;
433  AddMenuItem( PopMenu, edit_global_mnu, ID_POPUP_MODEDIT_GLOBAL_EDIT_EDGE,
434  _( "Global Changes" ), KiBitmap( edit_xpm ) );
436  _( "Change Body Items Width" ), KiBitmap( width_segment_xpm ) );
438  _( "Change Body Items Layer..." ), KiBitmap( select_layer_pair_xpm ) );
439  }
440  }
441  break;
442 
443  case PCB_LINE_T:
444  case PCB_TEXT_T:
445  case PCB_VIA_T:
446  case PCB_TRACE_T:
447  case PCB_SEGZONE_T:
448  case PCB_MARKER_T:
449  case PCB_DIMENSION_T:
450  case PCB_TARGET_T:
451  msg.Printf( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: Unexpected DrawType %d" ),
452  item->Type() );
453  DisplayError( this, msg );
454  break;
455 
456  case SCREEN_T:
457  case TYPE_NOT_INIT:
458  case PCB_T:
459  msg.Printf( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: illegal DrawType %d" ),
460  item->Type() );
461  DisplayError( this, msg );
462  break;
463 
464  default:
465  msg.Printf( wxT( "FOOTPRINT_EDIT_FRAME::OnRightClick Error: unknown DrawType %d" ),
466  item->Type() );
467  DisplayError( this, msg );
468  break;
469  }
470  PopMenu->AppendSeparator();
471  }
472 
473  return true;
474 }
475 
476 /*
477  * Called on a mouse left button double click
478  */
479 void FOOTPRINT_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
480 {
481  BOARD_ITEM* item = GetCurItem();
482 
483  switch( GetToolId() )
484  {
485  case ID_NO_TOOL_SELECTED:
486  if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
487  {
488  item = ModeditLocateAndDisplay();
489  }
490 
491  if( ( item == NULL ) || ( item->GetFlags() != 0 ) )
492  break;
493 
494  // Item found
495  SetCurItem( item );
496  OnEditItemRequest( DC, item );
497  break; // end case 0
498 
500  {
501  if( item && item->IsNew() )
502  {
503  End_Edge_Module( (EDGE_MODULE*) item );
504  SetCurItem( NULL );
505  m_canvas->Refresh();
506  }
507 
508  break;
509  }
510 
511  default:
512  break;
513  }
514 }
515 
516 
518 {
519  switch( aItem->Type() )
520  {
521  case PCB_PAD_T:
522  InstallPadOptionsFrame( static_cast<D_PAD*>( aItem ) );
524  break;
525 
526  case PCB_MODULE_T:
527  editFootprintProperties( (MODULE*) aItem );
529  m_canvas->Refresh();
530  break;
531 
532  case PCB_MODULE_TEXT_T:
533  InstallTextOptionsFrame( aItem, aDC );
534  break;
535 
536  case PCB_MODULE_EDGE_T :
538  break;
539 
540  default:
541  break;
542  }
543 }
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:513
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:512
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:248
int GetToolId() const
Definition: draw_frame.h:519
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:928
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:184
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.