Add hierarchical sheet (and pin) to color preview.

Fixes https://gitlab.com/kicad/code/kicad/issues/5029
This commit is contained in:
Jeff Young 2020-08-04 02:52:25 +01:00
parent 9c9fdb2569
commit be6e2e6308
1 changed files with 12 additions and 0 deletions

View File

@ -225,6 +225,8 @@ void PANEL_EESCHEMA_COLOR_SETTINGS::createPreviewItems()
m_page = new PAGE_INFO( PAGE_INFO::Custom );
m_titleBlock = new TITLE_BLOCK;
m_titleBlock->SetTitle( _( "Color Preview" ) );
m_titleBlock->SetDate( wxDateTime::Now().FormatDate() );
m_page->SetHeightMils( 5000 );
m_page->SetWidthMils( 6000 );
@ -381,6 +383,16 @@ void PANEL_EESCHEMA_COLOR_SETTINGS::createPreviewItems()
part->AddDrawItem( pin );
}
auto s = new SCH_SHEET( nullptr, wxPoint( Mils2iu( 4000 ), Mils2iu( 1300 ) ) );
s->SetSize( wxSize( Mils2iu( 800 ), Mils2iu( 1300 ) ) );
s->GetFields().at( SHEETNAME ).SetText( wxT( "SHEET" ) );
s->GetFields().at( SHEETFILENAME ).SetText( _( "/path/to/sheet" ) );
s->AutoplaceFields( nullptr, false );
addItem( s );
auto sp = new SCH_SHEET_PIN( s, wxPoint( Mils2iu( 4500 ), Mils2iu( 1500 ) ), wxT( "SHEET PIN" ) );
addItem( sp );
zoomFitPreview();
}