55 wxASSERT( aParent !=
nullptr );
60 bool HasPage(
int aPageNum )
override {
return ( aPageNum <= 2 ); }
61 void GetPageInfo(
int* minPage,
int* maxPage,
int* selPageFrom,
int* selPageTo )
override;
76 const wxString& aTitle,
const wxPoint& aPos = wxDefaultPosition,
77 const wxSize& aSize = wxDefaultSize ) :
78 wxPreviewFrame( aPreview, aParent, aTitle, aPos, aSize )
83 bool Show(
bool show )
override
96 s_pos = wxDefaultPosition;
105 ret = wxPreviewFrame::Show( show );
111 s_pos = GetPosition();
113 ret = wxPreviewFrame::Show( show );
126 DECLARE_EVENT_TABLE()
145 PrintPage( aPageNum );
151 int* selPageFrom,
int* selPageTo )
153 *minPage = *selPageFrom = 1;
154 *maxPage = *selPageTo = 2;
173 FitThisSizeToPaper( pageSizeIU );
174 fitRect = GetLogicalPaperRect();
176 int xoffset = ( fitRect.width - pageSizeIU.x ) / 2;
177 int yoffset = ( fitRect.height - pageSizeIU.y ) / 2;
179 OffsetLogicalOrigin( xoffset, yoffset );
223 wxPageSetupDialogData* aPageSetupData )
227 wxPrintDialogData printDialogData( *aPrintData );
228 printDialogData.SetMaxPage( pageCount );
231 printDialogData.EnablePageNumbers(
true );
233 wxPrinter printer( &printDialogData );
236 if( !printer.Print( aCaller, &printout,
true ) )
238 if( wxPrinter::GetLastError() == wxPRINTER_ERROR )
239 wxMessageBox(
_(
"An error occurred attempting to print the drawing sheet." ),
240 _(
"Printing" ), wxOK );
244 *aPageSetupData = printer.GetPrintDialogData().GetPrintData();
253 wxString title =
_(
"Preview" );
254 wxPrintPreview* preview =
new wxPrintPreview(
new PLEDITOR_PRINTOUT( aCaller, title ),
258 preview->SetZoom( 70 );
constexpr EDA_IU_SCALE drawSheetIUScale
Handles how to draw a screen (a board, a schematic ...)
void SetVirtualPageNumber(int aPageNumber)
VECTOR2I m_DrawOrg
offsets for drawing the circuit on the screen
VECTOR2I m_StartVisu
Coordinates in drawing units of the current view position (upper left corner of device)
This class handle bitmap images in KiCad.
void SetPixelSizeIu(double aPixSize)
Drawing sheet structure type definitions.
Handle the graphic items list to draw/plot the frame and title block.
static DS_DATA_MODEL & GetTheInstance()
static function: returns the instance of DS_DATA_MODEL used in the application
std::vector< DS_DATA_ITEM * > & GetItems()
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
virtual void SetDrawBgColor(const COLOR4D &aColor)
void PrintDrawingSheet(const RENDER_SETTINGS *aSettings, BASE_SCREEN *aScreen, const std::map< wxString, wxString > *aProperties, double aMils2Iu, const wxString &aFilename, const wxString &aSheetLayer=wxEmptyString)
Prints the drawing-sheet (frame and title block).
virtual COLOR4D GetDrawBgColor() const
A color representation with 4 components: red, green, blue, alpha.
Store page-layout-specific render settings.
void SetDefaultPenWidth(int aWidth)
void SetLayerColor(int aLayer, const COLOR4D &aColor)
Change the color used to draw a layer.
void SetPrintDC(wxDC *aDC)
const VECTOR2D GetSizeIU(double aIUScale) const
Gets the page size in internal units.
Custom print preview frame.
PLEDITOR_PREVIEW_FRAME(wxPrintPreview *aPreview, PL_EDITOR_FRAME *aParent, const wxString &aTitle, const wxPoint &aPos=wxDefaultPosition, const wxSize &aSize=wxDefaultSize)
bool Show(bool show) override
PL_EDITOR_FRAME * m_parent
Custom print out for printing schematics.
bool OnPrintPage(int aPageNum) override
PL_EDITOR_FRAME * m_parent
void PrintPage(int aPageNum)
PLEDITOR_PRINTOUT(PL_EDITOR_FRAME *aParent, const wxString &aTitle)
bool HasPage(int aPageNum) override
void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo) override
void DisplayDrawingSheet()
Build and update the list of WS_DRAW_ITEM_xxx showing the frame layout.
The main window used in the drawing sheet editor.
const PAGE_INFO & GetPageSettings() const override
PL_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
int InvokeDialogPrintPreview(PL_EDITOR_FRAME *aCaller, wxPrintData *aPrintData)
Create and show a print preview dialog returns 1 if OK, 0 , there is a problem.
int InvokeDialogPrint(PL_EDITOR_FRAME *aCaller, wxPrintData *aPrintData, wxPageSetupDialogData *aPageSetupData)
Create and show a print dialog returns 1 if OK, 0 , there is a problem.
void GRForceBlackPen(bool flagforce)
void GRResetPenAndBrush(wxDC *DC)
@ LAYER_DRAWINGSHEET
drawingsheet frame and titleblock
wxSize ToWxSize(const VECTOR2I &aSize)