53#include <wx/choicdlg.h>
54#include <wx/filedlg.h>
61 _(
"Writing/modifying legacy libraries (.mod files) is not allowed\n"\
62 "Please save the current library to the new .pretty format\n"\
63 "and update your footprint lib table\n"\
64 "to save your footprint (a .kicad_mod file) in the .pretty library folder" ) );
67 _(
"Modifying legacy libraries (.mod files) is not allowed\n"\
68 "Please save the current library under the new .pretty format\n"\
69 "and update your footprint lib table\n"\
70 "before deleting a footprint" ) );
80 static int lastFilterIndex = 0;
88 wxFileDialog dlg( aParent,
_(
"Import Footprint" ), aLastPath, wxEmptyString, wildCard,
89 wxFD_OPEN | wxFD_FILE_MUST_EXIST );
91 dlg.SetFilterIndex( lastFilterIndex );
93 if( dlg.ShowModal() == wxID_CANCEL )
96 lastFilterIndex = dlg.GetFilterIndex();
98 return wxFileName( dlg.GetPath() );
118 char* line = reader.
Line();
127 if( strncasecmp( line,
"(module", strlen(
"(module" ) ) == 0
128 || strncasecmp( line,
"(footprint", strlen(
"(footprint" ) ) == 0 )
131 *aName = aFileName.GetName();
139 if( !strncasecmp( line,
"$MODULE", strlen(
"$MODULE" ) ) )
146 else if( !strncasecmp( line,
"Element", strlen(
"Element" ) ) )
149 *aName = aFileName.GetName();
168 const wxString& aName )
176 default: wxFAIL_MSG( wxT(
"unexpected IO_MGR::PCB_FILE_T" ) );
break;
193 wxFFile f( aFileName.GetFullPath() );
198 f.ReadAll( &fcontents );
211 const wxString& aName )
227 wxFAIL_MSG( wxT(
"unexpected IO_MGR::PCB_FILE_T" ) );
237 wxString lastOpenedPathForLoading =
m_mruPath;
245 if( aName != wxT(
"") )
253 FILE* fp = wxFopen( fn.GetFullPath(), wxT(
"rt" ) );
257 wxString msg =
wxString::Format(
_(
"File '%s' not found." ), fn.GetFullPath() );
264 wxString footprintName;
301 footprint->
SetFPID(
LIB_ID( wxEmptyString, footprintName ) );
338 wxFileDialog dlg(
this,
_(
"Export Footprint" ), fn.GetPath(), fn.GetFullName(),
339 wildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
341 if( dlg.ShowModal() == wxID_CANCEL )
361 pcb_io.
Format( aFootprint );
363 FILE* fp = wxFopen( dlg.GetPath(), wxT(
"wt" ) );
381 wxString msg =
wxString::Format(
_(
"Footprint exported to file '%s'." ), dlg.GetPath() );
387 const wxString& aProposedName )
394 const wxString& aProposedName )
403 const wxString& aProposedName,
410 if( aTable ==
nullptr )
411 return wxEmptyString;
413 wxString initialPath = aProposedName.IsEmpty() ?
Prj().
GetProjectPath() : aProposedName;
418 if( aLibName.IsEmpty() )
426 return wxEmptyString;
435 if( !fn.IsAbsolute() )
437 fn.SetName( aLibName );
438 fn.MakeAbsolute( initialPath );
447 wxString libPath = fn.GetFullPath();
453 bool writable =
false;
472 return wxEmptyString;
477 KIDIALOG dlg(
this, msg,
_(
"Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
478 dlg.SetOKLabel(
_(
"Overwrite" ) );
482 return wxEmptyString;
493 return wxEmptyString;
506 if(
Prj().IsNullProject() )
512 wxMessageDialog dlg(
this,
_(
"Add the library to the global library table?" ),
513 _(
"Add To Global Library Table" ), wxYES_NO );
515 if( dlg.ShowModal() != wxID_OK )
522 wxArrayString libTableNames;
523 libTableNames.Add(
_(
"Global" ) );
524 libTableNames.Add(
_(
"Project" ) );
526 wxSingleChoiceDialog dlg(
this,
_(
"Choose the Library Table to add the library to:" ),
527 _(
"Add To Library Table" ), libTableNames );
531 dlg.FindWindow( wxID_CANCEL )->SetLabel(
_(
"Skip" ) );
532 dlg.FindWindow( wxID_OK )->SetLabel(
_(
"Add" ) );
535 if( dlg.ShowModal() != wxID_OK )
538 switch( dlg.GetSelection() )
542 default:
return nullptr;
549 if( aTable ==
nullptr )
552 if( aTable ==
nullptr )
553 return wxEmptyString;
557 wxFileName fn( aFilename );
559 if( aFilename.IsEmpty() )
569 wxString libPath = fn.GetFullPath();
570 wxString libName = fn.GetName();
572 if( libName.IsEmpty() )
581 libName = fn.GetFullName();
606 LIB_ID libID( libName, wxEmptyString );
607 editor->SyncLibraryTree(
true );
608 editor->FocusOnLibID( libID );
614 viewer->ReCreateLibraryList();
638 if( !
Prj().PcbFootprintLibs()->IsFootprintLibWritable( nickname ) )
646 wxString msg =
wxString::Format(
_(
"Delete footprint '%s' from library '%s'?" ),
648 nickname.GetData() );
650 if( aConfirm && !
IsOK(
this, msg ) )
663 msg.Printf(
_(
"Footprint '%s' deleted from library '%s'" ),
665 nickname.GetData() );
667 SetStatusText( msg );
676 if(
GetBoard()->GetFirstFootprint() ==
nullptr )
682 wxString footprintName;
684 auto resetReference =
687 aFootprint->SetReference(
"REF**" );
690 if( !aStoreInNewLib )
711 if( !footprint->GetFPID().GetLibItemName().empty() )
715 resetReference( fpCopy );
728 LIB_ID id = footprint->GetFPID();
730 footprint->SetFPID(
id );
740 if( libPath.IsEmpty() )
746 wxString libNickname;
747 bool map =
IsOK(
this,
_(
"Update footprints on board to refer to new library?" ) );
764 if( !footprint->GetFPID().GetLibItemName().empty() )
768 resetReference( fpCopy );
781 LIB_ID id = footprint->GetFPID();
783 footprint->SetFPID(
id );
816 else if( libraryName.IsEmpty() || footprintName.IsEmpty() )
834 wxString libfullname;
889 wxString newName = footprintName;
893 newName.Printf(
"%s_%d", footprintName, i++ );
897 if( aFootprint->
GetValue() == footprintName )
905 const wxString& aLibraryName )
932 if( pcbframe ==
nullptr )
946 sourceFootprint =
nullptr;
950 if( editorFootprint->
GetLink() == candidate->m_Uuid )
952 sourceFootprint = candidate;
958 if( !aAddNew && sourceFootprint ==
nullptr )
960 DisplayError(
this,
_(
"Unable to find the footprint on the main board.\nCannot save." ) );
968 DisplayError(
this,
_(
"Previous footprint placement still in progress." ) );
990 fixUuid(
const_cast<KIID&
>( newFootprint->
m_Uuid ) );
994 fixUuid(
const_cast<KIID&
>( aChild->
m_Uuid ) );
997 if( sourceFootprint )
1003 commit.
Push( wxT(
"Update footprint" ) );
1010 commit.
Add( newFootprint );
1016 commit.
Push( wxT(
"Insert footprint" ) );
1033 const wxString& aLibraryPreselect )
1039 wxArrayString headers;
1040 std::vector<wxArrayString> itemsToDisplay;
1042 headers.Add(
_(
"Nickname" ) );
1043 headers.Add(
_(
"Description" ) );
1045 for(
const wxString& nickname : nicknames )
1054 itemsToDisplay.push_back( item );
1058 for(
const wxString& nickname : nicknames )
1065 item.Add( nickname );
1067 itemsToDisplay.push_back( item );
1072 itemsToDisplay, aLibraryPreselect,
false );
1077 wxBoxSizer* bNameSizer =
new wxBoxSizer( wxHORIZONTAL );
1079 wxStaticText* label =
new wxStaticText( dlg, wxID_ANY,
_(
"Name:" ) );
1080 bNameSizer->Add( label, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
1082 wxTextCtrl* nameTextCtrl =
new wxTextCtrl( dlg,
ID_SAVE_AS_NAME, aFootprintName );
1083 bNameSizer->Add( nameTextCtrl, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
1085 wxTextValidator nameValidator( wxFILTER_EXCLUDE_CHAR_LIST );
1087 nameTextCtrl->SetValidator( nameValidator );
1091 dlg->
m_ButtonsSizer->Prepend( newLibraryButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 10 );
1093 dlg->GetSizer()->Prepend( bNameSizer, 0, wxEXPAND|wxTOP|wxLEFT|wxRIGHT, 5 );
1095 dlg->Bind( wxEVT_BUTTON,
1096 [dlg]( wxCommandEvent& )
1102 if( dlg->GetChildren().DeleteObject( nameTextCtrl ) )
1103 dlg->GetChildren().Insert( nameTextCtrl );
1108 dlg->GetSizer()->Fit( dlg );
1116 if( aFootprint ==
nullptr )
1125 bool updateValue = aFootprint->
GetValue() == footprintName;
1128 std::unique_ptr<EDA_LIST_DIALOG> dlg;
1134 int ret = dlg->ShowModal();
1136 if( ret == wxID_CANCEL )
1140 else if( ret == wxID_OK )
1147 libraryName = newLibrary.GetName();
1151 libraryName = dlg->GetTextSelection();
1153 if( libraryName.IsEmpty() )
1155 DisplayError(
this,
_(
"No library specified. Footprint could not be saved." ) );
1159 footprintName =
static_cast<wxTextCtrl*
>( dlg->FindWindow(
ID_SAVE_AS_NAME ) )->GetValue();
1160 footprintName.Trim(
true );
1161 footprintName.Trim(
false );
1163 if( footprintName.IsEmpty() )
1165 DisplayError(
this,
_(
"No footprint name specified. Footprint could not be saved." ) );
1169 aFootprint->
SetFPID(
LIB_ID( libraryName, footprintName ) );
1172 aFootprint->
SetValue( footprintName );
1185 bool footprintExists = tbl->
FootprintExists( libraryName, footprintName );
1187 if( footprintExists )
1192 KIDIALOG chkdlg(
this, msg,
_(
"Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
1193 chkdlg.SetOKLabel(
_(
"Overwrite" ) );
1205 wxString fmt = footprintExists ?
_(
"Footprint '%s' replaced in '%s'" )
1206 :
_(
"Footprint '%s' added to '%s'" );
1208 wxString msg =
wxString::Format( fmt, footprintName.GetData(), libraryName.GetData() );
1209 SetStatusText( msg );
1249 wxString footprintName = aFootprintName;
1252 static int footprintType = 1;
1253 int footprintTranslated =
FP_SMD;
1256 if( footprintName.IsEmpty() && !aQuiet )
1259 footprintName,
_(
"Footprint type:" ),
1260 {
_(
"Through hole" ),
_(
"SMD" ),
_(
"Other" ) },
1264 if( dlg.ShowModal() != wxID_OK )
1267 footprintType = dlg.GetChoice();
1269 switch( footprintType )
1272 case 1: footprintTranslated =
FP_SMD;
break;
1273 default: footprintTranslated = 0;
break;
1277 footprintName.Trim(
true );
1278 footprintName.Trim(
false );
1280 if( footprintName.IsEmpty() )
1292 footprint->
SetFPID(
LIB_ID( wxEmptyString, footprintName ) );
1297 wxPoint default_pos;
1304 default_pos.y -= settings.
GetTextSize( txt_layer ).y / 2;
1306 default_pos.y += settings.
GetTextSize( txt_layer ).y;
1312 default_pos.y += settings.
GetTextSize( txt_layer ).y / 2;
1314 default_pos.y += settings.
GetTextSize( txt_layer ).y;
1323 default_pos.y += settings.
GetTextSize( txt_layer ).y / 2;
1325 default_pos.y += settings.
GetTextSize( txt_layer ).y;
1332 if( footprint->
GetValue().IsEmpty() )
1333 footprint->
SetValue( footprintName );
1357 wxArrayString headers;
1359 headers.Add(
_(
"Nickname" ) );
1360 headers.Add(
_(
"Description" ) );
1365 std::vector< wxArrayString > itemsToDisplay;
1368 for(
const wxString& nickname : nicknames )
1377 itemsToDisplay.push_back( item );
1381 for(
const wxString& nickname : nicknames )
1388 item.Add( nickname );
1390 itemsToDisplay.push_back( item );
1394 EDA_LIST_DIALOG dlg(
this,
_(
"Select Library" ), headers, itemsToDisplay, aNicknameExisting,
1397 if( dlg.ShowModal() != wxID_OK )
1398 return wxEmptyString;
void SetContentModified(bool aModified=true)
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
Container for design settings for a BOARD object.
wxSize GetTextSize(PCB_LAYER_ID aLayer) const
Return the default text size from the layer class for the given layer.
std::vector< TEXT_ITEM_INFO > m_DefaultFPTextItems
bool GetTextUpright(PCB_LAYER_ID aLayer) const
int GetTextThickness(PCB_LAYER_ID aLayer) const
Return the default text thickness from the layer class for the given layer.
bool GetTextItalic(PCB_LAYER_ID aLayer) const
Handle actions specific to the board editor in PcbNew.
bool PlacingFootprint() const
Re-entrancy checker for above.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Information pertinent to a Pcbnew printed circuit board.
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
FOOTPRINTS & Footprints()
COMMIT & Add(EDA_ITEM *aItem)
Notify observers that aItem has been added.
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
virtual void ClearUndoRedoList()
Clear the undo and redo list using ClearUndoORRedoList()
void ShowInfoBarError(const wxString &aErrorMsg, bool aShowCloseButton=false, WX_INFOBAR::MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the WX_INFOBAR displayed on the top of the canvas with a message and an error icon on the left o...
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
bool LibraryFileBrowser(bool doOpen, wxFileName &aFilename, const wxString &wildcard, const wxString &ext, bool isDirectory=false, bool aIsGlobal=false, const wxString &aGlobalPath=wxEmptyString)
virtual void Zoom_Automatique(bool aWarpPointer)
Redraw the screen with best zoom level and the best centering that shows all the page or the board.
KIGFX::VIEW_CONTROLS * GetViewControls() const
Return a pointer to the #VIEW_CONTROLS instance used in the panel.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
KICAD_T Type() const
Returns the type of object.
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
virtual void SetParent(EDA_ITEM *aParent)
wxBoxSizer * m_ButtonsSizer
void SetOKLabel(const wxString &aLabel)
wxString GetTextSelection(int aColumn=0)
Return the selected text from aColumn in the wxListCtrl in the dialog.
void SetListLabel(const wxString &aLabel)
virtual void SetVisible(bool aVisible)
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
void SetKeepUpright(bool aKeepUpright)
void SetTextSize(const VECTOR2I &aNewSize)
virtual void SetText(const wxString &aText)
void SetItalic(bool aItalic)
A LINE_READER that reads from an open file.
Hold a record identifying a library accessed by the appropriate footprint library PLUGIN object in th...
const FP_LIB_TABLE_ROW * FindRow(const wxString &aNickName, bool aCheckIfEnabled=false)
Return an FP_LIB_TABLE_ROW if aNickName is found in this table or in any chained fall back table frag...
void FootprintDelete(const wxString &aNickname, const wxString &aFootprintName)
Delete the aFootprintName from the library given by aNickname.
bool FootprintExists(const wxString &aNickname, const wxString &aFootprintName)
Indicates whether or not the given footprint already exists in the given library.
SAVE_T FootprintSave(const wxString &aNickname, const FOOTPRINT *aFootprint, bool aOverwrite=true)
Write aFootprint to an existing library given by aNickname.
static wxString GetGlobalTableFileName()
virtual void SetPosition(const VECTOR2I &aPos) override
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
static const wxString ShowType(PCB_FILE_T aFileType)
Return a brief name for a plugin given aFileType enum.
static PCB_FILE_T GuessPluginTypeFromLibPath(const wxString &aLibPath)
Return a plugin type given a footprint library's libPath.
PCB_FILE_T
The set of file types that the IO_MGR knows about, and for which there has been a plugin written.
@ LEGACY
Legacy Pcbnew file formats prior to s-expression.
@ KICAD_SEXP
S-expression Pcbnew file format.
@ GEDA_PCB
Geda PCB file formats.
static PLUGIN * PluginFind(PCB_FILE_T aFileType)
Return a PLUGIN which the caller can use to import, export, save, or load design documents.
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
void DoNotShowCheckbox(wxString file, int line)
Checks the 'do not show again' setting for the dialog.
An interface for classes handling user events controlling the view behavior such as zooming,...
virtual void SetCrossHairCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true)=0
Move the graphic crosshair cursor to the requested position expressed in world coordinates.
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
virtual PROJECT & Prj() const
Return the PROJECT associated with this KIWAY.
A logical library item identifier and consists of various portions much like a URI.
bool IsValid() const
Check if this LID_ID is valid.
int SetLibNickname(const UTF8 &aNickname)
Override the logical library name portion of the LIB_ID to aNickname.
const UTF8 & GetLibItemName() const
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Hold a record identifying a library accessed by the appropriate plug in object in the LIB_TABLE.
const wxString & GetNickName() const
const wxString GetFullURI(bool aSubstituted=false) const
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
const wxString GetDescription(const wxString &aNickname)
std::vector< wxString > GetLogicalLibs()
Return the logical library names, all of them that are pertinent to a look up done on this LIB_TABLE.
bool InsertRow(LIB_TABLE_ROW *aRow, bool doReplace=false)
Adds aRow if it does not already exist or if doReplace is true.
const LIB_TABLE_ROW * FindRowByURI(const wxString &aURI)
void Save(const wxString &aFileName) const
Write this library table to aFileName in s-expression form.
static const wxString GetPinningSymbol()
char * Line() const
Return a pointer to the last line that was read in.
static wxString GetDefaultUserFootprintsPath()
Gets the default path we point users to create projects.
static TOOL_ACTION recombinePad
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION placeFootprint
bool AddLibrary(const wxString &aLibName=wxEmptyString, FP_LIB_TABLE *aTable=nullptr)
Add an existing library to either the global or project library table.
wxString CreateNewLibrary(const wxString &aLibName=wxEmptyString, const wxString &aProposedName=wxEmptyString)
If a library name is given, creates a new footprint library in the project folder with the given name...
wxString createNewLibrary(const wxString &aLibName, const wxString &aProposedName, FP_LIB_TABLE *aTable)
Create a new library in the given table (presumed to be either the global or project library table).
wxString CreateNewProjectLibrary(const wxString &aLibName=wxEmptyString, const wxString &aProposedName=wxEmptyString)
FP_LIB_TABLE * selectLibTable(bool aOptional=false)
Prompts a user to select global or project library tables.
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
wxString SelectLibrary(const wxString &aNicknameExisting)
Put up a dialog and allows the user to pick a library, for unspecified use.
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
void PlaceFootprint(FOOTPRINT *aFootprint, bool aRecreateRatsnest=true)
Places aFootprint at the current cursor position and updates footprint coordinates with the new posit...
FOOTPRINT * CreateNewFootprint(const wxString &aFootprintName, bool aQuiet=false)
Creates a new footprint, at position 0,0.
virtual void Update3DView(bool aMarkDirty, bool aRefresh, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
The main frame for Pcbnew.
void ExportFootprintsToLibrary(bool aStoreInNewLib, const wxString &aLibName=wxEmptyString, wxString *aLibPath=nullptr)
Save footprints in a library:
void ExchangeFootprint(FOOTPRINT *aExisting, FOOTPRINT *aNew, BOARD_COMMIT &aCommit, bool deleteExtraTexts=true, bool resetTextLayers=true, bool resetTextEffects=true, bool resetFabricationAttrs=true, bool reset3DModels=true, bool *aUpdated=nullptr)
Replace aExisting footprint by aNew footprint using the Existing footprint settings (position,...
A PLUGIN derivation for saving and loading Pcbnew s-expression formatted files.
BOARD_ITEM * Parse(const wxString &aClipboardSourceInput)
std::string GetStringOutput(bool doClear)
void Format(const BOARD_ITEM *aItem, int aNestLevel=0) const
Output aItem to aFormatter in s-expression format.
Releases a PLUGIN in the context of a potential thrown exception through its destructor.
virtual void FootprintLibCreate(const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr)
Create a new empty footprint library at aLibraryPath empty.
virtual bool FootprintLibDelete(const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr)
Delete an existing footprint library and returns true, or if library does not exist returns false,...
virtual void FootprintSave(const wxString &aLibraryPath, const FOOTPRINT *aFootprint, const STRING_UTF8_MAP *aProperties=nullptr)
Write aFootprint to an existing library located at aLibraryPath.
virtual FOOTPRINT * FootprintLoad(const wxString &aLibraryPath, const wxString &aFootprintName, bool aKeepUUID=false, const STRING_UTF8_MAP *aProperties=nullptr)
Load a footprint having aFootprintName from the aLibraryPath containing a library format that this PL...
virtual bool IsFootprintLibWritable(const wxString &aLibraryPath)
Return true if the library at aLibraryPath is writable.
The backing store for a PROJECT, in JSON format.
Container for project specific data.
virtual const wxString GetProjectPath() const
Return the full path of the project.
virtual FP_LIB_TABLE * PcbFootprintLibs(KIWAY &aKiway)
Return the table of footprint libraries.
virtual PROJECT_FILE & GetProjectFile() const
virtual void SetRString(RSTRING_T aStringId, const wxString &aString)
Store a "retained string", which is any session and project specific string identified in enum RSTRIN...
virtual const wxString & GetRString(RSTRING_T aStringId)
Return a "retained string", which is any session and project specific string identified in enum RSTRI...
Read lines of text from another LINE_READER but only returns non-comment lines and non-blank lines wi...
char * ReadLine() override
Read a line of text into the buffer and increments the line number counter.
A KICAD version of wxTextEntryDialog which supports the various improvements/work-arounds from DIALOG...
void SetTextValidator(wxTextValidatorStyle style)
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
bool ConfirmRevertDialog(wxWindow *parent, const wxString &aMessage)
Display a confirmation dialog for a revert action.
This file is part of the common library.
FP_LIB_TABLE GFootprintTable
The global footprint library table.
wxString NormalizePath(const wxFileName &aFilePath, const ENV_VAR_MAP *aEnvVars, const wxString &aProjectPath)
Normalize a file path to an environmental variable, if possible.
const std::string KiCadFootprintLibPathExtension
const std::string KiCadFootprintFileExtension
wxString KiCadFootprintLibPathWildcard()
wxString ModLegacyExportFileWildcard()
wxString KiCadFootprintLibFileWildcard()
wxString AllFilesWildcard()
wxString GedaPcbFootprintLibFileWildcard()
PCB_LAYER_ID
A quick note on layer IDs:
#define FOOTPRINT_LIBRARY_HEADER_CNT
#define FOOTPRINT_LIBRARY_HEADER
This file contains miscellaneous commonly used macros and functions.
static wxString FROM_UTF8(const char *cstring)
Convert a UTF8 encoded C string to a wxString for all wxWidgets build modes.
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
#define CTL_FOR_LIBRARY
Format output for a footprint library instead of clipboard or BOARD.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
FormatType fileType(const char *aFileName)
char * StrPurge(char *text)
Remove leading and training spaces, tabs and end of line chars in text.
std::vector< wxString > pinned_fp_libs
@ PCB_FP_TEXT_T
class FP_TEXT, text in a footprint
Custom text control validator definitions.
VECTOR2< double > VECTOR2D
Definition of file extensions used in Kicad.