Add hierarchical label group in pdf outline

This commit is contained in:
Marek Roszko 2022-09-24 22:35:43 -04:00
parent a381a0acb2
commit f2377b447d
1 changed files with 26 additions and 24 deletions

View File

@ -929,34 +929,36 @@ void SCH_LABEL_BASE::Plot( PLOTTER* aPlotter, bool aBackground ) const
if( s_poly.size() )
aPlotter->PlotPoly( s_poly, FILL_T::NO_FILL, penWidth );
// Plot attributes to a hypertext menu
std::vector<wxString> properties;
if( connection )
{
properties.emplace_back(
wxString::Format( wxT( "!%s = %s" ), _( "Net" ), connection->Name() ) );
properties.emplace_back( wxString::Format( wxT( "!%s = %s" ), _( "Resolved netclass" ),
GetEffectiveNetClass()->GetName() ) );
}
for( const SCH_FIELD& field : GetFields() )
{
properties.emplace_back(
wxString::Format( wxT( "!%s = %s" ), field.GetName(), field.GetShownText() ) );
}
if( !properties.empty() )
aPlotter->HyperlinkMenu( GetBodyBoundingBox(), properties );
if( Type() == SCH_HIER_LABEL_T )
{
aPlotter->Bookmark( GetBodyBoundingBox(), GetShownText(), _( "Hierarchical Labels" ) );
}
}
for( const SCH_FIELD& field : m_fields )
field.Plot( aPlotter, aBackground );
// Plot attributes to a hypertext menu
std::vector<wxString> properties;
if( connection )
{
properties.emplace_back( wxString::Format( wxT( "!%s = %s" ),
_( "Net" ),
connection->Name() ) );
properties.emplace_back( wxString::Format( wxT( "!%s = %s" ),
_( "Resolved netclass" ),
GetEffectiveNetClass()->GetName() ) );
}
for( const SCH_FIELD& field : GetFields() )
{
properties.emplace_back( wxString::Format( wxT( "!%s = %s" ),
field.GetName(),
field.GetShownText() ) );
}
if( !properties.empty() )
aPlotter->HyperlinkMenu( GetBodyBoundingBox(), properties );
}