53 wxASSERT( aParent !=
nullptr );
58 bool HasPage(
int aPageNum )
override {
return ( aPageNum <= 2 ); }
59 void GetPageInfo(
int* minPage,
int* maxPage,
int* selPageFrom,
int* selPageTo )
override;
74 const wxString& aTitle,
const wxPoint& aPos = wxDefaultPosition,
75 const wxSize& aSize = wxDefaultSize ) :
76 wxPreviewFrame( aPreview, aParent, aTitle, aPos, aSize )
81 bool Show(
bool show )
override
94 s_pos = wxDefaultPosition;
103 ret = wxPreviewFrame::Show( show );
109 s_pos = GetPosition();
111 ret = wxPreviewFrame::Show( show );
124 DECLARE_EVENT_TABLE()
149 int* selPageFrom,
int* selPageTo )
151 *minPage = *selPageFrom = 1;
152 *maxPage = *selPageTo = 2;
171 FitThisSizeToPaper( pageSizeIU );
172 fitRect = GetLogicalPaperRect();
174 int xoffset = ( fitRect.width - pageSizeIU.x ) / 2;
175 int yoffset = ( fitRect.height - pageSizeIU.y ) / 2;
177 OffsetLogicalOrigin( xoffset, yoffset );
207 m_parent->SetDrawBgColor( bg_color );
216 m_parent->GetCanvas()->DisplayDrawingSheet();
221 wxPageSetupDialogData* aPageSetupData )
225 wxPrintDialogData printDialogData( *aPrintData );
226 printDialogData.SetMaxPage( pageCount );
229 printDialogData.EnablePageNumbers(
true );
231 wxPrinter printer( &printDialogData );
234 if( !printer.Print( aCaller, &printout,
true ) )
236 if( wxPrinter::GetLastError() == wxPRINTER_ERROR )
237 wxMessageBox(
_(
"An error occurred attempting to print the drawing sheet." ),
238 _(
"Printing" ), wxOK );
242 *aPageSetupData = printer.GetPrintDialogData().GetPrintData();
252 wxString title =
_(
"Preview" );
253 wxPrintPreview* preview =
new wxPrintPreview(
new PLEDITOR_PRINTOUT( aCaller, title ),
257 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()
Return the instance of DS_DATA_MODEL used in the application.
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)
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
The main window used in the drawing sheet editor.
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
Sheet frame and title block.
VECTOR2< int32_t > VECTOR2I
wxSize ToWxSize(const VECTOR2I &aSize)