KiCad PCB EDA Suite
invoke_pcb_dialog.h File Reference

Go to the source code of this file.

Functions

int InvokePcbLibTableEditor (wxTopLevelWindow *aCaller, FP_LIB_TABLE *aGlobal, FP_LIB_TABLE *aProject)
 Function InvokePcbLibTableEditor shows the modal DIALOG_FP_LIB_TABLE for purposes of editing two lib tables. More...
 
int InvokeFootprintWizard (wxTopLevelWindow *aCaller, FP_LIB_TABLE *aGlobal, FP_LIB_TABLE *aProject)
 Function InvokeFootprintWizard Runs the footprint library wizard for easy library addition. More...
 
void Invoke3DShapeLibsDownloaderWizard (wxTopLevelWindow *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 (wxTopLevelWindow *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 InvokeDXFDialogBoardImport (PCB_BASE_FRAME *aCaller)
 Function InvokeDXFDialogBoardImport shows the modal DIALOG_DXF_IMPORT for importing a DXF file to a board. More...
 
bool InvokeDXFDialogModuleImport (PCB_BASE_FRAME *aCaller, MODULE *aModule)
 Function InvokeDXFDialogModuleImport shows the modal DIALOG_DXF_IMPORT for importing a DXF file as footprint outlines. More...
 
bool InvokeLayerSetup (wxTopLevelWindow *aCaller, BOARD *aBoard)
 Function InvokeLayerSetup shows the layer setup dialog. More...
 
bool InvokeSVGPrint (wxTopLevelWindow *aCaller, BOARD *aBoard, PCB_PLOT_PARAMS *aSettings)
 Function InvokeSVGPrint shows the SVG print dialog. More...
 
bool InvokeFPEditorPrefsDlg (FOOTPRINT_EDIT_FRAME *aCaller)
 Function InvokeSVGPrint shows the SVG print dialog. More...
 

Function Documentation

void Invoke3DShapeLibsDownloaderWizard ( wxTopLevelWindow *  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 wxTopLevelWindow which is invoking the dialog.

Definition at line 57 of file wizard_3DShape_Libs_downloader.cpp.

References WIZARD_3DSHAPE_LIBS_DOWNLOADER::GetFirstPage().

Referenced by PCB_EDIT_FRAME::Process_Config().

58 {
59  WIZARD_3DSHAPE_LIBS_DOWNLOADER wizard( aCaller );
60  wizard.RunWizard( wizard.GetFirstPage() );
61 }
bool InvokeDXFDialogBoardImport ( PCB_BASE_FRAME aCaller)

Function InvokeDXFDialogBoardImport shows the modal DIALOG_DXF_IMPORT for importing a DXF file to a board.

Parameters
aCalleris the wxTopLevelWindow which is invoking the dialog.
Returns
true if the import was made.

Definition at line 209 of file dialog_dxf_import.cpp.

References BOARD::Add(), PCB_BASE_FRAME::GetBoard(), DIALOG_DXF_IMPORT::GetImportedItems(), PCB_BASE_FRAME::OnModify(), PICKED_ITEMS_LIST::PushItem(), PCB_BASE_FRAME::SaveCopyInUndoList(), and UR_NEW.

Referenced by PCB_EDIT_FRAME::Process_Special_Functions().

210 {
211  DIALOG_DXF_IMPORT dlg( aCaller );
212  bool success = ( dlg.ShowModal() == wxID_OK );
213 
214  if( success )
215  {
216  const std::list<BOARD_ITEM*>& list = dlg.GetImportedItems();
217  PICKED_ITEMS_LIST picklist;
218  BOARD* board = aCaller->GetBoard();
219 
220  std::list<BOARD_ITEM*>::const_iterator it, itEnd;
221  for( it = list.begin(), itEnd = list.end(); it != itEnd; ++it )
222  {
223  BOARD_ITEM* item = *it;
224  board->Add( item );
225 
226  ITEM_PICKER itemWrapper( item, UR_NEW );
227  picklist.PushItem( itemWrapper );
228  }
229 
230  aCaller->SaveCopyInUndoList( picklist, UR_NEW, wxPoint( 0, 0 ) );
231  aCaller->OnModify();
232  }
233 
234  return success;
235 }
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
BOARD * GetBoard() const
void PushItem(const ITEM_PICKER &aItem)
Function PushItem pushes aItem to the top of the list.
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_INSERT) override
Adds an item to the container.
Class PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
virtual void OnModify()
Function OnModify Virtual Must be called after a change in order to set the "modify" flag of the curr...
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:169
virtual void SaveCopyInUndoList(BOARD_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, const wxPoint &aTransformPoint=wxPoint(0, 0))=0
Function SaveCopyInUndoList (virtual pure) Creates a new entry in undo list of commands.
bool InvokeDXFDialogModuleImport ( PCB_BASE_FRAME aCaller,
MODULE aModule 
)

Function InvokeDXFDialogModuleImport shows the modal DIALOG_DXF_IMPORT for importing a DXF file as footprint outlines.

Parameters
aCalleris the wxTopLevelWindow which is invoking the dialog.
aModuleis the footprint currently edited.
Returns
true if the import was made.

Definition at line 238 of file dialog_dxf_import.cpp.

References MODULE::Add(), DIALOG_DXF_IMPORT::GetImportedItems(), PCB_BASE_FRAME::OnModify(), PCB_BASE_FRAME::SaveCopyInUndoList(), and UR_CHANGED.

Referenced by FOOTPRINT_EDIT_FRAME::Process_Special_Functions().

239 {
240  wxASSERT( aModule );
241 
242  DIALOG_DXF_IMPORT dlg( aCaller, true );
243  bool success = ( dlg.ShowModal() == wxID_OK );
244 
245  if( success )
246  {
247  const std::list<BOARD_ITEM*>& list = dlg.GetImportedItems();
248 
249  aCaller->SaveCopyInUndoList( aModule, UR_CHANGED );
250  aCaller->OnModify();
251 
252  std::list<BOARD_ITEM*>::const_iterator it, itEnd;
253 
254  for( it = list.begin(), itEnd = list.end(); it != itEnd; ++it )
255  {
256  aModule->Add( *it );
257  }
258  }
259 
260  return success;
261 }
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_INSERT) override
>
virtual void OnModify()
Function OnModify Virtual Must be called after a change in order to set the "modify" flag of the curr...
virtual void SaveCopyInUndoList(BOARD_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, const wxPoint &aTransformPoint=wxPoint(0, 0))=0
Function SaveCopyInUndoList (virtual pure) Creates a new entry in undo list of commands.
int InvokeFootprintWizard ( wxTopLevelWindow *  aCaller,
FP_LIB_TABLE aGlobal,
FP_LIB_TABLE aProject 
)

Function InvokeFootprintWizard Runs the footprint library wizard for easy library addition.

Parameters
aCalleris the wxTopLevelWindow which is invoking the dialog.
aGlobalis the common footprint library table file being edited. If aGlobal is NULL, then it will not be updated.
aProjectis the project specific footprint library table file being edited. if aProject is NULL, then it will not be updated.
Returns
int 0 - no changes 1 - changes in the global table 2 - changes in the project table 3 - changes in both tables

Definition at line 765 of file dialog_fp_lib_table.cpp.

References WIZARD_FPLIB_TABLE::GetFirstPage(), WIZARD_FPLIB_TABLE::GetLibraries(), WIZARD_FPLIB_TABLE::GetLibScope(), WIZARD_FPLIB_TABLE::GLOBAL, LIB_TABLE::InsertRow(), and WIZARD_FPLIB_TABLE::LIBRARY::INVALID.

Referenced by PCB_EDIT_FRAME::Process_Config(), and FOOTPRINT_EDIT_FRAME::ProcessPreferences().

767 {
768  WIZARD_FPLIB_TABLE dlg( aParent );
769 
770  if( !dlg.RunWizard( dlg.GetFirstPage() ) )
771  return 0; // Aborted by user
772 
773  const std::vector<WIZARD_FPLIB_TABLE::LIBRARY>& libs = dlg.GetLibraries();
774  WIZARD_FPLIB_TABLE::LIB_SCOPE scope = dlg.GetLibScope();
775  FP_LIB_TABLE* fp_tbl = ( scope == WIZARD_FPLIB_TABLE::GLOBAL ? aGlobal : aProject );
776 
777  if( fp_tbl )
778  {
779  for( std::vector<WIZARD_FPLIB_TABLE::LIBRARY>::const_iterator it = libs.begin();
780  it != libs.end(); ++it )
781  {
782  if( it->GetStatus() == WIZARD_FPLIB_TABLE::LIBRARY::INVALID )
783  continue;
784 
785  FP_LIB_TABLE_ROW* row = new FP_LIB_TABLE_ROW( it->GetDescription(),
786  it->GetAutoPath( scope ),
787  it->GetPluginName(),
788  wxEmptyString ); // options
789  fp_tbl->InsertRow( row );
790  }
791  }
792 
793  return scope;
794 }
Class FP_LIB_TABLE_ROW.
Definition: fp_lib_table.h:42
bool InsertRow(LIB_TABLE_ROW *aRow, bool doReplace=false)
Function InsertRow.
LIB_SCOPE
Scope (global/project)
bool InvokeFPEditorPrefsDlg ( FOOTPRINT_EDIT_FRAME aCaller)

Function InvokeSVGPrint shows the SVG print dialog.

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

Definition at line 68 of file dialog_modedit_options.cpp.

Referenced by FOOTPRINT_EDIT_FRAME::ProcessPreferences().

69 {
70  DIALOG_MODEDIT_OPTIONS dlg( aCaller );
71 
72  int ret = dlg.ShowModal();
73 
74  return ret == wxID_OK;
75 }
bool InvokeLayerSetup ( wxTopLevelWindow *  aCaller,
BOARD aBoard 
)

Function InvokeLayerSetup shows the layer setup dialog.

Parameters
aCalleris the wxTopLevelWindow 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 736 of file dialog_layers_setup.cpp.

Referenced by PCB_EDIT_FRAME::Process_Config().

737 {
738  DIALOG_LAYERS_SETUP dlg( aCaller, aBoard );
739 
740  return dlg.ShowModal() == wxID_OK;
741 }
int InvokePcbLibTableEditor ( wxTopLevelWindow *  aCaller,
FP_LIB_TABLE aGlobal,
FP_LIB_TABLE aProject 
)

Function InvokePcbLibTableEditor shows the modal DIALOG_FP_LIB_TABLE for purposes of editing two lib tables.

Parameters
aCalleris the wxTopLevelWindow which is invoking the dialog.
aGlobalis the common footprint library table file being edited.
aProjectis the project specific footprint library table file being edited.
Returns
int - bits 0 and 1 tell whether a change was made to the aGlobal and/or the aProject table, respectively. If set, table was modified.

Definition at line 754 of file dialog_fp_lib_table.cpp.

Referenced by CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), PCB_EDIT_FRAME::Process_Config(), and FOOTPRINT_EDIT_FRAME::ProcessPreferences().

