KiCad PCB EDA Suite
wildcards_and_files_ext.cpp File Reference

Go to the source code of this file.

Functions

static wxString FormatWildcardExt (const wxString &aWildcard)
 Format wildcard extension to support case sensitive file dialogs. More...
 
const std::string SchematicSymbolFileExtension ("sym")
 
const std::string SchematicLibraryFileExtension ("lib")
 
const std::string SchematicBackupFileExtension ("bak")
 
const std::string VrmlFileExtension ("wrl")
 
const std::string ProjectFileExtension ("pro")
 
const std::string SchematicFileExtension ("sch")
 
const std::string NetlistFileExtension ("net")
 
const std::string ComponentFileExtension ("cmp")
 
const std::string GerberFileExtension ("gbr")
 
const std::string GerberJobFileExtension ("gbrjob")
 
const std::string HtmlFileExtension ("html")
 
const std::string LegacyPcbFileExtension ("brd")
 
const std::string KiCadPcbFileExtension ("kicad_pcb")
 
const std::string PageLayoutDescrFileExtension ("kicad_wks")
 
const std::string PdfFileExtension ("pdf")
 
const std::string MacrosFileExtension ("mcr")
 
const std::string DrillFileExtension ("drl")
 
const std::string SVGFileExtension ("svg")
 
const std::string ReportFileExtension ("rpt")
 
const std::string FootprintPlaceFileExtension ("pos")
 
const std::string KiCadLib3DShapesPathExtension ("3dshapes")
 3D shapes default libpath More...
 
const std::string KiCadFootprintLibPathExtension ("pretty")
 KICAD PLUGIN libpath. More...
 
const std::string LegacyFootprintLibPathExtension ("mod")
 
const std::string EagleFootprintLibPathExtension ("lbr")
 
const std::string KiCadFootprintFileExtension ("kicad_mod")
 
const std::string GedaPcbFootprintLibFileExtension ("fp")
 
const std::string SpecctraDsnFileExtension ("dsn")
 
const std::string IpcD356FileExtension ("d356")
 
const wxString AllFilesWildcard (_("All files (*)|*"))
 
wxString SchematicSymbolFileWildcard ()
 
wxString SchematicLibraryFileWildcard ()
 
wxString ProjectFileWildcard ()
 
wxString SchematicFileWildcard ()
 
wxString EagleSchematicFileWildcard ()
 
wxString EagleFilesWildcard ()
 
wxString NetlistFileWildcard ()
 
wxString GerberFileWildcard ()
 
wxString LegacyPcbFileWildcard ()
 
wxString EaglePcbFileWildcard ()
 
wxString PCadPcbFileWildcard ()
 
wxString PcbFileWildcard ()
 
wxString KiCadFootprintLibFileWildcard ()
 
wxString KiCadFootprintLibPathWildcard ()
 
wxString LegacyFootprintLibPathWildcard ()
 
wxString EagleFootprintLibPathWildcard ()
 
wxString GedaPcbFootprintLibFileWildcard ()
 
wxString PageLayoutDescrFileWildcard ()
 
wxString ComponentFileWildcard ()
 
wxString DrillFileWildcard ()
 
wxString SVGFileWildcard ()
 
wxString HtmlFileWildcard ()
 
wxString CsvFileWildcard ()
 
wxString PdfFileWildcard ()
 
wxString PSFileWildcard ()
 
wxString ReportFileWildcard ()
 
wxString FootprintPlaceFileWildcard ()
 
wxString Shapes3DFileWildcard ()
 
wxString IDF3DFileWildcard ()
 
wxString TextFileWildcard ()
 
wxString ModLegacyExportFileWildcard ()
 
wxString ErcFileWildcard ()
 
wxString SpiceLibraryFileWildcard ()
 
wxString SpiceNetlistFileWildcard ()
 
wxString CadstarNetlistFileWildcard ()
 
wxString EquFileWildcard ()
 
wxString ZipFileWildcard ()
 
wxString GencadFileWildcard ()
 
wxString DxfFileWildcard ()
 
wxString GerberJobFileWildcard ()
 
wxString SpecctraDsnFileWildcard ()
 
wxString IpcD356FileWildcard ()
 
wxString WorkbookFileWildcard ()
 
wxString PngFileWildcard ()
 

Function Documentation

const wxString AllFilesWildcard ( _("All files (*)|*")  )

Referenced by FormatWildcardExt().

const std::string ComponentFileExtension ( "cmp"  )

Referenced by FormatWildcardExt().

const std::string DrillFileExtension ( "drl"  )

Referenced by FormatWildcardExt().

const std::string EagleFootprintLibPathExtension ( "lbr"  )

Referenced by FormatWildcardExt().

const std::string FootprintPlaceFileExtension ( "pos"  )

Referenced by FormatWildcardExt().

static wxString FormatWildcardExt ( const wxString &  aWildcard)
static

Format wildcard extension to support case sensitive file dialogs.

The file extension wildcards of the GTK+ file dialog are case sensitive so using all lower case characters means that only file extensions that are all lower case will show up in the file dialog. The GTK+ file dialog does support regular expressions so the file extension is converted to a regular expression ( sch -> [sS][cC][hH] ) when wxWidgets is built against GTK+. Please make sure you call this function when adding new file wildcards.

Note
When calling wxFileDialog with a default file defined, make sure you include the file extension along with the file name. Otherwise, on GTK+ builds, the file dialog will append the wildcard regular expression as the file extension which is surely not what you want.
Parameters
aWildcardis the extension part of the wild card.
Returns
the build appropriate file dialog wildcard filter.

