Commit 37ee2394 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: in SVG export, add option to export only the board area, not the full page.

dialog plot functions: fix compil warnings with wxWidgets 2.8
parent ba6da604
...@@ -119,24 +119,25 @@ wxString wxBrushString(wxColour c, int style = wxBRUSHSTYLE_SOLID) ...@@ -119,24 +119,25 @@ wxString wxBrushString(wxColour c, int style = wxBRUSHSTYLE_SOLID)
IMPLEMENT_ABSTRACT_CLASS(KicadSVGFileDCImpl, wxDC) IMPLEMENT_ABSTRACT_CLASS(KicadSVGFileDCImpl, wxDC)
KicadSVGFileDCImpl::KicadSVGFileDCImpl( KicadSVGFileDC *owner, const wxString &filename, KicadSVGFileDCImpl::KicadSVGFileDCImpl( KicadSVGFileDC *owner, const wxString &aFilename,
int width, int height, double dpi ) : wxPoint aOrigin, wxSize aSize, double aDpi ) :
wxDCImpl( owner ) wxDCImpl( owner )
{ {
Init( filename, width, height, dpi ); Init( aFilename, aOrigin, aSize, aDpi );
} }
void KicadSVGFileDCImpl::Init (const wxString &filename, int Width, int Height, double dpi) void KicadSVGFileDCImpl::Init ( const wxString &aFilename,
wxPoint aOrigin, wxSize aSize, double aDpi)
{ {
m_width = Width; m_width = aSize.x;
m_height = Height; m_height = aSize.y;
m_dpi = dpi; m_dpi = aDpi;
m_OK = true; m_OK = true;
m_mm_to_pix_x = dpi/25.4; m_mm_to_pix_x = m_dpi/25.4;
m_mm_to_pix_y = dpi/25.4; m_mm_to_pix_y = m_dpi/25.4;
m_backgroundBrush = *wxTRANSPARENT_BRUSH; m_backgroundBrush = *wxTRANSPARENT_BRUSH;
m_textForegroundColour = *wxBLACK; m_textForegroundColour = *wxBLACK;
...@@ -151,11 +152,11 @@ void KicadSVGFileDCImpl::Init (const wxString &filename, int Width, int Height, ...@@ -151,11 +152,11 @@ void KicadSVGFileDCImpl::Init (const wxString &filename, int Width, int Height,
////////////////////code here ////////////////////code here
m_outfile = new wxFileOutputStream(filename); m_outfile = new wxFileOutputStream(aFilename);
m_OK = m_outfile->IsOk(); m_OK = m_outfile->IsOk();
if (m_OK) if (m_OK)
{ {
m_filename = filename; m_filename = aFilename;
m_sub_images = 0; m_sub_images = 0;
wxString s; wxString s;
s = wxT("<?xml version=\"1.0\" standalone=\"no\"?>") + wxString(wxT("\n")); s = wxT("<?xml version=\"1.0\" standalone=\"no\"?>") + wxString(wxT("\n"));
...@@ -166,9 +167,11 @@ void KicadSVGFileDCImpl::Init (const wxString &filename, int Width, int Height, ...@@ -166,9 +167,11 @@ void KicadSVGFileDCImpl::Init (const wxString &filename, int Width, int Height,
write(s); write(s);
s = wxT("<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" ") + wxString(wxT("\n")); s = wxT("<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" ") + wxString(wxT("\n"));
write(s); write(s);
s.Printf( wxT(" width=\"%scm\" height=\"%scm\" viewBox=\"0 0 %d %d \"> \n"), NumStr(float(Width)/dpi*2.54), NumStr(float(Height)/dpi*2.54), Width, Height ); s.Printf( wxT(" width=\"%scm\" height=\"%scm\" viewBox=\"%d %d %d %d \"> \n"),
NumStr(float(m_width)/m_dpi*2.54), NumStr(float(m_height)/m_dpi*2.54),
aOrigin.x, aOrigin.y, m_width, m_height );
write(s); write(s);
s = wxT("<title>SVG Picture created as ") + wxFileName(filename).GetFullName() + wxT(" </title>") + wxT("\n"); s = wxT("<title>SVG Picture created as ") + wxFileName(m_filename).GetFullName() + wxT(" </title>") + wxT("\n");
write(s); write(s);
s = wxString (wxT("<desc>Picture generated by wxSVG ")) + wxSVGVersion + wxT(" </desc>")+ wxT("\n"); s = wxString (wxT("<desc>Picture generated by wxSVG ")) + wxSVGVersion + wxT(" </desc>")+ wxT("\n");
write(s); write(s);
...@@ -738,27 +741,28 @@ wxString wxBrushString( wxColour c, int style ) ...@@ -738,27 +741,28 @@ wxString wxBrushString( wxColour c, int style )
/***********************************************************************/ /***********************************************************************/
void wxSVGFileDC::Init( wxString f, int Width, int Height, float dpi ) void wxSVGFileDC::Init( const wxString& aFilename,
wxPoint aOrigin, wxSize aSize, double aDpi )
/***********************************************************************/ /***********************************************************************/
/* set up things first wxDCBase does all this? /* set up things first wxDCBase does all this?
*/ */
{ {
m_width = Width; m_width = aSize.x;
m_height = Height; m_height = aSize.y;
m_clipping = false; m_clipping = false;
m_OK = true; m_OK = true;
m_mm_to_pix_x = dpi / 25.4; m_mm_to_pix_x = aDpi / 25.4;
m_mm_to_pix_y = dpi / 25.4; m_mm_to_pix_y = aDpi / 25.4;
m_signX = m_signY = 1; m_signX = m_signY = 1;
m_userScaleX = m_userScaleY = m_userScaleX = m_userScaleY =
m_deviceOriginX = m_deviceOriginY = 0; m_deviceOriginX = m_deviceOriginY = 0;
m_OriginX = m_OriginY = 0; m_OriginX = m_OriginY = 0;
m_logicalOriginX = m_logicalOriginY = 0; m_logicalOriginX = m_logicalOriginY = 0;
m_logicalScaleX = m_logicalScaleY = 0; m_logicalScaleX = m_logicalScaleY = 0;
m_scaleX = m_scaleY = 1.0; m_scaleX = m_scaleY = 1.0;
...@@ -780,11 +784,11 @@ void wxSVGFileDC::Init( wxString f, int Width, int Height, float dpi ) ...@@ -780,11 +784,11 @@ void wxSVGFileDC::Init( wxString f, int Width, int Height, float dpi )
////////////////////code here ////////////////////code here
m_outfile = new wxFileOutputStream( f ); m_outfile = new wxFileOutputStream( aFilename );
m_OK = m_outfile->Ok(); m_OK = m_outfile->Ok();
if( m_OK ) if( m_OK )
{ {
m_filename = f; m_filename = aFilename;
m_sub_images = 0; m_sub_images = 0;
wxString s; wxString s;
s = wxT( "<?xml version=\"1.0\" standalone=\"no\"?>" ); s = s + newline; s = wxT( "<?xml version=\"1.0\" standalone=\"no\"?>" ); s = s + newline;
...@@ -800,13 +804,14 @@ void wxSVGFileDC::Init( wxString f, int Width, int Height, float dpi ) ...@@ -800,13 +804,14 @@ void wxSVGFileDC::Init( wxString f, int Width, int Height, float dpi )
write( s ); write( s );
s.Printf( wxT( " version=\"1.1\"\n" ) ); s.Printf( wxT( " version=\"1.1\"\n" ) );
write( s ); write( s );
s.Printf( wxT( " width=\"%gin\" height=\"%gin\" viewBox=\"0 0 %d %d \"\n" ), s.Printf( wxT( " width=\"%gin\" height=\"%gin\" viewBox=\"%d %d %d %d \"\n" ),
double (Width) / dpi, double (Height) / dpi, Width, Height ); double (m_width) / aDpi, double (m_height) / aDpi,
aOrigin.x, aOrigin.y, aSize.x, aSize.y );
write( s ); write( s );
s.Printf( wxT( ">\n" ) ); s.Printf( wxT( ">\n" ) );
write( s ); write( s );
s = wxT( " <title>SVG Picture created as " ) + wxFileNameFromPath( f ) + s = wxT( " <title>SVG Picture created as " ) + wxFileNameFromPath( aFilename ) +
wxT( " </title>" ) + newline; wxT( " </title>" ) + newline;
write( s ); write( s );
s = wxString( wxT( " <desc>Picture generated by wxSVG " ) ) + wxSVGVersion + wxT( s = wxString( wxT( " <desc>Picture generated by wxSVG " ) ) + wxSVGVersion + wxT(
...@@ -818,21 +823,11 @@ void wxSVGFileDC::Init( wxString f, int Width, int Height, float dpi ) ...@@ -818,21 +823,11 @@ void wxSVGFileDC::Init( wxString f, int Width, int Height, float dpi )
} }
// constructors // constructor
wxSVGFileDC::wxSVGFileDC( wxString f ) wxSVGFileDC::wxSVGFileDC( const wxString &aFilename,
wxPoint aOrigin, wxSize aSize, double aDpi )
{ {
// quarter 640x480 screen display at 72 dpi Init( aFilename, aOrigin, aSize, aDpi);
Init( f, 320, 240, 72.0 );
}
wxSVGFileDC::wxSVGFileDC( wxString f, int Width, int Height )
{
Init( f, Width, Height, 72.0 );
}
wxSVGFileDC::wxSVGFileDC( wxString f, int Width, int Height, float dpi )
{
Init( f, Width, Height, dpi );
} }
wxSVGFileDC::~wxSVGFileDC() wxSVGFileDC::~wxSVGFileDC()
......
This diff is collapsed.
...@@ -188,8 +188,8 @@ void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( ) ...@@ -188,8 +188,8 @@ void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( )
plot_offset.x = 0; plot_offset.x = 0;
plot_offset.y = 0; plot_offset.y = 0;
plotFileName = schframe->GetUniqueFilenameForCurrentSheet() + '.' plotFileName = schframe->GetUniqueFilenameForCurrentSheet() + wxT(".")
+ DXF_PLOTTER::GetDefaultFileExtension(); + DXF_PLOTTER::GetDefaultFileExtension();
PlotOneSheetDXF( plotFileName, screen, plot_offset, 1 ); PlotOneSheetDXF( plotFileName, screen, plot_offset, 1 );
......
...@@ -336,8 +336,8 @@ void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_Schematic_HPGL( bool aPlotAll ) ...@@ -336,8 +336,8 @@ void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_Schematic_HPGL( bool aPlotAll )
plotOffset.x = -s_Offset.x; plotOffset.x = -s_Offset.x;
plotOffset.y = -s_Offset.y; plotOffset.y = -s_Offset.y;
plotFileName = m_Parent->GetUniqueFilenameForCurrentSheet() + '.' plotFileName = m_Parent->GetUniqueFilenameForCurrentSheet() + wxT(".")
+ HPGL_PLOTTER::GetDefaultFileExtension(); + HPGL_PLOTTER::GetDefaultFileExtension();
LOCALE_IO toggle; LOCALE_IO toggle;
......
...@@ -218,8 +218,8 @@ void DIALOG_PLOT_SCHEMATIC_PDF::createPDFFile() ...@@ -218,8 +218,8 @@ void DIALOG_PLOT_SCHEMATIC_PDF::createPDFFile()
if( first_page ) { if( first_page ) {
wxString msg; wxString msg;
wxString plotFileName = m_Parent->GetUniqueFilenameForCurrentSheet() + '.' wxString plotFileName = m_Parent->GetUniqueFilenameForCurrentSheet() + wxT(".")
+ PDF_PLOTTER::GetDefaultFileExtension(); + PDF_PLOTTER::GetDefaultFileExtension();
msg.Printf( _( "Plot: %s " ), GetChars( plotFileName ) ); msg.Printf( _( "Plot: %s " ), GetChars( plotFileName ) );
m_MsgBox->AppendText( msg ); m_MsgBox->AppendText( msg );
......
...@@ -242,7 +242,7 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile() ...@@ -242,7 +242,7 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile()
plot_offset.x = 0; plot_offset.x = 0;
plot_offset.y = 0; plot_offset.y = 0;
plotFileName = m_Parent->GetUniqueFilenameForCurrentSheet() + '.' plotFileName = m_Parent->GetUniqueFilenameForCurrentSheet() + wxT(".")
+ PS_PLOTTER::GetDefaultFileExtension(); + PS_PLOTTER::GetDefaultFileExtension();
plotOneSheetPS( plotFileName, screen, plotPage, plot_offset, scale ); plotOneSheetPS( plotFileName, screen, plotPage, plot_offset, scale );
......
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2012 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2008-2012 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors. * Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
/** /**
* @file getpart.cpp * @file getpart.cpp
* @brief Cod to handle get & place library component. * @brief functions to get and place library components.
*/ */
#include <fctsys.h> #include <fctsys.h>
...@@ -69,11 +69,15 @@ wxString SCH_BASE_FRAME::SelectComponentFromLibBrowser( void ) ...@@ -69,11 +69,15 @@ wxString SCH_BASE_FRAME::SelectComponentFromLibBrowser( void )
m_ViewlibFrame = new LIB_VIEW_FRAME( this, NULL, &semaphore ); m_ViewlibFrame = new LIB_VIEW_FRAME( this, NULL, &semaphore );
// Show the library viewer frame until it is closed // Show the library viewer frame until it is closed
while( semaphore.TryWait() == wxSEMA_BUSY ) // Wait for viewer closing event // and disable the current frame, until the library viewer is closed
Enable(false);
// Wait for viewer closing event:
while( semaphore.TryWait() == wxSEMA_BUSY )
{ {
wxYield(); wxYield();
wxMilliSleep( 50 ); wxMilliSleep( 50 );
} }
Enable(true);
cmpname = m_ViewlibFrame->GetSelectedComponent(); cmpname = m_ViewlibFrame->GetSelectedComponent();
m_ViewlibFrame->Destroy(); m_ViewlibFrame->Destroy();
......
...@@ -122,9 +122,6 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaph ...@@ -122,9 +122,6 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaph
m_Semaphore = semaphore; m_Semaphore = semaphore;
m_exportToEeschemaCmpName.Empty(); m_exportToEeschemaCmpName.Empty();
if( m_Semaphore )
MakeModal(true);
SetScreen( new SCH_SCREEN() ); SetScreen( new SCH_SCREEN() );
GetScreen()->m_Center = true; // Center coordinate origins on screen. GetScreen()->m_Center = true; // Center coordinate origins on screen.
LoadSettings(); LoadSettings();
...@@ -270,9 +267,8 @@ void LIB_VIEW_FRAME::OnCloseWindow( wxCloseEvent& Event ) ...@@ -270,9 +267,8 @@ void LIB_VIEW_FRAME::OnCloseWindow( wxCloseEvent& Event )
if( m_Semaphore ) if( m_Semaphore )
{ {
m_Semaphore->Post(); m_Semaphore->Post();
MakeModal(false);
// This window will be destroyed by the calling function, // This window will be destroyed by the calling function,
// to avoid side effects // if needed
} }
else else
{ {
......
...@@ -26,8 +26,8 @@ class WXDLLIMPEXP_FWD_CORE KicadSVGFileDC; ...@@ -26,8 +26,8 @@ class WXDLLIMPEXP_FWD_CORE KicadSVGFileDC;
class WXDLLIMPEXP_CORE KicadSVGFileDCImpl : public wxDCImpl class WXDLLIMPEXP_CORE KicadSVGFileDCImpl : public wxDCImpl
{ {
public: public:
KicadSVGFileDCImpl( KicadSVGFileDC *owner, const wxString &filename, KicadSVGFileDCImpl( KicadSVGFileDC *owner, const wxString &aFilename,
int width=320, int height=240, double dpi=72.0 ); wxPoint aOrigin, wxSize aSize, double aDpi );
virtual ~KicadSVGFileDCImpl(); virtual ~KicadSVGFileDCImpl();
...@@ -175,7 +175,7 @@ private: ...@@ -175,7 +175,7 @@ private:
virtual wxSize GetPPI() const; virtual wxSize GetPPI() const;
void Init (const wxString &filename, int width, int height, double dpi); void Init (const wxString &aFilename, wxPoint aOrigin, wxSize aSize, double aDpi);
void NewGraphics(); void NewGraphics();
...@@ -198,11 +198,9 @@ private: ...@@ -198,11 +198,9 @@ private:
class WXDLLIMPEXP_CORE KicadSVGFileDC : public wxDC class WXDLLIMPEXP_CORE KicadSVGFileDC : public wxDC
{ {
public: public:
KicadSVGFileDC(const wxString& filename, KicadSVGFileDC(const wxString& aFilename,
int width = 320, wxPoint aOrigin, wxSize aSize, double aDpi = 300.0)
int height = 240, : wxDC(new KicadSVGFileDCImpl(this, aFilename, aOrigin, aSize, aDpi))
double dpi = 72.0)
: wxDC(new KicadSVGFileDCImpl(this, filename, width, height, dpi))
{ {
} }
}; };
...@@ -309,7 +307,8 @@ private: ...@@ -309,7 +307,8 @@ private:
wxT( "wxSVGFILEDC::DoSetClippingRegionAsRegion Call not yet implemented" ) ); return; wxT( "wxSVGFILEDC::DoSetClippingRegionAsRegion Call not yet implemented" ) ); return;
}; };
void Init( wxString f, int Width, int Height, float dpi ); void Init( const wxString& aFilename,
wxPoint aOrigin, wxSize aSize, double aDpi );
void NewGraphics(); void NewGraphics();
...@@ -421,9 +420,8 @@ private: ...@@ -421,9 +420,8 @@ private:
public: public:
wxSVGFileDC( wxString f ); wxSVGFileDC( const wxString& aFilename,
wxSVGFileDC( wxString f, int Width, int Height ); wxPoint aOrigin, wxSize aSize, double aDpi );
wxSVGFileDC( wxString f, int Width, int Height, float dpi );
~wxSVGFileDC(); ~wxSVGFileDC();
......
///////////////////////////////////////////////////////////////////////////// /**
// Name: dialog_svg_print.cpp * @file dialog_svg_print.cpp
// Author: jean-pierre Charras */
// Modified by:
// Licence: GPL /*
///////////////////////////////////////////////////////////////////////////// * This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2012 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <fctsys.h> #include <fctsys.h>
#include <appl_wxstruct.h> #include <appl_wxstruct.h>
#include <common.h> #include <common.h>
#include <class_drawpanel.h> #include <class_drawpanel.h>
#include <confirm.h>
#include <gestfich.h>
#include <dcsvg.h> #include <dcsvg.h>
#include <wxBasePcbFrame.h> #include <wxBasePcbFrame.h>
#include <class_pcb_screen.h> #include <class_pcb_screen.h>
#include <macros.h>
#include <base_units.h> #include <base_units.h>
#include <pcbnew.h> #include <pcbnew.h>
...@@ -22,26 +41,23 @@ ...@@ -22,26 +41,23 @@
#include <printout_controler.h> #include <printout_controler.h>
#include <class_board.h> #include <class_board.h>
#include <class_edge_mod.h>
#include <class_mire.h>
#include <class_pcb_text.h>
#include <class_dimension.h>
#include <class_zone.h>
#include <dialog_SVG_print.h> #include <dialog_SVG_print.h>
// Keys for configuration // Keys for configuration
#define PLOTSVGMODECOLOR_KEY wxT( "PlotSVGModeColor" ) #define PLOTSVGMODECOLOR_KEY wxT( "PlotSVGModeColor" )
#define PLOTSVGPAGESIZEOPT_KEY wxT( "PlotSVGPageOpt" )
#define PLOTSVGPLOT_BRD_EDGE_KEY wxT( "PlotSVGBrdEdge" )
// reasonnable values for default pen width (in 1/10000 inch) // reasonnable values for default pen width
#define WIDTH_MAX_VALUE 500 #define WIDTH_MAX_VALUE (2 *IU_PER_MM)
#define WIDTH_MIN_VALUE 1 #define WIDTH_MIN_VALUE (0.05 *IU_PER_MM)
// Local variables: // Local variables:
static PRINT_PARAMETERS s_Parameters; static PRINT_PARAMETERS s_Parameters;
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;
/*! /*!
...@@ -66,15 +82,23 @@ void DIALOG_SVG_PRINT::initDialog( ) ...@@ -66,15 +82,23 @@ void DIALOG_SVG_PRINT::initDialog( )
if( m_Config ) if( m_Config )
{ {
m_Config->Read( PLOTSVGMODECOLOR_KEY, &s_Parameters.m_Print_Black_and_White ); m_Config->Read( PLOTSVGMODECOLOR_KEY, &s_Parameters.m_Print_Black_and_White );
long ltmp;
m_Config->Read( PLOTSVGPAGESIZEOPT_KEY, &ltmp, 0 );
m_rbSvgPageSizeOpt->SetSelection( ltmp );
m_Config->Read( PLOTSVGPLOT_BRD_EDGE_KEY, &ltmp, 1 );
m_PrintBoardEdgesCtrl->SetValue(ltmp );
} }
if( s_Parameters.m_Print_Black_and_White )
m_ModeColorOption->SetSelection( 1 );
else
m_ModeColorOption->SetSelection( 0 );
s_Parameters.m_PenDefaultSize = g_DrawDefaultLineThickness; s_Parameters.m_PenDefaultSize = g_DrawDefaultLineThickness;
AddUnitSymbol( *m_TextPenWidth, g_UserUnit ); AddUnitSymbol( *m_TextPenWidth, g_UserUnit );
m_DialogPenWidth->SetValue( m_DialogDefaultPenSize->SetValue(
ReturnStringFromValue( g_UserUnit, s_Parameters.m_PenDefaultSize ) ); ReturnStringFromValue( g_UserUnit, s_Parameters.m_PenDefaultSize ) );
m_Print_Frame_Ref_Ctrl->SetValue( s_Parameters.m_Print_Sheet_Ref );
// Create layers list // Create layers list
BOARD* board = m_Parent->GetBoard(); BOARD* board = m_Parent->GetBoard();
int layer; int layer;
...@@ -135,7 +159,7 @@ void DIALOG_SVG_PRINT::initDialog( ) ...@@ -135,7 +159,7 @@ void DIALOG_SVG_PRINT::initDialog( )
void DIALOG_SVG_PRINT::SetPenWidth() void DIALOG_SVG_PRINT::SetPenWidth()
{ {
s_Parameters.m_PenDefaultSize = ReturnValueFromTextCtrl( *m_DialogPenWidth ); s_Parameters.m_PenDefaultSize = ReturnValueFromTextCtrl( *m_DialogDefaultPenSize );
if( s_Parameters.m_PenDefaultSize > WIDTH_MAX_VALUE ) if( s_Parameters.m_PenDefaultSize > WIDTH_MAX_VALUE )
{ {
...@@ -148,16 +172,17 @@ void DIALOG_SVG_PRINT::SetPenWidth() ...@@ -148,16 +172,17 @@ void DIALOG_SVG_PRINT::SetPenWidth()
} }
g_DrawDefaultLineThickness = s_Parameters.m_PenDefaultSize; g_DrawDefaultLineThickness = s_Parameters.m_PenDefaultSize;
m_DialogPenWidth->SetValue( m_DialogDefaultPenSize->SetValue(
ReturnStringFromValue( g_UserUnit, s_Parameters.m_PenDefaultSize ) ); ReturnStringFromValue( g_UserUnit, s_Parameters.m_PenDefaultSize ) );
} }
void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Frame_Ref ) void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll )
{ {
wxFileName fn; wxFileName fn;
wxString msg; wxString msg;
s_Parameters.m_Print_Black_and_White = m_ModeColorOption->GetSelection();
SetPenWidth(); SetPenWidth();
PCB_SCREEN* screen = m_Parent->GetScreen(); PCB_SCREEN* screen = m_Parent->GetScreen();
...@@ -202,7 +227,7 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Frame_Ref ) ...@@ -202,7 +227,7 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Frame_Ref )
fn.SetExt( wxT( "svg" ) ); fn.SetExt( wxT( "svg" ) );
bool success = DrawPage( fn.GetFullPath(), screen, aPrint_Frame_Ref ); bool success = DrawPage( fn.GetFullPath(), screen );
msg = _( "Create file " ) + fn.GetFullPath(); msg = _( "Create file " ) + fn.GetFullPath();
if( !success ) if( !success )
msg += _( " error" ); msg += _( " error" );
...@@ -219,11 +244,8 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Frame_Ref ) ...@@ -219,11 +244,8 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Frame_Ref )
* Actual print function. * Actual print function.
*/ */
bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName,
BASE_SCREEN* screen, BASE_SCREEN* screen )
bool aPrint_Frame_Ref )
{ {
// const PAGE_INFO& pageInfo = m_Parent->GetPageSettings();
LOCALE_IO toggle; LOCALE_IO toggle;
int tmpzoom; int tmpzoom;
wxPoint tmp_startvisu; wxPoint tmp_startvisu;
...@@ -240,24 +262,23 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, ...@@ -240,24 +262,23 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName,
screen->SetScalingFactor( 1.0 ); screen->SetScalingFactor( 1.0 );
float dpi; double dpi = IU_PER_MILS * 1000.0;
#if defined( USE_PCBNEW_NANOMETRES )
dpi = 25.4e6;
#else
dpi = 10000.0;
#endif
EDA_DRAW_PANEL* panel = m_Parent->GetCanvas(); EDA_DRAW_PANEL* panel = m_Parent->GetCanvas();
// paper pageSize is in internal units, either nanometers or deci-mils // paper pageSize is in internal units, either nanometers or deci-mils
wxSize pageSize = m_Parent->GetPageSizeIU(); EDA_RECT rect;
rect.SetSize( m_Parent->GetPageSizeIU() );
if( PageIsBoardBoundarySize() )
{
rect = m_Parent->GetBoard()->ComputeBoundingBox();
}
KicadSVGFileDC dc( FullFileName, pageSize.x, pageSize.y, dpi ); KicadSVGFileDC dc( FullFileName, rect.GetOrigin(), rect.GetSize(), dpi );
EDA_RECT tmp = *panel->GetClipBox(); EDA_RECT tmp = *panel->GetClipBox();
GRResetPenAndBrush( &dc ); GRResetPenAndBrush( &dc );
GRForceBlackPen( m_ModeColorOption->GetSelection() == 0 ? false : true ); GRForceBlackPen( s_Parameters.m_Print_Black_and_White );
s_Parameters.m_DrillShapeOpt = PRINT_PARAMETERS::FULL_DRILL_SHAPE; s_Parameters.m_DrillShapeOpt = PRINT_PARAMETERS::FULL_DRILL_SHAPE;
// Set clip box to the max size // Set clip box to the max size
...@@ -270,7 +291,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, ...@@ -270,7 +291,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName,
int bg_color = g_DrawBgColor; int bg_color = g_DrawBgColor;
g_DrawBgColor = WHITE; g_DrawBgColor = WHITE;
if( aPrint_Frame_Ref ) if( PrintPageRef() )
m_Parent->TraceWorkSheet( &dc, screen, s_Parameters.m_PenDefaultSize, m_Parent->TraceWorkSheet( &dc, screen, s_Parameters.m_PenDefaultSize,
IU_PER_MILS, wxT( "" ) ); IU_PER_MILS, wxT( "" ) );
...@@ -292,15 +313,13 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, ...@@ -292,15 +313,13 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName,
void DIALOG_SVG_PRINT::OnButtonPrintBoardClick( wxCommandEvent& event ) void DIALOG_SVG_PRINT::OnButtonPrintBoardClick( wxCommandEvent& event )
{ {
s_Parameters.m_Print_Sheet_Ref = m_Print_Frame_Ref_Ctrl->IsChecked(); PrintSVGDoc( true );
PrintSVGDoc( true, s_Parameters.m_Print_Sheet_Ref );
} }
void DIALOG_SVG_PRINT::OnButtonPrintSelectedClick( wxCommandEvent& event ) void DIALOG_SVG_PRINT::OnButtonPrintSelectedClick( wxCommandEvent& event )
{ {
s_Parameters.m_Print_Sheet_Ref = m_Print_Frame_Ref_Ctrl->IsChecked(); PrintSVGDoc( false );
PrintSVGDoc( false, s_Parameters.m_Print_Sheet_Ref );
} }
...@@ -317,6 +336,9 @@ void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event ) ...@@ -317,6 +336,9 @@ void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event )
if( m_Config ) if( m_Config )
{ {
m_Config->Write( PLOTSVGMODECOLOR_KEY, s_Parameters.m_Print_Black_and_White ); m_Config->Write( PLOTSVGMODECOLOR_KEY, s_Parameters.m_Print_Black_and_White );
m_Config->Write( PLOTSVGPAGESIZEOPT_KEY, m_rbSvgPageSizeOpt->GetSelection() );
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 )
{ {
...@@ -328,11 +350,3 @@ void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event ) ...@@ -328,11 +350,3 @@ void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event )
} }
EndModal( 0 ); EndModal( 0 );
} }
/* called on radiobox color/black and white selection
*/
void DIALOG_SVG_PRINT::OnSetColorModeSelected( wxCommandEvent& event )
{
s_Parameters.m_Print_Black_and_White = m_ModeColorOption->GetSelection();
}
#ifndef _DIALOG_SVG_PRINT_H_ #ifndef _DIALOG_SVG_PRINT_H_
#define _DIALOG_SVG_PRINT_H_ #define _DIALOG_SVG_PRINT_H_
#include <dialog_SVG_print_base.h> #include <dialog_SVG_print_base.h>
class BASE_SCREEN; class BASE_SCREEN;
class PCB_BASE_FRAME; class PCB_BASE_FRAME;
class wxConfig; 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; wxConfig* m_Config;
long m_PrintMaskLayer; long m_PrintMaskLayer;
wxCheckBox* m_BoxSelectLayer[32]; wxCheckBox* m_BoxSelectLayer[32];
public: public:
DIALOG_SVG_PRINT( EDA_DRAW_FRAME* parent ); DIALOG_SVG_PRINT( EDA_DRAW_FRAME* parent );
~DIALOG_SVG_PRINT() {} ~DIALOG_SVG_PRINT() {}
private: private:
void OnCloseWindow( wxCloseEvent& event ); void OnCloseWindow( wxCloseEvent& event );
void initDialog( ); void initDialog( );
void OnButtonPrintSelectedClick( wxCommandEvent& event ); void OnButtonPrintSelectedClick( wxCommandEvent& event );
void OnButtonPrintBoardClick( wxCommandEvent& event ); void OnButtonPrintBoardClick( wxCommandEvent& event );
void OnButtonCancelClick( wxCommandEvent& event ); void OnButtonCancelClick( wxCommandEvent& event );
void OnSetColorModeSelected( wxCommandEvent& event ); void SetPenWidth();
void SetPenWidth(); void PrintSVGDoc( bool aPrintAll );
void PrintSVGDoc( bool aPrintAll, bool aPrint_Frame_Ref ); bool PageIsBoardBoundarySize()
bool DrawPage( const wxString& FullFileName, BASE_SCREEN* screen, bool aPrint_Frame_Ref ); {
}; return m_rbSvgPageSizeOpt->GetSelection() == 2;
}
bool PrintPageRef()
#endif // _DIALOG_SVG_PRINT_H_ {
return m_rbSvgPageSizeOpt->GetSelection() == 0;
}
bool DrawPage( const wxString& FullFileName, BASE_SCREEN* screen );
};
#endif // _DIALOG_SVG_PRINT_H_
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 30 2011) // C++ code generated with wxFormBuilder (version Apr 10 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -24,52 +24,56 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c ...@@ -24,52 +24,56 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c
m_CopperLayersBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Copper Layers:") ), wxVERTICAL ); m_CopperLayersBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Copper Layers:") ), wxVERTICAL );
sbLayersSizer->Add( m_CopperLayersBoxSizer, 1, wxEXPAND, 5 ); sbLayersSizer->Add( m_CopperLayersBoxSizer, 1, wxEXPAND, 5 );
m_TechnicalBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Technical Layers:") ), wxVERTICAL ); m_TechnicalBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Technical Layers:") ), wxVERTICAL );
sbLayersSizer->Add( m_TechnicalBoxSizer, 1, wxEXPAND, 5 ); sbLayersSizer->Add( m_TechnicalBoxSizer, 1, wxEXPAND, 5 );
bUpperSizer->Add( sbLayersSizer, 1, wxEXPAND, 5 ); bUpperSizer->Add( sbLayersSizer, 1, wxEXPAND, 5 );
wxStaticBoxSizer* sbOptionsSizer; wxStaticBoxSizer* sbOptionsSizer;
sbOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Print SVG options:") ), wxVERTICAL ); sbOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Print SVG options:") ), wxVERTICAL );
m_TextPenWidth = new wxStaticText( this, wxID_ANY, _("Pen width mini"), wxDefaultPosition, wxDefaultSize, 0 ); m_TextPenWidth = new wxStaticText( this, wxID_ANY, _("Default pen size"), wxDefaultPosition, wxDefaultSize, 0 );
m_TextPenWidth->Wrap( -1 ); m_TextPenWidth->Wrap( -1 );
sbOptionsSizer->Add( m_TextPenWidth, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); sbOptionsSizer->Add( m_TextPenWidth, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_DialogPenWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_DialogDefaultPenSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_DialogPenWidth->SetToolTip( _("Selection of the minimum pen thickness used to draw items.") ); m_DialogDefaultPenSize->SetToolTip( _("Selection of the pen size used to draw items which have no pen size speicfied.") );
sbOptionsSizer->Add( m_DialogPenWidth, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); sbOptionsSizer->Add( m_DialogDefaultPenSize, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
wxString m_ModeColorOptionChoices[] = { _("Color"), _("Black and White") }; wxString m_ModeColorOptionChoices[] = { _("Color"), _("Black and white") };
int m_ModeColorOptionNChoices = sizeof( m_ModeColorOptionChoices ) / sizeof( wxString ); int m_ModeColorOptionNChoices = sizeof( m_ModeColorOptionChoices ) / sizeof( wxString );
m_ModeColorOption = new wxRadioBox( this, wxID_ANY, _("Print mode"), wxDefaultPosition, wxDefaultSize, m_ModeColorOptionNChoices, m_ModeColorOptionChoices, 1, wxRA_SPECIFY_COLS ); m_ModeColorOption = new wxRadioBox( this, wxID_ANY, _("Print mode"), wxDefaultPosition, wxDefaultSize, m_ModeColorOptionNChoices, m_ModeColorOptionChoices, 1, wxRA_SPECIFY_COLS );
m_ModeColorOption->SetSelection( 0 ); 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") ); 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, wxALL|wxEXPAND, 5 );
m_Print_Frame_Ref_Ctrl = new wxCheckBox( this, wxID_ANY, _("Print Frame Ref"), wxDefaultPosition, wxDefaultSize, 0 ); wxString m_rbSvgPageSizeOptChoices[] = { _("Full page with frame ref"), _("Current page size"), _("Board area only") };
m_Print_Frame_Ref_Ctrl->SetValue(true); int m_rbSvgPageSizeOptNChoices = sizeof( m_rbSvgPageSizeOptChoices ) / sizeof( wxString );
m_Print_Frame_Ref_Ctrl->SetToolTip( _("Print (or not) the Frame references.") ); 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_Print_Frame_Ref_Ctrl, 0, wxALL, 5 ); sbOptionsSizer->Add( m_rbSvgPageSizeOpt, 0, wxALL|wxEXPAND, 5 );
m_PrintBoardEdgesCtrl = new wxCheckBox( this, wxID_ANY, _("Print Board Edges"), wxDefaultPosition, wxDefaultSize, 0 ); 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") );
m_PrintBoardEdgesCtrl->SetToolTip( _("Print (or not) the edges layer with others layers") );
sbOptionsSizer->Add( m_PrintBoardEdgesCtrl, 0, wxALL, 5 ); sbOptionsSizer->Add( m_PrintBoardEdgesCtrl, 0, wxALL, 5 );
bUpperSizer->Add( sbOptionsSizer, 1, wxEXPAND, 5 ); bUpperSizer->Add( sbOptionsSizer, 1, wxEXPAND, 5 );
wxBoxSizer* bButtonsSizer; wxBoxSizer* bButtonsSizer;
bButtonsSizer = new wxBoxSizer( wxVERTICAL ); bButtonsSizer = new wxBoxSizer( wxVERTICAL );
m_buttonPrintSelected = new wxButton( this, wxID_PRINT_CURRENT, _("Print Selected"), wxDefaultPosition, wxDefaultSize, 0 ); 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 ); bButtonsSizer->Add( m_buttonPrintSelected, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
m_buttonBoard = new wxButton( this, wxID_PRINT_BOARD, _("Print Board"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonBoard = new wxButton( this, wxID_PRINT_BOARD, _("Print Board"), wxDefaultPosition, wxDefaultSize, 0 );
...@@ -78,8 +82,10 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c ...@@ -78,8 +82,10 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c
m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Quit"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Quit"), wxDefaultPosition, wxDefaultSize, 0 );
bButtonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); bButtonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
bUpperSizer->Add( bButtonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 ); bUpperSizer->Add( bButtonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
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 = new wxStaticText( this, wxID_ANY, _("Filename:"), wxDefaultPosition, wxDefaultSize, 0 );
...@@ -101,12 +107,12 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c ...@@ -101,12 +107,12 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c
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 );
this->Layout(); this->Layout();
// 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_ModeColorOption->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnSetColorModeSelected ), NULL, this );
m_buttonPrintSelected->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonPrintSelectedClick ), NULL, this ); 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_buttonBoard->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonPrintBoardClick ), 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 );
...@@ -116,7 +122,6 @@ DIALOG_SVG_PRINT_base::~DIALOG_SVG_PRINT_base() ...@@ -116,7 +122,6 @@ 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_ModeColorOption->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnSetColorModeSelected ), NULL, this );
m_buttonPrintSelected->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonPrintSelectedClick ), NULL, this ); 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_buttonBoard->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonPrintBoardClick ), 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 );
......
This diff is collapsed.
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 30 2011) // C++ code generated with wxFormBuilder (version Apr 10 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -38,15 +38,15 @@ class DIALOG_SVG_PRINT_base : public wxDialog ...@@ -38,15 +38,15 @@ class DIALOG_SVG_PRINT_base : public wxDialog
enum enum
{ {
wxID_PRINT_CURRENT = 1000, wxID_PRINT_CURRENT = 1000,
wxID_PRINT_BOARD, wxID_PRINT_BOARD
}; };
wxStaticBoxSizer* m_CopperLayersBoxSizer; wxStaticBoxSizer* m_CopperLayersBoxSizer;
wxStaticBoxSizer* m_TechnicalBoxSizer; wxStaticBoxSizer* m_TechnicalBoxSizer;
wxStaticText* m_TextPenWidth; wxStaticText* m_TextPenWidth;
wxTextCtrl* m_DialogPenWidth; wxTextCtrl* m_DialogDefaultPenSize;
wxRadioBox* m_ModeColorOption; wxRadioBox* m_ModeColorOption;
wxCheckBox* m_Print_Frame_Ref_Ctrl; wxRadioBox* m_rbSvgPageSizeOpt;
wxCheckBox* m_PrintBoardEdgesCtrl; wxCheckBox* m_PrintBoardEdgesCtrl;
wxButton* m_buttonPrintSelected; wxButton* m_buttonPrintSelected;
wxButton* m_buttonBoard; wxButton* m_buttonBoard;
...@@ -58,7 +58,6 @@ class DIALOG_SVG_PRINT_base : public wxDialog ...@@ -58,7 +58,6 @@ class DIALOG_SVG_PRINT_base : public wxDialog
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); } virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); }
virtual void OnSetColorModeSelected( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonPrintSelectedClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnButtonPrintSelectedClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonPrintBoardClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnButtonPrintBoardClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonCancelClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnButtonCancelClick( wxCommandEvent& event ) { event.Skip(); }
......
...@@ -180,6 +180,8 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( PCB_EDIT_FRAME* aParent, ...@@ -180,6 +180,8 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( PCB_EDIT_FRAME* aParent,
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
LoadSettings(); LoadSettings();
GetBoard()->SetVisibleAlls();
GetScreen()->AddGrid( m_UserGridSize, m_UserGridUnit, ID_POPUP_GRID_USER ); GetScreen()->AddGrid( m_UserGridSize, m_UserGridUnit, ID_POPUP_GRID_USER );
GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment