void DIALOG_PRINT_FOR_MODEDIT::OnPrintButtonClick( wxCommandEvent& event ) { PCB_PLOT_PARAMS plot_opts = m_parent->GetPlotSettings(); s_Parameters.m_Print_Black_and_White = m_ModeColorOption->GetSelection(); s_Parameters.m_PrintScale = s_scaleList[m_ScaleOption->GetSelection()]; plot_opts.SetFineScaleAdjustX( s_Parameters.m_XScaleAdjust ); plot_opts.SetFineScaleAdjustY( s_Parameters.m_YScaleAdjust ); plot_opts.SetScale( s_Parameters.m_PrintScale ); m_parent->SetPlotSettings( plot_opts ); wxPrintDialogData printDialogData( *s_PrintData ); wxPrinter printer( &printDialogData ); BOARD_PRINTOUT_CONTROLLER printout( s_Parameters, m_parent, _( "Print Footprint" ) ); if( !printer.Print( this, &printout, true ) ) { if( wxPrinter::GetLastError() == wxPRINTER_ERROR ) DisplayError( this, _( "There was a problem printing." ) ); return; } else { *s_PrintData = printer.GetPrintDialogData().GetPrintData(); } }
void FOOTPRINT_EDIT_FRAME::SetPlotSettings( const PCB_PLOT_PARAMS& aSettings ) { // set the settings into parent editor, not our BOARD. // @todo(DICK) change the routing to some default or the board directly, parent may not exist PCB_BASE_FRAME* parentFrame = (PCB_BASE_FRAME*) Kiway().Player( FRAME_PCB, true ); wxASSERT( parentFrame ); parentFrame->SetPlotSettings( aSettings ); }