756 {
757  DIALOG_FP_LIB_TABLE dlg( aCaller, aGlobal, aProject );
758 
759  int dialogRet = dlg.ShowModal(); // returns value passed to EndModal() above
760 
761  return dialogRet;
762 }
Class DIALOG_FP_LIB_TABLE shows and edits the PCB library tables.
void InvokePluginOptionsEditor ( wxTopLevelWindow *  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 392 of file dialog_fp_plugin_options.cpp.

Referenced by DIALOG_FP_LIB_TABLE::optionsEditor().

395 {
396  DIALOG_FP_PLUGIN_OPTIONS dlg( aCaller, aNickname, aPluginType, aOptions, aResult );
397 
398  dlg.ShowModal();
399 }
Class DIALOG_FP_PLUGIN_OPTIONS is an options editor in the form of a two column name/value spreadshee...
bool InvokeSVGPrint ( wxTopLevelWindow *  aCaller,
BOARD aBoard,
PCB_PLOT_PARAMS aSettings 
)

Function InvokeSVGPrint shows the SVG print dialog.

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

Definition at line 447 of file dialog_SVG_print.cpp.

Referenced by PCB_EDIT_FRAME::SVG_Print().

448 {
449  DIALOG_SVG_PRINT dlg( aCaller, aBoard, aSettings );
450 
451  return dlg.ShowModal() == wxID_OK;
452 }