Commit 19e5bc3b authored by charras's avatar charras

Added: Pcbnew print SVG format (see changelog)

parent 30da5aff
...@@ -5,7 +5,17 @@ Started 2007-June-11 ...@@ -5,7 +5,17 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2009-Jan-19 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> 2009-Jan-11 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
++Pcbnew:
Added: print SVG format.
SVG print/plot function uses WRITE modeinsteed of OR mode as graphic mode.
todo ? uses OR graphic mode with black background color (wait and see)
++eeschema:
Code cleanup for Print SVG format, and used wxFormBuilder in SVG print dialog
2009-Jan-10 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================ ================================================================================
++Pcbnew: ++Pcbnew:
Calculations to create filled areas in a zone modified and uses 2 pass: Calculations to create filled areas in a zone modified and uses 2 pass:
......
...@@ -50,6 +50,8 @@ set(EESCHEMA_SRCS ...@@ -50,6 +50,8 @@ set(EESCHEMA_SRCS
dialog_erc.cpp dialog_erc.cpp
# dialog_find.cpp # dialog_find.cpp
dialog_options.cpp dialog_options.cpp
dialog_SVG_print.cpp
dialog_SVG_print_base.cpp
edit_component_in_lib.cpp edit_component_in_lib.cpp
edit_component_in_schematic.cpp edit_component_in_schematic.cpp
edit_label.cpp edit_label.cpp
...@@ -109,7 +111,6 @@ set(EESCHEMA_SRCS ...@@ -109,7 +111,6 @@ set(EESCHEMA_SRCS
set(EESCHEMA_EXTRA_SRCS set(EESCHEMA_EXTRA_SRCS
../share/setpage.cpp ../share/setpage.cpp
../share/svg_print.cpp
../share/wxprint.cpp) ../share/wxprint.cpp)
if(WIN32) if(WIN32)
......
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_SVG_print_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bUpperSizer;
bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* sbOptionsSizer;
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->Wrap( -1 );
sbOptionsSizer->Add( m_TextPenWidth, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_DialogPenWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_DialogPenWidth->SetToolTip( _("Selection of the minimum pen thickness used to draw items.") );
sbOptionsSizer->Add( m_DialogPenWidth, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
wxString m_ModeColorOptionChoices[] = { _("Color"), _("Black and White") };
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->SetSelection( 0 );
m_ModeColorOption->SetToolTip( _("Choose if you wand 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 );
m_Print_Sheet_Ref = new wxCheckBox( this, wxID_ANY, _("Print Frame Ref"), wxDefaultPosition, wxDefaultSize, 0 );
m_Print_Sheet_Ref->SetToolTip( _("Print (or not) the Frame references.") );
sbOptionsSizer->Add( m_Print_Sheet_Ref, 0, wxALL, 5 );
bUpperSizer->Add( sbOptionsSizer, 1, wxEXPAND, 5 );
wxBoxSizer* bButtonsSizer;
bButtonsSizer = new wxBoxSizer( wxVERTICAL );
m_buttonPlotCurrent = new wxButton( this, wxID_PRINT_CURRENT, _("PrintCurrent"), wxDefaultPosition, wxDefaultSize, 0 );
bButtonsSizer->Add( m_buttonPlotCurrent, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_buttonPlotAll = new wxButton( this, wxID_PRINT_ALL, _("Print All"), wxDefaultPosition, wxDefaultSize, 0 );
bButtonsSizer->Add( m_buttonPlotAll, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Quit"), wxDefaultPosition, wxDefaultSize, 0 );
bButtonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
bUpperSizer->Add( bButtonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
bMainSizer->Add( bUpperSizer, 1, 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 defaults files 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->Wrap( -1 );
bMainSizer->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_MessagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
bMainSizer->Add( m_MessagesBox, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
this->SetSizer( bMainSizer );
this->Layout();
// Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_SVG_PRINT_base::OnCloseWindow ) );
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_SVG_PRINT_base::OnInitDialog ) );
m_ModeColorOption->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnSetColorModeSelected ), NULL, this );
m_buttonPlotCurrent->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonPlotCurrentClick ), NULL, this );
m_buttonPlotAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonPlotAllClick ), NULL, this );
m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonCancelClick ), NULL, this );
}
DIALOG_SVG_PRINT_base::~DIALOG_SVG_PRINT_base()
{
// Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_SVG_PRINT_base::OnCloseWindow ) );
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_SVG_PRINT_base::OnInitDialog ) );
m_ModeColorOption->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnSetColorModeSelected ), NULL, this );
m_buttonPlotCurrent->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonPlotCurrentClick ), NULL, this );
m_buttonPlotAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SVG_PRINT_base::OnButtonPlotAllClick ), 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 Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_SVG_print_base__
#define __dialog_SVG_print_base__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/radiobox.h>
#include <wx/checkbox.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_SVG_PRINT_base
///////////////////////////////////////////////////////////////////////////////
class DIALOG_SVG_PRINT_base : public wxDialog
{
private:
protected:
enum
{
wxID_PRINT_CURRENT = 1000,
wxID_PRINT_ALL,
};
wxStaticText* m_TextPenWidth;
wxTextCtrl* m_DialogPenWidth;
wxRadioBox* m_ModeColorOption;
wxCheckBox* m_Print_Sheet_Ref;
wxButton* m_buttonPlotCurrent;
wxButton* m_buttonPlotAll;
wxButton* m_buttonQuit;
wxStaticText* m_staticText1;
wxTextCtrl* m_FileNameCtrl;
wxStaticText* m_staticText2;
wxTextCtrl* m_MessagesBox;
// Virtual event handlers, overide them in your derived class
virtual void OnCloseWindow( wxCloseEvent& event ){ event.Skip(); }
virtual void OnInitDialog( wxInitDialogEvent& event ){ event.Skip(); }
virtual void OnSetColorModeSelected( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonPlotCurrentClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonPlotAllClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCancelClick( wxCommandEvent& event ){ event.Skip(); }
public:
DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Create SVG file"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 550,459 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_SVG_PRINT_base();
};
#endif //__dialog_SVG_print_base__
...@@ -34,6 +34,8 @@ OBJECTS = eeschema.o\ ...@@ -34,6 +34,8 @@ OBJECTS = eeschema.o\
dialog_options.o\ dialog_options.o\
dialog_edit_libentry_fields_in_lib.o\ dialog_edit_libentry_fields_in_lib.o\
dialog_edit_libentry_fields_in_lib_base.o\ dialog_edit_libentry_fields_in_lib_base.o\
dialog_SVG_print.o\
dialog_SVG_print_base.o\
tool_lib.o\ tool_lib.o\
tool_sch.o\ tool_sch.o\
tool_viewlib.o\ tool_viewlib.o\
...@@ -99,8 +101,7 @@ OBJECTS = eeschema.o\ ...@@ -99,8 +101,7 @@ OBJECTS = eeschema.o\
find.o \ find.o \
backanno.o \ backanno.o \
controle.o\ controle.o\
hotkeys.o\ hotkeys.o
svg_print.o
eeschema.o: eeschema.cpp program.h general.h $(DEPEND) eeschema.o: eeschema.cpp program.h general.h $(DEPEND)
......
...@@ -68,6 +68,8 @@ set(PCBNEW_SRCS ...@@ -68,6 +68,8 @@ set(PCBNEW_SRCS
dialog_setup_libs.cpp dialog_setup_libs.cpp
dialog_orient_footprints.cpp dialog_orient_footprints.cpp
# dialog_track_options.cpp # dialog_track_options.cpp
dialog_SVG_print.cpp
dialog_SVG_print_base.cpp
dist.cpp dist.cpp
dragsegm.cpp dragsegm.cpp
drc.cpp drc.cpp
......
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_SVG_print_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxSize( -1,350 ), wxDefaultSize );
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bUpperSizer;
bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* sbLayersSizer;
sbLayersSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Layers:") ), wxHORIZONTAL );
m_CopperLayersBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Copper Layers:") ), wxVERTICAL );
sbLayersSizer->Add( m_CopperLayersBoxSizer, 1, wxEXPAND, 5 );
m_TechnicalBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Technical Layers:") ), wxVERTICAL );
sbLayersSizer->Add( m_TechnicalBoxSizer, 1, wxEXPAND, 5 );
bUpperSizer->Add( sbLayersSizer, 1, wxEXPAND, 5 );
wxStaticBoxSizer* sbOptionsSizer;
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->Wrap( -1 );
sbOptionsSizer->Add( m_TextPenWidth, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_DialogPenWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_DialogPenWidth->SetToolTip( _("Selection of the minimum pen thickness used to draw items.") );
sbOptionsSizer->Add( m_DialogPenWidth, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
wxString m_ModeColorOptionChoices[] = { _("Color"), _("Black and White") };
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->SetSelection( 0 );
m_ModeColorOption->SetToolTip( _("Choose if you wand 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 );
m_Print_Sheet_Ref = new wxCheckBox( this, wxID_ANY, _("Print Frame Ref"), wxDefaultPosition, wxDefaultSize, 0 );
m_Print_Sheet_Ref->SetValue(true);
m_Print_Sheet_Ref->SetToolTip( _("Print (or not) the Frame references.") );
sbOptionsSizer->Add( m_Print_Sheet_Ref, 0, wxALL, 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 with others layers") );
sbOptionsSizer->Add( m_PrintBoardEdgesCtrl, 0, wxALL, 5 );
bUpperSizer->Add( sbOptionsSizer, 1, wxEXPAND, 5 );
wxBoxSizer* bButtonsSizer;
bButtonsSizer = new wxBoxSizer( wxVERTICAL );
m_buttonPrintSelected = new wxButton( this, wxID_PRINT_CURRENT, _("Print Selected"), wxDefaultPosition, wxDefaultSize, 0 );
bButtonsSizer->Add( m_buttonPrintSelected, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_buttonBoard = new wxButton( this, wxID_PRINT_BOARD, _("Print Board"), wxDefaultPosition, wxDefaultSize, 0 );
bButtonsSizer->Add( m_buttonBoard, 0, wxALL, 5 );
m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Quit"), wxDefaultPosition, wxDefaultSize, 0 );
bButtonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
bUpperSizer->Add( bButtonsSizer, 0, wxALIGN_CENTER_VERTICAL, 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 defaults files 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->Wrap( -1 );
bMainSizer->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_MessagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
m_MessagesBox->SetMinSize( wxSize( -1,100 ) );
bMainSizer->Add( m_MessagesBox, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
this->SetSizer( bMainSizer );
this->Layout();
// Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_SVG_PRINT_base::OnCloseWindow ) );
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_SVG_PRINT_base::OnInitDialog ) );
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_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 );
}
DIALOG_SVG_PRINT_base::~DIALOG_SVG_PRINT_base()
{
// Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_SVG_PRINT_base::OnCloseWindow ) );
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_SVG_PRINT_base::OnInitDialog ) );
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_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 );
}
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_SVG_print_base__
#define __dialog_SVG_print_base__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/gdicmn.h>
#include <wx/stattext.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/radiobox.h>
#include <wx/checkbox.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_SVG_PRINT_base
///////////////////////////////////////////////////////////////////////////////
class DIALOG_SVG_PRINT_base : public wxDialog
{
private:
protected:
enum
{
wxID_PRINT_CURRENT = 1000,
wxID_PRINT_BOARD,
};
wxStaticBoxSizer* m_CopperLayersBoxSizer;
wxStaticBoxSizer* m_TechnicalBoxSizer;
wxStaticText* m_TextPenWidth;
wxTextCtrl* m_DialogPenWidth;
wxRadioBox* m_ModeColorOption;
wxCheckBox* m_Print_Sheet_Ref;
wxCheckBox* m_PrintBoardEdgesCtrl;
wxButton* m_buttonPrintSelected;
wxButton* m_buttonBoard;
wxButton* m_buttonQuit;
wxStaticText* m_staticText1;
wxTextCtrl* m_FileNameCtrl;
wxStaticText* m_staticText2;
wxTextCtrl* m_MessagesBox;
// Virtual event handlers, overide them in your derived class
virtual void OnCloseWindow( wxCloseEvent& event ){ event.Skip(); }
virtual void OnInitDialog( wxInitDialogEvent& event ){ event.Skip(); }
virtual void OnSetColorModeSelected( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonPrintSelectedClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonPrintBoardClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCancelClick( wxCommandEvent& event ){ event.Skip(); }
public:
DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Create SVG file"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 507,375 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_SVG_PRINT_base();
};
#endif //__dialog_SVG_print_base__
...@@ -33,6 +33,8 @@ OBJECTS= $(TARGET).o classpcb.o\ ...@@ -33,6 +33,8 @@ OBJECTS= $(TARGET).o classpcb.o\
dialog_pad_properties.o\ dialog_pad_properties.o\
dialog_pad_properties_base.o\ dialog_pad_properties_base.o\
dialog_pcb_text_properties.o\ dialog_pcb_text_properties.o\
dialog_SVG_print.o\
dialog_SVG_print_base.o\
onrightclick.o\ onrightclick.o\
onleftclick.o\ onleftclick.o\
modedit_onclick.o\ modedit_onclick.o\
......
...@@ -92,6 +92,11 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -92,6 +92,11 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
item->SetBitmap(print_button); item->SetBitmap(print_button);
m_FilesMenu->Append(item); m_FilesMenu->Append(item);
item = new wxMenuItem(m_FilesMenu, ID_GEN_PLOT_SVG,
_("Print S&VG"), _("Plot pcb board in SVG format"));
item->SetBitmap(print_button);
m_FilesMenu->Append(item);
// Add plot menu // Add plot menu
item = new wxMenuItem(m_FilesMenu, ID_GEN_PLOT, _("&Plot"), item = new wxMenuItem(m_FilesMenu, ID_GEN_PLOT, _("&Plot"),
_("Plot (HPGL, PostScript, or Gerber format)")); _("Plot (HPGL, PostScript, or Gerber format)"));
......
...@@ -116,6 +116,7 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame ) ...@@ -116,6 +116,7 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
EVT_TOOL( wxID_PASTE, WinEDA_PcbFrame::Process_Special_Functions ) EVT_TOOL( wxID_PASTE, WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( ID_UNDO_BUTT, WinEDA_PcbFrame::Process_Special_Functions ) EVT_TOOL( ID_UNDO_BUTT, WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( ID_GEN_PRINT, WinEDA_DrawFrame::ToPrinter ) EVT_TOOL( ID_GEN_PRINT, WinEDA_DrawFrame::ToPrinter )
EVT_TOOL( ID_GEN_PLOT_SVG, WinEDA_DrawFrame::SVG_Print )
EVT_TOOL( ID_GEN_PLOT, WinEDA_DrawFrame::Process_Special_Functions ) EVT_TOOL( ID_GEN_PLOT, WinEDA_DrawFrame::Process_Special_Functions )
EVT_TOOL( ID_FIND_ITEMS, WinEDA_PcbFrame::Process_Special_Functions ) EVT_TOOL( ID_FIND_ITEMS, WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( ID_GET_NETLIST, WinEDA_PcbFrame::Process_Special_Functions ) EVT_TOOL( ID_GET_NETLIST, WinEDA_PcbFrame::Process_Special_Functions )
......
/**********************************************/ /************************************************************/
/*lay2plot.cpp: some functions to plot boards */ /* print_board_functions.cpp: some functions to plot boards */
/**********************************************/ /************************************************************/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
......
/////////////////////////////////////////////////////////////////////////////
// Name: svg_print.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 05/02/2006 11:05:20
// RCS-ID:
// Copyright: License GNU
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 05/02/2006 11:05:20
#ifndef _SVG_PRINT_H_
#define _SVG_PRINT_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "svg_print.h"
#endif
/*!
* Includes
*/
////@begin includes
#include "wx/valgen.h"
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
class wxBoxSizer;
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_DIALOG 10000
#define ID_RADIOBOX_SETPRINTMODE 10007
#define ID_CHECKBOX 10004
#define ID_RADIOBOX_SELPAGE 10008
#define ID_PRINT_EXECUTE 10002
#define ID_TEXTCTRL 10001
#define ID_TEXTCTRL1 10006
#define SYMBOL_WINEDA_PRINTSVGFRAME_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|wxFRAME_FLOAT_ON_PARENT|MAYBE_RESIZE_BORDER
#define SYMBOL_WINEDA_PRINTSVGFRAME_TITLE _("Create SVG file")
#define SYMBOL_WINEDA_PRINTSVGFRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_PRINTSVGFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_PRINTSVGFRAME_POSITION wxDefaultPosition
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
/*!
* WinEDA_PrintSVGFrame class declaration
*/
class WinEDA_PrintSVGFrame: public wxDialog
{
DECLARE_DYNAMIC_CLASS( WinEDA_PrintSVGFrame )
DECLARE_EVENT_TABLE()
public:
/// Constructors
WinEDA_PrintSVGFrame( );
WinEDA_PrintSVGFrame( WinEDA_DrawFrame* parent,
wxWindowID id = SYMBOL_WINEDA_PRINTSVGFRAME_IDNAME,
const wxString& caption = SYMBOL_WINEDA_PRINTSVGFRAME_TITLE,
const wxPoint& pos = SYMBOL_WINEDA_PRINTSVGFRAME_POSITION,
const wxSize& size = SYMBOL_WINEDA_PRINTSVGFRAME_SIZE,
long style = SYMBOL_WINEDA_PRINTSVGFRAME_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_PRINTSVGFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_PRINTSVGFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_PRINTSVGFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_PRINTSVGFRAME_SIZE, long style = SYMBOL_WINEDA_PRINTSVGFRAME_STYLE );
/// Creates the controls and sizers
void CreateControls();
////@begin WinEDA_PrintSVGFrame event handler declarations
/// wxEVT_CLOSE_WINDOW event handler for ID_DIALOG
void OnCloseWindow( wxCloseEvent& event );
/// wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_RADIOBOX_SETPRINTMODE
void OnRadioboxSetprintmodeSelected( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PRINT_EXECUTE
void OnPrintExecuteClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void OnCancelClick( wxCommandEvent& event );
////@end WinEDA_PrintSVGFrame event handler declarations
////@begin WinEDA_PrintSVGFrame member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end WinEDA_PrintSVGFrame member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
void PrintSVGDoc(wxCommandEvent& event);
bool DrawPage(const wxString & FullFileName, BASE_SCREEN* screen);
////@begin WinEDA_PrintSVGFrame member variables
wxBoxSizer* m_DialogPenWidthSizer;
wxRadioBox* m_ModeColorOption;
wxCheckBox* m_Print_Sheet_Ref;
wxRadioBox* m_PagesOption;
wxTextCtrl* m_FileNameCtrl;
wxTextCtrl* m_MessagesBox;
////@end WinEDA_PrintSVGFrame member variables
WinEDA_DrawFrame * m_Parent;
WinEDA_ValueCtrl * m_DialogPenWidth;
void SetPenWidth();
int m_PrintMaskLayer;
int m_ImageXSize_mm;
};
#endif
// _SVG_PRINT_H_
This diff is collapsed.
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