KiCad PCB EDA Suite
eda_draw_frame.cpp File Reference
#include <fctsys.h>
#include <pgm_base.h>
#include <kiface_i.h>
#include <bitmaps.h>
#include <macros.h>
#include <id.h>
#include <base_screen.h>
#include <msgpanel.h>
#include <eda_draw_frame.h>
#include <confirm.h>
#include <dialog_helpers.h>
#include <lockfile.h>
#include <trace_helpers.h>
#include <wx/snglinst.h>
#include <view/view.h>
#include <tool/tool_manager.h>
#include <tool/action_manager.h>
#include <tool/tool_dispatcher.h>
#include <tool/actions.h>
#include <ws_draw_item.h>
#include <page_info.h>
#include <title_block.h>
#include <tool/tool_menu.h>
#include <tool/selection_conditions.h>
#include <tool/zoom_menu.h>
#include <tool/grid_menu.h>
#include <tool/common_tools.h>

Go to the source code of this file.


#define FR_HISTORY_LIST_CNT   10
 Maximum size of the find/replace history stacks. More...


static const wxString MaxUndoItemsEntry (wxT("DevelMaxUndoItems"))
 Integer to set the maximum number of undo items on the stack. More...
wxWindow * findDialog (wxWindowList &aList)
void PrintPageLayout (wxDC *aDC, const PAGE_INFO &aPageInfo, const wxString &aFullSheetName, const wxString &aFileName, const TITLE_BLOCK &aTitleBlock, int aSheetCount, int aSheetNumber, int aPenWidth, double aScalar, COLOR4D aColor, const wxString &aSheetLayer)
 Function PrintPageLayout is a core function to print the page layout with the frame and the basic inscriptions. More...


static const wxString productName = wxT( "KiCad E.D.A. " )
static const wxChar FirstRunShownKeyword [] = wxT( "FirstRunShown" )
static const wxChar FindReplaceFlagsEntry [] = wxT( "LastFindReplaceFlags" )
static const wxChar FindStringEntry [] = wxT( "LastFindString" )
static const wxChar ReplaceStringEntry [] = wxT( "LastReplaceString" )
static const wxChar FindStringHistoryEntry [] = wxT( "FindStringHistoryList%d" )
static const wxChar ReplaceStringHistoryEntry [] = wxT( "ReplaceStringHistoryList%d" )

Macro Definition Documentation


#define FR_HISTORY_LIST_CNT   10

Maximum size of the find/replace history stacks.

Definition at line 66 of file eda_draw_frame.cpp.

Function Documentation

◆ findDialog()

wxWindow* findDialog ( wxWindowList &  aList)

Definition at line 724 of file eda_draw_frame.cpp.

725 {
726  for( wxWindow* window : aList )
727  {
728  if( dynamic_cast<DIALOG_SHIM*>( window ) )
729  return window;
730  }
731  return NULL;
732 }

Referenced by EDA_DRAW_FRAME::FocusOnLocation().

◆ PrintPageLayout()

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

Function PrintPageLayout is a core function to print the page layout with the frame and the basic inscriptions.

aDCThe device context.
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.
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 758 of file eda_draw_frame.cpp.

762 {
763  WS_DRAW_ITEM_LIST drawList;
765  drawList.SetDefaultPenSize( aPenWidth );
766  drawList.SetMilsToIUfactor( aScalar );
767  drawList.SetSheetNumber( aSheetNumber );
768  drawList.SetSheetCount( aSheetCount );
769  drawList.SetFileName( aFileName );
770  drawList.SetSheetName( aFullSheetName );
771  drawList.SetSheetLayer( aSheetLayer );
773  drawList.BuildWorkSheetGraphicList( aPageInfo, aTitleBlock );
775  // Draw item list
776  drawList.Print( aDC, aColor );
777 }
void SetDefaultPenSize(int aPenSize)
Definition: ws_draw_item.h:425
void SetFileName(const wxString &aFileName)
Set the filename to draw/plot.
Definition: ws_draw_item.h:404
void SetSheetLayer(const wxString &aSheetLayer)
Set the sheet layer to draw/plot.
Definition: ws_draw_item.h:420
void SetSheetName(const wxString &aSheetName)
Set the sheet name to draw/plot.
Definition: ws_draw_item.h:412
void BuildWorkSheetGraphicList(const PAGE_INFO &aPageInfo, const TITLE_BLOCK &aTitleBlock)
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.
Definition: ws_draw_item.h:450
void SetMilsToIUfactor(double aScale)
Function SetMilsToIUfactor Set the scalar to convert pages units (mils) to draw/plot units.
Definition: ws_draw_item.h:432
void SetSheetNumber(int aSheetNumber)
Function SetSheetNumber Set the value of the sheet number, for basic inscriptions.
Definition: ws_draw_item.h:441
void Print(wxDC *aDC, COLOR4D aColor)
Draws the item list created by BuildWorkSheetGraphicList.

References WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList(), WS_DRAW_ITEM_LIST::Print(), WS_DRAW_ITEM_LIST::SetDefaultPenSize(), WS_DRAW_ITEM_LIST::SetFileName(), WS_DRAW_ITEM_LIST::SetMilsToIUfactor(), 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::PrintWorkSheet(), and DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample().

Variable Documentation

◆ productName

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

Definition at line 756 of file eda_draw_frame.cpp.