KiCad PCB EDA Suite
worksheet.h File Reference
#include <gal/color4d.h>
#include <page_info.h>

Go to the source code of this file.

Functions

void DrawPageLayout (wxDC *aDC, EDA_RECT *aClipBox, const PAGE_INFO &aPageInfo, const wxString &aFullSheetName, const wxString &aFileName, TITLE_BLOCK &aTitleBlock, int aSheetCount, int aSheetNumber, int aPenWidth, double aScalar, COLOR4D aColor, COLOR4D aAltColor, const wxString &aSheetLayer=wxEmptyString)
 Function DrawPageLayout is a core function to draw the page layout with the frame and the basic inscriptions. More...
 

Function Documentation

void DrawPageLayout ( wxDC *  aDC,
EDA_RECT aClipBox,
const PAGE_INFO aPageInfo,
const wxString &  aFullSheetName,
const wxString &  aFileName,
TITLE_BLOCK aTitleBlock,
int  aSheetCount,
int  aSheetNumber,
int  aPenWidth,
double  aScalar,
COLOR4D  aColor,
COLOR4D  aAltColor,
const wxString &  aSheetLayer = wxEmptyString 
)

Function DrawPageLayout is a core function to draw the page layout with the frame and the basic inscriptions.

Parameters
aDCThe device context.
aClipBox= the clipping rect, or NULL if no clipping.
aPageInfofor margins and page size (in mils).
aFullSheetNameThe sheetpath (full sheet name), for basic inscriptions.
aFileNameThe file name, for basic inscriptions.
aTitleBlockThe sheet title block, for basic inscriptions.
aSheetCountThe number of sheets (for basic inscriptions).
aSheetNumberThe sheet number (for basic inscriptions).
aPenWidththe pen size The line width for drawing.
aScalarthe scale factor to convert from mils to internal units.
aColorThe color for drawing.
aAltColorThe color for items which need to be "hightlighted".
aSheetLayerThe layer from pcbnew.

Parameters used in aPageInfo

  • the size of the page layout.
  • the LTmargin The left top margin of the page layout.
  • the RBmargin The right bottom margin of the page layout.

Definition at line 1765 of file legacy_gal/eda_draw_frame.cpp.

References WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList(), color, DARKDARKGRAY, WS_DRAW_ITEM_LIST::Draw(), EDA_DRAW_FRAME::DrawWorkSheet(), EDA_DRAW_PANEL::GetClipBox(), EDA_DRAW_FRAME::GetDocumentExtents(), EDA_DRAW_FRAME::GetPageSettings(), EDA_DRAW_FRAME::GetScreenDesc(), PAGE_INFO::GetSizeMils(), EDA_DRAW_FRAME::GetTitleBlock(), GR_COPY, GRRect(), GRSetDrawMode(), LIGHTGRAY, EDA_DRAW_FRAME::m_canvas, EDA_DRAW_FRAME::m_drawBgColor, BASE_SCREEN::m_IsPrinting, BASE_SCREEN::m_NumberOfScreens, BASE_SCREEN::m_ScreenNumber, EDA_DRAW_FRAME::m_showBorderAndTitleBlock, EDA_DRAW_FRAME::m_showPageLimits, RED, SaveCanvasImageToFile(), EDA_DRAW_FRAME::saveCanvasImageToFile(), WS_DRAW_ITEM_LIST::SetFileName(), BOX2< Vec >::SetMaximum(), WS_DRAW_ITEM_LIST::SetMilsToIUfactor(), WS_DRAW_ITEM_LIST::SetPenSize(), WS_DRAW_ITEM_LIST::SetSheetCount(), WS_DRAW_ITEM_LIST::SetSheetLayer(), WS_DRAW_ITEM_LIST::SetSheetName(), WS_DRAW_ITEM_LIST::SetSheetNumber(), and WHITE.

Referenced by EDA_DRAW_FRAME::DrawWorkSheet(), and DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample().

1774 {
1775  WS_DRAW_ITEM_LIST drawList;
1776 
1777  drawList.SetPenSize( aPenWidth );
1778  drawList.SetMilsToIUfactor( aScalar );
1779  drawList.SetSheetNumber( aSheetNumber );
1780  drawList.SetSheetCount( aSheetCount );
1781  drawList.SetFileName( aFileName );
1782  drawList.SetSheetName( aFullSheetName );
1783  drawList.SetSheetLayer( aSheetLayer );
1784 
1785  drawList.BuildWorkSheetGraphicList( aPageInfo,
1786  aTitleBlock, aColor, aAltColor );
1787 
1788  // Draw item list
1789  drawList.Draw( aClipBox, aDC );
1790 }
void SetFileName(const wxString &aFileName)
Set the filename to draw/plot.
void SetPenSize(int aPenSize)
Function SetPenSize Set the default pen size to draw/plot lines and texts.
void SetSheetLayer(const wxString &aSheetLayer)
Set the sheet layer to draw/plot.
void SetSheetName(const wxString &aSheetName)
Set the sheet name to draw/plot.
void BuildWorkSheetGraphicList(const PAGE_INFO &aPageInfo, const TITLE_BLOCK &aTitleBlock, COLOR4D aColor, COLOR4D aAltColor)
Function BuildWorkSheetGraphicList is a core function for drawing or plotting the page layout with th...
void SetSheetCount(int aSheetCount)
Function SetSheetCount Set the value of the count of sheets, for basic inscriptions.
void SetMilsToIUfactor(double aScale)
Function SetMilsToIUfactor Set the scalar to convert pages units ( mils) to draw/plot units...
void SetSheetNumber(int aSheetNumber)
Function SetSheetNumber Set the value of the sheet number, for basic inscriptions.
void Draw(EDA_RECT *aClipBox, wxDC *aDC)
Draws the item list created by BuildWorkSheetGraphicList.