70 { wxID_APPLY,
_(
"Plot Current Page" ) },
71 { wxID_CANCEL,
_(
"Close" ) } } );
75 SetTitle(
m_job->GetSettingsDialogTitle() );
83 if( !
m_job->GetOutputPathIsDirectory() )
86 m_outputPath->SetToolTip(
_(
"Target file for the plot. Can be absolute or relative to the schematic "
87 "main file location." ) );
97 for(
COLOR_SETTINGS* settings :
Pgm().GetSettingsManager().GetColorSettingsList() )
98 m_colorTheme->Append( settings->GetName(),
static_cast<void*
>( settings ) );
135 int paperSizeIndex = (int)
m_job->m_pageSizeSelect;
137 if( paperSizeIndex >= 0 && paperSizeIndex < (
int)
m_paperSizeOption->GetCount() )
144 switch(
m_job->m_plotFormat )
157 m_pngDPI->SetValue( pngJob->m_dpi );
168 wxString selectedVariant =
m_job->m_variant;
170 if( selectedVariant.IsEmpty() && !
m_job->m_variantNames.empty() )
171 selectedVariant =
m_job->m_variantNames.front();
173 if( !selectedVariant.IsEmpty() )
177 if( idx != wxNOT_FOUND )
183 GetSizer()->SetSizeHints(
this );
186 wxCommandEvent
dummy;
204 if(
Prj().IsNullProject() )
214 wxDirDialog dirDialog(
this,
_(
"Select Output Directory" ),
path );
216 if( dirDialog.ShowModal() == wxID_CANCEL )
219 wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() );
221 wxFileName fn(
Prj().AbsolutePath(
m_editFrame->Schematic().Root().GetFileName() ) );
222 wxString defaultPath = fn.GetPathWithSep();
223 wxFileName relPathTest;
225 relPathTest.Assign( dirDialog.GetPath() );
228 if( relPathTest.MakeRelativeTo( defaultPath ) )
230 if(
IsOK(
this, wxString::Format(
_(
"Do you want to use a path relative to\n'%s'?" ), defaultPath ) ) )
231 dirName.MakeRelativeTo( defaultPath );
318 wxCommandEvent
dummy;
347 m_job->m_plotAll =
true;
353 m_job->m_variantNames.clear();
355 if( !
m_job->m_variant.IsEmpty() )
356 m_job->m_variantNames.push_back(
m_job->m_variant );
360 pngJob->m_dpi =
m_pngDPI->GetValue();
379 std::unique_ptr<SCH_PLOTTER> schPlotter = std::make_unique<SCH_PLOTTER>(
m_editFrame );
402 OpenPDF( schPlotter->GetLastOutputFilePath() );
408 wxString extMsg = wxString::Format(
_(
"Falling back to user path '%s'." ),
414 std::function<bool( wxString* )> textResolver =
415 [&]( wxString* token ) ->
bool
426 if( fn.IsAbsolute() )
431 if(
Prj().IsNullProject() )
443 fn.SetName( wxEmptyString );
444 fn.SetExt( wxEmptyString );
458 DisplayErrorMessage(
this,
_(
"No project or path defined for the current schematic." ), extMsg );
489 if( ( selection != 0 ) && ( selection != wxNOT_FOUND ) )
constexpr EDA_IU_SCALE schIUScale
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
Color settings are a bit different than most of the settings objects in that there can be more than o...
static const wxString COLOR_BUILTIN_DEFAULT
COLOR4D GetColor(int aLayer) const
const wxString & GetName() const
wxStaticText * m_outputPathLabel
wxRadioBox * m_plotFormatOpt
wxChoice * m_DXF_plotUnits
wxStaticText * m_lineWidthUnits
wxCheckBox * m_plotPDFMetadata
wxChoice * m_ModeColorOption
wxStaticText * m_colorThemeLabel
DIALOG_PLOT_SCHEMATIC_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Plot Schematic"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
STD_BITMAP_BUTTON * m_browseButton
wxCheckBox * m_pngAntialias
wxStaticText * m_staticTextDXF
wxCheckBox * m_plotDrawingSheet
wxCheckBox * m_plotPDFPropertyPopups
WX_HTML_REPORT_PANEL * m_MessagesBox
wxStaticText * m_lineWidthLabel
wxCheckBox * m_plotPDFHierarchicalLinks
wxChoice * m_paperSizeOption
wxChoice * m_variantChoiceCtrl
wxCheckBox * m_openFileAfterPlot
wxButton * m_sdbSizer1Apply
wxCheckBox * m_plotBackgroundColor
wxStaticBoxSizer * m_sizerPNGOptions
wxTextCtrl * m_outputPath
wxTextCtrl * m_lineWidthCtrl
UNIT_BINDER m_defaultLineWidth
void OnPlotAll(wxCommandEvent &event) override
PLOT_FORMAT getPlotFileFormat()
void onColorMode(wxCommandEvent &aEvent) override
wxString getSelectedVariant() const
void OnPlotCurrent(wxCommandEvent &event) override
void onPlotFormatSelection(wxCommandEvent &event) override
JOB_EXPORT_SCH_PLOT * m_job
SCH_EDIT_FRAME * m_editFrame
void getPlotOptions(RENDER_SETTINGS *aSettings)
COLOR_SETTINGS * getColorSettings()
bool TransferDataToWindow() override
void plotSchematic(bool aPlotAll)
void onOutputDirectoryBrowseClicked(wxCommandEvent &event) override
DIALOG_PLOT_SCHEMATIC(SCH_EDIT_FRAME *aEditFrame)
wxString getOutputPath()
Determine the best absolute path to plot files given the contents of the path edit control.
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...
wxString GetFilename() const
APP_SETTINGS_BASE * KifaceSettings() const
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
virtual void LoadColors(const COLOR_SETTINGS *aSettings)
void SetDefaultFont(const wxString &aFont)
virtual void SetBackgroundColor(const COLOR4D &aColor)=0
Set the background color.
void SetMinPenWidth(int aWidth)
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
virtual const wxString GetProjectPath() const
Return the full path of the project.
Holds all the data relating to one schematic.
bool ResolveTextVar(const SCH_SHEET_PATH *aSheetPath, wxString *token, int aDepth) const
SCH_SHEET_PATH & CurrentSheet() const
Schematic editor (Eeschema) main window.
const wxString & GetFileName() const
wxString ExpandPathVariables(const wxString &aPath, const PROJECT *aProject, const std::function< bool(wxString *)> *aTextResolver)
Expand text variables, environment variables and a leading '~' in a user-entered file path.
wxString ResolveProjectPath(const wxString &aPath, const PROJECT *aProject, const std::function< bool(wxString *)> *aTextResolver)
Expand a user-entered file path as ExpandPathVariables() does, then anchor a relative result at the p...
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
This file is part of the common library.
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
bool OpenPDF(const wxString &file)
Run the PDF viewer and display a PDF file.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
@ LAYER_SCHEMATIC_BACKGROUND
PGM_BASE & Pgm()
The global program "get" accessor.
PLOT_FORMAT
The set of supported output plot formats.
Plotting engines similar to ps (PostScript, Gerber, svg)
std::vector< FAB_LAYER_COLOR > dummy
int default_line_thickness
DXF_UNITS m_DXF_File_Unit
wxString m_outputDirectory
bool m_PDFHierarchicalLinks
bool m_useBackgroundColor
wxLogTrace helper definitions.
#define FN_NORMALIZE_FLAGS
Default flags to pass to wxFileName::Normalize().