void DIALOG_GEN_MODULE_POSITION::OnOKButton( wxCommandEvent& event ) { m_unitsOpt = m_radioBoxUnits->GetSelection(); m_fileOpt = m_radioBoxFilesCount->GetSelection(); // Set output directory and replace backslashes with forward ones // (Keep unix convention in cfg files) wxString dirStr; dirStr = m_outputDirectoryName->GetValue(); dirStr.Replace( wxT( "\\" ), wxT( "/" ) ); m_plotOpts.SetOutputDirectory( dirStr ); m_parent->SetPlotSettings( m_plotOpts ); CreateFiles(); }
void DIALOG_PRINT_USING_PRINTER::SetPrintParameters( ) { PCB_PLOT_PARAMS plot_opts = m_parent->GetPlotSettings(); s_Parameters.m_PrintMirror = m_Print_Mirror->GetValue(); s_Parameters.m_Print_Sheet_Ref = m_Print_Sheet_Ref->GetValue(); s_Parameters.m_Print_Black_and_White = m_ModeColorOption->GetSelection() != 0; s_Parameters.m_DrillShapeOpt = (PRINT_PARAMETERS::DrillShapeOptT) m_Drill_Shape_Opt->GetSelection(); if( m_PagesOption ) s_Parameters.m_OptionPrintPage = m_PagesOption->GetSelection() != 0; SetLayerSetFromListSelection(); int idx = m_ScaleOption->GetSelection(); s_Parameters.m_PrintScale = s_ScaleList[idx]; plot_opts.SetScale( s_Parameters.m_PrintScale ); if( m_FineAdjustXscaleOpt ) { if( s_Parameters.m_XScaleAdjust > MAX_SCALE || s_Parameters.m_YScaleAdjust > MAX_SCALE ) DisplayInfoMessage( NULL, _( "Warning: Scale option set to a very large value" ) ); m_FineAdjustXscaleOpt->GetValue().ToDouble( &s_Parameters.m_XScaleAdjust ); } if( m_FineAdjustYscaleOpt ) { // Test for a reasonnable scale value if( s_Parameters.m_XScaleAdjust < MIN_SCALE || s_Parameters.m_YScaleAdjust < MIN_SCALE ) DisplayInfoMessage( NULL, _( "Warning: Scale option set to a very small value" ) ); m_FineAdjustYscaleOpt->GetValue().ToDouble( &s_Parameters.m_YScaleAdjust ); } plot_opts.SetFineScaleAdjustX( s_Parameters.m_XScaleAdjust ); plot_opts.SetFineScaleAdjustY( s_Parameters.m_YScaleAdjust ); m_parent->SetPlotSettings( plot_opts ); SetPenWidth(); }
void DIALOG_GEN_MODULE_POSITION::OnOKButton( wxCommandEvent& event ) { m_unitsOpt = m_radioBoxUnits->GetSelection(); m_fileOpt = m_radioBoxFilesCount->GetSelection(); m_fileFormat = m_rbFormat->GetSelection(); m_config->Write( PLACEFILE_UNITS_KEY, m_unitsOpt ); m_config->Write( PLACEFILE_OPT_KEY, m_fileOpt ); m_config->Write( PLACEFILE_FORMAT_KEY, m_fileFormat ); // Set output directory and replace backslashes with forward ones // (Keep unix convention in cfg files) wxString dirStr; dirStr = m_outputDirectoryName->GetValue(); dirStr.Replace( wxT( "\\" ), wxT( "/" ) ); m_plotOpts.SetOutputDirectory( dirStr ); m_parent->SetPlotSettings( m_plotOpts ); CreateFiles(); // the dialog is not closed here. }