KiCad PCB EDA Suite
eda_draw_frame.cpp File Reference
#include <base_screen.h>
#include <bitmaps.h>
#include <confirm.h>
#include <dialog_shim.h>
#include <eda_draw_frame.h>
#include <filehistory.h>
#include <id.h>
#include <kiface_i.h>
#include <lockfile.h>
#include <macros.h>
#include <page_info.h>
#include <pgm_base.h>
#include <render_settings.h>
#include <settings/app_settings.h>
#include <settings/color_settings.h>
#include <settings/common_settings.h>
#include <settings/settings_manager.h>
#include <title_block.h>
#include <tool/actions.h>
#include <tool/common_tools.h>
#include <tool/grid_menu.h>
#include <tool/selection_conditions.h>
#include <tool/tool_dispatcher.h>
#include <tool/tool_manager.h>
#include <tool/tool_menu.h>
#include <tool/zoom_menu.h>
#include <trace_helpers.h>
#include <view/view.h>
#include <page_layout/ws_draw_item.h>
#include <widgets/msgpanel.h>
#include <wx/snglinst.h>
#include <dialogs/dialog_grid_settings.h>
#include <widgets/ui_common.h>

Go to the source code of this file.

Macros

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

Functions

wxWindow * findDialog (wxWindowList &aList)
 
void PrintPageLayout (RENDER_SETTINGS *aSettings, const PAGE_INFO &aPageInfo, const wxString &aFullSheetName, const wxString &aFileName, const TITLE_BLOCK &aTitleBlock, int aSheetCount, const wxString &aPageNumber, double aScalar, const PROJECT *aProject, const wxString &aSheetLayer, bool aIsFirstPage)
 Print the border and title block. More...
 

Variables

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

Macro Definition Documentation

◆ FR_HISTORY_LIST_CNT

#define FR_HISTORY_LIST_CNT   10

Maximum size of the find/replace history stacks.

Definition at line 60 of file eda_draw_frame.cpp.

Function Documentation

◆ findDialog()

wxWindow* findDialog ( wxWindowList &  aList)

Definition at line 767 of file eda_draw_frame.cpp.

768 {
769  for( wxWindow* window : aList )
770  {
771  if( dynamic_cast<DIALOG_SHIM*>( window ) )
772  return window;
773  }
774  return NULL;
775 }
#define NULL

References NULL.

Referenced by EDA_DRAW_FRAME::FocusOnLocation().

◆ PrintPageLayout()

void PrintPageLayout ( RENDER_SETTINGS aSettings,
const PAGE_INFO aPageInfo,
const wxString &  aFullSheetName,
const wxString &  aFileName,
const TITLE_BLOCK aTitleBlock,
int  aSheetCount,
const wxString &  aPageNumber,
double  aScalar,
const PROJECT aProject,
const wxString &  aSheetLayer = wxEmptyString,
bool  aIsFirstPage = true 
)

Print the border and title block.

Parameters
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).
aPageNumberThe page number.
aScalarthe scale factor to convert from mils to internal units.
aSheetLayerThe layer from Pcbnew.
aIsFirstPageTrue when this is the first page. This only has meaning for schematics.

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 821 of file eda_draw_frame.cpp.

826 {
827  WS_DRAW_ITEM_LIST drawList;
828 
829  drawList.SetDefaultPenSize( aSettings->GetDefaultPenWidth() );
830  drawList.SetMilsToIUfactor( aScalar );
831  drawList.SetPageNumber( aPageNumber );
832  drawList.SetSheetCount( aSheetCount );
833  drawList.SetFileName( aFileName );
834  drawList.SetSheetName( aFullSheetName );
835  drawList.SetSheetLayer( aSheetLayer );
836  drawList.SetProject( aProject );
837  drawList.SetIsFirstPage( aIsFirstPage );
838 
839  drawList.BuildWorkSheetGraphicList( aPageInfo, aTitleBlock );
840 
841  // Draw item list
842  drawList.Print( aSettings );
843 }
void SetDefaultPenSize(int aPenSize)
Definition: ws_draw_item.h:437
void SetFileName(const wxString &aFileName)
Set the filename to draw/plot.
Definition: ws_draw_item.h:416
void SetSheetLayer(const wxString &aSheetLayer)
Set the sheet layer to draw/plot.
Definition: ws_draw_item.h:432
void SetSheetName(const wxString &aSheetName)
Set the sheet name to draw/plot.
Definition: ws_draw_item.h:424
void SetPageNumber(const wxString &aPageNumber)
Set the value of the sheet number.
Definition: ws_draw_item.h:451
Store the list of graphic items: rect, lines, polygons and texts to draw/plot the title block and fra...
Definition: ws_draw_item.h:359
void SetIsFirstPage(bool aIsFirstPage)
Set if the page is the first page.
Definition: ws_draw_item.h:459
void BuildWorkSheetGraphicList(const PAGE_INFO &aPageInfo, const TITLE_BLOCK &aTitleBlock)
Drawing or plot the page layout.
void SetSheetCount(int aSheetCount)
Set the value of the count of sheets, for basic inscriptions.
Definition: ws_draw_item.h:464
void SetMilsToIUfactor(double aScale)
Set the scalar to convert pages units (mils) to draw/plot units.
Definition: ws_draw_item.h:443
void Print(RENDER_SETTINGS *aSettings)
Draws the item list created by BuildWorkSheetGraphicList.
int GetDefaultPenWidth() const
void SetProject(const PROJECT *aProject)
Definition: ws_draw_item.h:401

References WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList(), KIGFX::RENDER_SETTINGS::GetDefaultPenWidth(), WS_DRAW_ITEM_LIST::Print(), WS_DRAW_ITEM_LIST::SetDefaultPenSize(), WS_DRAW_ITEM_LIST::SetFileName(), WS_DRAW_ITEM_LIST::SetIsFirstPage(), WS_DRAW_ITEM_LIST::SetMilsToIUfactor(), WS_DRAW_ITEM_LIST::SetPageNumber(), WS_DRAW_ITEM_LIST::SetProject(), WS_DRAW_ITEM_LIST::SetSheetCount(), WS_DRAW_ITEM_LIST::SetSheetLayer(), and WS_DRAW_ITEM_LIST::SetSheetName().

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

Variable Documentation

◆ productName

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

Definition at line 819 of file eda_draw_frame.cpp.