// Initialize the dialog options: void DIALOG_PLOT_SCHEMATIC::initDlg() { // Set color or B&W plot option bool tmp; m_config->Read( PLOT_MODECOLOR_KEY, &tmp, true ); setModeColor( tmp ); // Set plot or not frame reference option m_config->Read( PLOT_FRAME_REFERENCE_KEY, &tmp, true ); setPlotFrameRef( tmp ); // Set HPGL plot origin to center of paper of left bottom corner m_config->Read( PLOT_HPGL_ORIGIN_KEY, &tmp, false ); SetPlotOriginCenter( tmp ); m_config->Read( PLOT_HPGL_PAPERSIZE_KEY, &m_HPGLPaperSizeSelect, 0 ); // HPGL Pen Size is stored in mm in config m_config->Read( PLOT_HPGL_PEN_SIZE_KEY, &m_HPGLPenSize, 0.5 ); m_HPGLPenSize *= IU_PER_MM; // Switch to the last save plot format long plotfmt; m_config->Read( PLOT_FORMAT_KEY, &plotfmt, 0 ); switch( plotfmt ) { default: case PLOT_FORMAT_POST: m_plotFormatOpt->SetSelection( 0 ); break; case PLOT_FORMAT_PDF: m_plotFormatOpt->SetSelection( 1 ); break; case PLOT_FORMAT_SVG: m_plotFormatOpt->SetSelection( 2 ); break; case PLOT_FORMAT_DXF: m_plotFormatOpt->SetSelection( 3 ); break; case PLOT_FORMAT_HPGL: m_plotFormatOpt->SetSelection( 4 ); break; } // Set the default line width (pen width which should be used for // items that do not have a pen size defined (like frame ref) m_defaultLineWidth.SetValue( GetDefaultLineThickness() ); // Initialize HPGL specific widgets m_penWidth.SetValue( m_HPGLPenSize ); // Plot directory wxString path = m_parent->GetPlotDirectoryName(); #ifdef __WINDOWS__ path.Replace( '/', '\\' ); #endif m_outputDirectoryName->SetValue( path ); }
// Initialize the dialog options: void DIALOG_PLOT_SCHEMATIC::initDlg() { SetFocus(); // make the ESC work // Set paper size option m_PaperSizeOption->SetSelection( m_pageSizeSelect ); // Set color or B&W plot option bool tmp; m_config->Read( PLOT_MODECOLOR_KEY, &tmp, true ); setModeColor( tmp ); // Set plot or not frame reference option m_config->Read( PLOT_FRAME_REFERENCE_KEY, &tmp, true ); setPlotFrameRef( tmp ); // Set HPGL plot origin to center of paper of left bottom corner m_config->Read( PLOT_HPGL_ORIGIN_KEY, &tmp, false ); SetPlotOriginCenter( tmp ); m_config->Read( PLOT_HPGL_PAPERSIZE_KEY, &m_HPGLPaperSizeSelect, 0 ); m_HPGLPaperSizeOption->SetSelection( m_HPGLPaperSizeSelect ); // HPGL Pen Size is stored in mm in config m_config->Read( PLOT_HPGL_PEN_SIZE_KEY, &m_HPGLPenSize, 0.5 ); m_HPGLPenSize *= IU_PER_MM; // Switch to the last save plot format long plotfmt; m_config->Read( PLOT_FORMAT_KEY, &plotfmt, 0 ); switch( plotfmt ) { default: case PLOT_FORMAT_POST: m_plotFormatOpt->SetSelection( 0 ); break; case PLOT_FORMAT_PDF: m_plotFormatOpt->SetSelection( 1 ); break; case PLOT_FORMAT_SVG: m_plotFormatOpt->SetSelection( 2 ); break; case PLOT_FORMAT_DXF: m_plotFormatOpt->SetSelection( 3 ); break; case PLOT_FORMAT_HPGL: m_plotFormatOpt->SetSelection( 4 ); break; } // Set the default line width (pen width which should be used for // items that do not have a pen size defined (like frame ref) AddUnitSymbol( *m_defaultLineWidthTitle, g_UserUnit ); PutValueInLocalUnits( *m_DefaultLineSizeCtrl, GetDefaultLineThickness() ); // Initialize HPGL specific widgets AddUnitSymbol( *m_penHPLGWidthTitle, g_UserUnit ); PutValueInLocalUnits( *m_penHPGLWidthCtrl, m_HPGLPenSize ); m_HPGLPaperSizeOption->SetSelection( m_HPGLPaperSizeSelect ); // Hide/show widgets that are not always displayed: wxCommandEvent cmd_event; OnPlotFormatSelection( cmd_event ); }