diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
index d6eb45749c..befdb20510 100644
--- a/common/CMakeLists.txt
+++ b/common/CMakeLists.txt
@@ -49,7 +49,6 @@ set(COMMON_SRCS
common_plotSVG_functions.cpp
confirm.cpp
copy_to_clipboard.cpp
- dcsvg.cpp
dialog_shim.cpp
displlst.cpp
dlist.cpp
diff --git a/common/common_plotSVG_functions.cpp b/common/common_plotSVG_functions.cpp
index f7c340bf10..19002ed308 100644
--- a/common/common_plotSVG_functions.cpp
+++ b/common/common_plotSVG_functions.cpp
@@ -152,54 +152,26 @@ void SVG_PLOTTER::setSVGPlotStyle()
switch( m_fillMode )
{
case NO_FILL:
- fputs( "fill-opacity:0.0;\n", outputFile );
+ fputs( "fill-opacity:0.0; ", outputFile );
break;
case FILLED_SHAPE:
- fputs( "fill-opacity:1.0;\n", outputFile );
+ fputs( "fill-opacity:1.0; ", outputFile );
break;
case FILLED_WITH_BG_BODYCOLOR:
- fputs( "fill-opacity:0.6;\n", outputFile );
+ fputs( "fill-opacity:0.6; ", outputFile );
break;
}
- // output the pen color (RVB values in hex) and opacity
- double pen_opacity = 1.0; // 0.0 (transparent to 1.0 (solid)
- fprintf( outputFile, " stroke:#%6.6lX; stroke-opacity:%g;\n",
- m_pen_rgb_color, pen_opacity );
-
- // output the pen cap
- int pen_cap = 0; // round, square, butt (currenly not used)
-
- switch( pen_cap )
- {
- case 1:
- fputs( "stroke-linecap:square; ", outputFile );
- break;
-
- case 2:
- fputs( "stroke-linecap:butt; ", outputFile );
- break;
-
- case 0:
- default:
- fputs( "stroke-linecap:round; ", outputFile );
- }
-
- fputs( "stroke-linejoin:round; ", outputFile );
-
- int pen_w = (int) userToDeviceSize( GetCurrentLineWidth() );
- fprintf( outputFile,
- "stroke-width:%d\" \n transform=\"translate(%.2g %.2g) scale(%.2g %.2g)\">\n",
- pen_w,
- userToDeviceSize( plotOffset.x ), userToDeviceSize( plotOffset.y ),
- plotScale, plotScale );
+ double pen_w = userToDeviceSize( GetCurrentLineWidth() );
+ fprintf( outputFile, "\nstroke:#%6.6lX; stroke-width:%g; stroke-opacity:1; \n",
+ m_pen_rgb_color, pen_w );
+ fputs( "stroke-linecap:round; stroke-linejoin:round;\">\n", outputFile );
m_graphics_changed = false;
}
-
/* Set the current line width (in IUs) for the next plot
*/
void SVG_PLOTTER::SetCurrentLineWidth( int width )
@@ -487,10 +459,16 @@ bool SVG_PLOTTER::StartPlot( FILE* fout )
// End of header
fprintf( outputFile, " Picture generated by %s \n",
TO_UTF8( creator ) );
- fputs( "\n",
- outputFile );
- setSVGPlotStyle();
+ // output the pen and brush color (RVB values in hex) and opacity
+ double opacity = 1.0; // 0.0 (transparent to 1.0 (solid)
+ fprintf( outputFile,
+ "\n", outputFile );
return true;
}
diff --git a/common/dcsvg.cpp b/common/dcsvg.cpp.unused
similarity index 100%
rename from common/dcsvg.cpp
rename to common/dcsvg.cpp.unused
diff --git a/pcbnew/class_mire.cpp b/pcbnew/class_mire.cpp
index ccb7210cf3..340d2020f5 100644
--- a/pcbnew/class_mire.cpp
+++ b/pcbnew/class_mire.cpp
@@ -118,7 +118,9 @@ void PCB_TARGET::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE mode_color,
if( DC->LogicalToDeviceXRel( width ) < 2 )
typeaff = LINE;
- radius = m_Size / 4;
+ radius = m_Size / 3;
+ if( GetShape() ) // shape X
+ radius = m_Size / 2;
switch( typeaff )
{
@@ -142,9 +144,9 @@ void PCB_TARGET::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE mode_color,
dx2 = 0;
dy2 = radius;
- if( m_Shape ) /* Form X */
+ if( GetShape() ) // shape X
{
- dx1 = dy1 = ( radius * 7 ) / 5;
+ dx1 = dy1 = radius;
dx2 = dx1;
dy2 = -dy1;
}
diff --git a/pcbnew/class_pad_draw_functions.cpp b/pcbnew/class_pad_draw_functions.cpp
index d139dddf62..ab938c3e62 100644
--- a/pcbnew/class_pad_draw_functions.cpp
+++ b/pcbnew/class_pad_draw_functions.cpp
@@ -78,7 +78,6 @@ PAD_DRAWINFO::PAD_DRAWINFO()
void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDraw_mode,
const wxPoint& aOffset )
{
- EDA_COLOR_T color = ColorFromInt(0); // XXX EVIL (it will be ORed later)
wxSize mask_margin; // margin (clearance) used for some non copper layers
#ifdef SHOW_PADMASK_REAL_SIZE_AND_COLOR
@@ -143,6 +142,7 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDraw_mode,
else
drawInfo.m_ShowPadFilled = false;
+ EDA_COLOR_T color = ColorFromInt(0); // XXX EVIL (it will be ORed later)
if( m_layerMask & LAYER_FRONT )
{
color = brd->GetVisibleElementColor( PAD_FR_VISIBLE );
@@ -154,7 +154,7 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDraw_mode,
color = ColorFromInt( color | brd->GetVisibleElementColor( PAD_BK_VISIBLE ) );
}
- if( color == 0 ) // Not on copper layer XXX EVIL check
+ if( color == 0 ) // Not on a visible copper layer XXX EVIL check
{
// If the pad in on only one tech layer, use the layer color else use DARKGRAY
int mask_non_copper_layers = m_layerMask & ~ALL_CU_LAYERS;
diff --git a/pcbnew/dialogs/dialog_SVG_print.cpp b/pcbnew/dialogs/dialog_SVG_print.cpp
index 2bcd8b1637..dca44c204a 100644
--- a/pcbnew/dialogs/dialog_SVG_print.cpp
+++ b/pcbnew/dialogs/dialog_SVG_print.cpp
@@ -35,27 +35,24 @@
#include
#include
#include
+#include
#include
#include
#include
-
#include
-
#include
-
// Keys for configuration
-#define PLOTSVGMODECOLOR_KEY wxT( "PlotSVGModeColor" )
-#define PLOTSVGPAGESIZEOPT_KEY wxT( "PlotSVGPageOpt" )
-#define PLOTSVGPLOT_BRD_EDGE_KEY wxT( "PlotSVGBrdEdge" )
+#define PLOTSVGMODECOLOR_KEY wxT( "PlotSVGModeColor" )
+#define PLOTSVGPAGESIZEOPT_KEY wxT( "PlotSVGPageOpt" )
+#define PLOTSVGPLOT_BRD_EDGE_KEY wxT( "PlotSVGBrdEdge" )
// reasonnable values for default pen width
-#define WIDTH_MAX_VALUE (2 *IU_PER_MM)
-#define WIDTH_MIN_VALUE (0.05 *IU_PER_MM)
+#define WIDTH_MAX_VALUE (2 * IU_PER_MM)
+#define WIDTH_MIN_VALUE (0.05 * IU_PER_MM)
// Local variables:
-static PRINT_PARAMETERS s_Parameters;
static long s_SelectedLayers = LAYER_BACK | LAYER_FRONT |
SILKSCREEN_LAYER_FRONT | SILKSCREEN_LAYER_BACK;
@@ -66,42 +63,45 @@ static long s_SelectedLayers = LAYER_BACK | LAYER_FRONT |
DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( EDA_DRAW_FRAME* parent ) :
DIALOG_SVG_PRINT_base( parent )
{
- m_Parent = (PCB_BASE_FRAME*) parent;
- m_Config = wxGetApp().GetSettings();
+ m_Parent = (PCB_BASE_FRAME*) parent;
+ m_Config = wxGetApp().GetSettings();
initDialog();
GetSizer()->SetSizeHints( this );
Centre();
- m_buttonBoard->SetDefault();
}
+bool DIALOG_SVG_PRINT::m_printMirror = false;
+bool DIALOG_SVG_PRINT::m_oneFileOnly = false;
-void DIALOG_SVG_PRINT::initDialog( )
+void DIALOG_SVG_PRINT::initDialog()
{
- SetFocus(); // Make ESC key working
-
if( m_Config )
{
- m_Config->Read( PLOTSVGMODECOLOR_KEY, &s_Parameters.m_Print_Black_and_White );
+ m_Config->Read( PLOTSVGMODECOLOR_KEY, &m_printBW, false );
long ltmp;
m_Config->Read( PLOTSVGPAGESIZEOPT_KEY, <mp, 0 );
m_rbSvgPageSizeOpt->SetSelection( ltmp );
m_Config->Read( PLOTSVGPLOT_BRD_EDGE_KEY, <mp, 1 );
- m_PrintBoardEdgesCtrl->SetValue(ltmp );
+ m_PrintBoardEdgesCtrl->SetValue( ltmp );
}
- if( s_Parameters.m_Print_Black_and_White )
+ if( m_printBW )
m_ModeColorOption->SetSelection( 1 );
else
m_ModeColorOption->SetSelection( 0 );
- s_Parameters.m_PenDefaultSize = g_DrawDefaultLineThickness;
+ m_printMirrorOpt->SetValue( m_printMirror );
+ m_rbFileOpt->SetSelection( m_oneFileOnly ? 1 : 0 );
+
+
AddUnitSymbol( *m_TextPenWidth, g_UserUnit );
m_DialogDefaultPenSize->SetValue(
- ReturnStringFromValue( g_UserUnit, s_Parameters.m_PenDefaultSize ) );
+ ReturnStringFromValue( g_UserUnit, g_DrawDefaultLineThickness ) );
// Create layers list
- BOARD* board = m_Parent->GetBoard();
- int layer;
+ BOARD* board = m_Parent->GetBoard();
+ int layer;
+
for( layer = 0; layer < NB_LAYERS; ++layer )
{
if( !board->IsLayerEnabled( layer ) )
@@ -110,20 +110,23 @@ void DIALOG_SVG_PRINT::initDialog( )
m_BoxSelectLayer[layer] =
new wxCheckBox( this, -1, board->GetLayerName( layer ) );
}
+
// Add wxCheckBoxes in layers lists dialog
- // List layers in same order than in setup layers dialog
+ // List layers in same order than in setup layers dialog
// (Front or Top to Back or Bottom)
- DECLARE_LAYERS_ORDER_LIST(layersOrder);
+ DECLARE_LAYERS_ORDER_LIST( layersOrder );
+
for( int layer_idx = 0; layer_idx < NB_LAYERS; ++layer_idx )
{
layer = layersOrder[layer_idx];
- wxASSERT(layer < NB_LAYERS);
+ wxASSERT( layer < NB_LAYERS );
if( m_BoxSelectLayer[layer] == NULL )
continue;
long mask = 1 << layer;
+
if( mask & s_SelectedLayers )
m_BoxSelectLayer[layer]->SetValue( true );
@@ -143,11 +146,13 @@ void DIALOG_SVG_PRINT::initDialog( )
{
wxString layerKey;
- for( int layer = 0; layerRead( layerKey, &option ) )
@@ -159,82 +164,77 @@ void DIALOG_SVG_PRINT::initDialog( )
void DIALOG_SVG_PRINT::SetPenWidth()
{
- s_Parameters.m_PenDefaultSize = ReturnValueFromTextCtrl( *m_DialogDefaultPenSize );
+ int pensize = ReturnValueFromTextCtrl( *m_DialogDefaultPenSize );
- if( s_Parameters.m_PenDefaultSize > WIDTH_MAX_VALUE )
+ if( pensize > WIDTH_MAX_VALUE )
{
- s_Parameters.m_PenDefaultSize = WIDTH_MAX_VALUE;
+ pensize = WIDTH_MAX_VALUE;
}
- if( s_Parameters.m_PenDefaultSize < WIDTH_MIN_VALUE )
+ if( pensize < WIDTH_MIN_VALUE )
{
- s_Parameters.m_PenDefaultSize = WIDTH_MIN_VALUE;
+ pensize = WIDTH_MIN_VALUE;
}
- g_DrawDefaultLineThickness = s_Parameters.m_PenDefaultSize;
- m_DialogDefaultPenSize->SetValue(
- ReturnStringFromValue( g_UserUnit, s_Parameters.m_PenDefaultSize ) );
+ g_DrawDefaultLineThickness = pensize;
+ m_DialogDefaultPenSize->SetValue( ReturnStringFromValue( g_UserUnit, pensize ) );
}
-
-void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll )
+void DIALOG_SVG_PRINT::ExportSVGFile( bool aOnlyOneFile )
{
- wxFileName fn;
- wxString msg;
+ wxFileName fn;
+ wxString msg;
- s_Parameters.m_Print_Black_and_White = m_ModeColorOption->GetSelection();
+ m_printMirror = m_printMirrorOpt->GetValue();
+ m_printBW = m_ModeColorOption->GetSelection();
SetPenWidth();
- PCB_SCREEN* screen = m_Parent->GetScreen();
-
- if( aPrintAll )
- m_PrintMaskLayer = 0xFFFFFFFF;
- else
- m_PrintMaskLayer = 0;
-
- if( m_PrintBoardEdgesCtrl->IsChecked() )
- m_PrintMaskLayer |= EDGE_LAYER;
- else
- m_PrintMaskLayer &= ~EDGE_LAYER;
+ // Build layers mask
+ int printMaskLayer = 0;
for( int layer = 0; layerGetValue() )
+ printMaskLayer |= 1 << layer;
+ }
- if( !aPrintAll && !m_BoxSelectLayer[layer]->GetValue() )
+ for( int layer = 0; layerGetValue();
- if( !fn.IsOk() )
- {
- fn = m_Parent->GetBoard()->GetFileName();
- }
- if( aPrintAll )
+ if( !fn.IsOk() )
+ fn = m_Parent->GetBoard()->GetFileName();
+
+ if( aOnlyOneFile )
+ {
+ m_PrintMaskLayer = printMaskLayer;
fn.SetName( fn.GetName() + wxT( "-brd" ) );
+ }
else
{
- wxString extraname = m_Parent->GetBoard()->GetLayerName( layer, false );
- extraname.Trim(); // remove leading and trailing spaces if any
- extraname.Trim(false);
- fn.SetName( fn.GetName() + wxT( "-" ) + extraname );
-
- m_PrintMaskLayer = 1 << layer;
- if( m_PrintBoardEdgesCtrl->IsChecked() )
- m_PrintMaskLayer |= EDGE_LAYER;
+ m_PrintMaskLayer = currlayer_mask;
+ wxString suffix = m_Parent->GetBoard()->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" ) );
- bool success = DrawPage( fn.GetFullPath(), screen );
- msg = _( "Create file " ) + fn.GetFullPath();
- if( !success )
- msg += _( " error" );
- msg += wxT( "\n" );
+ if( m_PrintBoardEdgesCtrl->IsChecked() )
+ m_PrintMaskLayer |= EDGE_LAYER;
+
+ if( CreateSVGFile( fn.GetFullPath() ) )
+ msg.Printf( _( "Plot: %s OK\n" ), GetChars( fn.GetFullPath() ) );
+ else // Error
+ msg.Printf( _( "** Unable to create %s **\n" ), GetChars( fn.GetFullPath() ) );
m_MessagesBox->AppendText( msg );
- if( aPrintAll )
+ if( aOnlyOneFile )
break;
}
}
@@ -243,83 +243,61 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll )
/*
* Actual print function.
*/
-bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName,
- BASE_SCREEN* screen )
+bool DIALOG_SVG_PRINT::CreateSVGFile( const wxString& aFullFileName )
{
- LOCALE_IO toggle;
- int tmpzoom;
- wxPoint tmp_startvisu;
- wxPoint old_org;
- bool success = true;
+ BOARD* brd = m_Parent->GetBoard();
- // Change frames and local settings
- tmp_startvisu = screen->m_StartVisu;
- tmpzoom = screen->GetZoom();
- old_org = screen->m_DrawOrg;
+ PCB_PLOT_PARAMS m_plotOpts;
- screen->m_DrawOrg.x = screen->m_DrawOrg.y = 0;
- screen->m_StartVisu.x = screen->m_StartVisu.y = 0;
+ m_plotOpts.SetPlotFrameRef( PrintPageRef() );
+ m_plotOpts.SetDrillMarksType( PCB_PLOT_PARAMS::FULL_DRILL_SHAPE );
+ m_plotOpts.SetMirror( m_printMirror );
+ m_plotOpts.SetFormat( PLOT_FORMAT_SVG );
+ EDA_COLOR_T color = BLACK;
+ m_plotOpts.SetReferenceColor( color );
+ m_plotOpts.SetValueColor( color );
- screen->SetScalingFactor( 1.0 );
+ PAGE_INFO pageInfo = brd->GetPageSettings();
+ wxPoint axisorigin = brd->GetOriginAxisPosition();
- double dpi = IU_PER_MILS * 1000.0;
-
- EDA_DRAW_PANEL* panel = m_Parent->GetCanvas();
-
- // paper pageSize is in internal units, either nanometers or deci-mils
- EDA_RECT rect;
- rect.SetSize( m_Parent->GetPageSizeIU() );
if( PageIsBoardBoundarySize() )
{
- rect = m_Parent->GetBoard()->ComputeBoundingBox();
+ EDA_RECT bbox = brd->ComputeBoundingBox();
+ PAGE_INFO currpageInfo = brd->GetPageSettings();
+ currpageInfo.SetWidthMils( bbox.GetWidth() / IU_PER_MILS );
+ currpageInfo.SetHeightMils( bbox.GetHeight() / IU_PER_MILS );
+ brd->SetPageSettings( currpageInfo );
+ m_plotOpts.SetUseAuxOrigin( true );
+ wxPoint origin = bbox.GetOrigin();
+ brd->SetOriginAxisPosition( origin );
}
- KicadSVGFileDC dc( FullFileName, rect.GetOrigin(), rect.GetSize(), dpi );
+ LOCALE_IO toggle;
+ SVG_PLOTTER* plotter = (SVG_PLOTTER*) StartPlotBoard( brd,
+ &m_plotOpts, aFullFileName,
+ wxEmptyString );
- EDA_RECT tmp = *panel->GetClipBox();
- GRResetPenAndBrush( &dc );
- GRForceBlackPen( s_Parameters.m_Print_Black_and_White );
- s_Parameters.m_DrillShapeOpt = PRINT_PARAMETERS::FULL_DRILL_SHAPE;
+ if( plotter )
+ {
+ plotter->SetColorMode( m_ModeColorOption->GetSelection() == 0 );
+ PlotStandardLayer( brd, plotter, m_PrintMaskLayer, m_plotOpts, true, false );
+ // Adding drill marks, if required and if the plotter is able to plot them:
+ if( m_plotOpts.GetDrillMarksType() != PCB_PLOT_PARAMS::NO_DRILL_SHAPE )
+ PlotDrillMarks( brd, plotter, m_plotOpts );
+ }
- // Set clip box to the max size
- #define MAX_VALUE (INT_MAX/2) // MAX_VALUE is the max we can use in an integer
- // and that allows calculations without overflow
- panel->SetClipBox( EDA_RECT( wxPoint( 0, 0 ), wxSize( MAX_VALUE, MAX_VALUE ) ) );
+ plotter->EndPlot();
+ delete plotter;
+ brd->SetOriginAxisPosition( axisorigin );
+ brd->SetPageSettings( pageInfo );
- screen->m_IsPrinting = true;
-
- EDA_COLOR_T bg_color = g_DrawBgColor;
- g_DrawBgColor = WHITE;
-
- if( PrintPageRef() )
- m_Parent->TraceWorkSheet( &dc, screen, s_Parameters.m_PenDefaultSize,
- IU_PER_MILS, wxT( "" ) );
-
- m_Parent->PrintPage( &dc, m_PrintMaskLayer, false, &s_Parameters);
- g_DrawBgColor = bg_color;
-
- screen->m_IsPrinting = false;
- panel->SetClipBox( tmp );
-
- GRForceBlackPen( false );
-
- screen->m_StartVisu = tmp_startvisu;
- screen->m_DrawOrg = old_org;
- screen->SetZoom( tmpzoom );
-
- return success;
+ return true;
}
-
-void DIALOG_SVG_PRINT::OnButtonPrintBoardClick( wxCommandEvent& event )
+void DIALOG_SVG_PRINT::OnButtonPlot( wxCommandEvent& event )
{
- PrintSVGDoc( true );
-}
-
-
-void DIALOG_SVG_PRINT::OnButtonPrintSelectedClick( wxCommandEvent& event )
-{
- PrintSVGDoc( false );
+ m_oneFileOnly = m_rbFileOpt->GetSelection() == 1;
+ ExportSVGFile( m_oneFileOnly );
}
@@ -332,21 +310,26 @@ void DIALOG_SVG_PRINT::OnButtonCancelClick( wxCommandEvent& event )
void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event )
{
SetPenWidth();
- s_Parameters.m_Print_Black_and_White = m_ModeColorOption->GetSelection();
+ m_printBW = m_ModeColorOption->GetSelection();
+ m_oneFileOnly = m_rbFileOpt->GetSelection() == 1;
+
if( m_Config )
{
- m_Config->Write( PLOTSVGMODECOLOR_KEY, s_Parameters.m_Print_Black_and_White );
+ m_Config->Write( PLOTSVGMODECOLOR_KEY, m_printBW );
m_Config->Write( PLOTSVGPAGESIZEOPT_KEY, m_rbSvgPageSizeOpt->GetSelection() );
m_Config->Write( PLOTSVGPLOT_BRD_EDGE_KEY, m_PrintBoardEdgesCtrl->GetValue() );
wxString layerKey;
- for( int layer = 0; layerWrite( layerKey, m_BoxSelectLayer[layer]->IsChecked() );
}
}
+
EndModal( 0 );
}
diff --git a/pcbnew/dialogs/dialog_SVG_print.h b/pcbnew/dialogs/dialog_SVG_print.h
index 236272e8b4..ac0b20d4a5 100644
--- a/pcbnew/dialogs/dialog_SVG_print.h
+++ b/pcbnew/dialogs/dialog_SVG_print.h
@@ -18,6 +18,10 @@ private:
wxConfig* m_Config;
long m_PrintMaskLayer;
wxCheckBox* m_BoxSelectLayer[32];
+ bool m_printBW;
+ // Static member to store options
+ static bool m_printMirror;
+ static bool m_oneFileOnly;
public:
DIALOG_SVG_PRINT( EDA_DRAW_FRAME* parent );
@@ -26,11 +30,10 @@ public:
private:
void OnCloseWindow( wxCloseEvent& event );
void initDialog( );
- void OnButtonPrintSelectedClick( wxCommandEvent& event );
- void OnButtonPrintBoardClick( wxCommandEvent& event );
+ void OnButtonPlot( wxCommandEvent& event );
void OnButtonCancelClick( wxCommandEvent& event );
void SetPenWidth();
- void PrintSVGDoc( bool aPrintAll );
+ void ExportSVGFile( bool aOnlyOneFile );
bool PageIsBoardBoundarySize()
{
return m_rbSvgPageSizeOpt->GetSelection() == 2;
@@ -39,7 +42,7 @@ private:
{
return m_rbSvgPageSizeOpt->GetSelection() == 0;
}
- bool DrawPage( const wxString& FullFileName, BASE_SCREEN* screen );
+ bool CreateSVGFile( const wxString& FullFileName );
};
diff --git a/pcbnew/dialogs/dialog_SVG_print_base.cpp b/pcbnew/dialogs/dialog_SVG_print_base.cpp
index 21b8b5349c..aa5ae71e73 100644
--- a/pcbnew/dialogs/dialog_SVG_print_base.cpp
+++ b/pcbnew/dialogs/dialog_SVG_print_base.cpp
@@ -40,7 +40,7 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c
m_TextPenWidth = new wxStaticText( this, wxID_ANY, _("Default pen size"), wxDefaultPosition, wxDefaultSize, 0 );
m_TextPenWidth->Wrap( -1 );
- sbOptionsSizer->Add( m_TextPenWidth, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
+ sbOptionsSizer->Add( m_TextPenWidth, 0, wxRIGHT|wxLEFT, 5 );
m_DialogDefaultPenSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_DialogDefaultPenSize->SetToolTip( _("Selection of the pen size used to draw items which have no pen size speicfied.") );
@@ -53,37 +53,43 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c
m_ModeColorOption->SetSelection( 1 );
m_ModeColorOption->SetToolTip( _("Choose if you want to draw the sheet like it appears on screen,\nor in black and white mode, better to print it when using black and white printers") );
- sbOptionsSizer->Add( m_ModeColorOption, 0, wxALL|wxEXPAND, 5 );
+ sbOptionsSizer->Add( m_ModeColorOption, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxString m_rbSvgPageSizeOptChoices[] = { _("Full page with frame ref"), _("Current page size"), _("Board area only") };
int m_rbSvgPageSizeOptNChoices = sizeof( m_rbSvgPageSizeOptChoices ) / sizeof( wxString );
m_rbSvgPageSizeOpt = new wxRadioBox( this, wxID_ANY, _("SVG Page Size"), wxDefaultPosition, wxDefaultSize, m_rbSvgPageSizeOptNChoices, m_rbSvgPageSizeOptChoices, 1, wxRA_SPECIFY_COLS );
m_rbSvgPageSizeOpt->SetSelection( 0 );
- sbOptionsSizer->Add( m_rbSvgPageSizeOpt, 0, wxALL|wxEXPAND, 5 );
+ sbOptionsSizer->Add( m_rbSvgPageSizeOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_PrintBoardEdgesCtrl = new wxCheckBox( this, wxID_ANY, _("Print board edges"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_PrintBoardEdgesCtrl->SetValue(true);
m_PrintBoardEdgesCtrl->SetToolTip( _("Print (or not) the edges layer on others layers") );
- sbOptionsSizer->Add( m_PrintBoardEdgesCtrl, 0, wxALL, 5 );
+ sbOptionsSizer->Add( m_PrintBoardEdgesCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
+
+ m_printMirrorOpt = new wxCheckBox( this, wxID_ANY, _("Print mirror"), wxDefaultPosition, wxDefaultSize, 0 );
+ sbOptionsSizer->Add( m_printMirrorOpt, 0, wxRIGHT|wxLEFT, 5 );
- bUpperSizer->Add( sbOptionsSizer, 1, wxEXPAND, 5 );
+ bUpperSizer->Add( sbOptionsSizer, 0, wxEXPAND, 5 );
wxBoxSizer* bButtonsSizer;
bButtonsSizer = new wxBoxSizer( wxVERTICAL );
- m_buttonPrintSelected = new wxButton( this, wxID_PRINT_CURRENT, _("Print Selected"), wxDefaultPosition, wxDefaultSize, 0 );
- m_buttonPrintSelected->SetDefault();
- bButtonsSizer->Add( m_buttonPrintSelected, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
+ wxString m_rbFileOptChoices[] = { _("One file per layer"), _("All in one file") };
+ int m_rbFileOptNChoices = sizeof( m_rbFileOptChoices ) / sizeof( wxString );
+ m_rbFileOpt = new wxRadioBox( this, wxID_ANY, _("wxRadioBox"), wxDefaultPosition, wxDefaultSize, m_rbFileOptNChoices, m_rbFileOptChoices, 1, wxRA_SPECIFY_COLS );
+ m_rbFileOpt->SetSelection( 0 );
+ bButtonsSizer->Add( m_rbFileOpt, 0, wxALL, 5 );
- m_buttonBoard = new wxButton( this, wxID_PRINT_BOARD, _("Print Board"), wxDefaultPosition, wxDefaultSize, 0 );
- bButtonsSizer->Add( m_buttonBoard, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
+ m_buttonCreateFile = new wxButton( this, wxID_PRINT_BOARD, _("Plot"), wxDefaultPosition, wxDefaultSize, 0 );
+ bButtonsSizer->Add( m_buttonCreateFile, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
- m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Quit"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
bButtonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
- bUpperSizer->Add( bButtonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
+ bUpperSizer->Add( bButtonsSizer, 0, wxEXPAND, 5 );
bMainSizer->Add( bUpperSizer, 0, wxEXPAND, 5 );
@@ -113,8 +119,7 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c
// Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_SVG_PRINT_base::OnCloseWindow ) );
- m_buttonPrintSelected->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonPrintSelectedClick ), NULL, this );
- m_buttonBoard->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonPrintBoardClick ), 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 );
}
@@ -122,8 +127,7 @@ DIALOG_SVG_PRINT_base::~DIALOG_SVG_PRINT_base()
{
// Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_SVG_PRINT_base::OnCloseWindow ) );
- m_buttonPrintSelected->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonPrintSelectedClick ), NULL, this );
- m_buttonBoard->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonPrintBoardClick ), 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 );
}
diff --git a/pcbnew/dialogs/dialog_SVG_print_base.fbp b/pcbnew/dialogs/dialog_SVG_print_base.fbp
index 9c13aec67c..a5e7b103e4 100644
--- a/pcbnew/dialogs/dialog_SVG_print_base.fbp
+++ b/pcbnew/dialogs/dialog_SVG_print_base.fbp
@@ -42,7 +42,7 @@
-1,350
DIALOG_SVG_PRINT_base
- 507,375
+ 507,420
wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER
Create SVG file
@@ -145,7 +145,7 @@