KiCad PCB EDA Suite
lib_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) 2019 CERN
5  * Copyright (C) 2019 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 
25 #include <fctsys.h>
26 #include <kiway.h>
27 #include <sch_painter.h>
28 #include <tool/tool_manager.h>
29 #include <tools/ee_actions.h>
30 #include <tools/lib_control.h>
31 #include <lib_edit_frame.h>
32 #include <lib_view_frame.h>
35 #include <gestfich.h>
36 #include <project.h>
37 #include <confirm.h>
38 
39 
41 {
42  m_frame = getEditFrame<SCH_BASE_FRAME>();
45 
46  if( m_isLibEdit )
47  {
48  CONDITIONAL_MENU& ctxMenu = m_menu.GetMenu();
49  LIB_EDIT_FRAME* editFrame = getEditFrame<LIB_EDIT_FRAME>();
50 
51  auto libSelectedCondition = [ editFrame ] ( const SELECTION& aSel ) {
52  LIB_ID sel = editFrame->GetTreeLIBID();
53  return !sel.GetLibNickname().empty() && sel.GetLibItemName().empty();
54  };
55  auto pinnedLibSelectedCondition = [ editFrame ] ( const SELECTION& aSel ) {
56  LIB_TREE_NODE* current = editFrame->GetCurrentTreeNode();
57  return current && current->m_Type == LIB_TREE_NODE::LIB && current->m_Pinned;
58  };
59  auto unpinnedLibSelectedCondition = [ editFrame ] (const SELECTION& aSel ) {
60  LIB_TREE_NODE* current = editFrame->GetCurrentTreeNode();
61  return current && current->m_Type == LIB_TREE_NODE::LIB && !current->m_Pinned;
62  };
63  auto symbolSelectedCondition = [ editFrame ] ( const SELECTION& aSel ) {
64  LIB_ID sel = editFrame->GetTreeLIBID();
65  return !sel.GetLibNickname().empty() && !sel.GetLibItemName().empty();
66  };
67 
68  ctxMenu.AddItem( ACTIONS::pinLibrary, unpinnedLibSelectedCondition );
69  ctxMenu.AddItem( ACTIONS::unpinLibrary, pinnedLibSelectedCondition );
70  ctxMenu.AddSeparator();
71 
74  ctxMenu.AddItem( ACTIONS::save, libSelectedCondition );
75  ctxMenu.AddItem( ACTIONS::saveAs, libSelectedCondition );
76  ctxMenu.AddItem( ACTIONS::revert, libSelectedCondition );
77 
78  ctxMenu.AddSeparator();
80  ctxMenu.AddItem( EE_ACTIONS::editSymbol, symbolSelectedCondition );
81 
82  ctxMenu.AddSeparator();
83  ctxMenu.AddItem( ACTIONS::save, symbolSelectedCondition );
84  ctxMenu.AddItem( ACTIONS::saveCopyAs, symbolSelectedCondition );
85  ctxMenu.AddItem( EE_ACTIONS::duplicateSymbol, symbolSelectedCondition );
86  ctxMenu.AddItem( EE_ACTIONS::deleteSymbol, symbolSelectedCondition );
87  ctxMenu.AddItem( ACTIONS::revert, symbolSelectedCondition );
88 
89  ctxMenu.AddSeparator();
90  ctxMenu.AddItem( EE_ACTIONS::cutSymbol, symbolSelectedCondition );
91  ctxMenu.AddItem( EE_ACTIONS::copySymbol, symbolSelectedCondition );
93 
94  ctxMenu.AddSeparator();
96  ctxMenu.AddItem( EE_ACTIONS::exportSymbol, symbolSelectedCondition );
97  }
98 
99  return true;
100 }
101 
102 
104 {
105  bool createNew = aEvent.IsAction( &ACTIONS::newLibrary );
106 
108  static_cast<LIB_EDIT_FRAME*>( m_frame )->AddLibraryFile( createNew );
109 
110  return 0;
111 }
112 
113 
115 {
117  {
118  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
119  int unit = 0;
120  LIB_ID partId = editFrame->GetTreeLIBID( &unit );
121 
122  editFrame->LoadPart( partId.GetLibItemName(), partId.GetLibNickname(), unit );
123  }
124 
125  return 0;
126 }
127 
128 
129 int LIB_CONTROL::AddSymbol( const TOOL_EVENT& aEvent )
130 {
132  {
133  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
134 
135  if( aEvent.IsAction( &EE_ACTIONS::newSymbol ) )
136  editFrame->CreateNewPart();
137  else if( aEvent.IsAction( &EE_ACTIONS::importSymbol ) )
138  editFrame->ImportPart();
139  }
140 
141  return 0;
142 }
143 
144 
145 int LIB_CONTROL::Save( const TOOL_EVENT& aEvt )
146 {
148  {
149  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
150 
151  if( aEvt.IsAction( &EE_ACTIONS::save ) )
152  editFrame->Save();
153  else if( aEvt.IsAction( &EE_ACTIONS::saveAs ) || aEvt.IsAction( &EE_ACTIONS::saveCopyAs ) )
154  editFrame->SaveAs();
155  else if( aEvt.IsAction( &EE_ACTIONS::saveAll ) )
156  editFrame->SaveAll();
157  }
158 
159  return 0;
160 }
161 
162 
163 int LIB_CONTROL::Revert( const TOOL_EVENT& aEvent )
164 {
166  static_cast<LIB_EDIT_FRAME*>( m_frame )->Revert();
167 
168  return 0;
169 }
170 
171 
173 {
175  static_cast<LIB_EDIT_FRAME*>( m_frame )->ExportPart();
176 
177  return 0;
178 }
179 
180 
182 {
184  {
185  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
186 
188  editFrame->CopyPartToClipboard();
189 
191  editFrame->DeletePartFromLibrary();
192  }
193 
194  return 0;
195 }
196 
197 
199 {
201  {
202  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
203  editFrame->DuplicatePart( aEvent.IsAction( &EE_ACTIONS::pasteSymbol ) );
204  }
205 
206  return 0;
207 }
208 
209 
211 {
212  int convert = aEvent.IsAction( &EE_ACTIONS::showDeMorganStandard ) ?
213  LIB_ITEM::LIB_CONVERT::BASE : LIB_ITEM::LIB_CONVERT::DEMORGAN;
214 
216  {
219 
220  LIB_EDIT_FRAME* libEditFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
221  libEditFrame->SetConvert( convert );
222 
224  libEditFrame->RebuildView();
225  }
227  {
228  LIB_VIEW_FRAME* libViewFrame = static_cast<LIB_VIEW_FRAME*>( m_frame );
229  libViewFrame->SetUnitAndConvert( libViewFrame->GetUnit(), convert );
230  }
231 
232  return 0;
233 }
234 
235 
237 {
239  {
240  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
241  LIB_TREE_NODE* currentNode = editFrame->GetCurrentTreeNode();
242 
243  if( currentNode && !currentNode->m_Pinned )
244  {
245  currentNode->m_Pinned = true;
246  editFrame->RegenerateLibraryTree();
247  }
248  }
249 
250  return 0;
251 }
252 
253 
255 {
257  {
258  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
259  LIB_TREE_NODE* currentNode = editFrame->GetCurrentTreeNode();
260 
261  if( currentNode && currentNode->m_Pinned )
262  {
263  currentNode->m_Pinned = false;
264  editFrame->RegenerateLibraryTree();
265  }
266  }
267 
268  return 0;
269 }
270 
271 
273 {
275  {
276  wxCommandEvent dummy;
277  static_cast<LIB_EDIT_FRAME*>( m_frame )->OnToggleSearchTree( dummy );
278  }
279 
280  return 0;
281 }
282 
283 
285 {
287 
288  // Update canvas
291  m_frame->GetCanvas()->Refresh();
292 
293  return 0;
294 }
295 
296 
298 {
299  if( !m_isLibEdit )
300  return 0;
301 
302  LIB_EDIT_FRAME* editFrame = getEditFrame<LIB_EDIT_FRAME>();
303  editFrame->m_SyncPinEdit = !editFrame->m_SyncPinEdit;
304 
305  return 0;
306 }
307 
308 
310 {
311  if( !m_isLibEdit )
312  return 0;
313 
314  LIB_EDIT_FRAME* editFrame = getEditFrame<LIB_EDIT_FRAME>();
315  LIB_PART* part = editFrame->GetCurPart();
316 
317  if( !part )
318  {
319  wxMessageBox( _( "No symbol to export" ) );
320  return 0;
321  }
322 
323  wxString file_ext = wxT( "png" );
324  wxString mask = wxT( "*." ) + file_ext;
325  wxFileName fn( part->GetName() );
326  fn.SetExt( "png" );
327 
328  wxString projectPath = wxPathOnly( m_frame->Prj().GetProjectFullName() );
329 
330  wxFileDialog dlg( editFrame, _( "Image File Name" ), projectPath, fn.GetFullName(),
331  PngFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
332 
333  if( dlg.ShowModal() == wxID_OK && !dlg.GetPath().IsEmpty() )
334  {
335  // calling wxYield is mandatory under Linux, after closing the file selector dialog
336  // to refresh the screen before creating the PNG or JPEG image from screen
337  wxYield();
338 
339  if( !SaveCanvasImageToFile( editFrame, dlg.GetPath(), wxBITMAP_TYPE_PNG ) )
340  {
341  wxMessageBox( wxString::Format( _( "Can't save file \"%s\"." ), dlg.GetPath() ) );
342  }
343  }
344 
345  return 0;
346 }
347 
348 
350 {
351  if( !m_isLibEdit )
352  return 0;
353 
354  LIB_EDIT_FRAME* editFrame = getEditFrame<LIB_EDIT_FRAME>();
355  LIB_PART* part = editFrame->GetCurPart();
356 
357  if( !part )
358  {
359  wxMessageBox( _( "No symbol to export" ) );
360  return 0;
361  }
362 
363  wxString file_ext = wxT( "svg" );
364  wxString mask = wxT( "*." ) + file_ext;
365  wxFileName fn( part->GetName() );
366  fn.SetExt( file_ext );
367 
368  wxString pro_dir = wxPathOnly( m_frame->Prj().GetProjectFullName() );
369 
370  wxString fullFileName = EDA_FILE_SELECTOR( _( "Filename:" ), pro_dir, fn.GetFullName(),
371  file_ext, mask, m_frame, wxFD_SAVE, true );
372 
373  if( !fullFileName.IsEmpty() )
374  {
375  PAGE_INFO pageSave = editFrame->GetScreen()->GetPageSettings();
376  PAGE_INFO pageTemp = pageSave;
377 
378  wxSize componentSize = part->GetUnitBoundingBox( editFrame->GetUnit(),
379  editFrame->GetConvert() ).GetSize();
380 
381  // Add a small margin to the plot bounding box
382  pageTemp.SetWidthMils( int( componentSize.x * 1.2 ) );
383  pageTemp.SetHeightMils( int( componentSize.y * 1.2 ) );
384 
385  editFrame->GetScreen()->SetPageSettings( pageTemp );
386  editFrame->SVG_PlotComponent( fullFileName );
387  editFrame->GetScreen()->SetPageSettings( pageSave );
388  }
389 
390  return 0;
391 }
392 
393 
395 {
396  LIB_PART* part = nullptr;
397  LIB_ID libId;
398  int unit, convert;
399 
400  if( m_isLibEdit )
401  {
402  LIB_EDIT_FRAME* editFrame = getEditFrame<LIB_EDIT_FRAME>();
403 
404  part = editFrame->GetCurPart();
405  unit = editFrame->GetUnit();
406  convert = editFrame->GetConvert();
407 
408  if( part )
409  libId = part->GetLibId();
410  }
411  else
412  {
413  LIB_VIEW_FRAME* viewFrame = getEditFrame<LIB_VIEW_FRAME>();
414 
415  if( viewFrame->IsModal() )
416  {
417  // if we're modal then we just need to return the symbol selection; the caller is
418  // already in a EE_ACTIONS::placeSymbol coroutine.
419  viewFrame->FinishModal();
420  return 0;
421  }
422  else
423  {
424  part = viewFrame->GetSelectedSymbol();
425  unit = viewFrame->GetUnit();
426  convert = viewFrame->GetConvert();
427 
428  if( part )
429  libId = part->GetLibId();
430  }
431  }
432 
433  if( part )
434  {
435  SCH_EDIT_FRAME* schframe = (SCH_EDIT_FRAME*) m_frame->Kiway().Player( FRAME_SCH, false );
436 
437  if( !schframe ) // happens when the schematic editor is not active (or closed)
438  {
439  DisplayErrorMessage( m_frame, _( "No schematic currently open." ) );
440  return 0;
441  }
442 
443  SCH_COMPONENT* comp = new SCH_COMPONENT( *part, libId, g_CurrentSheet, unit, convert );
444 
445  // Be sure the link to the corresponding LIB_PART is OK:
446  comp->Resolve( *m_frame->Prj().SchSymbolLibTable() );
447 
448  if( schframe->GetAutoplaceFields() )
449  comp->AutoplaceFields( /* aScreen */ nullptr, /* aManual */ false );
450 
451  schframe->Raise();
452  schframe->GetToolManager()->RunAction( EE_ACTIONS::placeSymbol, true, comp );
453  }
454 
455  return 0;
456 }
457 
458 
460 {
466 
467  Go( &LIB_CONTROL::Save, ACTIONS::save.MakeEvent() );
468  Go( &LIB_CONTROL::Save, ACTIONS::saveAs.MakeEvent() ); // for libraries
469  Go( &LIB_CONTROL::Save, ACTIONS::saveCopyAs.MakeEvent() ); // for symbols
470  Go( &LIB_CONTROL::Save, ACTIONS::saveAll.MakeEvent() );
471  Go( &LIB_CONTROL::Revert, ACTIONS::revert.MakeEvent() );
472 
482 
485 
491 }
static bool ShowAlways(const SELECTION &aSelection)
Function ShowAlways The default condition function (always returns true).
void SVG_PlotComponent(const wxString &aFullFileName)
Creates the SVG print file for the current edited component.
KIGFX::SCH_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
static TOOL_ACTION pinLibrary
Definition: actions.h:104
void DuplicatePart(bool aFromClipboard)
Inserts a duplicate part.
int AddLibrary(const TOOL_EVENT &aEvent)
LIB_PART * GetSelectedSymbol() const
int UnpinLibrary(const TOOL_EVENT &aEvent)
const UTF8 & GetLibItemName() const
Definition: lib_id.h:114
TOOL_MENU m_menu
functions below are not yet implemented - their interface may change
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_holder.h:56
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
int EditSymbol(const TOOL_EVENT &aEvent)
LIB_ID GetLibId() const override
void SetUnitAndConvert(int aUnit, int aConvert)
Set unit and convert, and set flag preventing them from automatically resetting to 1.
static TOOL_ACTION pasteSymbol
Definition: ee_actions.h:171
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:252
This file is part of the common library TODO brief description.
int GetConvert() const
wxString GetName() const override
bool SaveCanvasImageToFile(EDA_DRAW_FRAME *aFrame, const wxString &aFileName, wxBitmapType aBitmapType)
Save the current view as an image file.
Definition: bitmap.cpp:195
Model changes (required full reload)
Definition: tool_base.h:81
This file is part of the common library.
int PinLibrary(const TOOL_EVENT &aEvent)
int ToggleSyncedPinsMode(const TOOL_EVENT &aEvent)
static TOOL_ACTION duplicateSymbol
Definition: ee_actions.h:167
int AddSymbol(const TOOL_EVENT &aEvent)
bool Resolve(PART_LIBS *aLibs)
Assigns the current LIB_PART from aLibs which this symbol is based on.
void LoadPart(const wxString &aLibrary, const wxString &aPart, int Unit)
int ShowElectricalTypes(const TOOL_EVENT &aEvent)
CONDITIONAL_MENU & GetMenu()
Function GetMenu.
Definition: tool_menu.cpp:46
int GetUnit() const
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:218
static TOOL_ACTION cancelInteractive
Definition: actions.h:65
void UpdateAllItems(int aUpdateFlags)
Updates all items in the view according to the given flags.
Definition: view.cpp:1444
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:139
void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: sch_screen.h:153
KIGFX::SCH_RENDER_SETTINGS * GetRenderSettings()
static TOOL_ACTION unpinLibrary
Definition: actions.h:105
int ExportView(const TOOL_EVENT &aEvent)
Schematic editor (Eeschema) main window.
void SetShowElectricalType(bool aShow)
LIB_PART * GetCurPart()
Return the current part being edited or NULL if none selected.
static TOOL_ACTION showComponentTree
Definition: ee_actions.h:191
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
int ExportSymbol(const TOOL_EVENT &aEvent)
bool GetAutoplaceFields() const
static TOOL_ACTION showDeMorganAlternate
Definition: ee_actions.h:129
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:152
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Function Go()
Symbol library viewer main window.
int GetConvert() const
void RegenerateLibraryTree()
Filter, sort, and redisplay the library tree.
static TOOL_ACTION saveCopyAs
Definition: actions.h:56
bool IsAction(const TOOL_ACTION *aAction) const
Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_AC...
Definition: tool_event.cpp:67
void Save()
Saves the selected part or library.
LIB_ID GetTreeLIBID(int *aUnit=nullptr) const
Return the LIB_ID of the library or symbol selected in the symbol tree.
void SaveAs()
Saves the selected part or library to a new name and/or location.
static TOOL_ACTION editSymbol
Definition: ee_actions.h:166
Item is being added to the view.
Definition: view_item.h:60
int GetUnit() const
SCH_SHEET_PATH * g_CurrentSheet
With the new connectivity algorithm, many more places than before want to know what the current sheet...
VTBL_ENTRY KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=NULL)
Function Player returns the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:341
void SaveAll()
Saves all modified parts and libraries.
PAGE_INFO describes the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:54
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
static TOOL_ACTION save
Definition: actions.h:54
int Save(const TOOL_EVENT &aEvt)
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
TOOL_EVENT.
Definition: tool_event.h:171
wxString EDA_FILE_SELECTOR(const wxString &aTitle, const wxString &aPath, const wxString &aFileName, const wxString &aExtension, const wxString &aWildcard, wxWindow *aParent, int aStyle, const bool aKeepWorkingDirectory, const wxPoint &aPosition, wxString *aMruPath)
Function EDA_FILE_SELECTOR.
Definition: gestfich.cpp:52
static TOOL_ACTION deleteSymbol
Definition: ee_actions.h:168
Define a library symbol object.
static TOOL_ACTION cutSymbol
Definition: ee_actions.h:169
Definition of file extensions used in Kicad.
void ResetTools(TOOL_BASE::RESET_REASON aReason)
Function ResetTools() Resets all tools (i.e.
static TOOL_ACTION addLibrary
Definition: actions.h:52
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:97
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:153
static TOOL_ACTION importSymbol
Definition: ee_actions.h:172
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:58
static TOOL_ACTION placeSymbol
Definition: ee_actions.h:79
VTBL_ENTRY const wxString GetProjectFullName() const
Function GetProjectFullName returns the full path and name of the project.
Definition: project.cpp:96
static TOOL_ACTION addSymbolToSchematic
Definition: ee_actions.h:162
Model class in the component selector Model-View-Adapter (mediated MVC) architecture.
int AddSymbolToSchematic(const TOOL_EVENT &aEvent)
bool IsModal()
Definition: kiway_player.h:163
void setTransitions() override
Sets up handlers for various events.
static TOOL_ACTION newLibrary
Definition: actions.h:51
static TOOL_ACTION showDeMorganStandard
Definition: ee_actions.h:128
static TOOL_ACTION showElectricalTypes
Definition: ee_actions.h:190
void SetHeightMils(int aHeightInMils)
Definition: page_info.cpp:253
static TOOL_ACTION exportSymbolView
Definition: ee_actions.h:194
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...
wxString PngFileWildcard()
void AddSeparator(int aOrder=ANY_ORDER)
Function AddSeparator()
void ImportPart()
Definition: lib_export.cpp:37
static TOOL_ACTION newSymbol
Definition: ee_actions.h:165
static TOOL_ACTION exportSymbol
Definition: ee_actions.h:173
static TOOL_ACTION copySymbol
Definition: ee_actions.h:170
int CutCopyDelete(const TOOL_EVENT &aEvent)
int Revert(const TOOL_EVENT &aEvent)
The symbol library editor main window.
bool m_SyncPinEdit
Set to true to synchronize pins at the same position when editing symbols with multiple units or mult...
bool IsType(FRAME_T aType) const
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
static TOOL_ACTION saveAs
Definition: actions.h:55
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
#define _(s)
Definition: 3d_actions.cpp:33
void FinishModal()
Send the selected symbol back to the caller.
enum TYPE m_Type
void SetWidthMils(int aWidthInMils)
Definition: page_info.cpp:239
const EDA_RECT GetUnitBoundingBox(int aUnit, int aConvert) const
Get the bounding box for the symbol.
void CreateNewPart()
Creates a new part in the selected library.
void SetConvert(int aConvert)
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Automatically orient all the fields in the component.
SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:99
static TOOL_ACTION toggleSyncedPinsMode
Definition: ee_actions.h:184
int ExportSymbolAsSVG(const TOOL_EVENT &aEvent)
static TOOL_ACTION saveAll
Definition: actions.h:57
int DuplicateSymbol(const TOOL_EVENT &aEvent)
LIB_TREE_NODE * GetCurrentTreeNode() const
static TOOL_ACTION exportSymbolAsSVG
Definition: ee_actions.h:195
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Function AddItem()
bool Init() override
Function Init() Init() is called once upon a registration of the tool.
Definition: lib_control.cpp:40
int ShowComponentTree(const TOOL_EVENT &aEvent)
static TOOL_ACTION revert
Definition: actions.h:58
int OnDeMorgan(const TOOL_EVENT &aEvent)
bool GetShowElectricalType()
Allow some frames to show/hide pin electrical type names.
bool empty() const
Definition: utf8.h:108