Support SHEET_PATH when printing.
Fixes https://gitlab.com/kicad/code/kicad/issues/14233
This commit is contained in:
parent
5427100539
commit
dc78797274
|
@ -674,9 +674,9 @@ void DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample()
|
|||
|
||||
GRFilledRect( &memDC, VECTOR2I( 0, 0 ), m_layout_size, 0, bgColor, bgColor );
|
||||
|
||||
PrintDrawingSheet( &renderSettings, pageDUMMY, emptyString, emptyString, m_tb,
|
||||
nullptr, m_screen->GetPageCount(), m_screen->GetPageNumber(), 1,
|
||||
&Prj(), wxEmptyString, m_screen->GetVirtualPageNumber() == 1 );
|
||||
PrintDrawingSheet( &renderSettings, pageDUMMY, emptyString, emptyString, emptyString,
|
||||
m_tb, nullptr, m_screen->GetPageCount(), m_screen->GetPageNumber(),
|
||||
1, &Prj(), wxEmptyString, m_screen->GetVirtualPageNumber() == 1 );
|
||||
|
||||
memDC.SelectObject( wxNullBitmap );
|
||||
m_PageLayoutExampleBitmap->SetBitmap( *m_pageBitmap );
|
||||
|
|
|
@ -982,8 +982,8 @@ static const wxString productName = wxT( "KiCad E.D.A. " );
|
|||
|
||||
|
||||
void PrintDrawingSheet( const RENDER_SETTINGS* aSettings, const PAGE_INFO& aPageInfo,
|
||||
const wxString& aFullSheetName, const wxString& aFileName,
|
||||
const TITLE_BLOCK& aTitleBlock,
|
||||
const wxString& aSheetName, const wxString& aSheetPath,
|
||||
const wxString& aFileName, const TITLE_BLOCK& aTitleBlock,
|
||||
const std::map<wxString, wxString>* aProperties, int aSheetCount,
|
||||
const wxString& aPageNumber, double aMils2Iu, const PROJECT* aProject,
|
||||
const wxString& aSheetLayer, bool aIsFirstPage )
|
||||
|
@ -995,7 +995,8 @@ void PrintDrawingSheet( const RENDER_SETTINGS* aSettings, const PAGE_INFO& aPage
|
|||
drawList.SetPageNumber( aPageNumber );
|
||||
drawList.SetSheetCount( aSheetCount );
|
||||
drawList.SetFileName( aFileName );
|
||||
drawList.SetSheetName( aFullSheetName );
|
||||
drawList.SetSheetName( aSheetName );
|
||||
drawList.SetSheetPath( aSheetPath );
|
||||
drawList.SetSheetLayer( aSheetLayer );
|
||||
drawList.SetProject( aProject );
|
||||
drawList.SetIsFirstPage( aIsFirstPage );
|
||||
|
@ -1025,9 +1026,10 @@ void EDA_DRAW_FRAME::PrintDrawingSheet( const RENDER_SETTINGS* aSettings, BASE_S
|
|||
DC->SetAxisOrientation( true, false );
|
||||
}
|
||||
|
||||
::PrintDrawingSheet( aSettings, GetPageSettings(), GetScreenDesc(), aFilename, GetTitleBlock(),
|
||||
aProperties, aScreen->GetPageCount(), aScreen->GetPageNumber(), aMils2Iu,
|
||||
&Prj(), aSheetLayer, aScreen->GetVirtualPageNumber() == 1 );
|
||||
::PrintDrawingSheet( aSettings, GetPageSettings(), GetScreenDesc(), GetFullScreenDesc(),
|
||||
aFilename, GetTitleBlock(), aProperties, aScreen->GetPageCount(),
|
||||
aScreen->GetPageNumber(), aMils2Iu, &Prj(), aSheetLayer,
|
||||
aScreen->GetVirtualPageNumber() == 1 );
|
||||
|
||||
if( origin.y > 0 )
|
||||
{
|
||||
|
@ -1044,6 +1046,13 @@ wxString EDA_DRAW_FRAME::GetScreenDesc() const
|
|||
}
|
||||
|
||||
|
||||
wxString EDA_DRAW_FRAME::GetFullScreenDesc() const
|
||||
{
|
||||
// Virtual function. Base class implementation returns an empty string.
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
|
||||
bool EDA_DRAW_FRAME::LibraryFileBrowser( bool doOpen, wxFileName& aFilename,
|
||||
const wxString& wildcard, const wxString& ext,
|
||||
bool isDirectory, bool aIsGlobal,
|
||||
|
|
|
@ -668,6 +668,14 @@ SCHEMATIC& SCH_EDIT_FRAME::Schematic() const
|
|||
|
||||
|
||||
wxString SCH_EDIT_FRAME::GetScreenDesc() const
|
||||
{
|
||||
wxString s = GetCurrentSheet().Last()->GetName();
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
wxString SCH_EDIT_FRAME::GetFullScreenDesc() const
|
||||
{
|
||||
wxString s = GetCurrentSheet().PathHumanReadable();
|
||||
|
||||
|
|
|
@ -164,6 +164,7 @@ public:
|
|||
* Return a human-readable description of the current screen.
|
||||
*/
|
||||
wxString GetScreenDesc() const override;
|
||||
wxString GetFullScreenDesc() const override;
|
||||
|
||||
/**
|
||||
* Execute a remote command sent via a socket on port KICAD_SCH_PORT_SERVICE_NUMBER (which
|
||||
|
|
|
@ -113,10 +113,8 @@ void SCH_VIEW::DisplaySheet( const SCH_SCREEN *aScreen )
|
|||
|
||||
wxCHECK( editFrame, /* void */ );
|
||||
|
||||
wxString sheetName = editFrame->GetCurrentSheet().Last()->GetName();
|
||||
wxString sheetPath = editFrame->GetCurrentSheet().PathHumanReadable();
|
||||
m_drawingSheet->SetSheetName( TO_UTF8( sheetName ) );
|
||||
m_drawingSheet->SetSheetPath( TO_UTF8( sheetPath ) );
|
||||
m_drawingSheet->SetSheetName( TO_UTF8( editFrame->GetScreenDesc() ) );
|
||||
m_drawingSheet->SetSheetPath( TO_UTF8( editFrame->GetFullScreenDesc() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -129,7 +129,8 @@ private:
|
|||
*
|
||||
* @param aDC The device context.
|
||||
* @param aPageInfo for margins and page size (in mils).
|
||||
* @param aFullSheetName The sheetpath (full sheet name), for basic inscriptions.
|
||||
* @param aSheetName The sheet name, for basic inscriptions.
|
||||
* @param aSheetPath The sheetpath (full sheet name), for basic inscriptions.
|
||||
* @param aFileName The file name, for basic inscriptions.
|
||||
* @param aTitleBlock The sheet title block, for text variable resolution.
|
||||
* @param aProperties Optional properties for text variable resolution.
|
||||
|
@ -145,8 +146,8 @@ private:
|
|||
* - the RBmargin The right bottom margin of the drawing sheet.
|
||||
*/
|
||||
void PrintDrawingSheet( const RENDER_SETTINGS* aSettings, const PAGE_INFO& aPageInfo,
|
||||
const wxString& aFullSheetName, const wxString& aFileName,
|
||||
const TITLE_BLOCK& aTitleBlock,
|
||||
const wxString& aSheetName, const wxString& aSheetPath,
|
||||
const wxString& aFileName, const TITLE_BLOCK& aTitleBlock,
|
||||
const std::map<wxString, wxString>* aProperties, int aSheetCount,
|
||||
const wxString& aPageNumber, double aScalar, const PROJECT* aProject,
|
||||
const wxString& aSheetLayer = wxEmptyString, bool aIsFirstPage = true );
|
||||
|
|
|
@ -185,6 +185,7 @@ public:
|
|||
void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override;
|
||||
|
||||
virtual wxString GetScreenDesc() const;
|
||||
virtual wxString GetFullScreenDesc() const;
|
||||
|
||||
/**
|
||||
* Return a pointer to a BASE_SCREEN or one of its derivatives.
|
||||
|
|
|
@ -568,6 +568,7 @@ void PCB_EDIT_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
|
|||
&m_pcb->GetProperties() );
|
||||
|
||||
drawingSheet->SetSheetName( std::string( GetScreenDesc().mb_str() ) );
|
||||
drawingSheet->SetSheetPath( std::string( GetFullScreenDesc().mb_str() ) );
|
||||
|
||||
// A board is not like a schematic having a main page and sub sheets.
|
||||
// So for the drawing sheet, use only the first page option to display items
|
||||
|
|
Loading…
Reference in New Issue