KiCad PCB EDA Suite
footprint_editor_control.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) 2014-2019 CERN
5  * Copyright (C) 2019-2020 KiCad Developers, see AUTHORS.txt for contributors.
6  * @author Maciej Suminski <maciej.suminski@cern.ch>
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 
27 #include "kicad_clipboard.h"
28 #include <tool/tool_manager.h>
29 #include <tools/pcb_actions.h>
30 #include <view/view_controls.h>
31 #include <footprint_edit_frame.h>
32 #include <pcbnew_id.h>
33 #include <confirm.h>
34 #include <widgets/infobar.h>
35 #include <bitmaps.h>
36 #include <footprint.h>
37 #include <project.h>
38 #include <fp_lib_table.h>
41 #include <footprint_wizard_frame.h>
42 #include <kiway.h>
44 
45 
47  PCB_TOOL_BASE( "pcbnew.ModuleEditor" ),
48  m_frame( nullptr ),
49  m_checkerDialog( nullptr )
50 {
51 }
52 
53 
55 {
56 }
57 
58 
60 {
61  m_frame = getEditFrame<FOOTPRINT_EDIT_FRAME>();
62 
63  if( m_checkerDialog )
65 }
66 
67 
69 {
70  // Build a context menu for the footprint tree
71  //
72  CONDITIONAL_MENU& ctxMenu = m_menu.GetMenu();
73 
74  auto libSelectedCondition =
75  [ this ]( const SELECTION& aSel )
76  {
77  LIB_ID sel = m_frame->GetTreeFPID();
78  return !sel.GetLibNickname().empty() && sel.GetLibItemName().empty();
79  };
80  // The libInferredCondition allows you to do things like New Symbol and Paste with a
81  // symbol selected (in other words, when we know the library context even if the library
82  // itself isn't selected.
83  auto libInferredCondition =
84  [ this ]( const SELECTION& aSel )
85  {
86  LIB_ID sel = m_frame->GetTreeFPID();
87  return !sel.GetLibNickname().empty();
88  };
89  auto pinnedLibSelectedCondition =
90  [ this ]( const SELECTION& aSel )
91  {
93  return current && current->m_Type == LIB_TREE_NODE::LIB && current->m_Pinned;
94  };
95  auto unpinnedLibSelectedCondition =
96  [ this ](const SELECTION& aSel )
97  {
99  return current && current->m_Type == LIB_TREE_NODE::LIB && !current->m_Pinned;
100  };
101  auto fpSelectedCondition =
102  [ this ]( const SELECTION& aSel )
103  {
104  LIB_ID sel = m_frame->GetTreeFPID();
105  return !sel.GetLibNickname().empty() && !sel.GetLibItemName().empty();
106  };
107 
108  ctxMenu.AddItem( ACTIONS::pinLibrary, unpinnedLibSelectedCondition );
109  ctxMenu.AddItem( ACTIONS::unpinLibrary, pinnedLibSelectedCondition );
110 
111  ctxMenu.AddSeparator();
112  ctxMenu.AddItem( PCB_ACTIONS::newFootprint, libSelectedCondition );
113 #ifdef KICAD_SCRIPTING
114  ctxMenu.AddItem( PCB_ACTIONS::createFootprint, libSelectedCondition );
115 #endif
116 
117  ctxMenu.AddSeparator();
118  ctxMenu.AddItem( ACTIONS::save, libSelectedCondition || libInferredCondition );
119  ctxMenu.AddItem( ACTIONS::saveAs, libSelectedCondition );
120  ctxMenu.AddItem( ACTIONS::saveCopyAs, fpSelectedCondition );
121  ctxMenu.AddItem( ACTIONS::revert, libSelectedCondition || libInferredCondition );
122 
123  ctxMenu.AddSeparator();
124  ctxMenu.AddItem( PCB_ACTIONS::cutFootprint, fpSelectedCondition );
125  ctxMenu.AddItem( PCB_ACTIONS::copyFootprint, fpSelectedCondition );
126  ctxMenu.AddItem( PCB_ACTIONS::pasteFootprint, libInferredCondition );
127  ctxMenu.AddItem( PCB_ACTIONS::deleteFootprint, fpSelectedCondition );
128 
129  ctxMenu.AddSeparator();
130  ctxMenu.AddItem( PCB_ACTIONS::importFootprint, libInferredCondition );
131  ctxMenu.AddItem( PCB_ACTIONS::exportFootprint, fpSelectedCondition );
132 
133  // If we've got nothing else to show, at least show a hide tree option
134  ctxMenu.AddItem( PCB_ACTIONS::hideFootprintTree, !libInferredCondition );
135 
136  return true;
137 }
138 
139 
141 {
142  LIB_ID selected = m_frame->GetTreeFPID();
143  FOOTPRINT* newFootprint = m_frame->CreateNewFootprint( wxEmptyString );
144 
145  if( !newFootprint )
146  return 0;
147 
148  if( !m_frame->Clear_Pcb( true ) )
149  return 0;
150 
152  m_frame->AddFootprintToBoard( newFootprint );
153 
154  // Initialize data relative to nets and netclasses (for a new footprint the defaults are
155  // used). This is mandatory to handle and draw pads.
156  board()->BuildListOfNets();
157  newFootprint->SetPosition( wxPoint( 0, 0 ) );
158  newFootprint->ClearFlags();
159 
160  m_frame->Zoom_Automatique( false );
162 
163  // If selected from the library tree then go ahead and save it there
164  if( !selected.GetLibNickname().empty() )
165  {
166  LIB_ID fpid = newFootprint->GetFPID();
167  fpid.SetLibNickname( selected.GetLibNickname() );
168  newFootprint->SetFPID( fpid );
169  m_frame->SaveFootprint( newFootprint );
170  m_frame->ClearModify();
171  }
172 
173  m_frame->UpdateView();
174  m_frame->Update3DView( true, true );
175 
176  m_frame->SyncLibraryTree( false );
177  return 0;
178 }
179 
180 
182 {
183  LIB_ID selected = m_frame->GetTreeFPID();
184 
185  if( m_frame->IsContentModified() )
186  {
187  if( !HandleUnsavedChanges( m_frame, _( "The current footprint has been modified. "
188  "Save changes?" ),
189  [&]() -> bool
190  {
191  return m_frame->SaveFootprint( footprint() );
192  } ) )
193  {
194  return 0;
195  }
196  }
197 
199  true, m_frame );
200 
201  if( wizard->ShowModal( NULL, m_frame ) )
202  {
203  // Creates the new footprint from python script wizard
204  FOOTPRINT* newFootprint = wizard->GetBuiltFootprint();
205 
206  if( newFootprint ) // i.e. if create footprint command is OK
207  {
208  m_frame->Clear_Pcb( false );
209 
211  // Add the new object to board
212  m_frame->AddFootprintToBoard( newFootprint );
213 
214  // Initialize data relative to nets and netclasses (for a new footprint the defaults
215  // are used). This is mandatory to handle and draw pads.
216  board()->BuildListOfNets();
217  newFootprint->SetPosition( wxPoint( 0, 0 ) );
218  newFootprint->ClearFlags();
219 
220  m_frame->Zoom_Automatique( false );
222 
223  // If selected from the library tree then go ahead and save it there
224  if( !selected.GetLibNickname().empty() )
225  {
226  LIB_ID fpid = newFootprint->GetFPID();
227  fpid.SetLibNickname( selected.GetLibNickname() );
228  newFootprint->SetFPID( fpid );
229  m_frame->SaveFootprint( newFootprint );
230  m_frame->ClearModify();
231  }
232 
233  m_frame->UpdateView();
234  canvas()->Refresh();
235  m_frame->Update3DView( true, true );
236 
237  m_frame->SyncLibraryTree( false );
238  }
239  }
240 
241  wizard->Destroy();
242  return 0;
243 }
244 
245 
247 {
248  if( !footprint() ) // no loaded footprint
249  return 0;
250 
252  {
253  if( m_frame->SaveFootprint( footprint() ) )
254  {
255  view()->Update( footprint() );
256 
257  canvas()->ForceRefresh();
258  m_frame->ClearModify();
259  m_frame->UpdateTitle();
260  }
261  }
262 
264  return 0;
265 }
266 
267 
269 {
271  {
272  // Save Library As
273  const wxString& src_libNickname = m_frame->GetTargetFPID().GetLibNickname();
274  wxString src_libFullName = m_frame->Prj().PcbFootprintLibs()->GetFullURI( src_libNickname );
275 
276  if( m_frame->SaveLibraryAs( src_libFullName ) )
277  m_frame->SyncLibraryTree( true );
278  }
279  else if( m_frame->GetTargetFPID() == m_frame->GetLoadedFPID() )
280  {
281  // Save Board Footprint As
282  if( footprint() && m_frame->SaveFootprintAs( footprint() ) )
283  {
284  view()->Update( footprint() );
285  m_frame->ClearModify();
286 
287  // Get rid of the save-will-update-board-only (or any other dismissable warning)
288  WX_INFOBAR* infobar = m_frame->GetInfoBar();
289 
290  if( infobar->IsShown() && infobar->HasCloseButton() )
291  infobar->Dismiss();
292 
293  canvas()->ForceRefresh();
294  m_frame->SyncLibraryTree( true );
295  }
296  }
297  else
298  {
299  // Save Selected Footprint As
301 
303  m_frame->SyncLibraryTree( true );
304  }
305 
307  return 0;
308 }
309 
310 
312 {
313  getEditFrame<FOOTPRINT_EDIT_FRAME>()->RevertFootprint();
314  return 0;
315 }
316 
317 
319 {
320  LIB_ID fpID = m_frame->GetTreeFPID();
321 
322  if( fpID == m_frame->GetLoadedFPID() )
324  else
325  m_copiedFootprint.reset( m_frame->LoadFootprint( fpID ) );
326 
327  if( aEvent.IsAction( &PCB_ACTIONS::cutFootprint ) )
328  DeleteFootprint( aEvent );
329 
330  return 0;
331 }
332 
333 
335 {
337  {
338  wxString newLib = m_frame->GetTreeFPID().GetLibNickname();
339  wxString newName = m_copiedFootprint->GetFPID().GetLibItemName();
340 
341  while( m_frame->Prj().PcbFootprintLibs()->FootprintExists( newLib, newName ) )
342  newName += _( "_copy" );
343 
344  m_copiedFootprint->SetFPID( LIB_ID( newLib, newName ) );
346 
347  m_frame->SyncLibraryTree( true );
348  m_frame->FocusOnLibID( m_copiedFootprint->GetFPID() );
349  }
350 
351  return 0;
352 }
353 
354 
356 {
357  FOOTPRINT_EDIT_FRAME* frame = getEditFrame<FOOTPRINT_EDIT_FRAME>();
358 
359  if( frame->DeleteFootprintFromLibrary( frame->GetTargetFPID(), true ) )
360  {
361  if( frame->GetTargetFPID() == frame->GetLoadedFPID() )
362  frame->Clear_Pcb( false );
363 
364  frame->SyncLibraryTree( true );
365  }
366 
367  return 0;
368 }
369 
370 
372 {
373  bool is_last_fp_from_brd = m_frame->IsCurrentFPFromBoard();
374 
375  if( !m_frame->Clear_Pcb( true ) )
376  return -1; // this command is aborted
377 
380 
383 
385 
386  // Update the save items if needed.
387  if( is_last_fp_from_brd )
388  {
391  }
392 
394  m_frame->OnModify();
395  return 0;
396 }
397 
398 
400 {
401  LIB_ID fpID = m_frame->GetTreeFPID();
402  FOOTPRINT* fp;
403 
404  if( !fpID.IsValid() )
406  else
407  fp = m_frame->LoadFootprint( fpID );
408 
409  m_frame->ExportFootprint( fp );
410  return 0;
411 }
412 
413 
415 {
417  return 0;
418 }
419 
420 
422 {
423  LIB_TREE_NODE* currentNode = m_frame->GetCurrentTreeNode();
424 
425  if( currentNode && !currentNode->m_Pinned )
426  {
427  currentNode->m_Pinned = true;
429  }
430 
431  return 0;
432 }
433 
434 
436 {
437  LIB_TREE_NODE* currentNode = m_frame->GetCurrentTreeNode();
438 
439  if( currentNode && currentNode->m_Pinned )
440  {
441  currentNode->m_Pinned = false;
443  }
444 
445  return 0;
446 }
447 
448 
450 {
452  return 0;
453 }
454 
455 
457 {
459 
460  if( footprint )
461  {
462  getEditFrame<FOOTPRINT_EDIT_FRAME>()->OnEditItemRequest( footprint );
463  m_frame->GetCanvas()->Refresh();
464  }
465  return 0;
466 }
467 
468 
470 {
471  getEditFrame<FOOTPRINT_EDIT_FRAME>()->ShowPadPropertiesDialog( nullptr );
472  return 0;
473 }
474 
475 
477 {
478  FOOTPRINT_EDIT_FRAME* editFrame = getEditFrame<FOOTPRINT_EDIT_FRAME>();
479  DIALOG_CLEANUP_GRAPHICS dlg( editFrame, true );
480 
481  dlg.ShowModal();
482  return 0;
483 }
484 
485 
487 {
488  if( !m_checkerDialog )
489  {
491 
492  m_checkerDialog->Show( true );
493  }
494  else // The dialog is just not visible (because the user has double clicked on an error item)
495  {
497  m_checkerDialog->Show( true );
498  }
499  return 0;
500 }
501 
502 
504 {
505  if( m_checkerDialog )
506  {
507  m_checkerDialog->Destroy();
508  m_checkerDialog = nullptr;
509  }
510 }
511 
512 
514 {
522 
527 
530 
532 
534 
541 }
int Save(const TOOL_EVENT &aEvent)
int DefaultPadProperties(const TOOL_EVENT &aEvent)
Edit the properties used for new pad creation.
static TOOL_ACTION pinLibrary
Definition: actions.h:112
void BuildListOfNets()
Definition: board.h:735
FOOTPRINT_WIZARD_FRAME.
bool HandleUnsavedChanges(wxWindow *aParent, const wxString &aMessage, const std::function< bool()> &aSaveFunction)
Display a dialog with Save, Cancel and Discard Changes buttons.
Definition: confirm.cpp:207
static TOOL_ACTION hideFootprintTree
Definition: pcb_actions.h:354
void LoadFootprintFromLibrary(LIB_ID aFPID)
const UTF8 & GetLibItemName() const
Definition: lib_id.h:106
TOOL_MENU m_menu
The functions below are not yet implemented - their interface may change.
static TOOL_ACTION footprintProperties
Definition: pcb_actions.h:376
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:56
void ForceRefresh()
Force a redraw.
void ReCreateHToolbar() override
Create the main horizontal toolbar for the footprint editor.
DIALOG_FOOTPRINT_CHECKER * m_checkerDialog
KIGFX::VIEW_CONTROLS * GetViewControls() const
Return a pointer to the #VIEW_CONTROLS instance used in the panel.
int PasteFootprint(const TOOL_EVENT &aEvent)
BOARD * board() const
This file is part of the common library.
static TOOL_ACTION checkFootprint
Definition: pcb_actions.h:379
static TOOL_ACTION cleanupGraphics
Definition: pcb_actions.h:324
std::unique_ptr< FOOTPRINT > m_copiedFootprint
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
CONDITIONAL_MENU & GetMenu()
Definition: tool_menu.cpp:46
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:215
static TOOL_ACTION zoomFitScreen
Definition: actions.h:99
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:141
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:368
bool Init() override
Init() is called once upon a registration of the tool.
int ImportFootprint(const TOOL_EVENT &aEvent)
static TOOL_ACTION unpinLibrary
Definition: actions.h:113
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
FOOTPRINT_EDIT_FRAME * m_frame
bool IsValid() const
Check if this LID_ID is valid.
Definition: lib_id.h:168
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Define which state (aStateFunc) to go when a certain event arrives (aConditions).
int CreateFootprint(const TOOL_EVENT &aEvent)
static TOOL_ACTION createFootprint
Definition: pcb_actions.h:361
static TOOL_ACTION saveCopyAs
Definition: actions.h:56
static TOOL_ACTION cutFootprint
Definition: pcb_actions.h:370
bool IsAction(const TOOL_ACTION *aAction) const
Test if the event contains an action issued upon activation of the given TOOL_ACTION.
Definition: tool_event.cpp:70
static TOOL_ACTION copyFootprint
Definition: pcb_actions.h:371
int CleanupGraphics(const TOOL_EVENT &aEvent)
bool IsContentModified() override
Get if any footprints or libraries have been modified but not saved.
int ToggleFootprintTree(const TOOL_EVENT &aEvent)
bool HasCloseButton() const
Definition: infobar.cpp:311
PCB_BASE_EDIT_FRAME * frame() const
virtual void Zoom_Automatique(bool aWarpPointer)
Redraw the screen with best zoom level and the best centering that shows all the page or the board.
void ReCreateMenuBar() override
(Re)Create the menubar for the Footprint Editor frame
void ExportFootprint(FOOTPRINT *aFootprint)
Create a file containing only one footprint.
void SyncLibraryTree(bool aProgress)
Synchronize the footprint library tree to the current state of the footprint library table.
void RegenerateLibraryTree()
Filter, sort, and redisplay the library tree.
void Dismiss() override
Dismisses the infobar and updates the containing layout and AUI manager (if one is provided).
Definition: infobar.cpp:176
bool Clear_Pcb(bool aQuery)
Delete all and reinitialize the current board.
Definition: initpcb.cpp:96
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const override
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: pcb_view.cpp:92
FOOTPRINT * GetFirstFootprint() const
Gets the first footprint on the board or nullptr.
Definition: board.h:382
#define NULL
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622
int CutCopyFootprint(const TOOL_EVENT &aEvent)
bool SaveLibraryAs(const wxString &aLibraryPath)
Save a library to a new name and/or library type.
void OnModify() override
Must be called after a footprint change in order to set the "modify" flag of the current screen and p...
BOARD_DRC_ITEMS_PROVIDER is an implementation of the RC_ITEMS_PROVIDER interface which uses a BOARD i...
static TOOL_ACTION exportFootprint
Definition: pcb_actions.h:374
void FocusOnLibID(const LIB_ID &aLibID)
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
wxString GetFullURI(const wxString &aLibNickname, bool aExpandEnvVars=true) const
Return the full URI of the library mapped to aLibNickname.
static TOOL_ACTION editFootprint
Definition: pcb_actions.h:368
static TOOL_ACTION save
Definition: actions.h:54
LIB_ID GetTargetFPID() const
Return the LIB_ID of the part selected in the footprint tree, or the loaded part if there is no selec...
bool SaveFootprintInLibrary(FOOTPRINT *aFootprint, const wxString &aLibraryName)
Generic, UI-independent tool event.
Definition: tool_event.h:173
FOOTPRINT * footprint() const
KIGFX::PCB_VIEW * view() const
int Revert(const TOOL_EVENT &aEvent)
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:92
FOOTPRINT * LoadFootprint(const LIB_ID &aFootprintId)
Attempt to load aFootprintId from the footprint library table.
const LIB_ID & GetFPID() const
Definition: footprint.h:190
int NewFootprint(const TOOL_EVENT &aEvent)
virtual void SetCrossHairCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true)=0
Move the graphic crosshair cursor to the requested position expressed in world coordinates.
Model class in the component selector Model-View-Adapter (mediated MVC) architecture.
LIB_TREE_NODE * GetCurrentTreeNode() const
static TOOL_ACTION importFootprint
Definition: pcb_actions.h:373
bool Show(bool show) override
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void AddSeparator(int aOrder=ANY_ORDER)
Add a separator to the menu.
virtual FP_LIB_TABLE * PcbFootprintLibs(KIWAY &aKiway)
Return the table of footprint libraries.
Definition: project.cpp:285
int SetLibNickname(const UTF8 &aNickname)
Override the logical library name portion of the LIB_ID to aNickname.
Definition: lib_id.cpp:193
void setTransitions() override
< Set up handlers for various events.
FOOTPRINT * CreateNewFootprint(const wxString &aFootprintName)
Creates a new footprint, at position 0,0.
void SetFPID(const LIB_ID &aFPID)
Definition: footprint.h:191
A modified version of the wxInfoBar class that allows us to:
Definition: infobar.h:73
static TOOL_ACTION defaultPadProperties
Definition: pcb_actions.h:377
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
int EditFootprint(const TOOL_EVENT &aEvent)
static TOOL_ACTION showFootprintTree
Definition: pcb_actions.h:353
int DeleteFootprint(const TOOL_EVENT &aEvent)
int CheckFootprint(const TOOL_EVENT &aEvent)
void SetMarkersProvider(RC_ITEMS_PROVIDER *aProvider)
static TOOL_ACTION saveAs
Definition: actions.h:55
LIB_ID GetLoadedFPID() const
Return the LIB_ID of the part being edited.
int ExportFootprint(const TOOL_EVENT &aEvent)
#define _(s)
Definition: 3d_actions.cpp:33
virtual void Update3DView(bool aMarkDirty, bool aRefresh, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
enum TYPE m_Type
bool SaveFootprintAs(FOOTPRINT *aFootprint)
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
RESET_REASON
Determine the reason of reset for a tool.
Definition: tool_base.h:78
int UnpinLibrary(const TOOL_EVENT &aEvent)
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:204
WX_INFOBAR * GetInfoBar()
static TOOL_ACTION pasteFootprint
Definition: pcb_actions.h:372
int SaveAs(const TOOL_EVENT &aEvent)
void AddFootprintToBoard(FOOTPRINT *aFootprint) override
Override from PCB_BASE_EDIT_FRAME which adds a footprint to the editor's dummy board,...
void RefreshLibraryTree()
Redisplay the library tree.
BOARD * GetBoard() const
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
Definition: tool_base.cpp:42
void SetModify()
Definition: base_screen.h:59
void SetPosition(const wxPoint &aPos) override
Definition: footprint.cpp:1438
PCB_DRAW_PANEL_GAL * canvas() const
bool SaveFootprint(FOOTPRINT *aFootprint)
Save in an existing library a given footprint.
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Add a menu entry to run a TOOL_ACTION on selected items.
virtual void ClearUndoRedoList()
Clear the undo and redo list using ClearUndoORRedoList()
static TOOL_ACTION deleteFootprint
Definition: pcb_actions.h:369
int PinLibrary(const TOOL_EVENT &aEvent)
bool FootprintExists(const wxString &aNickname, const wxString &aFootprintName)
Indicates whether or not the given footprint already exists in the given library.
LIB_ID GetTreeFPID() const
Return the LIB_ID of the part or library selected in the footprint tree.
static TOOL_ACTION revert
Definition: actions.h:58
static TOOL_ACTION newFootprint
Definition: pcb_actions.h:358
int Properties(const TOOL_EVENT &aEvent)
FOOTPRINT * ImportFootprint(const wxString &aName=wxT(""))
Read a file containing only one footprint.
bool empty() const
Definition: utf8.h:103