You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

561 lines
20 KiB

7 years ago
7 years ago
7 years ago
5 years ago
7 years ago
5 years ago
5 years ago
5 years ago
7 years ago
7 years ago
7 years ago
7 years ago
5 years ago
5 years ago
5 years ago
6 years ago
7 years ago
7 years ago
  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-2021 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. #include <kiway.h>
  25. #include <sch_painter.h>
  26. #include <tool/tool_manager.h>
  27. #include <tools/ee_actions.h>
  28. #include <tools/symbol_editor_control.h>
  29. #include <symbol_edit_frame.h>
  30. #include <symbol_library_manager.h>
  31. #include <symbol_viewer_frame.h>
  32. #include <symbol_tree_model_adapter.h>
  33. #include <wildcards_and_files_ext.h>
  34. #include <wildcards_and_files_ext.h>
  35. #include <bitmaps/bitmap_types.h>
  36. #include <confirm.h>
  37. #include <wx/filedlg.h>
  38. bool SYMBOL_EDITOR_CONTROL::Init()
  39. {
  40. m_frame = getEditFrame<SCH_BASE_FRAME>();
  41. m_selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
  42. m_isSymbolEditor = m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR );
  43. if( m_isSymbolEditor )
  44. {
  45. CONDITIONAL_MENU& ctxMenu = m_menu.GetMenu();
  46. SYMBOL_EDIT_FRAME* editFrame = getEditFrame<SYMBOL_EDIT_FRAME>();
  47. wxCHECK( editFrame, false );
  48. auto libSelectedCondition =
  49. [ editFrame ]( const SELECTION& aSel )
  50. {
  51. LIB_ID sel = editFrame->GetTreeLIBID();
  52. return !sel.GetLibNickname().empty() && sel.GetLibItemName().empty();
  53. };
  54. // The libInferredCondition allows you to do things like New Symbol and Paste with a
  55. // symbol selected (in other words, when we know the library context even if the library
  56. // itself isn't selected.
  57. auto libInferredCondition =
  58. [ editFrame ]( const SELECTION& aSel )
  59. {
  60. LIB_ID sel = editFrame->GetTreeLIBID();
  61. return !sel.GetLibNickname().empty();
  62. };
  63. auto pinnedLibSelectedCondition =
  64. [ editFrame ]( const SELECTION& aSel )
  65. {
  66. LIB_TREE_NODE* current = editFrame->GetCurrentTreeNode();
  67. return current && current->m_Type == LIB_TREE_NODE::LIB && current->m_Pinned;
  68. };
  69. auto unpinnedLibSelectedCondition =
  70. [ editFrame ](const SELECTION& aSel )
  71. {
  72. LIB_TREE_NODE* current = editFrame->GetCurrentTreeNode();
  73. return current && current->m_Type == LIB_TREE_NODE::LIB && !current->m_Pinned;
  74. };
  75. auto symbolSelectedCondition =
  76. [ editFrame ]( const SELECTION& aSel )
  77. {
  78. LIB_ID sel = editFrame->GetTreeLIBID();
  79. return !sel.GetLibNickname().empty() && !sel.GetLibItemName().empty();
  80. };
  81. auto saveSymbolAsCondition =
  82. [ editFrame ]( const SELECTION& aSel )
  83. {
  84. LIB_ID sel = editFrame->GetTargetLibId();
  85. return !sel.GetLibNickname().empty() && !sel.GetLibItemName().empty();
  86. };
  87. ctxMenu.AddItem( ACTIONS::pinLibrary, unpinnedLibSelectedCondition );
  88. ctxMenu.AddItem( ACTIONS::unpinLibrary, pinnedLibSelectedCondition );
  89. ctxMenu.AddSeparator();
  90. ctxMenu.AddItem( EE_ACTIONS::newSymbol, libInferredCondition );
  91. ctxMenu.AddSeparator();
  92. ctxMenu.AddItem( ACTIONS::save, symbolSelectedCondition || libInferredCondition );
  93. ctxMenu.AddItem( EE_ACTIONS::saveLibraryAs, libSelectedCondition );
  94. ctxMenu.AddItem( EE_ACTIONS::saveSymbolAs, saveSymbolAsCondition );
  95. ctxMenu.AddItem( ACTIONS::revert, symbolSelectedCondition || libInferredCondition );
  96. ctxMenu.AddSeparator();
  97. ctxMenu.AddItem( EE_ACTIONS::cutSymbol, symbolSelectedCondition );
  98. ctxMenu.AddItem( EE_ACTIONS::copySymbol, symbolSelectedCondition );
  99. ctxMenu.AddItem( EE_ACTIONS::pasteSymbol, libInferredCondition );
  100. ctxMenu.AddItem( EE_ACTIONS::duplicateSymbol, symbolSelectedCondition );
  101. ctxMenu.AddItem( EE_ACTIONS::deleteSymbol, symbolSelectedCondition );
  102. ctxMenu.AddSeparator();
  103. ctxMenu.AddItem( EE_ACTIONS::importSymbol, libInferredCondition );
  104. ctxMenu.AddItem( EE_ACTIONS::exportSymbol, symbolSelectedCondition );
  105. // If we've got nothing else to show, at least show a hide tree option
  106. ctxMenu.AddItem( EE_ACTIONS::hideSymbolTree, !libInferredCondition );
  107. }
  108. return true;
  109. }
  110. int SYMBOL_EDITOR_CONTROL::AddLibrary( const TOOL_EVENT& aEvent )
  111. {
  112. bool createNew = aEvent.IsAction( &ACTIONS::newLibrary );
  113. if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) )
  114. static_cast<SYMBOL_EDIT_FRAME*>( m_frame )->AddLibraryFile( createNew );
  115. return 0;
  116. }
  117. int SYMBOL_EDITOR_CONTROL::EditSymbol( const TOOL_EVENT& aEvent )
  118. {
  119. if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) )
  120. {
  121. SYMBOL_EDIT_FRAME* editFrame = static_cast<SYMBOL_EDIT_FRAME*>( m_frame );
  122. int unit = 0;
  123. LIB_ID partId = editFrame->GetTreeLIBID( &unit );
  124. editFrame->LoadSymbol( partId.GetLibItemName(), partId.GetLibNickname(), unit );
  125. }
  126. return 0;
  127. }
  128. int SYMBOL_EDITOR_CONTROL::AddSymbol( const TOOL_EVENT& aEvent )
  129. {
  130. if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) )
  131. {
  132. SYMBOL_EDIT_FRAME* editFrame = static_cast<SYMBOL_EDIT_FRAME*>( m_frame );
  133. LIB_ID sel = editFrame->GetTreeLIBID();
  134. const wxString& libName = sel.GetLibNickname();
  135. wxString msg;
  136. if( libName.IsEmpty() )
  137. {
  138. msg.Printf( _( "No symbol library selected." ), libName );
  139. m_frame->ShowInfoBarError( msg );
  140. return 0;
  141. }
  142. if( editFrame->GetLibManager().IsLibraryReadOnly( libName ) )
  143. {
  144. msg.Printf( _( "Symbol library '%s' is not writable." ), libName );
  145. m_frame->ShowInfoBarError( msg );
  146. return 0;
  147. }
  148. if( aEvent.IsAction( &EE_ACTIONS::newSymbol ) )
  149. editFrame->CreateNewSymbol();
  150. else if( aEvent.IsAction( &EE_ACTIONS::importSymbol ) )
  151. editFrame->ImportSymbol();
  152. }
  153. return 0;
  154. }
  155. int SYMBOL_EDITOR_CONTROL::Save( const TOOL_EVENT& aEvt )
  156. {
  157. if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) )
  158. {
  159. SYMBOL_EDIT_FRAME* editFrame = static_cast<SYMBOL_EDIT_FRAME*>( m_frame );
  160. if( aEvt.IsAction( &EE_ACTIONS::save ) )
  161. editFrame->Save();
  162. else if( aEvt.IsAction( &EE_ACTIONS::saveLibraryAs ) )
  163. editFrame->SaveLibraryAs();
  164. else if( aEvt.IsAction( &EE_ACTIONS::saveSymbolAs ) )
  165. editFrame->SaveSymbolAs();
  166. else if( aEvt.IsAction( &EE_ACTIONS::saveAll ) )
  167. editFrame->SaveAll();
  168. }
  169. return 0;
  170. }
  171. int SYMBOL_EDITOR_CONTROL::Revert( const TOOL_EVENT& aEvent )
  172. {
  173. if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) )
  174. static_cast<SYMBOL_EDIT_FRAME*>( m_frame )->Revert();
  175. return 0;
  176. }
  177. int SYMBOL_EDITOR_CONTROL::ExportSymbol( const TOOL_EVENT& aEvent )
  178. {
  179. if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) )
  180. static_cast<SYMBOL_EDIT_FRAME*>( m_frame )->ExportSymbol();
  181. return 0;
  182. }
  183. int SYMBOL_EDITOR_CONTROL::CutCopyDelete( const TOOL_EVENT& aEvt )
  184. {
  185. if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) )
  186. {
  187. SYMBOL_EDIT_FRAME* editFrame = static_cast<SYMBOL_EDIT_FRAME*>( m_frame );
  188. if( aEvt.IsAction( &EE_ACTIONS::cutSymbol ) || aEvt.IsAction( &EE_ACTIONS::copySymbol ) )
  189. editFrame->CopySymbolToClipboard();
  190. if( aEvt.IsAction( &EE_ACTIONS::cutSymbol ) || aEvt.IsAction( &EE_ACTIONS::deleteSymbol ) )
  191. {
  192. LIB_ID sel = editFrame->GetTreeLIBID();
  193. const wxString& libName = sel.GetLibNickname();
  194. wxString msg;
  195. if( editFrame->GetLibManager().IsLibraryReadOnly( libName ) )
  196. {
  197. msg.Printf( _( "Symbol library '%s' is not writable." ), libName );
  198. m_frame->ShowInfoBarError( msg );
  199. return 0;
  200. }
  201. editFrame->DeleteSymbolFromLibrary();
  202. }
  203. }
  204. return 0;
  205. }
  206. int SYMBOL_EDITOR_CONTROL::DuplicateSymbol( const TOOL_EVENT& aEvent )
  207. {
  208. if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) )
  209. {
  210. SYMBOL_EDIT_FRAME* editFrame = static_cast<SYMBOL_EDIT_FRAME*>( m_frame );
  211. LIB_ID sel = editFrame->GetTreeLIBID();
  212. const wxString& libName = sel.GetLibNickname();
  213. wxString msg;
  214. if( editFrame->GetLibManager().IsLibraryReadOnly( libName ) )
  215. {
  216. msg.Printf( _( "Symbol library '%s' is not writable." ), libName );
  217. m_frame->ShowInfoBarError( msg );
  218. return 0;
  219. }
  220. editFrame->DuplicateSymbol( aEvent.IsAction( &EE_ACTIONS::pasteSymbol ) );
  221. }
  222. return 0;
  223. }
  224. int SYMBOL_EDITOR_CONTROL::OnDeMorgan( const TOOL_EVENT& aEvent )
  225. {
  226. int convert = aEvent.IsAction( &EE_ACTIONS::showDeMorganStandard ) ?
  227. LIB_ITEM::LIB_CONVERT::BASE : LIB_ITEM::LIB_CONVERT::DEMORGAN;
  228. if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) )
  229. {
  230. m_toolMgr->RunAction( ACTIONS::cancelInteractive, true );
  231. m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
  232. SYMBOL_EDIT_FRAME* symbolEditor = static_cast<SYMBOL_EDIT_FRAME*>( m_frame );
  233. symbolEditor->SetConvert( convert );
  234. m_toolMgr->ResetTools( TOOL_BASE::MODEL_RELOAD );
  235. symbolEditor->RebuildView();
  236. }
  237. else if( m_frame->IsType( FRAME_SCH_VIEWER ) || m_frame->IsType( FRAME_SCH_VIEWER_MODAL ) )
  238. {
  239. SYMBOL_VIEWER_FRAME* symbolViewer = static_cast<SYMBOL_VIEWER_FRAME*>( m_frame );
  240. symbolViewer->SetUnitAndConvert( symbolViewer->GetUnit(), convert );
  241. }
  242. return 0;
  243. }
  244. int SYMBOL_EDITOR_CONTROL::PinLibrary( const TOOL_EVENT& aEvent )
  245. {
  246. if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) )
  247. {
  248. SYMBOL_EDIT_FRAME* editFrame = static_cast<SYMBOL_EDIT_FRAME*>( m_frame );
  249. LIB_TREE_NODE* currentNode = editFrame->GetCurrentTreeNode();
  250. if( currentNode && !currentNode->m_Pinned )
  251. {
  252. currentNode->m_Pinned = true;
  253. editFrame->RegenerateLibraryTree();
  254. }
  255. }
  256. return 0;
  257. }
  258. int SYMBOL_EDITOR_CONTROL::UnpinLibrary( const TOOL_EVENT& aEvent )
  259. {
  260. if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) )
  261. {
  262. SYMBOL_EDIT_FRAME* editFrame = static_cast<SYMBOL_EDIT_FRAME*>( m_frame );
  263. LIB_TREE_NODE* currentNode = editFrame->GetCurrentTreeNode();
  264. if( currentNode && currentNode->m_Pinned )
  265. {
  266. currentNode->m_Pinned = false;
  267. editFrame->RegenerateLibraryTree();
  268. }
  269. }
  270. return 0;
  271. }
  272. int SYMBOL_EDITOR_CONTROL::ToggleSymbolTree( const TOOL_EVENT& aEvent )
  273. {
  274. if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) )
  275. {
  276. wxCommandEvent dummy;
  277. static_cast<SYMBOL_EDIT_FRAME*>( m_frame )->OnToggleSymbolTree( dummy );
  278. }
  279. return 0;
  280. }
  281. int SYMBOL_EDITOR_CONTROL::ShowElectricalTypes( const TOOL_EVENT& aEvent )
  282. {
  283. KIGFX::SCH_RENDER_SETTINGS* renderSettings = m_frame->GetRenderSettings();
  284. renderSettings->m_ShowPinsElectricalType = !renderSettings->m_ShowPinsElectricalType;
  285. // Update canvas
  286. m_frame->GetCanvas()->GetView()->UpdateAllItems( KIGFX::REPAINT );
  287. m_frame->GetCanvas()->Refresh();
  288. return 0;
  289. }
  290. int SYMBOL_EDITOR_CONTROL::ToggleSyncedPinsMode( const TOOL_EVENT& aEvent )
  291. {
  292. if( !m_isSymbolEditor )
  293. return 0;
  294. SYMBOL_EDIT_FRAME* editFrame = getEditFrame<SYMBOL_EDIT_FRAME>();
  295. editFrame->m_SyncPinEdit = !editFrame->m_SyncPinEdit;
  296. return 0;
  297. }
  298. int SYMBOL_EDITOR_CONTROL::ExportView( const TOOL_EVENT& aEvent )
  299. {
  300. if( !m_isSymbolEditor )
  301. return 0;
  302. SYMBOL_EDIT_FRAME* editFrame = getEditFrame<SYMBOL_EDIT_FRAME>();
  303. LIB_SYMBOL* symbol = editFrame->GetCurSymbol();
  304. if( !symbol )
  305. {
  306. wxMessageBox( _( "No symbol to export" ) );
  307. return 0;
  308. }
  309. wxString file_ext = wxT( "png" );
  310. wxString mask = wxT( "*." ) + file_ext;
  311. wxFileName fn( symbol->GetName() );
  312. fn.SetExt( "png" );
  313. wxString projectPath = wxPathOnly( m_frame->Prj().GetProjectFullName() );
  314. wxFileDialog dlg( editFrame, _( "Image File Name" ), projectPath, fn.GetFullName(),
  315. PngFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
  316. if( dlg.ShowModal() == wxID_OK && !dlg.GetPath().IsEmpty() )
  317. {
  318. // calling wxYield is mandatory under Linux, after closing the file selector dialog
  319. // to refresh the screen before creating the PNG or JPEG image from screen
  320. wxYield();
  321. if( !SaveCanvasImageToFile( editFrame, dlg.GetPath(), BITMAP_TYPE::PNG ) )
  322. {
  323. wxMessageBox( wxString::Format( _( "Can't save file '%s'." ), dlg.GetPath() ) );
  324. }
  325. }
  326. return 0;
  327. }
  328. int SYMBOL_EDITOR_CONTROL::ExportSymbolAsSVG( const TOOL_EVENT& aEvent )
  329. {
  330. if( !m_isSymbolEditor )
  331. return 0;
  332. SYMBOL_EDIT_FRAME* editFrame = getEditFrame<SYMBOL_EDIT_FRAME>();
  333. LIB_SYMBOL* symbol = editFrame->GetCurSymbol();
  334. if( !symbol )
  335. {
  336. wxMessageBox( _( "No symbol to export" ) );
  337. return 0;
  338. }
  339. wxString file_ext = SVGFileExtension;
  340. wxFileName fn( symbol->GetName() );
  341. fn.SetExt( SVGFileExtension );
  342. wxString pro_dir = wxPathOnly( m_frame->Prj().GetProjectFullName() );
  343. wxString fullFileName = wxFileSelector( _( "SVG File Name" ), pro_dir, fn.GetFullName(),
  344. SVGFileExtension, SVGFileWildcard(), wxFD_SAVE,
  345. m_frame );
  346. if( !fullFileName.IsEmpty() )
  347. {
  348. PAGE_INFO pageSave = editFrame->GetScreen()->GetPageSettings();
  349. PAGE_INFO pageTemp = pageSave;
  350. wxSize symbolSize = symbol->GetUnitBoundingBox( editFrame->GetUnit(),
  351. editFrame->GetConvert() ).GetSize();
  352. // Add a small margin to the plot bounding box
  353. pageTemp.SetWidthMils( int( symbolSize.x * 1.2 ) );
  354. pageTemp.SetHeightMils( int( symbolSize.y * 1.2 ) );
  355. editFrame->GetScreen()->SetPageSettings( pageTemp );
  356. editFrame->SVGPlotSymbol( fullFileName );
  357. editFrame->GetScreen()->SetPageSettings( pageSave );
  358. }
  359. return 0;
  360. }
  361. int SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic( const TOOL_EVENT& aEvent )
  362. {
  363. LIB_SYMBOL* libSymbol = nullptr;
  364. LIB_ID libId;
  365. int unit, convert;
  366. if( m_isSymbolEditor )
  367. {
  368. SYMBOL_EDIT_FRAME* editFrame = getEditFrame<SYMBOL_EDIT_FRAME>();
  369. libSymbol = editFrame->GetCurSymbol();
  370. unit = editFrame->GetUnit();
  371. convert = editFrame->GetConvert();
  372. if( libSymbol )
  373. libId = libSymbol->GetLibId();
  374. }
  375. else
  376. {
  377. SYMBOL_VIEWER_FRAME* viewerFrame = getEditFrame<SYMBOL_VIEWER_FRAME>();
  378. if( viewerFrame->IsModal() )
  379. {
  380. // if we're modal then we just need to return the symbol selection; the caller is
  381. // already in a EE_ACTIONS::placeSymbol coroutine.
  382. viewerFrame->FinishModal();
  383. return 0;
  384. }
  385. else
  386. {
  387. libSymbol = viewerFrame->GetSelectedSymbol();
  388. unit = viewerFrame->GetUnit();
  389. convert = viewerFrame->GetConvert();
  390. if( libSymbol )
  391. libId = libSymbol->GetLibId();
  392. }
  393. }
  394. if( libSymbol )
  395. {
  396. SCH_EDIT_FRAME* schframe = (SCH_EDIT_FRAME*) m_frame->Kiway().Player( FRAME_SCH, false );
  397. if( !schframe ) // happens when the schematic editor is not active (or closed)
  398. {
  399. DisplayErrorMessage( m_frame, _( "No schematic currently open." ) );
  400. return 0;
  401. }
  402. wxCHECK( libSymbol->GetLibId().IsValid(), 0 );
  403. SCH_SYMBOL* symbol = new SCH_SYMBOL( *libSymbol, libId, &schframe->GetCurrentSheet(),
  404. unit, convert );
  405. symbol->SetParent( schframe->GetScreen() );
  406. if( schframe->eeconfig()->m_AutoplaceFields.enable )
  407. symbol->AutoplaceFields( /* aScreen */ nullptr, /* aManual */ false );
  408. schframe->Raise();
  409. schframe->GetToolManager()->RunAction( EE_ACTIONS::placeSymbol, true, symbol );
  410. }
  411. return 0;
  412. }
  413. void SYMBOL_EDITOR_CONTROL::setTransitions()
  414. {
  415. Go( &SYMBOL_EDITOR_CONTROL::AddLibrary, ACTIONS::newLibrary.MakeEvent() );
  416. Go( &SYMBOL_EDITOR_CONTROL::AddLibrary, ACTIONS::addLibrary.MakeEvent() );
  417. Go( &SYMBOL_EDITOR_CONTROL::AddSymbol, EE_ACTIONS::newSymbol.MakeEvent() );
  418. Go( &SYMBOL_EDITOR_CONTROL::AddSymbol, EE_ACTIONS::importSymbol.MakeEvent() );
  419. Go( &SYMBOL_EDITOR_CONTROL::EditSymbol, EE_ACTIONS::editSymbol.MakeEvent() );
  420. Go( &SYMBOL_EDITOR_CONTROL::Save, ACTIONS::save.MakeEvent() );
  421. Go( &SYMBOL_EDITOR_CONTROL::Save, EE_ACTIONS::saveLibraryAs.MakeEvent() );
  422. Go( &SYMBOL_EDITOR_CONTROL::Save, EE_ACTIONS::saveSymbolAs.MakeEvent() );
  423. Go( &SYMBOL_EDITOR_CONTROL::Save, ACTIONS::saveAll.MakeEvent() );
  424. Go( &SYMBOL_EDITOR_CONTROL::Revert, ACTIONS::revert.MakeEvent() );
  425. Go( &SYMBOL_EDITOR_CONTROL::DuplicateSymbol, EE_ACTIONS::duplicateSymbol.MakeEvent() );
  426. Go( &SYMBOL_EDITOR_CONTROL::CutCopyDelete, EE_ACTIONS::deleteSymbol.MakeEvent() );
  427. Go( &SYMBOL_EDITOR_CONTROL::CutCopyDelete, EE_ACTIONS::cutSymbol.MakeEvent() );
  428. Go( &SYMBOL_EDITOR_CONTROL::CutCopyDelete, EE_ACTIONS::copySymbol.MakeEvent() );
  429. Go( &SYMBOL_EDITOR_CONTROL::DuplicateSymbol, EE_ACTIONS::pasteSymbol.MakeEvent() );
  430. Go( &SYMBOL_EDITOR_CONTROL::ExportSymbol, EE_ACTIONS::exportSymbol.MakeEvent() );
  431. Go( &SYMBOL_EDITOR_CONTROL::ExportView, EE_ACTIONS::exportSymbolView.MakeEvent() );
  432. Go( &SYMBOL_EDITOR_CONTROL::ExportSymbolAsSVG, EE_ACTIONS::exportSymbolAsSVG.MakeEvent() );
  433. Go( &SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic, EE_ACTIONS::addSymbolToSchematic.MakeEvent() );
  434. Go( &SYMBOL_EDITOR_CONTROL::OnDeMorgan, EE_ACTIONS::showDeMorganStandard.MakeEvent() );
  435. Go( &SYMBOL_EDITOR_CONTROL::OnDeMorgan, EE_ACTIONS::showDeMorganAlternate.MakeEvent() );
  436. Go( &SYMBOL_EDITOR_CONTROL::ShowElectricalTypes, EE_ACTIONS::showElectricalTypes.MakeEvent() );
  437. Go( &SYMBOL_EDITOR_CONTROL::PinLibrary, ACTIONS::pinLibrary.MakeEvent() );
  438. Go( &SYMBOL_EDITOR_CONTROL::UnpinLibrary, ACTIONS::unpinLibrary.MakeEvent() );
  439. Go( &SYMBOL_EDITOR_CONTROL::ToggleSymbolTree, EE_ACTIONS::showSymbolTree.MakeEvent() );
  440. Go( &SYMBOL_EDITOR_CONTROL::ToggleSymbolTree, EE_ACTIONS::hideSymbolTree.MakeEvent() );
  441. Go( &SYMBOL_EDITOR_CONTROL::ToggleSyncedPinsMode, EE_ACTIONS::toggleSyncedPinsMode.MakeEvent() );
  442. }