Definition at line 49 of file wildcards_and_files_ext.cpp.

References AllFilesWildcard(), ComponentFileExtension(), DrillFileExtension(), EagleFootprintLibPathExtension(), FootprintPlaceFileExtension(), Format(), GedaPcbFootprintLibFileExtension(), GerberFileExtension(), GerberJobFileExtension(), HtmlFileExtension(), IpcD356FileExtension(), KiCadFootprintFileExtension(), KiCadFootprintLibPathExtension(), KiCadLib3DShapesPathExtension(), KiCadPcbFileExtension(), LegacyFootprintLibPathExtension(), LegacyPcbFileExtension(), MacrosFileExtension(), NetlistFileExtension(), PageLayoutDescrFileExtension(), PdfFileExtension(), ProjectFileExtension(), ReportFileExtension(), SchematicBackupFileExtension(), SchematicFileExtension(), SchematicLibraryFileExtension(), SchematicSymbolFileExtension(), SpecctraDsnFileExtension(), SVGFileExtension(), and VrmlFileExtension().

Referenced by CadstarNetlistFileWildcard(), ComponentFileWildcard(), CsvFileWildcard(), DrillFileWildcard(), DxfFileWildcard(), EagleFilesWildcard(), EagleFootprintLibPathWildcard(), EaglePcbFileWildcard(), EagleSchematicFileWildcard(), EquFileWildcard(), ErcFileWildcard(), FootprintPlaceFileWildcard(), GedaPcbFootprintLibFileWildcard(), GencadFileWildcard(), GerberFileWildcard(), GerberJobFileWildcard(), HtmlFileWildcard(), IDF3DFileWildcard(), IpcD356FileWildcard(), KiCadFootprintLibFileWildcard(), KiCadFootprintLibPathWildcard(), LegacyFootprintLibPathWildcard(), LegacyPcbFileWildcard(), ModLegacyExportFileWildcard(), NetlistFileWildcard(), PageLayoutDescrFileWildcard(), PCadPcbFileWildcard(), PcbFileWildcard(), PdfFileWildcard(), PngFileWildcard(), ProjectFileWildcard(), PSFileWildcard(), ReportFileWildcard(), SchematicFileWildcard(), SchematicLibraryFileWildcard(), SchematicSymbolFileWildcard(), Shapes3DFileWildcard(), SpecctraDsnFileWildcard(), SpiceLibraryFileWildcard(), SpiceNetlistFileWildcard(), SVGFileWildcard(), TextFileWildcard(), WorkbookFileWildcard(), and ZipFileWildcard().

50 {
51  wxString wc;
52 #if defined( __WXGTK__ )
53 
54  for( auto ch : aWildcard )
55  {
56  if( wxIsalpha( ch ) )
57  wc += wxString::Format( "[%c%c]", wxTolower( ch ), wxToupper( ch ) );
58  else
59  wc += ch;
60  }
61 
62  return wc;
63 #else
64  wc = aWildcard;
65 
66  return wc;
67 #endif
68 }
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
const std::string GedaPcbFootprintLibFileExtension ( "fp"  )

Referenced by FormatWildcardExt().

const std::string GerberFileExtension ( "gbr"  )

Referenced by FormatWildcardExt().

const std::string GerberJobFileExtension ( "gbrjob"  )

Referenced by FormatWildcardExt().

const std::string HtmlFileExtension ( "html"  )

Referenced by FormatWildcardExt().

const std::string IpcD356FileExtension ( "d356"  )

Referenced by FormatWildcardExt().

const std::string KiCadFootprintFileExtension ( "kicad_mod"  )

Referenced by FormatWildcardExt().

const std::string KiCadFootprintLibPathExtension ( "pretty"  )

KICAD PLUGIN libpath.

Referenced by FormatWildcardExt().

const std::string KiCadLib3DShapesPathExtension ( "3dshapes"  )

3D shapes default libpath

Referenced by FormatWildcardExt().

const std::string KiCadPcbFileExtension ( "kicad_pcb"  )

Referenced by FormatWildcardExt().

const std::string LegacyFootprintLibPathExtension ( "mod"  )

Referenced by FormatWildcardExt().

const std::string LegacyPcbFileExtension ( "brd"  )

Referenced by FormatWildcardExt().

const std::string MacrosFileExtension ( "mcr"  )

Referenced by FormatWildcardExt().

const std::string NetlistFileExtension ( "net"  )

Referenced by FormatWildcardExt().

const std::string PageLayoutDescrFileExtension ( "kicad_wks"  )

Referenced by FormatWildcardExt().

const std::string PdfFileExtension ( "pdf"  )

Referenced by FormatWildcardExt().

const std::string ProjectFileExtension ( "pro"  )

Referenced by FormatWildcardExt().

const std::string ReportFileExtension ( "rpt"  )

Referenced by FormatWildcardExt().

const std::string SchematicBackupFileExtension ( "bak"  )

Referenced by FormatWildcardExt().

const std::string SchematicFileExtension ( "sch"  )

Referenced by FormatWildcardExt().

const std::string SchematicLibraryFileExtension ( "lib"  )

Referenced by FormatWildcardExt().

const std::string SchematicSymbolFileExtension ( "sym"  )

Referenced by FormatWildcardExt().

const std::string SpecctraDsnFileExtension ( "dsn"  )

Referenced by FormatWildcardExt().

const std::string SVGFileExtension ( "svg"  )

Referenced by FormatWildcardExt().

const std::string VrmlFileExtension ( "wrl"  )

Referenced by FormatWildcardExt().