KiCad PCB EDA Suite
invoke_pcb_dialog.h File Reference

Go to the source code of this file.

Functions

void InvokePcbLibTableEditor (KIWAY *aKiway, wxWindow *aCaller)
 Function InvokePcbLibTableEditor shows the modal DIALOG_FP_LIB_TABLE for purposes of editing the global and project library tables. More...
 
void Invoke3DShapeLibsDownloaderWizard (wxWindow *aCaller)
 Function Invoke3DShapeLibsDownloaderWizard Runs the downloader wizard for easy 3D shape libraries download from the official Kicad Github repository of *.3Dshape libraries. More...
 
void InvokePluginOptionsEditor (wxWindow *aCaller, const wxString &aNickname, const wxString &aPluginType, const wxString &aOptions, wxString *aResult)
 Function InvokePluginOptionsEditor calls DIALOG_FP_PLUGIN_OPTIONS dialog so that plugin options set can be edited. More...
 
bool InvokeExportSVG (PCB_EDIT_FRAME *aCaller, BOARD *aBoard)
 Function InvokeExportSVG shows the Export SVG dialog. More...
 

Function Documentation

◆ Invoke3DShapeLibsDownloaderWizard()

void Invoke3DShapeLibsDownloaderWizard ( wxWindow *  aCaller)

Function Invoke3DShapeLibsDownloaderWizard Runs the downloader wizard for easy 3D shape libraries download from the official Kicad Github repository of *.3Dshape libraries.

Parameters
aCalleris the wxWindow which is invoking the dialog.

Definition at line 58 of file wizard_3DShape_Libs_downloader.cpp.

59 {
60  WIZARD_3DSHAPE_LIBS_DOWNLOADER wizard( aCaller );
61  wizard.RunWizard( wizard.GetFirstPage() );
62 }

References WIZARD_3DSHAPE_LIBS_DOWNLOADER::GetFirstPage().

Referenced by PCB_EDIT_FRAME::On3DShapeLibWizard().

◆ InvokeExportSVG()

bool InvokeExportSVG ( PCB_EDIT_FRAME aCaller,
BOARD aBoard 
)

Function InvokeExportSVG shows the Export SVG dialog.

Parameters
aCalleris the PCB_EDIT_FRAME which is invoking the dialog.
aBoardis the currently edited board.
Returns
bool - true if user pressed OK (did not abort), else false.

Definition at line 344 of file dialog_export_svg.cpp.

345 {
346  DIALOG_EXPORT_SVG dlg( aCaller, aBoard );
347 
348  dlg.ShowModal();
349 
350  return true;
351 }

Referenced by PCB_EDIT_FRAME::ExportSVG().

◆ InvokePcbLibTableEditor()

void InvokePcbLibTableEditor ( KIWAY aKiway,
wxWindow *  aCaller 
)

Function InvokePcbLibTableEditor shows the modal DIALOG_FP_LIB_TABLE for purposes of editing the global and project library tables.

Parameters
aCalleris the wxWindow which is invoking the dialog.
Returns
true if either table changed.

Definition at line 972 of file panel_fp_lib_table.cpp.

973 {
974  FP_LIB_TABLE* globalTable = &GFootprintTable;
975  wxString globalTablePath = FP_LIB_TABLE::GetGlobalTableFileName();
976  FP_LIB_TABLE* projectTable = aKiway->Prj().PcbFootprintLibs();
977  wxString projectTablePath = aKiway->Prj().FootprintLibTblName();
978  wxString msg;
979 
980  DIALOG_EDIT_LIBRARY_TABLES dlg( aCaller, _( "Footprint Libraries" ) );
981  dlg.SetKiway( &dlg, aKiway );
982 
983  dlg.InstallPanel( new PANEL_FP_LIB_TABLE( &dlg, globalTable, globalTablePath,
984  projectTable, projectTablePath,
985  aKiway->Prj().GetProjectPath() ) );
986 
987  if( dlg.ShowModal() == wxID_CANCEL )
988  return;
989 
990  if( dlg.m_GlobalTableChanged )
991  {
992  try
993  {
994  globalTable->Save( globalTablePath );
995  }
996  catch( const IO_ERROR& ioe )
997  {
998  msg.Printf( _( "Error saving global library table:\n\n%s" ), ioe.What() );
999  wxMessageBox( msg, _( "File Save Error" ), wxOK | wxICON_ERROR );
1000  }
1001  }
1002 
1003  if( dlg.m_ProjectTableChanged )
1004  {
1005  try
1006  {
1007  projectTable->Save( projectTablePath );
1008  }
1009  catch( const IO_ERROR& ioe )
1010  {
1011  msg.Printf( _( "Error saving project-specific library table:\n\n%s" ), ioe.What() );
1012  wxMessageBox( msg, _( "File Save Error" ), wxOK | wxICON_ERROR );
1013  }
1014  }
1015 
1016  auto editor = (FOOTPRINT_EDIT_FRAME*) aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
1017 
1018  if( editor )
1019  editor->SyncLibraryTree( true );
1020 
1021  auto viewer = (FOOTPRINT_VIEWER_FRAME*) aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
1022 
1023  if( viewer )
1024  viewer->ReCreateLibraryList();
1025 }
VTBL_ENTRY PROJECT & Prj() const
Function Prj returns the PROJECT associated with this KIWAY.
Definition: kiway.cpp:171
FP_LIB_TABLE GFootprintTable
!!!!!!!!!!!!!! This code is obsolete because of the merge into pcbnew, don't bother with it.
Component library viewer main window.
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:102
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
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
VTBL_ENTRY FP_LIB_TABLE * PcbFootprintLibs(KIWAY &aKiway)
Return the table of footprint libraries.
Definition: project.cpp:427
#define _(s)
Definition: 3d_actions.cpp:33
void Save(const wxString &aFileName) const
Write this library table to aFileName in s-expression form.
Dialog to show and edit symbol library tables.
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
VTBL_ENTRY const wxString FootprintLibTblName() const
Function FootprintLibTblName returns the path and filename of this project's fp-lib-table,...
Definition: project.cpp:120
static wxString GetGlobalTableFileName()
Function GetGlobalTableFileName.

References _, PROJECT::FootprintLibTblName(), FRAME_FOOTPRINT_EDITOR, FRAME_FOOTPRINT_VIEWER, FP_LIB_TABLE::GetGlobalTableFileName(), PROJECT::GetProjectPath(), GFootprintTable, DIALOG_EDIT_LIBRARY_TABLES::InstallPanel(), DIALOG_EDIT_LIBRARY_TABLES::m_GlobalTableChanged, DIALOG_EDIT_LIBRARY_TABLES::m_ProjectTableChanged, PROJECT::PcbFootprintLibs(), KIWAY::Player(), KIWAY::Prj(), LIB_TABLE::Save(), KIWAY_HOLDER::SetKiway(), and IO_ERROR::What().

Referenced by PCB::IFACE::CreateWindow().

◆ InvokePluginOptionsEditor()

void InvokePluginOptionsEditor ( wxWindow *  aCaller,
const wxString &  aNickname,
const wxString &  aPluginType,
const wxString &  aOptions,
wxString *  aResult 
)

Function InvokePluginOptionsEditor calls DIALOG_FP_PLUGIN_OPTIONS dialog so that plugin options set can be edited.

Parameters
aCalleris the wxTopLevelWindow which is invoking the dialog.
aNicknameis the footprint library whose options are being edited.
aPluginTypeis something that will pass through IO_MGR::EnumFromStr().
aOptionsis the options string on calling into this function.
aResultis where to put the result of the editing.

Definition at line 292 of file dialog_fp_plugin_options.cpp.

295 {
296  DIALOG_FP_PLUGIN_OPTIONS dlg( aCaller, aNickname, aPluginType, aOptions, aResult );
297 
298  dlg.ShowModal();
299 }
DIALOG_FP_PLUGIN_OPTIONS is an options editor in the form of a two column name/value spreadsheet like...

Referenced by FP_GRID_TRICKS::optionsEditor().