Loading pcbnew/dialogs/dialog_SVG_print.cpp +114 −60 Original line number Original line Diff line number Diff line Loading @@ -36,6 +36,7 @@ #include <class_pcb_screen.h> #include <class_pcb_screen.h> #include <base_units.h> #include <base_units.h> #include <convert_from_iu.h> #include <convert_from_iu.h> #include <wildcards_and_files_ext.h> #include <pcbnew.h> #include <pcbnew.h> #include <pcbplot.h> #include <pcbplot.h> Loading @@ -56,15 +57,14 @@ static long s_SelectedLayers = LAYER_BACK | LAYER_FRONT | static long s_SelectedLayers = LAYER_BACK | LAYER_FRONT | SILKSCREEN_LAYER_FRONT | SILKSCREEN_LAYER_BACK; SILKSCREEN_LAYER_FRONT | SILKSCREEN_LAYER_BACK; /* /*! * DIALOG_SVG_PRINT functions * DIALOG_SVG_PRINT functions */ */ DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( EDA_DRAW_FRAME* parent ) : DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( EDA_DRAW_FRAME* parent ) : DIALOG_SVG_PRINT_base( parent ) DIALOG_SVG_PRINT_base( parent ) { { m_Parent = (PCB_BASE_FRAME*) parent; m_parent = (PCB_BASE_FRAME*) parent; m_Config = wxGetApp().GetSettings(); m_config = wxGetApp().GetSettings(); initDialog(); initDialog(); GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this ); Centre(); Centre(); Loading @@ -75,16 +75,21 @@ bool DIALOG_SVG_PRINT::m_oneFileOnly = false; void DIALOG_SVG_PRINT::initDialog() void DIALOG_SVG_PRINT::initDialog() { { if( m_Config ) m_board = m_parent->GetBoard(); if( m_config ) { { m_Config->Read( PLOTSVGMODECOLOR_KEY, &m_printBW, false ); m_config->Read( PLOTSVGMODECOLOR_KEY, &m_printBW, false ); long ltmp; long ltmp; m_Config->Read( PLOTSVGPAGESIZEOPT_KEY, <mp, 0 ); m_config->Read( PLOTSVGPAGESIZEOPT_KEY, <mp, 0 ); m_rbSvgPageSizeOpt->SetSelection( ltmp ); m_rbSvgPageSizeOpt->SetSelection( ltmp ); m_Config->Read( PLOTSVGPLOT_BRD_EDGE_KEY, <mp, 1 ); m_config->Read( PLOTSVGPLOT_BRD_EDGE_KEY, <mp, 1 ); m_PrintBoardEdgesCtrl->SetValue( ltmp ); m_PrintBoardEdgesCtrl->SetValue( ltmp ); } } m_outputDirectory = m_parent->GetPlotSettings().GetOutputDirectory(); m_outputDirectoryName->SetValue( m_outputDirectory ); if( m_printBW ) if( m_printBW ) m_ModeColorOption->SetSelection( 1 ); m_ModeColorOption->SetSelection( 1 ); else else Loading @@ -99,16 +104,14 @@ void DIALOG_SVG_PRINT::initDialog() ReturnStringFromValue( g_UserUnit, g_DrawDefaultLineThickness ) ); ReturnStringFromValue( g_UserUnit, g_DrawDefaultLineThickness ) ); // Create layers list // Create layers list BOARD* board = m_Parent->GetBoard(); int layer; int layer; for( layer = 0; layer < NB_LAYERS; ++layer ) for( layer = 0; layer < NB_LAYERS; ++layer ) { { if( !board->IsLayerEnabled( layer ) ) if( !m_board->IsLayerEnabled( layer ) ) m_BoxSelectLayer[layer] = NULL; m_boxSelectLayer[layer] = NULL; else else m_BoxSelectLayer[layer] = m_boxSelectLayer[layer] = new wxCheckBox( this, -1, board->GetLayerName( layer ) ); new wxCheckBox( this, -1, m_board->GetLayerName( layer ) ); } } // Add wxCheckBoxes in layers lists dialog // Add wxCheckBoxes in layers lists dialog Loading @@ -122,27 +125,27 @@ void DIALOG_SVG_PRINT::initDialog() wxASSERT( layer < NB_LAYERS ); wxASSERT( layer < NB_LAYERS ); if( m_BoxSelectLayer[layer] == NULL ) if( m_boxSelectLayer[layer] == NULL ) continue; continue; long mask = 1 << layer; long mask = 1 << layer; if( mask & s_SelectedLayers ) if( mask & s_SelectedLayers ) m_BoxSelectLayer[layer]->SetValue( true ); m_boxSelectLayer[layer]->SetValue( true ); if( layer < 16 ) if( layer < 16 ) m_CopperLayersBoxSizer->Add( m_BoxSelectLayer[layer], m_CopperLayersBoxSizer->Add( m_boxSelectLayer[layer], 0, 0, wxGROW | wxALL, wxGROW | wxALL, 1 ); 1 ); else else m_TechnicalBoxSizer->Add( m_BoxSelectLayer[layer], m_TechnicalBoxSizer->Add( m_boxSelectLayer[layer], 0, 0, wxGROW | wxALL, wxGROW | wxALL, 1 ); 1 ); } } if( m_Config ) if( m_config ) { { wxString layerKey; wxString layerKey; Loading @@ -150,17 +153,53 @@ void DIALOG_SVG_PRINT::initDialog() { { bool option; bool option; if( m_BoxSelectLayer[layer] == NULL ) if( m_boxSelectLayer[layer] == NULL ) continue; continue; layerKey.Printf( OPTKEY_LAYERBASE, layer ); layerKey.Printf( OPTKEY_LAYERBASE, layer ); if( m_Config->Read( layerKey, &option ) ) if( m_config->Read( layerKey, &option ) ) m_BoxSelectLayer[layer]->SetValue( option ); m_boxSelectLayer[layer]->SetValue( option ); } } } } } } void DIALOG_SVG_PRINT::OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { // Build the absolute path of current output plot directory // to preselect it when opening the dialog. wxFileName fn( m_outputDirectoryName->GetValue() ); wxString path; if( fn.IsRelative() ) path = wxGetCwd() + fn.GetPathSeparator() + m_outputDirectoryName->GetValue(); else path = m_outputDirectoryName->GetValue(); wxDirDialog dirDialog( this, _( "Select Output Directory" ), path ); if( dirDialog.ShowModal() == wxID_CANCEL ) return; wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() ); wxMessageDialog dialog( this, _( "Use a relative path? " ), _( "Plot Output Directory" ), wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT ); if( dialog.ShowModal() == wxID_YES ) { wxString boardFilePath = ( (wxFileName) m_board->GetFileName() ).GetPath(); if( !dirName.MakeRelativeTo( boardFilePath ) ) wxMessageBox( _( "Cannot make path relative (target volume different from board file volume)!" ), _( "Plot Output Directory" ), wxOK | wxICON_ERROR ); } m_outputDirectoryName->SetValue( dirName.GetFullPath() ); m_outputDirectory = m_outputDirectoryName->GetValue(); } void DIALOG_SVG_PRINT::SetPenWidth() void DIALOG_SVG_PRINT::SetPenWidth() { { Loading @@ -182,8 +221,15 @@ void DIALOG_SVG_PRINT::SetPenWidth() void DIALOG_SVG_PRINT::ExportSVGFile( bool aOnlyOneFile ) void DIALOG_SVG_PRINT::ExportSVGFile( bool aOnlyOneFile ) { { wxFileName fn; m_outputDirectory = m_outputDirectoryName->GetValue(); wxString msg; // Create output directory if it does not exist (also transform it in // absolute form). Bail if it fails wxFileName outputDir = wxFileName::DirName( m_outputDirectory ); wxString boardFilename = m_board->GetFileName(); if( !EnsureOutputDirectory( &outputDir, boardFilename, m_messagesBox ) ) return; m_printMirror = m_printMirrorOpt->GetValue(); m_printMirror = m_printMirrorOpt->GetValue(); m_printBW = m_ModeColorOption->GetSelection(); m_printBW = m_ModeColorOption->GetSelection(); Loading @@ -194,45 +240,41 @@ void DIALOG_SVG_PRINT::ExportSVGFile( bool aOnlyOneFile ) for( int layer = 0; layer<NB_LAYERS; layer++ ) for( int layer = 0; layer<NB_LAYERS; layer++ ) { { if( m_BoxSelectLayer[layer] && m_BoxSelectLayer[layer]->GetValue() ) if( m_boxSelectLayer[layer] && m_boxSelectLayer[layer]->GetValue() ) printMaskLayer |= 1 << layer; printMaskLayer |= 1 << layer; } } wxString msg; for( int layer = 0; layer<NB_LAYERS; layer++ ) for( int layer = 0; layer<NB_LAYERS; layer++ ) { { int currlayer_mask = 1 << layer; int currlayer_mask = 1 << layer; if( (printMaskLayer & currlayer_mask ) == 0 ) if( (printMaskLayer & currlayer_mask ) == 0 ) continue; continue; fn = m_FileNameCtrl->GetValue(); wxString suffix = m_board->GetLayerName( layer, false ); if( !fn.IsOk() ) fn = m_Parent->GetBoard()->GetFileName(); if( aOnlyOneFile ) if( aOnlyOneFile ) { { m_PrintMaskLayer = printMaskLayer; m_printMaskLayer = printMaskLayer; fn.SetName( fn.GetName() + wxT( "-brd" ) ); suffix = wxT( "-brd" ); } } else else { { m_PrintMaskLayer = currlayer_mask; m_printMaskLayer = currlayer_mask; wxString suffix = m_Parent->GetBoard()->GetLayerName( layer, false ); suffix = m_board->GetLayerName( layer, false ); suffix.Trim(); // remove leading and trailing spaces if any suffix.Trim( false ); fn.SetName( fn.GetName() + wxT( "-" ) + suffix ); } } fn.SetExt( wxT( "svg" ) ); wxFileName fn(boardFilename); BuildPlotFileName( &fn, outputDir.GetPath(), suffix, SVGFileExtension ); if( m_PrintBoardEdgesCtrl->IsChecked() ) if( m_PrintBoardEdgesCtrl->IsChecked() ) m_PrintMaskLayer |= EDGE_LAYER; m_printMaskLayer |= EDGE_LAYER; if( CreateSVGFile( fn.GetFullPath() ) ) if( CreateSVGFile( fn.GetFullPath() ) ) msg.Printf( _( "Plot: %s OK\n" ), GetChars( fn.GetFullPath() ) ); msg.Printf( _( "Plot: %s OK\n" ), GetChars( fn.GetFullPath() ) ); else // Error else // Error msg.Printf( _( "** Unable to create %s **\n" ), GetChars( fn.GetFullPath() ) ); msg.Printf( _( "** Unable to create %s **\n" ), GetChars( fn.GetFullPath() ) ); m_MessagesBox->AppendText( msg ); m_messagesBox->AppendText( msg ); if( aOnlyOneFile ) if( aOnlyOneFile ) break; break; Loading @@ -243,14 +285,12 @@ void DIALOG_SVG_PRINT::ExportSVGFile( bool aOnlyOneFile ) // Actual SVG file export function. // Actual SVG file export function. bool DIALOG_SVG_PRINT::CreateSVGFile( const wxString& aFullFileName ) bool DIALOG_SVG_PRINT::CreateSVGFile( const wxString& aFullFileName ) { { BOARD* brd = m_Parent->GetBoard(); PCB_PLOT_PARAMS m_plotOpts; PCB_PLOT_PARAMS m_plotOpts; m_plotOpts.SetPlotFrameRef( PrintPageRef() ); m_plotOpts.SetPlotFrameRef( PrintPageRef() ); // Adding drill marks, for copper layers // Adding drill marks, for copper layers if( (m_PrintMaskLayer & ALL_CU_LAYERS) ) if( (m_printMaskLayer & ALL_CU_LAYERS) ) m_plotOpts.SetDrillMarksType( PCB_PLOT_PARAMS::FULL_DRILL_SHAPE ); m_plotOpts.SetDrillMarksType( PCB_PLOT_PARAMS::FULL_DRILL_SHAPE ); else else m_plotOpts.SetDrillMarksType( PCB_PLOT_PARAMS::NO_DRILL_SHAPE ); m_plotOpts.SetDrillMarksType( PCB_PLOT_PARAMS::NO_DRILL_SHAPE ); Loading @@ -263,36 +303,36 @@ bool DIALOG_SVG_PRINT::CreateSVGFile( const wxString& aFullFileName ) m_plotOpts.SetReferenceColor( color ); m_plotOpts.SetReferenceColor( color ); m_plotOpts.SetValueColor( color ); m_plotOpts.SetValueColor( color ); PAGE_INFO pageInfo = brd->GetPageSettings(); PAGE_INFO pageInfo = m_board->GetPageSettings(); wxPoint axisorigin = brd->GetOriginAxisPosition(); wxPoint axisorigin = m_board->GetOriginAxisPosition(); if( PageIsBoardBoundarySize() ) if( PageIsBoardBoundarySize() ) { { EDA_RECT bbox = brd->ComputeBoundingBox(); EDA_RECT bbox = m_board->ComputeBoundingBox(); PAGE_INFO currpageInfo = brd->GetPageSettings(); PAGE_INFO currpageInfo = m_board->GetPageSettings(); currpageInfo.SetWidthMils( bbox.GetWidth() / IU_PER_MILS ); currpageInfo.SetWidthMils( bbox.GetWidth() / IU_PER_MILS ); currpageInfo.SetHeightMils( bbox.GetHeight() / IU_PER_MILS ); currpageInfo.SetHeightMils( bbox.GetHeight() / IU_PER_MILS ); brd->SetPageSettings( currpageInfo ); m_board->SetPageSettings( currpageInfo ); m_plotOpts.SetUseAuxOrigin( true ); m_plotOpts.SetUseAuxOrigin( true ); wxPoint origin = bbox.GetOrigin(); wxPoint origin = bbox.GetOrigin(); brd->SetOriginAxisPosition( origin ); m_board->SetOriginAxisPosition( origin ); } } LOCALE_IO toggle; LOCALE_IO toggle; SVG_PLOTTER* plotter = (SVG_PLOTTER*) StartPlotBoard( brd, SVG_PLOTTER* plotter = (SVG_PLOTTER*) StartPlotBoard( m_board, &m_plotOpts, aFullFileName, &m_plotOpts, aFullFileName, wxEmptyString ); wxEmptyString ); if( plotter ) if( plotter ) { { plotter->SetColorMode( m_ModeColorOption->GetSelection() == 0 ); plotter->SetColorMode( m_ModeColorOption->GetSelection() == 0 ); PlotStandardLayer( brd, plotter, m_PrintMaskLayer, m_plotOpts ); PlotStandardLayer( m_board, plotter, m_printMaskLayer, m_plotOpts ); plotter->EndPlot(); } } plotter->EndPlot(); delete plotter; delete plotter; brd->SetOriginAxisPosition( axisorigin ); m_board->SetOriginAxisPosition( axisorigin ); brd->SetPageSettings( pageInfo ); m_board->SetPageSettings( pageInfo ); return true; return true; } } Loading @@ -316,23 +356,37 @@ void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event ) m_printBW = m_ModeColorOption->GetSelection(); m_printBW = m_ModeColorOption->GetSelection(); m_oneFileOnly = m_rbFileOpt->GetSelection() == 1; m_oneFileOnly = m_rbFileOpt->GetSelection() == 1; if( m_Config ) if( m_config ) { { m_Config->Write( PLOTSVGMODECOLOR_KEY, m_printBW ); m_config->Write( PLOTSVGMODECOLOR_KEY, m_printBW ); m_Config->Write( PLOTSVGPAGESIZEOPT_KEY, m_rbSvgPageSizeOpt->GetSelection() ); m_config->Write( PLOTSVGPAGESIZEOPT_KEY, m_rbSvgPageSizeOpt->GetSelection() ); m_Config->Write( PLOTSVGPLOT_BRD_EDGE_KEY, m_PrintBoardEdgesCtrl->GetValue() ); m_config->Write( PLOTSVGPLOT_BRD_EDGE_KEY, m_PrintBoardEdgesCtrl->GetValue() ); wxString layerKey; wxString layerKey; for( int layer = 0; layer<NB_LAYERS; ++layer ) for( int layer = 0; layer<NB_LAYERS; ++layer ) { { if( m_BoxSelectLayer[layer] == NULL ) if( m_boxSelectLayer[layer] == NULL ) continue; continue; layerKey.Printf( OPTKEY_LAYERBASE, layer ); layerKey.Printf( OPTKEY_LAYERBASE, layer ); m_Config->Write( layerKey, m_BoxSelectLayer[layer]->IsChecked() ); m_config->Write( layerKey, m_boxSelectLayer[layer]->IsChecked() ); } } } } // Set output directory and replace backslashes with forward ones wxString dirStr; dirStr = m_outputDirectoryName->GetValue(); dirStr.Replace( wxT( "\\" ), wxT( "/" ) ); if( dirStr != m_parent->GetPlotSettings().GetOutputDirectory() ) { PCB_PLOT_PARAMS tempOptions( m_parent->GetPlotSettings() ); tempOptions.SetOutputDirectory( dirStr ); m_parent->SetPlotSettings( tempOptions ); m_parent->OnModify(); } EndModal( 0 ); EndModal( 0 ); } } pcbnew/dialogs/dialog_SVG_print.h +9 −5 Original line number Original line Diff line number Diff line Loading @@ -14,11 +14,14 @@ class wxConfig; class DIALOG_SVG_PRINT : public DIALOG_SVG_PRINT_base class DIALOG_SVG_PRINT : public DIALOG_SVG_PRINT_base { { private: private: PCB_BASE_FRAME* m_Parent; PCB_BASE_FRAME* m_parent; wxConfig* m_Config; BOARD* m_board; long m_PrintMaskLayer; wxConfig* m_config; wxCheckBox* m_BoxSelectLayer[32]; long m_printMaskLayer; wxCheckBox* m_boxSelectLayer[32]; bool m_printBW; bool m_printBW; wxString m_outputDirectory; // Static member to store options // Static member to store options static bool m_printMirror; static bool m_printMirror; static bool m_oneFileOnly; static bool m_oneFileOnly; Loading @@ -32,6 +35,7 @@ private: void initDialog( ); void initDialog( ); void OnButtonPlot( wxCommandEvent& event ); void OnButtonPlot( wxCommandEvent& event ); void OnButtonCancelClick( wxCommandEvent& event ); void OnButtonCancelClick( wxCommandEvent& event ); void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ); void SetPenWidth(); void SetPenWidth(); void ExportSVGFile( bool aOnlyOneFile ); void ExportSVGFile( bool aOnlyOneFile ); bool PageIsBoardBoundarySize() bool PageIsBoardBoundarySize() Loading pcbnew/dialogs/dialog_SVG_print_base.cpp +24 −13 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,25 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c wxBoxSizer* bMainSizer; wxBoxSizer* bMainSizer; bMainSizer = new wxBoxSizer( wxVERTICAL ); bMainSizer = new wxBoxSizer( wxVERTICAL ); m_staticTextDir = new wxStaticText( this, wxID_ANY, _("Output directory:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextDir->Wrap( -1 ); bMainSizer->Add( m_staticTextDir, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); wxBoxSizer* bSizer4; bSizer4 = new wxBoxSizer( wxHORIZONTAL ); m_outputDirectoryName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_outputDirectoryName->SetToolTip( _("Enter a filename if you do not want to use default file names\nCan be used only when printing the current sheet") ); m_outputDirectoryName->SetMinSize( wxSize( 450,-1 ) ); bSizer4->Add( m_outputDirectoryName, 1, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_browseButton = new wxButton( this, wxID_ANY, _("Browse..."), wxDefaultPosition, wxDefaultSize, 0 ); bSizer4->Add( m_browseButton, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); bMainSizer->Add( bSizer4, 0, wxEXPAND|wxBOTTOM, 5 ); wxBoxSizer* bUpperSizer; wxBoxSizer* bUpperSizer; bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); Loading Loading @@ -94,24 +113,14 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c bMainSizer->Add( bUpperSizer, 0, wxEXPAND, 5 ); bMainSizer->Add( bUpperSizer, 0, wxEXPAND, 5 ); m_staticText1 = new wxStaticText( this, wxID_ANY, _("Filename:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText1->Wrap( -1 ); bMainSizer->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_FileNameCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_FileNameCtrl->SetToolTip( _("Enter a filename if you do not want to use default file names\nCan be used only when printing the current sheet") ); m_FileNameCtrl->SetMinSize( wxSize( 450,-1 ) ); bMainSizer->Add( m_FileNameCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_staticText2 = new wxStaticText( this, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText2 = new wxStaticText( this, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText2->Wrap( -1 ); m_staticText2->Wrap( -1 ); bMainSizer->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); bMainSizer->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_MessagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); m_messagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); m_MessagesBox->SetMinSize( wxSize( -1,100 ) ); m_messagesBox->SetMinSize( wxSize( -1,100 ) ); bMainSizer->Add( m_MessagesBox, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); bMainSizer->Add( m_messagesBox, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); this->SetSizer( bMainSizer ); this->SetSizer( bMainSizer ); Loading @@ -119,6 +128,7 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c // Connect Events // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_SVG_PRINT_base::OnCloseWindow ) ); this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_SVG_PRINT_base::OnCloseWindow ) ); m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnOutputDirectoryBrowseClicked ), NULL, this ); m_buttonCreateFile->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonPlot ), NULL, this ); m_buttonCreateFile->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonPlot ), NULL, this ); m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonCancelClick ), NULL, this ); m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonCancelClick ), NULL, this ); } } Loading @@ -127,6 +137,7 @@ DIALOG_SVG_PRINT_base::~DIALOG_SVG_PRINT_base() { { // Disconnect Events // Disconnect Events this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_SVG_PRINT_base::OnCloseWindow ) ); this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_SVG_PRINT_base::OnCloseWindow ) ); m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnOutputDirectoryBrowseClicked ), NULL, this ); m_buttonCreateFile->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonPlot ), NULL, this ); m_buttonCreateFile->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonPlot ), NULL, this ); m_buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonCancelClick ), NULL, this ); m_buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonCancelClick ), NULL, this ); Loading Loading
pcbnew/dialogs/dialog_SVG_print.cpp +114 −60 Original line number Original line Diff line number Diff line Loading @@ -36,6 +36,7 @@ #include <class_pcb_screen.h> #include <class_pcb_screen.h> #include <base_units.h> #include <base_units.h> #include <convert_from_iu.h> #include <convert_from_iu.h> #include <wildcards_and_files_ext.h> #include <pcbnew.h> #include <pcbnew.h> #include <pcbplot.h> #include <pcbplot.h> Loading @@ -56,15 +57,14 @@ static long s_SelectedLayers = LAYER_BACK | LAYER_FRONT | static long s_SelectedLayers = LAYER_BACK | LAYER_FRONT | SILKSCREEN_LAYER_FRONT | SILKSCREEN_LAYER_BACK; SILKSCREEN_LAYER_FRONT | SILKSCREEN_LAYER_BACK; /* /*! * DIALOG_SVG_PRINT functions * DIALOG_SVG_PRINT functions */ */ DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( EDA_DRAW_FRAME* parent ) : DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( EDA_DRAW_FRAME* parent ) : DIALOG_SVG_PRINT_base( parent ) DIALOG_SVG_PRINT_base( parent ) { { m_Parent = (PCB_BASE_FRAME*) parent; m_parent = (PCB_BASE_FRAME*) parent; m_Config = wxGetApp().GetSettings(); m_config = wxGetApp().GetSettings(); initDialog(); initDialog(); GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this ); Centre(); Centre(); Loading @@ -75,16 +75,21 @@ bool DIALOG_SVG_PRINT::m_oneFileOnly = false; void DIALOG_SVG_PRINT::initDialog() void DIALOG_SVG_PRINT::initDialog() { { if( m_Config ) m_board = m_parent->GetBoard(); if( m_config ) { { m_Config->Read( PLOTSVGMODECOLOR_KEY, &m_printBW, false ); m_config->Read( PLOTSVGMODECOLOR_KEY, &m_printBW, false ); long ltmp; long ltmp; m_Config->Read( PLOTSVGPAGESIZEOPT_KEY, <mp, 0 ); m_config->Read( PLOTSVGPAGESIZEOPT_KEY, <mp, 0 ); m_rbSvgPageSizeOpt->SetSelection( ltmp ); m_rbSvgPageSizeOpt->SetSelection( ltmp ); m_Config->Read( PLOTSVGPLOT_BRD_EDGE_KEY, <mp, 1 ); m_config->Read( PLOTSVGPLOT_BRD_EDGE_KEY, <mp, 1 ); m_PrintBoardEdgesCtrl->SetValue( ltmp ); m_PrintBoardEdgesCtrl->SetValue( ltmp ); } } m_outputDirectory = m_parent->GetPlotSettings().GetOutputDirectory(); m_outputDirectoryName->SetValue( m_outputDirectory ); if( m_printBW ) if( m_printBW ) m_ModeColorOption->SetSelection( 1 ); m_ModeColorOption->SetSelection( 1 ); else else Loading @@ -99,16 +104,14 @@ void DIALOG_SVG_PRINT::initDialog() ReturnStringFromValue( g_UserUnit, g_DrawDefaultLineThickness ) ); ReturnStringFromValue( g_UserUnit, g_DrawDefaultLineThickness ) ); // Create layers list // Create layers list BOARD* board = m_Parent->GetBoard(); int layer; int layer; for( layer = 0; layer < NB_LAYERS; ++layer ) for( layer = 0; layer < NB_LAYERS; ++layer ) { { if( !board->IsLayerEnabled( layer ) ) if( !m_board->IsLayerEnabled( layer ) ) m_BoxSelectLayer[layer] = NULL; m_boxSelectLayer[layer] = NULL; else else m_BoxSelectLayer[layer] = m_boxSelectLayer[layer] = new wxCheckBox( this, -1, board->GetLayerName( layer ) ); new wxCheckBox( this, -1, m_board->GetLayerName( layer ) ); } } // Add wxCheckBoxes in layers lists dialog // Add wxCheckBoxes in layers lists dialog Loading @@ -122,27 +125,27 @@ void DIALOG_SVG_PRINT::initDialog() wxASSERT( layer < NB_LAYERS ); wxASSERT( layer < NB_LAYERS ); if( m_BoxSelectLayer[layer] == NULL ) if( m_boxSelectLayer[layer] == NULL ) continue; continue; long mask = 1 << layer; long mask = 1 << layer; if( mask & s_SelectedLayers ) if( mask & s_SelectedLayers ) m_BoxSelectLayer[layer]->SetValue( true ); m_boxSelectLayer[layer]->SetValue( true ); if( layer < 16 ) if( layer < 16 ) m_CopperLayersBoxSizer->Add( m_BoxSelectLayer[layer], m_CopperLayersBoxSizer->Add( m_boxSelectLayer[layer], 0, 0, wxGROW | wxALL, wxGROW | wxALL, 1 ); 1 ); else else m_TechnicalBoxSizer->Add( m_BoxSelectLayer[layer], m_TechnicalBoxSizer->Add( m_boxSelectLayer[layer], 0, 0, wxGROW | wxALL, wxGROW | wxALL, 1 ); 1 ); } } if( m_Config ) if( m_config ) { { wxString layerKey; wxString layerKey; Loading @@ -150,17 +153,53 @@ void DIALOG_SVG_PRINT::initDialog() { { bool option; bool option; if( m_BoxSelectLayer[layer] == NULL ) if( m_boxSelectLayer[layer] == NULL ) continue; continue; layerKey.Printf( OPTKEY_LAYERBASE, layer ); layerKey.Printf( OPTKEY_LAYERBASE, layer ); if( m_Config->Read( layerKey, &option ) ) if( m_config->Read( layerKey, &option ) ) m_BoxSelectLayer[layer]->SetValue( option ); m_boxSelectLayer[layer]->SetValue( option ); } } } } } } void DIALOG_SVG_PRINT::OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { // Build the absolute path of current output plot directory // to preselect it when opening the dialog. wxFileName fn( m_outputDirectoryName->GetValue() ); wxString path; if( fn.IsRelative() ) path = wxGetCwd() + fn.GetPathSeparator() + m_outputDirectoryName->GetValue(); else path = m_outputDirectoryName->GetValue(); wxDirDialog dirDialog( this, _( "Select Output Directory" ), path ); if( dirDialog.ShowModal() == wxID_CANCEL ) return; wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() ); wxMessageDialog dialog( this, _( "Use a relative path? " ), _( "Plot Output Directory" ), wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT ); if( dialog.ShowModal() == wxID_YES ) { wxString boardFilePath = ( (wxFileName) m_board->GetFileName() ).GetPath(); if( !dirName.MakeRelativeTo( boardFilePath ) ) wxMessageBox( _( "Cannot make path relative (target volume different from board file volume)!" ), _( "Plot Output Directory" ), wxOK | wxICON_ERROR ); } m_outputDirectoryName->SetValue( dirName.GetFullPath() ); m_outputDirectory = m_outputDirectoryName->GetValue(); } void DIALOG_SVG_PRINT::SetPenWidth() void DIALOG_SVG_PRINT::SetPenWidth() { { Loading @@ -182,8 +221,15 @@ void DIALOG_SVG_PRINT::SetPenWidth() void DIALOG_SVG_PRINT::ExportSVGFile( bool aOnlyOneFile ) void DIALOG_SVG_PRINT::ExportSVGFile( bool aOnlyOneFile ) { { wxFileName fn; m_outputDirectory = m_outputDirectoryName->GetValue(); wxString msg; // Create output directory if it does not exist (also transform it in // absolute form). Bail if it fails wxFileName outputDir = wxFileName::DirName( m_outputDirectory ); wxString boardFilename = m_board->GetFileName(); if( !EnsureOutputDirectory( &outputDir, boardFilename, m_messagesBox ) ) return; m_printMirror = m_printMirrorOpt->GetValue(); m_printMirror = m_printMirrorOpt->GetValue(); m_printBW = m_ModeColorOption->GetSelection(); m_printBW = m_ModeColorOption->GetSelection(); Loading @@ -194,45 +240,41 @@ void DIALOG_SVG_PRINT::ExportSVGFile( bool aOnlyOneFile ) for( int layer = 0; layer<NB_LAYERS; layer++ ) for( int layer = 0; layer<NB_LAYERS; layer++ ) { { if( m_BoxSelectLayer[layer] && m_BoxSelectLayer[layer]->GetValue() ) if( m_boxSelectLayer[layer] && m_boxSelectLayer[layer]->GetValue() ) printMaskLayer |= 1 << layer; printMaskLayer |= 1 << layer; } } wxString msg; for( int layer = 0; layer<NB_LAYERS; layer++ ) for( int layer = 0; layer<NB_LAYERS; layer++ ) { { int currlayer_mask = 1 << layer; int currlayer_mask = 1 << layer; if( (printMaskLayer & currlayer_mask ) == 0 ) if( (printMaskLayer & currlayer_mask ) == 0 ) continue; continue; fn = m_FileNameCtrl->GetValue(); wxString suffix = m_board->GetLayerName( layer, false ); if( !fn.IsOk() ) fn = m_Parent->GetBoard()->GetFileName(); if( aOnlyOneFile ) if( aOnlyOneFile ) { { m_PrintMaskLayer = printMaskLayer; m_printMaskLayer = printMaskLayer; fn.SetName( fn.GetName() + wxT( "-brd" ) ); suffix = wxT( "-brd" ); } } else else { { m_PrintMaskLayer = currlayer_mask; m_printMaskLayer = currlayer_mask; wxString suffix = m_Parent->GetBoard()->GetLayerName( layer, false ); suffix = m_board->GetLayerName( layer, false ); suffix.Trim(); // remove leading and trailing spaces if any suffix.Trim( false ); fn.SetName( fn.GetName() + wxT( "-" ) + suffix ); } } fn.SetExt( wxT( "svg" ) ); wxFileName fn(boardFilename); BuildPlotFileName( &fn, outputDir.GetPath(), suffix, SVGFileExtension ); if( m_PrintBoardEdgesCtrl->IsChecked() ) if( m_PrintBoardEdgesCtrl->IsChecked() ) m_PrintMaskLayer |= EDGE_LAYER; m_printMaskLayer |= EDGE_LAYER; if( CreateSVGFile( fn.GetFullPath() ) ) if( CreateSVGFile( fn.GetFullPath() ) ) msg.Printf( _( "Plot: %s OK\n" ), GetChars( fn.GetFullPath() ) ); msg.Printf( _( "Plot: %s OK\n" ), GetChars( fn.GetFullPath() ) ); else // Error else // Error msg.Printf( _( "** Unable to create %s **\n" ), GetChars( fn.GetFullPath() ) ); msg.Printf( _( "** Unable to create %s **\n" ), GetChars( fn.GetFullPath() ) ); m_MessagesBox->AppendText( msg ); m_messagesBox->AppendText( msg ); if( aOnlyOneFile ) if( aOnlyOneFile ) break; break; Loading @@ -243,14 +285,12 @@ void DIALOG_SVG_PRINT::ExportSVGFile( bool aOnlyOneFile ) // Actual SVG file export function. // Actual SVG file export function. bool DIALOG_SVG_PRINT::CreateSVGFile( const wxString& aFullFileName ) bool DIALOG_SVG_PRINT::CreateSVGFile( const wxString& aFullFileName ) { { BOARD* brd = m_Parent->GetBoard(); PCB_PLOT_PARAMS m_plotOpts; PCB_PLOT_PARAMS m_plotOpts; m_plotOpts.SetPlotFrameRef( PrintPageRef() ); m_plotOpts.SetPlotFrameRef( PrintPageRef() ); // Adding drill marks, for copper layers // Adding drill marks, for copper layers if( (m_PrintMaskLayer & ALL_CU_LAYERS) ) if( (m_printMaskLayer & ALL_CU_LAYERS) ) m_plotOpts.SetDrillMarksType( PCB_PLOT_PARAMS::FULL_DRILL_SHAPE ); m_plotOpts.SetDrillMarksType( PCB_PLOT_PARAMS::FULL_DRILL_SHAPE ); else else m_plotOpts.SetDrillMarksType( PCB_PLOT_PARAMS::NO_DRILL_SHAPE ); m_plotOpts.SetDrillMarksType( PCB_PLOT_PARAMS::NO_DRILL_SHAPE ); Loading @@ -263,36 +303,36 @@ bool DIALOG_SVG_PRINT::CreateSVGFile( const wxString& aFullFileName ) m_plotOpts.SetReferenceColor( color ); m_plotOpts.SetReferenceColor( color ); m_plotOpts.SetValueColor( color ); m_plotOpts.SetValueColor( color ); PAGE_INFO pageInfo = brd->GetPageSettings(); PAGE_INFO pageInfo = m_board->GetPageSettings(); wxPoint axisorigin = brd->GetOriginAxisPosition(); wxPoint axisorigin = m_board->GetOriginAxisPosition(); if( PageIsBoardBoundarySize() ) if( PageIsBoardBoundarySize() ) { { EDA_RECT bbox = brd->ComputeBoundingBox(); EDA_RECT bbox = m_board->ComputeBoundingBox(); PAGE_INFO currpageInfo = brd->GetPageSettings(); PAGE_INFO currpageInfo = m_board->GetPageSettings(); currpageInfo.SetWidthMils( bbox.GetWidth() / IU_PER_MILS ); currpageInfo.SetWidthMils( bbox.GetWidth() / IU_PER_MILS ); currpageInfo.SetHeightMils( bbox.GetHeight() / IU_PER_MILS ); currpageInfo.SetHeightMils( bbox.GetHeight() / IU_PER_MILS ); brd->SetPageSettings( currpageInfo ); m_board->SetPageSettings( currpageInfo ); m_plotOpts.SetUseAuxOrigin( true ); m_plotOpts.SetUseAuxOrigin( true ); wxPoint origin = bbox.GetOrigin(); wxPoint origin = bbox.GetOrigin(); brd->SetOriginAxisPosition( origin ); m_board->SetOriginAxisPosition( origin ); } } LOCALE_IO toggle; LOCALE_IO toggle; SVG_PLOTTER* plotter = (SVG_PLOTTER*) StartPlotBoard( brd, SVG_PLOTTER* plotter = (SVG_PLOTTER*) StartPlotBoard( m_board, &m_plotOpts, aFullFileName, &m_plotOpts, aFullFileName, wxEmptyString ); wxEmptyString ); if( plotter ) if( plotter ) { { plotter->SetColorMode( m_ModeColorOption->GetSelection() == 0 ); plotter->SetColorMode( m_ModeColorOption->GetSelection() == 0 ); PlotStandardLayer( brd, plotter, m_PrintMaskLayer, m_plotOpts ); PlotStandardLayer( m_board, plotter, m_printMaskLayer, m_plotOpts ); plotter->EndPlot(); } } plotter->EndPlot(); delete plotter; delete plotter; brd->SetOriginAxisPosition( axisorigin ); m_board->SetOriginAxisPosition( axisorigin ); brd->SetPageSettings( pageInfo ); m_board->SetPageSettings( pageInfo ); return true; return true; } } Loading @@ -316,23 +356,37 @@ void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event ) m_printBW = m_ModeColorOption->GetSelection(); m_printBW = m_ModeColorOption->GetSelection(); m_oneFileOnly = m_rbFileOpt->GetSelection() == 1; m_oneFileOnly = m_rbFileOpt->GetSelection() == 1; if( m_Config ) if( m_config ) { { m_Config->Write( PLOTSVGMODECOLOR_KEY, m_printBW ); m_config->Write( PLOTSVGMODECOLOR_KEY, m_printBW ); m_Config->Write( PLOTSVGPAGESIZEOPT_KEY, m_rbSvgPageSizeOpt->GetSelection() ); m_config->Write( PLOTSVGPAGESIZEOPT_KEY, m_rbSvgPageSizeOpt->GetSelection() ); m_Config->Write( PLOTSVGPLOT_BRD_EDGE_KEY, m_PrintBoardEdgesCtrl->GetValue() ); m_config->Write( PLOTSVGPLOT_BRD_EDGE_KEY, m_PrintBoardEdgesCtrl->GetValue() ); wxString layerKey; wxString layerKey; for( int layer = 0; layer<NB_LAYERS; ++layer ) for( int layer = 0; layer<NB_LAYERS; ++layer ) { { if( m_BoxSelectLayer[layer] == NULL ) if( m_boxSelectLayer[layer] == NULL ) continue; continue; layerKey.Printf( OPTKEY_LAYERBASE, layer ); layerKey.Printf( OPTKEY_LAYERBASE, layer ); m_Config->Write( layerKey, m_BoxSelectLayer[layer]->IsChecked() ); m_config->Write( layerKey, m_boxSelectLayer[layer]->IsChecked() ); } } } } // Set output directory and replace backslashes with forward ones wxString dirStr; dirStr = m_outputDirectoryName->GetValue(); dirStr.Replace( wxT( "\\" ), wxT( "/" ) ); if( dirStr != m_parent->GetPlotSettings().GetOutputDirectory() ) { PCB_PLOT_PARAMS tempOptions( m_parent->GetPlotSettings() ); tempOptions.SetOutputDirectory( dirStr ); m_parent->SetPlotSettings( tempOptions ); m_parent->OnModify(); } EndModal( 0 ); EndModal( 0 ); } }
pcbnew/dialogs/dialog_SVG_print.h +9 −5 Original line number Original line Diff line number Diff line Loading @@ -14,11 +14,14 @@ class wxConfig; class DIALOG_SVG_PRINT : public DIALOG_SVG_PRINT_base class DIALOG_SVG_PRINT : public DIALOG_SVG_PRINT_base { { private: private: PCB_BASE_FRAME* m_Parent; PCB_BASE_FRAME* m_parent; wxConfig* m_Config; BOARD* m_board; long m_PrintMaskLayer; wxConfig* m_config; wxCheckBox* m_BoxSelectLayer[32]; long m_printMaskLayer; wxCheckBox* m_boxSelectLayer[32]; bool m_printBW; bool m_printBW; wxString m_outputDirectory; // Static member to store options // Static member to store options static bool m_printMirror; static bool m_printMirror; static bool m_oneFileOnly; static bool m_oneFileOnly; Loading @@ -32,6 +35,7 @@ private: void initDialog( ); void initDialog( ); void OnButtonPlot( wxCommandEvent& event ); void OnButtonPlot( wxCommandEvent& event ); void OnButtonCancelClick( wxCommandEvent& event ); void OnButtonCancelClick( wxCommandEvent& event ); void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ); void SetPenWidth(); void SetPenWidth(); void ExportSVGFile( bool aOnlyOneFile ); void ExportSVGFile( bool aOnlyOneFile ); bool PageIsBoardBoundarySize() bool PageIsBoardBoundarySize() Loading
pcbnew/dialogs/dialog_SVG_print_base.cpp +24 −13 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,25 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c wxBoxSizer* bMainSizer; wxBoxSizer* bMainSizer; bMainSizer = new wxBoxSizer( wxVERTICAL ); bMainSizer = new wxBoxSizer( wxVERTICAL ); m_staticTextDir = new wxStaticText( this, wxID_ANY, _("Output directory:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextDir->Wrap( -1 ); bMainSizer->Add( m_staticTextDir, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); wxBoxSizer* bSizer4; bSizer4 = new wxBoxSizer( wxHORIZONTAL ); m_outputDirectoryName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_outputDirectoryName->SetToolTip( _("Enter a filename if you do not want to use default file names\nCan be used only when printing the current sheet") ); m_outputDirectoryName->SetMinSize( wxSize( 450,-1 ) ); bSizer4->Add( m_outputDirectoryName, 1, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_browseButton = new wxButton( this, wxID_ANY, _("Browse..."), wxDefaultPosition, wxDefaultSize, 0 ); bSizer4->Add( m_browseButton, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); bMainSizer->Add( bSizer4, 0, wxEXPAND|wxBOTTOM, 5 ); wxBoxSizer* bUpperSizer; wxBoxSizer* bUpperSizer; bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); Loading Loading @@ -94,24 +113,14 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c bMainSizer->Add( bUpperSizer, 0, wxEXPAND, 5 ); bMainSizer->Add( bUpperSizer, 0, wxEXPAND, 5 ); m_staticText1 = new wxStaticText( this, wxID_ANY, _("Filename:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText1->Wrap( -1 ); bMainSizer->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_FileNameCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_FileNameCtrl->SetToolTip( _("Enter a filename if you do not want to use default file names\nCan be used only when printing the current sheet") ); m_FileNameCtrl->SetMinSize( wxSize( 450,-1 ) ); bMainSizer->Add( m_FileNameCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_staticText2 = new wxStaticText( this, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText2 = new wxStaticText( this, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText2->Wrap( -1 ); m_staticText2->Wrap( -1 ); bMainSizer->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); bMainSizer->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_MessagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); m_messagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); m_MessagesBox->SetMinSize( wxSize( -1,100 ) ); m_messagesBox->SetMinSize( wxSize( -1,100 ) ); bMainSizer->Add( m_MessagesBox, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); bMainSizer->Add( m_messagesBox, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); this->SetSizer( bMainSizer ); this->SetSizer( bMainSizer ); Loading @@ -119,6 +128,7 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c // Connect Events // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_SVG_PRINT_base::OnCloseWindow ) ); this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_SVG_PRINT_base::OnCloseWindow ) ); m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnOutputDirectoryBrowseClicked ), NULL, this ); m_buttonCreateFile->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonPlot ), NULL, this ); m_buttonCreateFile->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonPlot ), NULL, this ); m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonCancelClick ), NULL, this ); m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonCancelClick ), NULL, this ); } } Loading @@ -127,6 +137,7 @@ DIALOG_SVG_PRINT_base::~DIALOG_SVG_PRINT_base() { { // Disconnect Events // Disconnect Events this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_SVG_PRINT_base::OnCloseWindow ) ); this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_SVG_PRINT_base::OnCloseWindow ) ); m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnOutputDirectoryBrowseClicked ), NULL, this ); m_buttonCreateFile->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonPlot ), NULL, this ); m_buttonCreateFile->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonPlot ), NULL, this ); m_buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonCancelClick ), NULL, this ); m_buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonCancelClick ), NULL, this ); Loading