KiCad PCB EDA Suite
worksheet.cpp File Reference

Common code to draw the title block and frame references. More...

#include <fctsys.h>
#include <pgm_base.h>
#include <gr_basic.h>
#include <common.h>
#include <class_drawpanel.h>
#include <base_screen.h>
#include <draw_frame.h>
#include <worksheet.h>
#include <title_block.h>
#include <build_version.h>
#include <worksheet_shape_builder.h>

Go to the source code of this file.


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)
 Function DrawPageLayout is a core function to draw the page layout with the frame and the basic inscriptions. More...


static const wxString productName = wxT( "KiCad E.D.A. " )

Detailed Description

Common code to draw the title block and frame references.

it should include title_block_shape_gost.h or title_block_shape.h which defines most of draw shapes, and contains a part of the draw code

Definition in file worksheet.cpp.

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.

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 48 of file worksheet.cpp.

References WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList(), WS_DRAW_ITEM_LIST::Draw(), WS_DRAW_ITEM_LIST::SetFileName(), 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(), and WS_DRAW_ITEM_LIST::SetSheetNumber().

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

57 {
58  WS_DRAW_ITEM_LIST drawList;
60  drawList.SetPenSize( aPenWidth );
61  drawList.SetMilsToIUfactor( aScalar );
62  drawList.SetSheetNumber( aSheetNumber );
63  drawList.SetSheetCount( aSheetCount );
64  drawList.SetFileName( aFileName );
65  drawList.SetSheetName( aFullSheetName );
66  drawList.SetSheetLayer( aSheetLayer );
68  drawList.BuildWorkSheetGraphicList( aPageInfo,
69  aTitleBlock, aColor, aAltColor );
71  // Draw item list
72  drawList.Draw( aClipBox, aDC );
73 }
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.

Variable Documentation

const wxString productName = wxT( "KiCad E.D.A. " )

Definition at line 46 of file worksheet.cpp.

Referenced by WS_DRAW_ITEM_LIST::BuildFullText().