From 8560488612be78b60b37a3ecebfd69d03debfc21 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 21 Apr 2010 19:22:27 +0200 Subject: [PATCH] Printing functions fixes, and other minor enhancements --- eeschema/dialog_print_using_printer_base.cpp | 148 +- eeschema/dialog_print_using_printer_base.fbp | 830 +++---- eeschema/dialog_print_using_printer_base.h | 110 +- include/wxPcbStruct.h | 13 + pcbnew/dialog_print_using_printer.cpp | 4 +- pcbnew/dialog_print_using_printer_base.cpp | 330 +-- pcbnew/dialog_print_using_printer_base.fbp | 2198 +++++++++--------- pcbnew/dialog_print_using_printer_base.h | 164 +- pcbnew/print_board_functions.cpp | 81 +- pcbnew/printout_controler.cpp | 3 + 10 files changed, 1988 insertions(+), 1893 deletions(-) diff --git a/eeschema/dialog_print_using_printer_base.cpp b/eeschema/dialog_print_using_printer_base.cpp index c82aa00310..7cdb88f6c1 100644 --- a/eeschema/dialog_print_using_printer_base.cpp +++ b/eeschema/dialog_print_using_printer_base.cpp @@ -1,74 +1,74 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 16 2008) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "dialog_print_using_printer_base.h" - -/////////////////////////////////////////////////////////////////////////// - -DIALOG_PRINT_USING_PRINTER_BASE::DIALOG_PRINT_USING_PRINTER_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( wxHORIZONTAL ); - - wxBoxSizer* bleftSizer; - bleftSizer = new wxBoxSizer( wxVERTICAL ); - - m_checkReference = new wxCheckBox( this, wxID_ANY, _("Print sheet &reference and title block"), wxDefaultPosition, wxDefaultSize, 0 ); - m_checkReference->SetValue(true); - - m_checkReference->SetToolTip( _("Print (or not) the Frame references.") ); - - bleftSizer->Add( m_checkReference, 0, wxALL, 5 ); - - m_checkMonochrome = new wxCheckBox( this, wxID_ANY, _("Print in &black and white only"), wxDefaultPosition, wxDefaultSize, 0 ); - - bleftSizer->Add( m_checkMonochrome, 0, wxALL, 5 ); - - bMainSizer->Add( bleftSizer, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxTOP, 12 ); - - wxBoxSizer* bbuttonsSizer; - bbuttonsSizer = new wxBoxSizer( wxVERTICAL ); - - m_buttonPageSetup = new wxButton( this, wxID_ANY, _("Page Setup"), wxDefaultPosition, wxDefaultSize, 0 ); - bbuttonsSizer->Add( m_buttonPageSetup, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); - - m_buttonPreview = new wxButton( this, wxID_ANY, _("Preview"), wxDefaultPosition, wxDefaultSize, 0 ); - bbuttonsSizer->Add( m_buttonPreview, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_buttonPrint = new wxButton( this, wxID_ANY, _("Print"), wxDefaultPosition, wxDefaultSize, 0 ); - bbuttonsSizer->Add( m_buttonPrint, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); - bbuttonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - bMainSizer->Add( bbuttonsSizer, 0, wxALL, 12 ); - - this->SetSizer( bMainSizer ); - this->Layout(); - bMainSizer->Fit( this ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnCloseWindow ) ); - this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnInitDialog ) ); - m_buttonPageSetup->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnPageSetup ), NULL, this ); - m_buttonPreview->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnPrintPreview ), NULL, this ); - m_buttonPrint->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnPrintButtonClick ), NULL, this ); - m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnButtonCancelClick ), NULL, this ); -} - -DIALOG_PRINT_USING_PRINTER_BASE::~DIALOG_PRINT_USING_PRINTER_BASE() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnCloseWindow ) ); - this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnInitDialog ) ); - m_buttonPageSetup->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnPageSetup ), NULL, this ); - m_buttonPreview->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnPrintPreview ), NULL, this ); - m_buttonPrint->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnPrintButtonClick ), NULL, this ); - m_buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnButtonCancelClick ), NULL, this ); -} +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 16 2008) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_print_using_printer_base.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_PRINT_USING_PRINTER_BASE::DIALOG_PRINT_USING_PRINTER_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( wxHORIZONTAL ); + + wxBoxSizer* bleftSizer; + bleftSizer = new wxBoxSizer( wxVERTICAL ); + + m_checkReference = new wxCheckBox( this, wxID_ANY, _("Print sheet &reference and title block"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkReference->SetValue(true); + + m_checkReference->SetToolTip( _("Print (or not) the Frame references.") ); + + bleftSizer->Add( m_checkReference, 0, wxALL, 5 ); + + m_checkMonochrome = new wxCheckBox( this, wxID_ANY, _("Print in &black and white only"), wxDefaultPosition, wxDefaultSize, 0 ); + + bleftSizer->Add( m_checkMonochrome, 0, wxALL, 5 ); + + bMainSizer->Add( bleftSizer, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxTOP, 12 ); + + wxBoxSizer* bbuttonsSizer; + bbuttonsSizer = new wxBoxSizer( wxVERTICAL ); + + m_buttonPageSetup = new wxButton( this, wxID_ANY, _("Page Setup"), wxDefaultPosition, wxDefaultSize, 0 ); + bbuttonsSizer->Add( m_buttonPageSetup, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5 ); + + m_buttonPreview = new wxButton( this, wxID_ANY, _("Preview"), wxDefaultPosition, wxDefaultSize, 0 ); + bbuttonsSizer->Add( m_buttonPreview, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + m_buttonPrint = new wxButton( this, wxID_ANY, _("Print"), wxDefaultPosition, wxDefaultSize, 0 ); + bbuttonsSizer->Add( m_buttonPrint, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); + bbuttonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + bMainSizer->Add( bbuttonsSizer, 0, wxALL, 12 ); + + this->SetSizer( bMainSizer ); + this->Layout(); + bMainSizer->Fit( this ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnCloseWindow ) ); + this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnInitDialog ) ); + m_buttonPageSetup->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnPageSetup ), NULL, this ); + m_buttonPreview->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnPrintPreview ), NULL, this ); + m_buttonPrint->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnPrintButtonClick ), NULL, this ); + m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnButtonCancelClick ), NULL, this ); +} + +DIALOG_PRINT_USING_PRINTER_BASE::~DIALOG_PRINT_USING_PRINTER_BASE() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnCloseWindow ) ); + this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnInitDialog ) ); + m_buttonPageSetup->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnPageSetup ), NULL, this ); + m_buttonPreview->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnPrintPreview ), NULL, this ); + m_buttonPrint->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnPrintButtonClick ), NULL, this ); + m_buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_BASE::OnButtonCancelClick ), NULL, this ); +} diff --git a/eeschema/dialog_print_using_printer_base.fbp b/eeschema/dialog_print_using_printer_base.fbp index 5eab5f393b..f63c2f14cb 100644 --- a/eeschema/dialog_print_using_printer_base.fbp +++ b/eeschema/dialog_print_using_printer_base.fbp @@ -1,415 +1,415 @@ - - - - - - C++ - 1 - UTF-8 - connect - dialog_print_using_printer_base - 1000 - none - 1 - dialog_print_schematic - - . - - 1 - 1 - 0 - - - - - 1 - - - - 0 - wxID_ANY - - -1,-1 - DIALOG_PRINT_USING_PRINTER_BASE - - -1,-1 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - - Print - - - - - - - - OnCloseWindow - - - - - - OnInitDialog - - - - - - - - - - - - - - - - - - - - - - - bMainSizer - wxHORIZONTAL - none - - 12 - wxBOTTOM|wxEXPAND|wxLEFT|wxTOP - 1 - - - bleftSizer - wxVERTICAL - none - - 5 - wxALL - 0 - - - 1 - - 1 - - - 0 - wxID_ANY - Print sheet &reference and title block - - - m_checkReference - protected - - - - - Print (or not) the Frame references. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Print in &black and white only - - - m_checkMonochrome - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 12 - wxALL - 0 - - - bbuttonsSizer - wxVERTICAL - none - - 5 - wxALIGN_CENTER_HORIZONTAL|wxALL - 0 - - - - 0 - 1 - - - 0 - wxID_ANY - Page Setup - - - m_buttonPageSetup - protected - - - - - - - - - OnPageSetup - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL - 0 - - - - 0 - 1 - - - 0 - wxID_ANY - Preview - - - m_buttonPreview - protected - - - - - - - - - OnPrintPreview - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL - 0 - - - - 0 - 1 - - - 0 - wxID_ANY - Print - - - m_buttonPrint - protected - - - - - - - - - OnPrintButtonClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL - 0 - - - - 0 - 1 - - - 0 - wxID_CANCEL - Close - - - m_buttonQuit - protected - - - - - - - - - OnButtonCancelClick - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + C++ + 1 + UTF-8 + connect + dialog_print_using_printer_base + 1000 + none + 1 + dialog_print_schematic + + . + + 1 + 1 + 0 + + + + + 1 + + + + 0 + wxID_ANY + + -1,-1 + DIALOG_PRINT_USING_PRINTER_BASE + + -1,-1 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + + Print + + + + + + + + OnCloseWindow + + + + + + OnInitDialog + + + + + + + + + + + + + + + + + + + + + + + bMainSizer + wxHORIZONTAL + none + + 12 + wxBOTTOM|wxEXPAND|wxLEFT|wxTOP + 1 + + + bleftSizer + wxVERTICAL + none + + 5 + wxALL + 0 + + + 1 + + 1 + + + 0 + wxID_ANY + Print sheet &reference and title block + + + m_checkReference + protected + + + + + Print (or not) the Frame references. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Print in &black and white only + + + m_checkMonochrome + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 12 + wxALL + 0 + + + bbuttonsSizer + wxVERTICAL + none + + 5 + wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + wxID_ANY + Page Setup + + + m_buttonPageSetup + protected + + + + + + + + + OnPageSetup + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + wxID_ANY + Preview + + + m_buttonPreview + protected + + + + + + + + + OnPrintPreview + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + wxID_ANY + Print + + + m_buttonPrint + protected + + + + + + + + + OnPrintButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + wxID_CANCEL + Close + + + m_buttonQuit + protected + + + + + + + + + OnButtonCancelClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eeschema/dialog_print_using_printer_base.h b/eeschema/dialog_print_using_printer_base.h index ba4150fbb3..44e03da97d 100644 --- a/eeschema/dialog_print_using_printer_base.h +++ b/eeschema/dialog_print_using_printer_base.h @@ -1,55 +1,55 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 16 2008) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __dialog_print_using_printer_base__ -#define __dialog_print_using_printer_base__ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_PRINT_USING_PRINTER_BASE -/////////////////////////////////////////////////////////////////////////////// -class DIALOG_PRINT_USING_PRINTER_BASE : public wxDialog -{ - private: - - protected: - wxCheckBox* m_checkReference; - wxCheckBox* m_checkMonochrome; - wxButton* m_buttonPageSetup; - wxButton* m_buttonPreview; - wxButton* m_buttonPrint; - wxButton* m_buttonQuit; - - // 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 OnPageSetup( wxCommandEvent& event ){ event.Skip(); } - virtual void OnPrintPreview( wxCommandEvent& event ){ event.Skip(); } - virtual void OnPrintButtonClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnButtonCancelClick( wxCommandEvent& event ){ event.Skip(); } - - - public: - DIALOG_PRINT_USING_PRINTER_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Print"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_PRINT_USING_PRINTER_BASE(); - -}; - -#endif //__dialog_print_using_printer_base__ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 16 2008) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __dialog_print_using_printer_base__ +#define __dialog_print_using_printer_base__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_PRINT_USING_PRINTER_BASE +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_PRINT_USING_PRINTER_BASE : public wxDialog +{ + private: + + protected: + wxCheckBox* m_checkReference; + wxCheckBox* m_checkMonochrome; + wxButton* m_buttonPageSetup; + wxButton* m_buttonPreview; + wxButton* m_buttonPrint; + wxButton* m_buttonQuit; + + // 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 OnPageSetup( wxCommandEvent& event ){ event.Skip(); } + virtual void OnPrintPreview( wxCommandEvent& event ){ event.Skip(); } + virtual void OnPrintButtonClick( wxCommandEvent& event ){ event.Skip(); } + virtual void OnButtonCancelClick( wxCommandEvent& event ){ event.Skip(); } + + + public: + DIALOG_PRINT_USING_PRINTER_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Print"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_PRINT_USING_PRINTER_BASE(); + +}; + +#endif //__dialog_print_using_printer_base__ diff --git a/include/wxPcbStruct.h b/include/wxPcbStruct.h index fe715084fd..f987ae68e0 100644 --- a/include/wxPcbStruct.h +++ b/include/wxPcbStruct.h @@ -1040,6 +1040,19 @@ public: */ void ToPrinter( wxCommandEvent& event ); + /** Virtual function PrintPage + * used to print a page + * Print the page pointed by ActiveScreen, set by the calling print function + * @param aDC = wxDC given by the calling print function + * @param aPrint_Sheet_Ref = true to print page references + * @param aPrintMask = not used here + * @param aPrintMirrorMode = not used here (Set when printing in mirror mode) + * @param aData = a pointer on an auxiliary data (NULL if not used) + */ + virtual void PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, + int aPrintMask, bool aPrintMirrorMode, + void * aData = NULL); + // BOARD handling /** function Clear_Pcb() diff --git a/pcbnew/dialog_print_using_printer.cpp b/pcbnew/dialog_print_using_printer.cpp index 008ac72748..ae01d09b2c 100644 --- a/pcbnew/dialog_print_using_printer.cpp +++ b/pcbnew/dialog_print_using_printer.cpp @@ -59,7 +59,7 @@ public: private: void OnCloseWindow( wxCloseEvent& event ); - void OnPrintSetup( wxCommandEvent& event ); + void OnPageSetup( wxCommandEvent& event ); void OnPrintPreview( wxCommandEvent& event ); void OnPrintButtonClick( wxCommandEvent& event ); @@ -414,7 +414,7 @@ void DIALOG_PRINT_USING_PRINTER::SetPenWidth() /**********************************************************/ -void DIALOG_PRINT_USING_PRINTER::OnPrintSetup( wxCommandEvent& event ) +void DIALOG_PRINT_USING_PRINTER::OnPageSetup( wxCommandEvent& event ) /**********************************************************/ /* Open a dialog box for printer setup (printer options, page size ...) diff --git a/pcbnew/dialog_print_using_printer_base.cpp b/pcbnew/dialog_print_using_printer_base.cpp index 8aece2c5c0..d04c8612b1 100644 --- a/pcbnew/dialog_print_using_printer_base.cpp +++ b/pcbnew/dialog_print_using_printer_base.cpp @@ -1,165 +1,165 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 16 2008) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "dialog_print_using_printer_base.h" - -/////////////////////////////////////////////////////////////////////////// - -DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_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( wxHORIZONTAL ); - - wxStaticBoxSizer* sbLayersSizer; - sbLayersSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Layers:") ), wxVERTICAL ); - - wxBoxSizer* bleftSizer; - bleftSizer = new wxBoxSizer( wxHORIZONTAL ); - - m_CopperLayersBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Copper Layers:") ), wxVERTICAL ); - - bleftSizer->Add( m_CopperLayersBoxSizer, 1, wxALL, 5 ); - - m_TechnicalLayersBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Technical Layers:") ), wxVERTICAL ); - - bleftSizer->Add( m_TechnicalLayersBoxSizer, 1, wxALL, 5 ); - - sbLayersSizer->Add( bleftSizer, 1, wxEXPAND, 5 ); - - m_Exclude_Edges_Pcb = new wxCheckBox( this, wxID_ANY, _("Exclude Edges_Pcb Layer"), wxDefaultPosition, wxDefaultSize, 0 ); - - m_Exclude_Edges_Pcb->SetToolTip( _("Exclude contents of Edges_Pcb layer from all other layers") ); - - sbLayersSizer->Add( m_Exclude_Edges_Pcb, 0, wxALL|wxEXPAND, 5 ); - - bMainSizer->Add( sbLayersSizer, 1, wxEXPAND, 5 ); - - wxBoxSizer* bmiddleLeftSizer; - bmiddleLeftSizer = new wxBoxSizer( wxVERTICAL ); - - wxString m_ScaleOptionChoices[] = { _("fit in page"), _("Scale 0.5"), _("Scale 0.7"), _("Approx. Scale 1"), _("Accurate Scale 1"), _("Scale 1.4"), _("Scale 2"), _("Scale 3"), _("Scale 4") }; - int m_ScaleOptionNChoices = sizeof( m_ScaleOptionChoices ) / sizeof( wxString ); - m_ScaleOption = new wxRadioBox( this, wxID_ANY, _("Approx. Scale:"), wxDefaultPosition, wxDefaultSize, m_ScaleOptionNChoices, m_ScaleOptionChoices, 1, wxRA_SPECIFY_COLS ); - m_ScaleOption->SetSelection( 4 ); - bmiddleLeftSizer->Add( m_ScaleOption, 0, wxALL, 5 ); - - m_FineAdjustXscaleTitle = new wxStaticText( this, wxID_ANY, _("X Scale Adjust"), wxDefaultPosition, wxDefaultSize, 0 ); - m_FineAdjustXscaleTitle->Wrap( -1 ); - bmiddleLeftSizer->Add( m_FineAdjustXscaleTitle, 0, wxRIGHT|wxLEFT, 5 ); - - m_FineAdjustXscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_FineAdjustXscaleOpt->SetToolTip( _("Set X scale adjust for exact scale plotting") ); - - bmiddleLeftSizer->Add( m_FineAdjustXscaleOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - m_FineAdjustYscaleTitle = new wxStaticText( this, wxID_ANY, _("Y Scale Adjust"), wxDefaultPosition, wxDefaultSize, 0 ); - m_FineAdjustYscaleTitle->Wrap( -1 ); - bmiddleLeftSizer->Add( m_FineAdjustYscaleTitle, 0, wxRIGHT|wxLEFT, 5 ); - - m_FineAdjustYscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_FineAdjustYscaleOpt->SetToolTip( _("Set Y scale adjust for exact scale plotting") ); - - bmiddleLeftSizer->Add( m_FineAdjustYscaleOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - bMainSizer->Add( bmiddleLeftSizer, 0, wxEXPAND, 5 ); - - wxBoxSizer* bmiddleRightSizer; - bmiddleRightSizer = new wxBoxSizer( wxVERTICAL ); - - wxStaticBoxSizer* sbOptionsSizer; - sbOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options:") ), wxVERTICAL ); - - m_TextPenWidth = new wxStaticText( this, wxID_ANY, _("Default pen size:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_TextPenWidth->Wrap( -1 ); - m_TextPenWidth->SetToolTip( _("Pen size used to draw items that have no pen size specified.\nUsed mainly to draw items in sketch mode.") ); - - sbOptionsSizer->Add( m_TextPenWidth, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_DialogPenWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - sbOptionsSizer->Add( m_DialogPenWidth, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - m_Print_Sheet_Ref = new wxCheckBox( this, wxID_FRAME_SEL, _("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, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_Print_Mirror = new wxCheckBox( this, wxID_ANY, _("Mirror"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbOptionsSizer->Add( m_Print_Mirror, 0, wxALL, 5 ); - - bmiddleRightSizer->Add( sbOptionsSizer, 0, wxEXPAND|wxALL, 5 ); - - wxString m_Drill_Shape_OptChoices[] = { _("No drill mark"), _("Small mark"), _("Real drill") }; - int m_Drill_Shape_OptNChoices = sizeof( m_Drill_Shape_OptChoices ) / sizeof( wxString ); - m_Drill_Shape_Opt = new wxRadioBox( this, wxID_ANY, _("Pads Drill Opt"), wxDefaultPosition, wxDefaultSize, m_Drill_Shape_OptNChoices, m_Drill_Shape_OptChoices, 1, wxRA_SPECIFY_COLS ); - m_Drill_Shape_Opt->SetSelection( 1 ); - bmiddleRightSizer->Add( m_Drill_Shape_Opt, 0, wxALL|wxEXPAND, 5 ); - - wxString m_ModeColorOptionChoices[] = { _("Color"), _("Black and white") }; - int m_ModeColorOptionNChoices = sizeof( m_ModeColorOptionChoices ) / sizeof( wxString ); - m_ModeColorOption = new wxRadioBox( this, wxID_PRINT_MODE, _("Print Mode"), wxDefaultPosition, wxDefaultSize, m_ModeColorOptionNChoices, m_ModeColorOptionChoices, 1, wxRA_SPECIFY_COLS ); - m_ModeColorOption->SetSelection( 1 ); - 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") ); - - bmiddleRightSizer->Add( m_ModeColorOption, 0, wxALL|wxEXPAND, 5 ); - - bMainSizer->Add( bmiddleRightSizer, 0, wxEXPAND, 5 ); - - wxBoxSizer* bbuttonsSizer; - bbuttonsSizer = new wxBoxSizer( wxVERTICAL ); - - wxString m_PagesOptionChoices[] = { _("1 Page per Layer"), _("Single page") }; - int m_PagesOptionNChoices = sizeof( m_PagesOptionChoices ) / sizeof( wxString ); - m_PagesOption = new wxRadioBox( this, wxID_PAGE_MODE, _("Page Print"), wxDefaultPosition, wxDefaultSize, m_PagesOptionNChoices, m_PagesOptionChoices, 1, wxRA_SPECIFY_COLS ); - m_PagesOption->SetSelection( 0 ); - bbuttonsSizer->Add( m_PagesOption, 0, wxALL|wxEXPAND, 5 ); - - - bbuttonsSizer->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_buttonOption = new wxButton( this, wxID_PRINT_OPTIONS, _("Page Options"), wxDefaultPosition, wxDefaultSize, 0 ); - bbuttonsSizer->Add( m_buttonOption, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - m_buttonPreview = new wxButton( this, wxID_PREVIEW, _("Preview"), wxDefaultPosition, wxDefaultSize, 0 ); - bbuttonsSizer->Add( m_buttonPreview, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - m_buttonPrint = new wxButton( this, wxID_PRINT_ALL, _("Print"), wxDefaultPosition, wxDefaultSize, 0 ); - bbuttonsSizer->Add( m_buttonPrint, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonQuit->SetDefault(); - bbuttonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - - bbuttonsSizer->Add( 0, 0, 1, wxEXPAND, 5 ); - - bMainSizer->Add( bbuttonsSizer, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - this->SetSizer( bMainSizer ); - this->Layout(); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnCloseWindow ) ); - m_buttonOption->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintSetup ), NULL, this ); - m_buttonPreview->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintPreview ), NULL, this ); - m_buttonPrint->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintButtonClick ), NULL, this ); - m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnButtonCancelClick ), NULL, this ); -} - -DIALOG_PRINT_USING_PRINTER_base::~DIALOG_PRINT_USING_PRINTER_base() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnCloseWindow ) ); - m_buttonOption->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintSetup ), NULL, this ); - m_buttonPreview->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintPreview ), NULL, this ); - m_buttonPrint->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintButtonClick ), NULL, this ); - m_buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnButtonCancelClick ), NULL, this ); -} +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 16 2008) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_print_using_printer_base.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_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( wxHORIZONTAL ); + + wxStaticBoxSizer* sbLayersSizer; + sbLayersSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Layers:") ), wxVERTICAL ); + + wxBoxSizer* bleftSizer; + bleftSizer = new wxBoxSizer( wxHORIZONTAL ); + + m_CopperLayersBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Copper Layers:") ), wxVERTICAL ); + + bleftSizer->Add( m_CopperLayersBoxSizer, 1, wxALL, 5 ); + + m_TechnicalLayersBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Technical Layers:") ), wxVERTICAL ); + + bleftSizer->Add( m_TechnicalLayersBoxSizer, 1, wxALL, 5 ); + + sbLayersSizer->Add( bleftSizer, 1, wxEXPAND, 5 ); + + m_Exclude_Edges_Pcb = new wxCheckBox( this, wxID_ANY, _("Exclude Edges_Pcb Layer"), wxDefaultPosition, wxDefaultSize, 0 ); + + m_Exclude_Edges_Pcb->SetToolTip( _("Exclude contents of Edges_Pcb layer from all other layers") ); + + sbLayersSizer->Add( m_Exclude_Edges_Pcb, 0, wxALL|wxEXPAND, 5 ); + + bMainSizer->Add( sbLayersSizer, 1, wxEXPAND, 5 ); + + wxBoxSizer* bmiddleLeftSizer; + bmiddleLeftSizer = new wxBoxSizer( wxVERTICAL ); + + wxString m_ScaleOptionChoices[] = { _("fit in page"), _("Scale 0.5"), _("Scale 0.7"), _("Approx. Scale 1"), _("Accurate Scale 1"), _("Scale 1.4"), _("Scale 2"), _("Scale 3"), _("Scale 4") }; + int m_ScaleOptionNChoices = sizeof( m_ScaleOptionChoices ) / sizeof( wxString ); + m_ScaleOption = new wxRadioBox( this, wxID_ANY, _("Approx. Scale:"), wxDefaultPosition, wxDefaultSize, m_ScaleOptionNChoices, m_ScaleOptionChoices, 1, wxRA_SPECIFY_COLS ); + m_ScaleOption->SetSelection( 4 ); + bmiddleLeftSizer->Add( m_ScaleOption, 0, wxALL, 5 ); + + m_FineAdjustXscaleTitle = new wxStaticText( this, wxID_ANY, _("X Scale Adjust"), wxDefaultPosition, wxDefaultSize, 0 ); + m_FineAdjustXscaleTitle->Wrap( -1 ); + bmiddleLeftSizer->Add( m_FineAdjustXscaleTitle, 0, wxRIGHT|wxLEFT, 5 ); + + m_FineAdjustXscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_FineAdjustXscaleOpt->SetToolTip( _("Set X scale adjust for exact scale plotting") ); + + bmiddleLeftSizer->Add( m_FineAdjustXscaleOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + m_FineAdjustYscaleTitle = new wxStaticText( this, wxID_ANY, _("Y Scale Adjust"), wxDefaultPosition, wxDefaultSize, 0 ); + m_FineAdjustYscaleTitle->Wrap( -1 ); + bmiddleLeftSizer->Add( m_FineAdjustYscaleTitle, 0, wxRIGHT|wxLEFT, 5 ); + + m_FineAdjustYscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_FineAdjustYscaleOpt->SetToolTip( _("Set Y scale adjust for exact scale plotting") ); + + bmiddleLeftSizer->Add( m_FineAdjustYscaleOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + bMainSizer->Add( bmiddleLeftSizer, 0, wxEXPAND, 5 ); + + wxBoxSizer* bmiddleRightSizer; + bmiddleRightSizer = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbOptionsSizer; + sbOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options:") ), wxVERTICAL ); + + m_TextPenWidth = new wxStaticText( this, wxID_ANY, _("Default pen size:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_TextPenWidth->Wrap( -1 ); + m_TextPenWidth->SetToolTip( _("Pen size used to draw items that have no pen size specified.\nUsed mainly to draw items in sketch mode.") ); + + sbOptionsSizer->Add( m_TextPenWidth, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_DialogPenWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + sbOptionsSizer->Add( m_DialogPenWidth, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + m_Print_Sheet_Ref = new wxCheckBox( this, wxID_FRAME_SEL, _("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, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_Print_Mirror = new wxCheckBox( this, wxID_ANY, _("Mirror"), wxDefaultPosition, wxDefaultSize, 0 ); + + sbOptionsSizer->Add( m_Print_Mirror, 0, wxALL, 5 ); + + bmiddleRightSizer->Add( sbOptionsSizer, 0, wxEXPAND|wxALL, 5 ); + + wxString m_Drill_Shape_OptChoices[] = { _("No drill mark"), _("Small mark"), _("Real drill") }; + int m_Drill_Shape_OptNChoices = sizeof( m_Drill_Shape_OptChoices ) / sizeof( wxString ); + m_Drill_Shape_Opt = new wxRadioBox( this, wxID_ANY, _("Pads Drill Opt"), wxDefaultPosition, wxDefaultSize, m_Drill_Shape_OptNChoices, m_Drill_Shape_OptChoices, 1, wxRA_SPECIFY_COLS ); + m_Drill_Shape_Opt->SetSelection( 1 ); + bmiddleRightSizer->Add( m_Drill_Shape_Opt, 0, wxALL|wxEXPAND, 5 ); + + wxString m_ModeColorOptionChoices[] = { _("Color"), _("Black and white") }; + int m_ModeColorOptionNChoices = sizeof( m_ModeColorOptionChoices ) / sizeof( wxString ); + m_ModeColorOption = new wxRadioBox( this, wxID_PRINT_MODE, _("Print Mode"), wxDefaultPosition, wxDefaultSize, m_ModeColorOptionNChoices, m_ModeColorOptionChoices, 1, wxRA_SPECIFY_COLS ); + m_ModeColorOption->SetSelection( 1 ); + 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") ); + + bmiddleRightSizer->Add( m_ModeColorOption, 0, wxALL|wxEXPAND, 5 ); + + bMainSizer->Add( bmiddleRightSizer, 0, wxEXPAND, 5 ); + + wxBoxSizer* bbuttonsSizer; + bbuttonsSizer = new wxBoxSizer( wxVERTICAL ); + + wxString m_PagesOptionChoices[] = { _("1 Page per Layer"), _("Single page") }; + int m_PagesOptionNChoices = sizeof( m_PagesOptionChoices ) / sizeof( wxString ); + m_PagesOption = new wxRadioBox( this, wxID_PAGE_MODE, _("Page Print"), wxDefaultPosition, wxDefaultSize, m_PagesOptionNChoices, m_PagesOptionChoices, 1, wxRA_SPECIFY_COLS ); + m_PagesOption->SetSelection( 0 ); + bbuttonsSizer->Add( m_PagesOption, 0, wxALL|wxEXPAND, 5 ); + + + bbuttonsSizer->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_buttonOption = new wxButton( this, wxID_PRINT_OPTIONS, _("Page Options"), wxDefaultPosition, wxDefaultSize, 0 ); + bbuttonsSizer->Add( m_buttonOption, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + m_buttonPreview = new wxButton( this, wxID_PREVIEW, _("Preview"), wxDefaultPosition, wxDefaultSize, 0 ); + bbuttonsSizer->Add( m_buttonPreview, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + m_buttonPrint = new wxButton( this, wxID_PRINT_ALL, _("Print"), wxDefaultPosition, wxDefaultSize, 0 ); + bbuttonsSizer->Add( m_buttonPrint, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonQuit->SetDefault(); + bbuttonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + + bbuttonsSizer->Add( 0, 0, 1, wxEXPAND, 5 ); + + bMainSizer->Add( bbuttonsSizer, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + this->SetSizer( bMainSizer ); + this->Layout(); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnCloseWindow ) ); + m_buttonOption->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPageSetup ), NULL, this ); + m_buttonPreview->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintPreview ), NULL, this ); + m_buttonPrint->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintButtonClick ), NULL, this ); + m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnButtonCancelClick ), NULL, this ); +} + +DIALOG_PRINT_USING_PRINTER_base::~DIALOG_PRINT_USING_PRINTER_base() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnCloseWindow ) ); + m_buttonOption->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPageSetup ), NULL, this ); + m_buttonPreview->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintPreview ), NULL, this ); + m_buttonPrint->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintButtonClick ), NULL, this ); + m_buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnButtonCancelClick ), NULL, this ); +} diff --git a/pcbnew/dialog_print_using_printer_base.fbp b/pcbnew/dialog_print_using_printer_base.fbp index da4e49693a..d0ff578762 100644 --- a/pcbnew/dialog_print_using_printer_base.fbp +++ b/pcbnew/dialog_print_using_printer_base.fbp @@ -1,1099 +1,1099 @@ - - - - - - C++ - 1 - UTF-8 - connect - dialog_print_using_printer_base - 1000 - none - 1 - DialogPrint_base - - . - - 1 - 1 - 0 - - - - - 1 - - - - 0 - wxID_ANY - - -1,-1 - DIALOG_PRINT_USING_PRINTER_base - - 551,315 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - - Print - - - - - - - - OnCloseWindow - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bMainSizer - wxHORIZONTAL - none - - 5 - wxEXPAND - 1 - - wxID_ANY - Layers: - - sbLayersSizer - wxVERTICAL - none - - - 5 - wxEXPAND - 1 - - - bleftSizer - wxHORIZONTAL - none - - 5 - wxALL - 1 - - wxID_ANY - Copper Layers: - - m_CopperLayersBoxSizer - wxVERTICAL - protected - - - - - 5 - wxALL - 1 - - wxID_ANY - Technical Layers: - - m_TechnicalLayersBoxSizer - wxVERTICAL - protected - - - - - - - 5 - wxALL|wxEXPAND - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Exclude Edges_Pcb Layer - - - m_Exclude_Edges_Pcb - protected - - - - - Exclude contents of Edges_Pcb layer from all other layers - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 0 - - - bmiddleLeftSizer - wxVERTICAL - none - - 5 - wxALL - 0 - - - "fit in page" "Scale 0.5" "Scale 0.7" "Approx. Scale 1" "Accurate Scale 1" "Scale 1.4" "Scale 2" "Scale 3" "Scale 4" - - 1 - - - 0 - wxID_ANY - Approx. Scale: - 1 - - - m_ScaleOption - protected - - 4 - - wxRA_SPECIFY_COLS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - X Scale Adjust - - - m_FineAdjustXscaleTitle - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND - 0 - - - - 1 - - - 0 - wxID_ANY - - 0 - - m_FineAdjustXscaleOpt - protected - - - - - Set X scale adjust for exact scale plotting - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - Y Scale Adjust - - - m_FineAdjustYscaleTitle - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND - 0 - - - - 1 - - - 0 - wxID_ANY - - 0 - - m_FineAdjustYscaleOpt - protected - - - - - Set Y scale adjust for exact scale plotting - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 0 - - - bmiddleRightSizer - wxVERTICAL - none - - 5 - wxEXPAND|wxALL - 0 - - wxID_ANY - Options: - - sbOptionsSizer - wxVERTICAL - none - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - Default pen size: - - - m_TextPenWidth - protected - - - - - Pen size used to draw items that have no pen size specified. Used mainly to draw items in sketch mode. - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND - 0 - - - - 1 - - - 0 - wxID_ANY - - 0 - -1,-1 - m_DialogPenWidth - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - 1 - - 1 - - - 0 - wxID_FRAME_SEL - Print frame ref - - - m_Print_Sheet_Ref - protected - - - - - Print (or not) the Frame references. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Mirror - - - m_Print_Mirror - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - - "No drill mark" "Small mark" "Real drill" - - 1 - - - 0 - wxID_ANY - Pads Drill Opt - 1 - - - m_Drill_Shape_Opt - protected - - 1 - - wxRA_SPECIFY_COLS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - - "Color" "Black and white" - - 1 - - - 0 - wxID_PRINT_MODE - Print Mode - 1 - - - m_ModeColorOption - protected - - 1 - - wxRA_SPECIFY_COLS - - Choose if you wand to draw the sheet like it appears on screen, or in black and white mode, better to print it when using black and white printers - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxEXPAND - 0 - - - bbuttonsSizer - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 0 - - - "1 Page per Layer" "Single page" - - 1 - - - 0 - wxID_PAGE_MODE - Page Print - 1 - - - m_PagesOption - protected - - 0 - - wxRA_SPECIFY_COLS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND - 0 - - - - 0 - 1 - - - 0 - wxID_PRINT_OPTIONS - Page Options - - - m_buttonOption - protected - - - - - - - - - OnPrintSetup - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND - 0 - - - - 0 - 1 - - - 0 - wxID_PREVIEW - Preview - - - m_buttonPreview - protected - - - - - - - - - OnPrintPreview - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND - 0 - - - - 0 - 1 - - - 0 - wxID_PRINT_ALL - Print - - - m_buttonPrint - protected - - - - - - - - - OnPrintButtonClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND - 0 - - - - 1 - 1 - - - 0 - wxID_CANCEL - Close - - - m_buttonQuit - protected - - - - - - - - - OnButtonCancelClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - - - - - + + + + + + C++ + 1 + UTF-8 + connect + dialog_print_using_printer_base + 1000 + none + 1 + DialogPrint_base + + . + + 1 + 1 + 0 + + + + + 1 + + + + 0 + wxID_ANY + + -1,-1 + DIALOG_PRINT_USING_PRINTER_base + + 551,315 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + + Print + + + + + + + + OnCloseWindow + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bMainSizer + wxHORIZONTAL + none + + 5 + wxEXPAND + 1 + + wxID_ANY + Layers: + + sbLayersSizer + wxVERTICAL + none + + + 5 + wxEXPAND + 1 + + + bleftSizer + wxHORIZONTAL + none + + 5 + wxALL + 1 + + wxID_ANY + Copper Layers: + + m_CopperLayersBoxSizer + wxVERTICAL + protected + + + + + 5 + wxALL + 1 + + wxID_ANY + Technical Layers: + + m_TechnicalLayersBoxSizer + wxVERTICAL + protected + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Exclude Edges_Pcb Layer + + + m_Exclude_Edges_Pcb + protected + + + + + Exclude contents of Edges_Pcb layer from all other layers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + + bmiddleLeftSizer + wxVERTICAL + none + + 5 + wxALL + 0 + + + "fit in page" "Scale 0.5" "Scale 0.7" "Approx. Scale 1" "Accurate Scale 1" "Scale 1.4" "Scale 2" "Scale 3" "Scale 4" + + 1 + + + 0 + wxID_ANY + Approx. Scale: + 1 + + + m_ScaleOption + protected + + 4 + + wxRA_SPECIFY_COLS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + X Scale Adjust + + + m_FineAdjustXscaleTitle + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_FineAdjustXscaleOpt + protected + + + + + Set X scale adjust for exact scale plotting + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + Y Scale Adjust + + + m_FineAdjustYscaleTitle + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_FineAdjustYscaleOpt + protected + + + + + Set Y scale adjust for exact scale plotting + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + + bmiddleRightSizer + wxVERTICAL + none + + 5 + wxEXPAND|wxALL + 0 + + wxID_ANY + Options: + + sbOptionsSizer + wxVERTICAL + none + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + Default pen size: + + + m_TextPenWidth + protected + + + + + Pen size used to draw items that have no pen size specified. Used mainly to draw items in sketch mode. + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + -1,-1 + m_DialogPenWidth + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + 1 + + 1 + + + 0 + wxID_FRAME_SEL + Print frame ref + + + m_Print_Sheet_Ref + protected + + + + + Print (or not) the Frame references. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Mirror + + + m_Print_Mirror + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + "No drill mark" "Small mark" "Real drill" + + 1 + + + 0 + wxID_ANY + Pads Drill Opt + 1 + + + m_Drill_Shape_Opt + protected + + 1 + + wxRA_SPECIFY_COLS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + "Color" "Black and white" + + 1 + + + 0 + wxID_PRINT_MODE + Print Mode + 1 + + + m_ModeColorOption + protected + + 1 + + wxRA_SPECIFY_COLS + + Choose if you wand to draw the sheet like it appears on screen, or in black and white mode, better to print it when using black and white printers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxEXPAND + 0 + + + bbuttonsSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + + "1 Page per Layer" "Single page" + + 1 + + + 0 + wxID_PAGE_MODE + Page Print + 1 + + + m_PagesOption + protected + + 0 + + wxRA_SPECIFY_COLS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + wxID_PRINT_OPTIONS + Page Options + + + m_buttonOption + protected + + + + + + + + + OnPageSetup + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + wxID_PREVIEW + Preview + + + m_buttonPreview + protected + + + + + + + + + OnPrintPreview + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + wxID_PRINT_ALL + Print + + + m_buttonPrint + protected + + + + + + + + + OnPrintButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND + 0 + + + + 1 + 1 + + + 0 + wxID_CANCEL + Close + + + m_buttonQuit + protected + + + + + + + + + OnButtonCancelClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + + + + + diff --git a/pcbnew/dialog_print_using_printer_base.h b/pcbnew/dialog_print_using_printer_base.h index e35763c944..66cdd24462 100644 --- a/pcbnew/dialog_print_using_printer_base.h +++ b/pcbnew/dialog_print_using_printer_base.h @@ -1,82 +1,82 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 16 2008) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __dialog_print_using_printer_base__ -#define __dialog_print_using_printer_base__ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_PRINT_USING_PRINTER_base -/////////////////////////////////////////////////////////////////////////////// -class DIALOG_PRINT_USING_PRINTER_base : public wxDialog -{ - private: - - protected: - enum - { - wxID_FRAME_SEL = 1000, - wxID_PRINT_MODE, - wxID_PAGE_MODE, - wxID_PRINT_OPTIONS, - wxID_PRINT_ALL, - }; - - wxStaticBoxSizer* m_CopperLayersBoxSizer; - wxStaticBoxSizer* m_TechnicalLayersBoxSizer; - wxCheckBox* m_Exclude_Edges_Pcb; - wxRadioBox* m_ScaleOption; - wxStaticText* m_FineAdjustXscaleTitle; - wxTextCtrl* m_FineAdjustXscaleOpt; - wxStaticText* m_FineAdjustYscaleTitle; - wxTextCtrl* m_FineAdjustYscaleOpt; - wxStaticText* m_TextPenWidth; - wxTextCtrl* m_DialogPenWidth; - wxCheckBox* m_Print_Sheet_Ref; - wxCheckBox* m_Print_Mirror; - wxRadioBox* m_Drill_Shape_Opt; - wxRadioBox* m_ModeColorOption; - wxRadioBox* m_PagesOption; - - wxButton* m_buttonOption; - wxButton* m_buttonPreview; - wxButton* m_buttonPrint; - wxButton* m_buttonQuit; - - - // Virtual event handlers, overide them in your derived class - virtual void OnCloseWindow( wxCloseEvent& event ){ event.Skip(); } - virtual void OnPrintSetup( wxCommandEvent& event ){ event.Skip(); } - virtual void OnPrintPreview( wxCommandEvent& event ){ event.Skip(); } - virtual void OnPrintButtonClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnButtonCancelClick( wxCommandEvent& event ){ event.Skip(); } - - - public: - DIALOG_PRINT_USING_PRINTER_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Print"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 551,315 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_PRINT_USING_PRINTER_base(); - -}; - -#endif //__dialog_print_using_printer_base__ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 16 2008) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __dialog_print_using_printer_base__ +#define __dialog_print_using_printer_base__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_PRINT_USING_PRINTER_base +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_PRINT_USING_PRINTER_base : public wxDialog +{ + private: + + protected: + enum + { + wxID_FRAME_SEL = 1000, + wxID_PRINT_MODE, + wxID_PAGE_MODE, + wxID_PRINT_OPTIONS, + wxID_PRINT_ALL, + }; + + wxStaticBoxSizer* m_CopperLayersBoxSizer; + wxStaticBoxSizer* m_TechnicalLayersBoxSizer; + wxCheckBox* m_Exclude_Edges_Pcb; + wxRadioBox* m_ScaleOption; + wxStaticText* m_FineAdjustXscaleTitle; + wxTextCtrl* m_FineAdjustXscaleOpt; + wxStaticText* m_FineAdjustYscaleTitle; + wxTextCtrl* m_FineAdjustYscaleOpt; + wxStaticText* m_TextPenWidth; + wxTextCtrl* m_DialogPenWidth; + wxCheckBox* m_Print_Sheet_Ref; + wxCheckBox* m_Print_Mirror; + wxRadioBox* m_Drill_Shape_Opt; + wxRadioBox* m_ModeColorOption; + wxRadioBox* m_PagesOption; + + wxButton* m_buttonOption; + wxButton* m_buttonPreview; + wxButton* m_buttonPrint; + wxButton* m_buttonQuit; + + + // Virtual event handlers, overide them in your derived class + virtual void OnCloseWindow( wxCloseEvent& event ){ event.Skip(); } + virtual void OnPageSetup( wxCommandEvent& event ){ event.Skip(); } + virtual void OnPrintPreview( wxCommandEvent& event ){ event.Skip(); } + virtual void OnPrintButtonClick( wxCommandEvent& event ){ event.Skip(); } + virtual void OnButtonCancelClick( wxCommandEvent& event ){ event.Skip(); } + + + public: + DIALOG_PRINT_USING_PRINTER_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Print"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 551,315 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_PRINT_USING_PRINTER_base(); + +}; + +#endif //__dialog_print_using_printer_base__ diff --git a/pcbnew/print_board_functions.cpp b/pcbnew/print_board_functions.cpp index 82b5f19537..b8e7e5e9c2 100644 --- a/pcbnew/print_board_functions.cpp +++ b/pcbnew/print_board_functions.cpp @@ -19,8 +19,87 @@ static void Print_Module( WinEDA_DrawPanel* aPanel, wxDC* aDC, MODULE* aModule, int aDraw_mode, int aMasklayer, PRINT_PARAMETERS::DrillShapeOptT aDrillShapeOpt ); +/** Function WinEDA_ModuleEditFrame::PrintPage + * Used to print the board (on printer, or when creating SVF files). + * Print the board, but only layers allowed by aPrintMaskLayer + * @param aDC = the print device context + * @param aPrint_Sheet_Ref = true to print frame references + * @param aPrint_Sheet_Ref = a 32 bits mask: bit n = 1 -> layer n is printed + * @param aPrintMirrorMode = true to plot mirrored + * @param aData = a pointer to an optional data (NULL if not used) + */ +void WinEDA_ModuleEditFrame::PrintPage( wxDC* aDC, + bool aPrint_Sheet_Ref, + int aPrintMaskLayer, + bool aPrintMirrorMode, + void * aData) +{ + MODULE* Module; + int drawmode = GR_COPY; + DISPLAY_OPTIONS save_opt; + BOARD* Pcb = GetBoard(); + int defaultPenSize = 50; -/** Function PrintPage + PRINT_PARAMETERS * printParameters = (PRINT_PARAMETERS*) aData; // can be null + PRINT_PARAMETERS::DrillShapeOptT drillShapeOpt = PRINT_PARAMETERS::FULL_DRILL_SHAPE; + if( printParameters ) + defaultPenSize = printParameters->m_PenDefaultSize; + + save_opt = DisplayOpt; + + DisplayOpt.ContrastModeDisplay = false; + DisplayOpt.DisplayPadFill = true; + DisplayOpt.DisplayViaFill = true; + + m_DisplayPadFill = DisplayOpt.DisplayPadFill; + m_DisplayViaFill = DisplayOpt.DisplayViaFill; + m_DisplayPadNum = DisplayOpt.DisplayPadNum = false; + bool nctmp = GetBoard()->IsElementVisible(NO_CONNECTS_VISIBLE); + GetBoard()->SetElementVisibility(NO_CONNECTS_VISIBLE, false); + DisplayOpt.DisplayPadIsol = false; + DisplayOpt.DisplayModEdge = FILLED; + DisplayOpt.DisplayModText = FILLED; + m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill = FILLED; + DisplayOpt.ShowTrackClearanceMode = DO_NOT_SHOW_CLEARANCE; + DisplayOpt.DisplayDrawItems = FILLED; + DisplayOpt.DisplayZonesMode = 0; + DisplayOpt.DisplayNetNamesMode = 0; + + DrawPanel->m_PrintIsMirrored = aPrintMirrorMode; + + // The OR mode is used in color mode, but be aware the backgroud *must be + // BLACK. In the print page dialog, we first print in BLACK, and after + // reprint in color, on the black "local" backgroud, in OR mode the black + // print is not made before, only a white page is printed + if( GetGRForceBlackPenState() == false ) + drawmode = GR_OR; + + // Draw footprints, this is done at last in order to print the pad holes in + // white (or g_DrawBgColor) after the tracks and zones + Module = (MODULE*) Pcb->m_Modules; + int tmp = D_PAD::m_PadSketchModePenSize; + D_PAD::m_PadSketchModePenSize = defaultPenSize; + for( ; Module != NULL; Module = Module->Next() ) + { + Print_Module( DrawPanel, aDC, Module, drawmode, aPrintMaskLayer, drillShapeOpt ); + } + D_PAD::m_PadSketchModePenSize = tmp; + + if( aPrint_Sheet_Ref ) + TraceWorkSheet( aDC, GetScreen(), defaultPenSize ); + + DrawPanel->m_PrintIsMirrored = false; + + DisplayOpt = save_opt; + m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill; + m_DisplayPadFill = DisplayOpt.DisplayPadFill; + m_DisplayViaFill = DisplayOpt.DisplayViaFill; + m_DisplayPadNum = DisplayOpt.DisplayPadNum; + GetBoard()->SetElementVisibility(NO_CONNECTS_VISIBLE, nctmp); +} + + +/** WinEDA_PcbFrame::Function PrintPage * Used to print the board (on printer, or when creating SVF files). * Print the board, but only layers allowed by aPrintMaskLayer * @param aDC = the print device context diff --git a/pcbnew/printout_controler.cpp b/pcbnew/printout_controler.cpp index 71741a3f6b..b438f7b741 100644 --- a/pcbnew/printout_controler.cpp +++ b/pcbnew/printout_controler.cpp @@ -240,6 +240,9 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage() if( userscale == 1.0 ) { + // We want a 1:1 scale and margins for printing + MapScreenSizeToPaper( ); + // Fine scale adjust dc->SetUserScale( accurate_Xscale, accurate_Yscale ); }