50 m_editFrame( aEditFrame ),
52 m_printMirror( false ),
53 m_oneFileOnly( false )
62 { wxID_CANCEL,
_(
"Close" ) } } );
68 wxString theme_old_selection = cfg->m_ExportSvg.color_theme;
72 int pos =
m_colorTheme->Append( settings->GetName(),
static_cast<void*
>( settings ) );
74 if( settings->GetName() == theme_old_selection )
89 { wxID_CANCEL,
_(
"Close" ) } } );
108 catch(
const std::runtime_error& e )
110 wxFAIL_MSG( e.what() );
144 if( layer.first->IsChecked( layer.second ) )
170 wxCommandEvent
dummy;
208 if( layer.first->IsChecked( layer.second ) )
209 ret.
set( layer_idx );
222 wxDirDialog dirDialog(
this,
_(
"Select Output Directory" ),
path );
224 if( dirDialog.ShowModal() == wxID_CANCEL )
227 wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() );
229 wxMessageDialog dialog(
this,
_(
"Use a relative path?" ),
_(
"Plot Output Directory" ),
230 wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
232 if( dialog.ShowModal() == wxID_YES )
236 boardFilePath = wxPathOnly( boardFilePath );
238 if( !dirName.MakeRelativeTo( boardFilePath ) )
239 wxMessageBox(
_(
"Cannot make path relative (target volume different from board "
241 _(
"Plot Output Directory" ), wxOK | wxICON_ERROR );
273 std::function<bool( wxString* )> textResolver =
274 [&]( wxString* token ) ->
bool
284 wxFileName outputDir = wxFileName::DirName(
path );
291 wxString msg = wxString::Format(
_(
"Could not write plot files to folder '%s'." ),
292 outputDir.GetPath() );
325 wxFileName fn( boardFilename );
329 wxString svgPath = fn.GetFullPath();
341 reporter.
Report( wxString::Format(
_(
"Exported '%s'." ), svgPath ),
346 reporter.
Report( wxString::Format(
_(
"Failed to create file '%s'." ), svgPath ),
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
wxString m_ColorTheme
Active color theme name.
BASE_SET & set(size_t pos)
Information pertinent to a Pcbnew printed circuit board.
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
static wxString GetStandardLayerName(PCB_LAYER_ID aLayerId)
Return an "English Standard" name of a PCB layer when given aLayerNumber.
bool ResolveTextVar(wxString *token, int aDepth) const
const wxString & GetFileName() const
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Color settings are a bit different than most of the settings objects in that there can be more than o...
Class DIALOG_EXPORT_SVG_BASE.
wxCheckBox * m_cbUsedBoardTheme
wxCheckBox * m_checkboxPagePerLayer
wxCheckListBox * m_CopperLayersList
wxRadioBox * m_ModeColorOption
wxRadioBox * m_rbSvgPageSizeOpt
WX_HTML_REPORT_PANEL * m_messagesPanel
STD_BITMAP_BUTTON * m_browseButton
wxCheckBox * m_checkboxEdgesOnAllPages
wxCheckBox * m_printMirrorOpt
wxCheckListBox * m_TechnicalLayersList
wxTextCtrl * m_outputDirectoryName
~DIALOG_EXPORT_SVG() override
PCB_EDIT_FRAME * m_editFrame
void OnOutputDirectoryBrowseClicked(wxCommandEvent &event) override
JOB_EXPORT_PCB_SVG * m_job
void OnButtonPlot(wxCommandEvent &event) override
DIALOG_EXPORT_SVG(JOB_EXPORT_PCB_SVG *aJob, PCB_EDIT_FRAME *aEditFrame, wxWindow *aParent)
void onPagePerLayerClicked(wxCommandEvent &event) override
std::map< int, std::pair< wxCheckListBox *, int > > m_boxSelectLayer
LSET getCheckBoxSelectedLayers() const
void ExportSVGFile(bool aOnlyOneFile)
wxString m_outputDirectory
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
SETTINGS_MANAGER * GetSettingsManager() const
static bool Plot(BOARD *aBoard, const PCB_PLOT_SVG_OPTIONS &aSvgPlotOptions)
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
LSET is a set of PCB_LAYER_IDs.
LSEQ UIOrder() const
Returns the copper, technical and user layers in the order shown in layer widget.
LSEQ SeqStackupForPlotting() const
Return the sequence that is typical for a bottom-to-top stack-up.
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
DIALOG_EXPORT_SVG m_ExportSvg
PCBNEW_SETTINGS * GetPcbNewSettings() const
The main frame for Pcbnew.
The backing store for a PROJECT, in JSON format.
wxString m_PcbLastPath[LAST_PATH_SIZE]
MRU path storage.
virtual PROJECT_FILE & GetProjectFile() const
virtual const wxString AbsolutePath(const wxString &aFileName) const
Fix up aFileName if it is relative to the project's directory to be an absolute path and filename.
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
std::vector< COLOR_SETTINGS * > GetColorSettingsList()
void SetFileName(const wxString &aReportFileName)
const wxString ExpandEnvVarSubstitutions(const wxString &aString, const PROJECT *aProject)
Replace any environment variable & text variable references with their values.
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject, int aFlags)
bool EnsureFileDirectoryExists(wxFileName *aTargetFullFileName, const wxString &aBaseFilename, REPORTER *aReporter)
Make aTargetFullFileName absolute and create the path of this file if it doesn't yet exist.
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
This file is part of the common library.
bool InvokeExportSVG(PCB_EDIT_FRAME *aCaller, BOARD *aBoard)
Function InvokeExportSVG shows the Export SVG dialog.
static const std::string SVGFileExtension
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
PCB_LAYER_ID
A quick note on layer IDs:
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
void BuildPlotFileName(wxFileName *aFilename, const wxString &aOutputDir, const wxString &aSuffix, const wxString &aExtension)
Complete a plot filename.
Plotting engines similar to ps (PostScript, Gerber, svg)
std::vector< FAB_LAYER_COLOR > dummy
std::vector< int > layers
bool m_sketchPadsOnFabLayers
bool m_sketchDNPFPsOnFabLayers
bool m_crossoutDNPFPsOnFabLayers
bool m_hideDNPFPsOnFabLayers
Definition of file extensions used in Kicad.