mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-21 08:21:39 +00:00
ADDED: Clickable links on hierarchical sheets, sheet pins and hierarchical labels in PDF exports of schematics.
By default, the new links get generated instead of popup menus for those elements. Can be turned off in the plot dialog or from the cli. Fixes https://gitlab.com/kicad/code/kicad/-/issues/18900
This commit is contained in:
parent
09389a437f
commit
7df0879a44
@ -76,6 +76,7 @@ JOB_EXPORT_SCH_PLOT::JOB_EXPORT_SCH_PLOT( bool aIsCli ) :
|
||||
m_HPGLPenSize( 1.0 ),
|
||||
m_HPGLPaperSizeSelect( JOB_HPGL_PAGE_SIZE::DEFAULT ),
|
||||
m_PDFPropertyPopups( true ),
|
||||
m_PDFHierarchicalLinks( true ),
|
||||
m_PDFMetadata( true ),
|
||||
m_theme(),
|
||||
m_outputDirectory(),
|
||||
@ -101,6 +102,8 @@ JOB_EXPORT_SCH_PLOT::JOB_EXPORT_SCH_PLOT( bool aIsCli ) :
|
||||
"hpgl_page_size", &m_HPGLPaperSizeSelect, m_HPGLPaperSizeSelect ) );
|
||||
m_params.emplace_back( new JOB_PARAM<bool>( "pdf_property_popups", &m_PDFPropertyPopups,
|
||||
m_PDFPropertyPopups ) );
|
||||
m_params.emplace_back( new JOB_PARAM<bool>( "pdf_hierarchical_links", &m_PDFHierarchicalLinks,
|
||||
m_PDFHierarchicalLinks ) );
|
||||
m_params.emplace_back( new JOB_PARAM<bool>( "pdf_metadata", &m_PDFMetadata, m_PDFMetadata ) );
|
||||
m_params.emplace_back( new JOB_PARAM<wxString>( "color_theme", &m_theme, m_theme ) );
|
||||
m_params.emplace_back(
|
||||
|
@ -92,6 +92,7 @@ public:
|
||||
double m_HPGLPenSize; // for HPGL format only: pen size
|
||||
JOB_HPGL_PAGE_SIZE m_HPGLPaperSizeSelect;
|
||||
bool m_PDFPropertyPopups;
|
||||
bool m_PDFHierarchicalLinks;
|
||||
bool m_PDFMetadata;
|
||||
wxString m_theme;
|
||||
|
||||
|
@ -131,6 +131,7 @@ void DIALOG_PLOT_SCHEMATIC::initDlg()
|
||||
setOpenFileAfterPlot( cfg->m_PlotPanel.open_file_after_plot );
|
||||
|
||||
m_plotPDFPropertyPopups->SetValue( cfg->m_PlotPanel.pdf_property_popups );
|
||||
m_plotPDFHierarchicalLinks->SetValue( cfg->m_PlotPanel.pdf_hierarchical_links );
|
||||
m_plotPDFMetadata->SetValue( cfg->m_PlotPanel.pdf_metadata );
|
||||
|
||||
// HPGL plot origin and unit system configuration
|
||||
@ -177,15 +178,16 @@ void DIALOG_PLOT_SCHEMATIC::initDlg()
|
||||
else if( m_job )
|
||||
{
|
||||
m_plotFormatOpt->SetSelection( static_cast<int>( m_job->m_plotFormat ) );
|
||||
m_plotBackgroundColor->SetValue( m_job->m_useBackgroundColor );
|
||||
m_penWidth.SetValue( m_job->m_HPGLPenSize );
|
||||
m_plotBackgroundColor->SetValue( m_job->m_useBackgroundColor );
|
||||
m_penWidth.SetValue( m_job->m_HPGLPenSize );
|
||||
m_HPGLPaperSizeSelect = static_cast<HPGL_PAGE_SIZE>( m_job->m_HPGLPaperSizeSelect );
|
||||
m_plotPDFPropertyPopups->SetValue( m_job->m_PDFPropertyPopups );
|
||||
m_plotPDFMetadata->SetValue( m_job->m_PDFMetadata );
|
||||
m_colorTheme->Enable( m_job->m_plotFormat != SCH_PLOT_FORMAT::HPGL );
|
||||
m_ModeColorOption->Enable( m_job->m_plotFormat != SCH_PLOT_FORMAT::HPGL );
|
||||
m_plotOriginOpt->SetSelection( static_cast<int>( m_job->m_HPGLPlotOrigin ) );
|
||||
m_pageSizeSelect = static_cast<int>( m_job->m_pageSizeSelect );
|
||||
m_plotPDFPropertyPopups->SetValue( m_job->m_PDFPropertyPopups );
|
||||
m_plotPDFHierarchicalLinks->SetValue( m_job->m_PDFHierarchicalLinks );
|
||||
m_plotPDFMetadata->SetValue( m_job->m_PDFMetadata );
|
||||
m_colorTheme->Enable( m_job->m_plotFormat != SCH_PLOT_FORMAT::HPGL );
|
||||
m_ModeColorOption->Enable( m_job->m_plotFormat != SCH_PLOT_FORMAT::HPGL );
|
||||
m_plotOriginOpt->SetSelection( static_cast<int>( m_job->m_HPGLPlotOrigin ) );
|
||||
m_pageSizeSelect = static_cast<int>( m_job->m_pageSizeSelect );
|
||||
|
||||
// Set the plot format
|
||||
switch( m_job->m_plotFormat )
|
||||
@ -320,6 +322,7 @@ void DIALOG_PLOT_SCHEMATIC::OnUpdateUI( wxUpdateUIEvent& event )
|
||||
|
||||
m_openFileAfterPlot->Enable( fmt == PLOT_FORMAT::PDF );
|
||||
m_plotPDFPropertyPopups->Enable( fmt == PLOT_FORMAT::PDF );
|
||||
m_plotPDFHierarchicalLinks->Enable( fmt == PLOT_FORMAT::PDF );
|
||||
m_plotPDFMetadata->Enable( fmt == PLOT_FORMAT::PDF );
|
||||
|
||||
m_paperSizeOption->Set( paperSizes );
|
||||
@ -359,9 +362,10 @@ void DIALOG_PLOT_SCHEMATIC::getPlotOptions( RENDER_SETTINGS* aSettings )
|
||||
cfg->m_PlotPanel.format = static_cast<int>( GetPlotFileFormat() );
|
||||
cfg->m_PlotPanel.hpgl_origin = m_plotOriginOpt->GetSelection();
|
||||
cfg->m_PlotPanel.hpgl_paper_size = static_cast<int>( m_HPGLPaperSizeSelect );
|
||||
cfg->m_PlotPanel.pdf_property_popups = m_plotPDFPropertyPopups->GetValue();
|
||||
cfg->m_PlotPanel.pdf_metadata = m_plotPDFMetadata->GetValue();
|
||||
cfg->m_PlotPanel.open_file_after_plot = getOpenFileAfterPlot();
|
||||
cfg->m_PlotPanel.pdf_property_popups = m_plotPDFPropertyPopups->GetValue();
|
||||
cfg->m_PlotPanel.pdf_hierarchical_links = m_plotPDFHierarchicalLinks->GetValue();
|
||||
cfg->m_PlotPanel.pdf_metadata = m_plotPDFMetadata->GetValue();
|
||||
cfg->m_PlotPanel.open_file_after_plot = getOpenFileAfterPlot();
|
||||
|
||||
// HPGL Pen Size is stored in mm in config
|
||||
cfg->m_PlotPanel.hpgl_pen_size = m_HPGLPenSize / schIUScale.IU_PER_MM;
|
||||
@ -437,6 +441,7 @@ void DIALOG_PLOT_SCHEMATIC::plotSchematic( bool aPlotAll )
|
||||
plotOpts.m_useBackgroundColor = m_plotBackgroundColor->GetValue();
|
||||
plotOpts.m_theme = colors->GetFilename();
|
||||
plotOpts.m_PDFPropertyPopups = m_plotPDFPropertyPopups->GetValue();
|
||||
plotOpts.m_PDFHierarchicalLinks = m_plotPDFHierarchicalLinks->GetValue();
|
||||
plotOpts.m_PDFMetadata = m_plotPDFMetadata->GetValue();
|
||||
plotOpts.m_HPGLPaperSizeSelect = static_cast<HPGL_PAGE_SIZE>( m_HPGLPaperSizeSelect );
|
||||
plotOpts.m_HPGLPlotOrigin =
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -164,6 +164,10 @@ DIALOG_PLOT_SCHEMATIC_BASE::DIALOG_PLOT_SCHEMATIC_BASE( wxWindow* parent, wxWind
|
||||
m_plotPDFPropertyPopups->SetValue(true);
|
||||
sbSizer4->Add( m_plotPDFPropertyPopups, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_plotPDFHierarchicalLinks = new wxCheckBox( sbSizer4->GetStaticBox(), wxID_ANY, _("Generate clickable links for hierarchical elements"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_plotPDFHierarchicalLinks->SetValue(true);
|
||||
sbSizer4->Add( m_plotPDFHierarchicalLinks, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_plotPDFMetadata = new wxCheckBox( sbSizer4->GetStaticBox(), wxID_ANY, _("Generate metadata from AUTHOR && SUBJECT variables"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_plotPDFMetadata->SetToolTip( _("Generate PDF document properties from AUTHOR and SUBJECT text variables") );
|
||||
|
||||
|
@ -1,34 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="17"/>
|
||||
<FileVersion major="1" minor="18"/>
|
||||
<object class="Project" expanded="true">
|
||||
<property name="class_decoration"></property>
|
||||
<property name="code_generation">C++</property>
|
||||
<property name="disconnect_events">1</property>
|
||||
<property name="disconnect_mode">source_name</property>
|
||||
<property name="disconnect_php_events">0</property>
|
||||
<property name="disconnect_python_events">0</property>
|
||||
<property name="cpp_class_decoration"></property>
|
||||
<property name="cpp_disconnect_events">1</property>
|
||||
<property name="cpp_event_generation">connect</property>
|
||||
<property name="cpp_help_provider">none</property>
|
||||
<property name="cpp_namespace"></property>
|
||||
<property name="cpp_precompiled_header"></property>
|
||||
<property name="cpp_use_array_enum">0</property>
|
||||
<property name="cpp_use_enum">1</property>
|
||||
<property name="embedded_files_path">res</property>
|
||||
<property name="encoding">UTF-8</property>
|
||||
<property name="event_generation">connect</property>
|
||||
<property name="file">dialog_plot_schematic_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="image_path_wrapper_function_name"></property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="lua_skip_events">1</property>
|
||||
<property name="lua_ui_table">UI</property>
|
||||
<property name="name">Dialog_plot_schematic_base</property>
|
||||
<property name="namespace"></property>
|
||||
<property name="path">.</property>
|
||||
<property name="precompiled_header"></property>
|
||||
<property name="php_disconnect_events">0</property>
|
||||
<property name="php_disconnect_mode">source_name</property>
|
||||
<property name="php_skip_events">1</property>
|
||||
<property name="python_disconnect_events">0</property>
|
||||
<property name="python_disconnect_mode">source_name</property>
|
||||
<property name="python_image_path_wrapper_function_name"></property>
|
||||
<property name="python_indent_with_spaces"></property>
|
||||
<property name="python_skip_events">1</property>
|
||||
<property name="relative_path">1</property>
|
||||
<property name="skip_lua_events">1</property>
|
||||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_array_enum">0</property>
|
||||
<property name="use_enum">1</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<property name="use_native_eol">0</property>
|
||||
<object class="Dialog" expanded="true">
|
||||
<property name="aui_managed">0</property>
|
||||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||
@ -82,10 +84,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -144,10 +146,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -209,10 +211,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -295,10 +297,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -393,10 +395,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -458,10 +460,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -527,10 +529,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -595,10 +597,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -660,10 +662,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -728,10 +730,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -793,10 +795,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -861,10 +863,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -929,10 +931,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -994,10 +996,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1062,10 +1064,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1167,10 +1169,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1232,10 +1234,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1300,10 +1302,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1365,10 +1367,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1433,10 +1435,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1511,10 +1513,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1567,6 +1569,71 @@
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">1</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Generate clickable links for hierarchical elements</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_plotPDFHierarchicalLinks</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
|
||||
@ -1576,10 +1643,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1655,10 +1722,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1735,10 +1802,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -67,6 +67,7 @@ class DIALOG_PLOT_SCHEMATIC_BASE : public DIALOG_SHIM
|
||||
wxTextCtrl* m_penWidthCtrl;
|
||||
wxStaticText* m_penWidthUnits;
|
||||
wxCheckBox* m_plotPDFPropertyPopups;
|
||||
wxCheckBox* m_plotPDFHierarchicalLinks;
|
||||
wxCheckBox* m_plotPDFMetadata;
|
||||
wxStaticBoxSizer* m_otherOptions;
|
||||
wxCheckBox* m_openFileAfterPlot;
|
||||
|
@ -318,6 +318,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportPlot( JOB* aJob )
|
||||
plotOpts.m_HPGLPenSize = aPlotJob->m_HPGLPenSize;
|
||||
plotOpts.m_HPGLPlotOrigin = hpglOrigin;
|
||||
plotOpts.m_PDFPropertyPopups = aPlotJob->m_PDFPropertyPopups;
|
||||
plotOpts.m_PDFHierarchicalLinks = aPlotJob->m_PDFHierarchicalLinks;
|
||||
plotOpts.m_PDFMetadata = aPlotJob->m_PDFMetadata;
|
||||
plotOpts.m_outputDirectory = aPlotJob->m_outputDirectory;
|
||||
plotOpts.m_outputFile = aPlotJob->m_outputFile;
|
||||
|
@ -546,6 +546,9 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() :
|
||||
m_params.emplace_back( new PARAM<bool>( "plot.pdf_property_popups",
|
||||
&m_PlotPanel.pdf_property_popups, true ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "plot.pdf_hierarchical_links",
|
||||
&m_PlotPanel.pdf_hierarchical_links, true ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "plot.pdf_metadata",
|
||||
&m_PlotPanel.pdf_metadata, true ) );
|
||||
|
||||
|
@ -260,6 +260,7 @@ public:
|
||||
double hpgl_pen_size;
|
||||
int hpgl_origin;
|
||||
bool pdf_property_popups;
|
||||
bool pdf_hierarchical_links;
|
||||
bool pdf_metadata;
|
||||
bool open_file_after_plot;
|
||||
};
|
||||
|
@ -1344,8 +1344,34 @@ void SCH_LABEL_BASE::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_O
|
||||
aPlotter->PlotPoly( s_poly, FILL_T::NO_FILL, penWidth );
|
||||
}
|
||||
|
||||
// Make sheet pins and hierarchical labels clickable hyperlinks
|
||||
bool linkAlreadyPlotted = false;
|
||||
if( aPlotOpts.m_PDFHierarchicalLinks )
|
||||
{
|
||||
if( Type() == SCH_HIER_LABEL_T )
|
||||
{
|
||||
if( sheet->size() >= 2 )
|
||||
{
|
||||
SCH_SHEET_PATH path = *sheet;
|
||||
path.pop_back();
|
||||
aPlotter->HyperlinkBox( GetBodyBoundingBox(),
|
||||
EDA_TEXT::GotoPageHref( path.GetPageNumber() ) );
|
||||
linkAlreadyPlotted = true;
|
||||
}
|
||||
}
|
||||
else if( Type() == SCH_SHEET_PIN_T )
|
||||
{
|
||||
SCH_SHEET_PATH path = *sheet;
|
||||
SCH_SHEET* parent = static_cast<SCH_SHEET*>( m_parent );
|
||||
path.push_back( parent );
|
||||
aPlotter->HyperlinkBox( GetBodyBoundingBox(),
|
||||
EDA_TEXT::GotoPageHref( path.GetPageNumber() ) );
|
||||
linkAlreadyPlotted = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Plot attributes to a hypertext menu
|
||||
if( aPlotOpts.m_PDFPropertyPopups )
|
||||
if( aPlotOpts.m_PDFPropertyPopups && !linkAlreadyPlotted )
|
||||
{
|
||||
std::vector<wxString> properties;
|
||||
|
||||
|
@ -89,6 +89,7 @@ struct SCH_PLOT_OPTS
|
||||
double m_HPGLPenSize; // for HPGL format only: pen size
|
||||
HPGL_PAGE_SIZE m_HPGLPaperSizeSelect;
|
||||
bool m_PDFPropertyPopups;
|
||||
bool m_PDFHierarchicalLinks;
|
||||
bool m_PDFMetadata;
|
||||
wxString m_theme;
|
||||
|
||||
@ -106,6 +107,7 @@ struct SCH_PLOT_OPTS
|
||||
m_HPGLPenSize( 1.0 ),
|
||||
m_HPGLPaperSizeSelect( HPGL_PAGE_SIZE::DEFAULT ),
|
||||
m_PDFPropertyPopups( false ),
|
||||
m_PDFHierarchicalLinks( false ),
|
||||
m_PDFMetadata( false ),
|
||||
m_theme(),
|
||||
m_outputDirectory(),
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <trigo.h>
|
||||
#include <sch_edit_frame.h>
|
||||
#include <plotters/plotter.h>
|
||||
#include <sch_plotter.h>
|
||||
#include <string_utils.h>
|
||||
#include <widgets/msgpanel.h>
|
||||
#include <math/util.h> // for KiROUND
|
||||
@ -1247,18 +1248,25 @@ void SCH_SHEET::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS&
|
||||
}
|
||||
|
||||
// Make the sheet object a clickable hyperlink (e.g. for PDF plotter)
|
||||
std::vector<wxString> properties;
|
||||
|
||||
properties.emplace_back( EDA_TEXT::GotoPageHref( findSelf().GetPageNumber() ) );
|
||||
|
||||
for( const SCH_FIELD& field : GetFields() )
|
||||
if( aPlotOpts.m_PDFHierarchicalLinks )
|
||||
{
|
||||
properties.emplace_back( wxString::Format( wxT( "!%s = %s" ),
|
||||
field.GetName(),
|
||||
field.GetShownText( false ) ) );
|
||||
aPlotter->HyperlinkBox( GetBoundingBox(),
|
||||
EDA_TEXT::GotoPageHref( findSelf().GetPageNumber() ) );
|
||||
}
|
||||
else if( aPlotOpts.m_PDFPropertyPopups )
|
||||
{
|
||||
std::vector<wxString> properties;
|
||||
|
||||
aPlotter->HyperlinkMenu( GetBoundingBox(), properties );
|
||||
properties.emplace_back( EDA_TEXT::GotoPageHref( findSelf().GetPageNumber() ) );
|
||||
|
||||
for( const SCH_FIELD& field : GetFields() )
|
||||
{
|
||||
properties.emplace_back( wxString::Format( wxT( "!%s = %s" ), field.GetName(),
|
||||
field.GetShownText( false ) ) );
|
||||
}
|
||||
|
||||
aPlotter->HyperlinkMenu( GetBoundingBox(), properties );
|
||||
}
|
||||
|
||||
// Plot sheet pins
|
||||
for( SCH_SHEET_PIN* sheetPin : m_pins )
|
||||
|
@ -36,6 +36,7 @@
|
||||
#define ARG_HPGL_ORIGIN "--origin"
|
||||
#define ARG_PAGES "--pages"
|
||||
#define ARG_EXCLUDE_PDF_PROPERTY_POPUPS "--exclude-pdf-property-popups"
|
||||
#define ARG_EXCLUDE_PDF_HIERARCHICAL_LINKS "--exclude-pdf-hierarchical-links"
|
||||
#define ARG_EXCLUDE_PDF_METADATA "--exclude-pdf-metadata"
|
||||
|
||||
const JOB_HPGL_PLOT_ORIGIN_AND_UNITS hpgl_origin_ops[4] = {
|
||||
@ -81,6 +82,11 @@ CLI::SCH_EXPORT_PLOT_COMMAND::SCH_EXPORT_PLOT_COMMAND( const std::string& aName,
|
||||
.help( UTF8STDSTR( _( "Do not generate property popups in PDF" ) ) )
|
||||
.flag();
|
||||
|
||||
m_argParser.add_argument( ARG_EXCLUDE_PDF_HIERARCHICAL_LINKS )
|
||||
.help( UTF8STDSTR( _( "Do not generate clickable links for hierarchical elements "
|
||||
"in PDF" ) ) )
|
||||
.flag();
|
||||
|
||||
m_argParser.add_argument( ARG_EXCLUDE_PDF_METADATA )
|
||||
.help( UTF8STDSTR( _( "Do not generate PDF metadata from AUTHOR and SUBJECT variables" ) ) )
|
||||
.flag();
|
||||
@ -184,6 +190,8 @@ int CLI::SCH_EXPORT_PLOT_COMMAND::doPerform( KIWAY& aKiway )
|
||||
else if( m_plotFormat == SCH_PLOT_FORMAT::PDF )
|
||||
{
|
||||
plotJob->m_PDFPropertyPopups = !m_argParser.get<bool>( ARG_EXCLUDE_PDF_PROPERTY_POPUPS );
|
||||
plotJob->m_PDFHierarchicalLinks =
|
||||
!m_argParser.get<bool>( ARG_EXCLUDE_PDF_HIERARCHICAL_LINKS );
|
||||
plotJob->m_PDFMetadata = !m_argParser.get<bool>( ARG_EXCLUDE_PDF_METADATA );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user