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 <confirm.h>
37 
38 
40 {
41  m_frame = getEditFrame<SCH_BASE_FRAME>();
44 
45  if( m_isLibEdit )
46  {
47  CONDITIONAL_MENU& ctxMenu = m_menu.GetMenu();
48  LIB_EDIT_FRAME* editFrame = getEditFrame<LIB_EDIT_FRAME>();
49 
50  auto libSelectedCondition = [ editFrame ] ( const SELECTION& aSel ) {
51  LIB_ID sel = editFrame->GetTreeLIBID();
52  return !sel.GetLibNickname().empty() && sel.GetLibItemName().empty();
53  };
54  auto pinnedLibSelectedCondition = [ editFrame ] ( const SELECTION& aSel ) {
55  LIB_TREE_NODE* current = editFrame->GetCurrentTreeNode();
56  return current && current->m_Type == LIB_TREE_NODE::LIB && current->m_Pinned;
57  };
58  auto unpinnedLibSelectedCondition = [ editFrame ] (const SELECTION& aSel ) {
59  LIB_TREE_NODE* current = editFrame->GetCurrentTreeNode();
60  return current && current->m_Type == LIB_TREE_NODE::LIB && !current->m_Pinned;
61  };
62  auto symbolSelectedCondition = [ editFrame ] ( const SELECTION& aSel ) {
63  LIB_ID sel = editFrame->GetTreeLIBID();
64  return !sel.GetLibNickname().empty() && !sel.GetLibItemName().empty();
65  };
66 
67  ctxMenu.AddItem( ACTIONS::pinLibrary, unpinnedLibSelectedCondition );
68  ctxMenu.AddItem( ACTIONS::unpinLibrary, pinnedLibSelectedCondition );
69  ctxMenu.AddSeparator();
70 
73  ctxMenu.AddItem( ACTIONS::save, libSelectedCondition );
74  ctxMenu.AddItem( ACTIONS::saveAs, libSelectedCondition );
75  ctxMenu.AddItem( ACTIONS::revert, libSelectedCondition );
76 
77  ctxMenu.AddSeparator();
79  ctxMenu.AddItem( EE_ACTIONS::editSymbol, symbolSelectedCondition );
80 
81  ctxMenu.AddSeparator();
82  ctxMenu.AddItem( ACTIONS::save, symbolSelectedCondition );
83  ctxMenu.AddItem( ACTIONS::saveCopyAs, symbolSelectedCondition );
84  ctxMenu.AddItem( EE_ACTIONS::duplicateSymbol, symbolSelectedCondition );
85  ctxMenu.AddItem( EE_ACTIONS::deleteSymbol, symbolSelectedCondition );
86  ctxMenu.AddItem( ACTIONS::revert, symbolSelectedCondition );
87 
88  ctxMenu.AddSeparator();
89  ctxMenu.AddItem( EE_ACTIONS::cutSymbol, symbolSelectedCondition );
90  ctxMenu.AddItem( EE_ACTIONS::copySymbol, symbolSelectedCondition );
92 
93  ctxMenu.AddSeparator();
95  ctxMenu.AddItem( EE_ACTIONS::exportSymbol, symbolSelectedCondition );
96  }
97 
98  return true;
99 }
100 
101 
103 {
104  bool createNew = aEvent.IsAction( &ACTIONS::newLibrary );
105 
107  static_cast<LIB_EDIT_FRAME*>( m_frame )->AddLibraryFile( createNew );
108 
109  return 0;
110 }
111 
112 
114 {
116  {
117  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
118  int unit = 0;
119  LIB_ID partId = editFrame->GetTreeLIBID( &unit );
120 
121  editFrame->LoadPart( partId.GetLibItemName(), partId.GetLibNickname(), unit );
122  }
123 
124  return 0;
125 }
126 
127 
128 int LIB_CONTROL::AddSymbol( const TOOL_EVENT& aEvent )
129 {
131  {
132  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
133 
134  if( aEvent.IsAction( &EE_ACTIONS::newSymbol ) )
135  editFrame->CreateNewPart();
136  else if( aEvent.IsAction( &EE_ACTIONS::importSymbol ) )
137  editFrame->ImportPart();
138  }
139 
140  return 0;
141 }
142 
143 
144 int LIB_CONTROL::Save( const TOOL_EVENT& aEvt )
145 {
147  {
148  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
149 
150  if( aEvt.IsAction( &EE_ACTIONS::save ) )
151  editFrame->Save();
152  else if( aEvt.IsAction( &EE_ACTIONS::saveAs ) || aEvt.IsAction( &EE_ACTIONS::saveCopyAs ) )
153  editFrame->SaveAs();
154  else if( aEvt.IsAction( &EE_ACTIONS::saveAll ) )
155  editFrame->SaveAll();
156  }
157 
158  return 0;
159 }
160 
161 
162 int LIB_CONTROL::Revert( const TOOL_EVENT& aEvent )
163 {
165  static_cast<LIB_EDIT_FRAME*>( m_frame )->Revert();
166 
167  return 0;
168 }
169 
170 
172 {
174  static_cast<LIB_EDIT_FRAME*>( m_frame )->ExportPart();
175 
176  return 0;
177 }
178 
179 
181 {
183  {
184  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
185 
187  editFrame->CopyPartToClipboard();
188 
190  editFrame->DeletePartFromLibrary();
191  }
192 
193  return 0;
194 }
195 
196 
198 {
200  {
201  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
202  editFrame->DuplicatePart( aEvent.IsAction( &EE_ACTIONS::pasteSymbol ) );
203  }
204 
205  return 0;
206 }
207 
208 
210 {
211  int convert = aEvent.IsAction( &EE_ACTIONS::showDeMorganStandard ) ?
212  LIB_ITEM::LIB_CONVERT::BASE : LIB_ITEM::LIB_CONVERT::DEMORGAN;
213 
215  {
218 
219  LIB_EDIT_FRAME* libEditFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
220  libEditFrame->SetConvert( convert );
221 
223  libEditFrame->RebuildView();
224  }
226  {
227  LIB_VIEW_FRAME* libViewFrame = static_cast<LIB_VIEW_FRAME*>( m_frame );
228  libViewFrame->SetUnitAndConvert( libViewFrame->GetUnit(), convert );
229  }
230 
231  return 0;
232 }
233 
234 
236 {
238  {
239  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
240  LIB_TREE_NODE* currentNode = editFrame->GetCurrentTreeNode();
241 
242  if( currentNode && !currentNode->m_Pinned )
243  {
244  currentNode->m_Pinned = true;
245  editFrame->RegenerateLibraryTree();
246  }
247  }
248 
249  return 0;
250 }
251 
252 
254 {
256  {
257  LIB_EDIT_FRAME* editFrame = static_cast<LIB_EDIT_FRAME*>( m_frame );
258  LIB_TREE_NODE* currentNode = editFrame->GetCurrentTreeNode();
259 
260  if( currentNode && currentNode->m_Pinned )
261  {
262  currentNode->m_Pinned = false;
263  editFrame->RegenerateLibraryTree();
264  }
265  }
266 
267  return 0;
268 }
269 
270 
272 {
274  {
275  wxCommandEvent dummy;
276  static_cast<LIB_EDIT_FRAME*>( m_frame )->OnToggleSearchTree( dummy );
277  }
278 
279  return 0;
280 }
281 
282 
284 {
286  renderSettings->m_ShowPinsElectricalType = !renderSettings->m_ShowPinsElectricalType;
287 
288  // Update canvas
290  m_frame->GetCanvas()->Refresh();
291 
292  return 0;
293 }
294 
295 
297 {
298  if( !m_isLibEdit )
299  return 0;
300 
301  LIB_EDIT_FRAME* editFrame = getEditFrame<LIB_EDIT_FRAME>();
302  editFrame->m_SyncPinEdit = !editFrame->m_SyncPinEdit;
303 
304  return 0;
305 }
306 
307 
309 {
310  if( !m_isLibEdit )
311  return 0;
312 
313  LIB_EDIT_FRAME* editFrame = getEditFrame<LIB_EDIT_FRAME>();
314  LIB_PART* part = editFrame->GetCurPart();
315 
316  if( !part )
317  {
318  wxMessageBox( _( "No symbol to export" ) );
319  return 0;
320  }
321 
322  wxString file_ext = wxT( "png" );
323  wxString mask = wxT( "*." ) + file_ext;
324  wxFileName fn( part->GetName() );
325  fn.SetExt( "png" );
326 
327  wxString projectPath = wxPathOnly( m_frame->Prj().GetProjectFullName() );
328 
329  wxFileDialog dlg( editFrame, _( "Image File Name" ), projectPath, fn.GetFullName(),
330  PngFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
331 
332  if( dlg.ShowModal() == wxID_OK && !dlg.GetPath().IsEmpty() )
333  {
334  // calling wxYield is mandatory under Linux, after closing the file selector dialog
335  // to refresh the screen before creating the PNG or JPEG image from screen
336  wxYield();
337 
338  if( !SaveCanvasImageToFile( editFrame, dlg.GetPath(), wxBITMAP_TYPE_PNG ) )
339  {
340  wxMessageBox( wxString::Format( _( "Can't save file \"%s\"." ), dlg.GetPath() ) );
341  }
342  }
343 
344  return 0;
345 }
346 
347 
349 {
350  if( !m_isLibEdit )
351  return 0;
352 
353  LIB_EDIT_FRAME* editFrame = getEditFrame<LIB_EDIT_FRAME>();
354  LIB_PART* part = editFrame->GetCurPart();
355 
356  if( !part )
357  {
358  wxMessageBox( _( "No symbol to export" ) );
359  return 0;
360  }
361 
362  wxString file_ext = wxT( "svg" );
363  wxString mask = wxT( "*." ) + file_ext;
364  wxFileName fn( part->GetName() );
365  fn.SetExt( file_ext );
366 
367  wxString pro_dir = wxPathOnly( m_frame->Prj().GetProjectFullName() );
368 
369  wxString fullFileName = EDA_FILE_SELECTOR( _( "Filename:" ), pro_dir, fn.GetFullName(),
370  file_ext, mask, m_frame, wxFD_SAVE, true );
371 
372  if( !fullFileName.IsEmpty() )
373  {
374  PAGE_INFO pageSave = editFrame->GetScreen()->GetPageSettings();
375  PAGE_INFO pageTemp = pageSave;
376 
377  wxSize componentSize = part->GetUnitBoundingBox( editFrame->GetUnit(),
378  editFrame->GetConvert() ).GetSize();
379 
380  // Add a small margin to the plot bounding box
381  pageTemp.SetWidthMils( int( componentSize.x * 1.2 ) );
382  pageTemp.SetHeightMils( int( componentSize.y * 1.2 ) );
383 
384  editFrame->GetScreen()->SetPageSettings( pageTemp );
385  editFrame->SVG_PlotComponent( fullFileName );
386  editFrame->GetScreen()->SetPageSettings( pageSave );
387  }
388 
389  return 0;
390 }
391 
392 
394 {
395  LIB_PART* part = nullptr;
396  LIB_ID libId;
397  int unit, convert;
398 
399  if( m_isLibEdit )
400  {
401  LIB_EDIT_FRAME* editFrame = getEditFrame<LIB_EDIT_FRAME>();
402 
403  part = editFrame->GetCurPart();
404  unit = editFrame->GetUnit();
405  convert = editFrame->GetConvert();
406 
407  if( part )
408  libId = part->GetLibId();
409  }
410  else
411  {
412  LIB_VIEW_FRAME* viewFrame = getEditFrame<LIB_VIEW_FRAME>();
413 
414  if( viewFrame->IsModal() )
415  {
416  // if we're modal then we just need to return the symbol selection; the caller is
417  // already in a EE_ACTIONS::placeSymbol coroutine.
418  viewFrame->FinishModal();
419  return 0;
420  }
421  else
422  {
423  part = viewFrame->GetSelectedSymbol();
424  unit = viewFrame->GetUnit();
425  convert = viewFrame->GetConvert();
426 
427  if( part )
428  libId = part->GetLibId();
429  }
430  }
431 
432  if( part )
433  {
434  SCH_EDIT_FRAME* schframe = (SCH_EDIT_FRAME*) m_frame->Kiway().Player( FRAME_SCH, false );
435 
436  if( !schframe ) // happens when the schematic editor is not active (or closed)
437  {
438  DisplayErrorMessage( m_frame, _( "No schematic currently open." ) );
439  return 0;
440  }
441 
442  wxCHECK( part->GetLibId().IsValid(), 0 );
443 
444  SCH_COMPONENT* comp =
445  new SCH_COMPONENT( *part, libId, &schframe->GetCurrentSheet(), unit, convert );
446 
447  comp->SetParent( schframe->GetCurrentSheet().LastScreen() );
448 
449  if( schframe->eeconfig()->m_AutoplaceFields.enable )
450  comp->AutoplaceFields( /* aScreen */ nullptr, /* aManual */ false );
451 
452  schframe->Raise();
453  schframe->GetToolManager()->RunAction( EE_ACTIONS::placeSymbol, true, comp );
454  }
455 
456  return 0;
457 }
458 
459 
461 {
467 
468  Go( &LIB_CONTROL::Save, ACTIONS::save.MakeEvent() );
469  Go( &LIB_CONTROL::Save, ACTIONS::saveAs.MakeEvent() ); // for libraries
470  Go( &LIB_CONTROL::Save, ACTIONS::saveCopyAs.MakeEvent() ); // for symbols
471  Go( &LIB_CONTROL::Save, ACTIONS::saveAll.MakeEvent() );
472  Go( &LIB_CONTROL::Revert, ACTIONS::revert.MakeEvent() );
473 
483 
486 
492 }
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:105
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
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:177
Model changes (required full reload)
Definition: tool_base.h:82
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)
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:219
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:140
void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: sch_screen.h:181
KIGFX::SCH_RENDER_SETTINGS * GetRenderSettings()
static TOOL_ACTION unpinLibrary
Definition: actions.h:106
int ExportView(const TOOL_EVENT &aEvent)
Schematic editor (Eeschema) main window.
LIB_PART * GetCurPart()
Return the current part being edited or NULL if none selected.
static TOOL_ACTION showComponentTree
Definition: ee_actions.h:194
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 IsValid() const
Definition: lib_id.h:171
static TOOL_ACTION showDeMorganAlternate
Definition: ee_actions.h:127
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:180
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.
virtual void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:196
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.
EESCHEMA_SETTINGS * eeconfig() const
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
AUTOPLACE_FIELDS m_AutoplaceFields
Item is being added to the view.
Definition: view_item.h:62
int GetUnit() const
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:342
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:56
static TOOL_ACTION placeSymbol
Definition: ee_actions.h:77
VTBL_ENTRY const wxString GetProjectFullName() const
Function GetProjectFullName returns the full path and name of the project.
Definition: project.cpp:116
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)
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:126
static TOOL_ACTION showElectricalTypes
Definition: ee_actions.h:193
void SetHeightMils(int aHeightInMils)
Definition: page_info.cpp:253
static TOOL_ACTION exportSymbolView
Definition: ee_actions.h:197
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...
SCH_SCREEN * LastScreen()
Function LastScreen.
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.
bool IsModal() const
Definition: kiway_player.h:176
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)
Schematic symbol object.
Definition: sch_component.h:88
SCH_RENDER_SETTINGS Stores schematic-specific render settings.
Definition: sch_painter.h:70
SCH_SHEET_PATH & GetCurrentSheet() const
static TOOL_ACTION toggleSyncedPinsMode
Definition: ee_actions.h:187
int ExportSymbolAsSVG(const TOOL_EVENT &aEvent)
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:74
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:198
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:39
int ShowComponentTree(const TOOL_EVENT &aEvent)
static TOOL_ACTION revert
Definition: actions.h:58
int OnDeMorgan(const TOOL_EVENT &aEvent)
bool empty() const
Definition: utf8.h:108