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 <class_base_screen.h>
#include <drawtxt.h>
#include <draw_frame.h>
#include <worksheet.h>
#include <class_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 49 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().

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

Referenced by WS_DRAW_ITEM_LIST::BuildFullText().