From 8560488612be78b60b37a3ecebfd69d03debfc21 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 21 Apr 2010 19:22:27 +0200 Subject: [PATCH 1/3] 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 ); } From e066b91cd4a356872d25b1c32d5a568b2616e306 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 21 Apr 2010 20:57:34 +0200 Subject: [PATCH 2/3] Pcbnew+gerbview: fixed some issues in printing dialog --- gerbview/dialog_print_using_printer.cpp | 32 ++++++---- gerbview/dialog_print_using_printer_base.cpp | 4 +- gerbview/dialog_print_using_printer_base.fbp | 2 +- gerbview/dialog_print_using_printer_base.h | 2 +- pcbnew/dialog_print_using_printer.cpp | 26 +++++--- pcbnew/printout_controler.cpp | 65 +++++++++----------- pcbnew/printout_controler.h | 1 + 7 files changed, 70 insertions(+), 62 deletions(-) diff --git a/gerbview/dialog_print_using_printer.cpp b/gerbview/dialog_print_using_printer.cpp index 9694d075c7..8c414de4bf 100644 --- a/gerbview/dialog_print_using_printer.cpp +++ b/gerbview/dialog_print_using_printer.cpp @@ -34,6 +34,7 @@ static double s_ScaleList[] = // static print data and page setup data, to remember settings during the session static wxPrintData* g_PrintData; +static wxPageSetupDialogData* g_pageSetupData = (wxPageSetupDialogData*) NULL; // Variables locales static PRINT_PARAMETERS s_Parameters; @@ -58,7 +59,7 @@ public: private: void OnCloseWindow( wxCloseEvent& event ); void OnInitDialog( wxInitDialogEvent& event ); - void OnPrintSetup( wxCommandEvent& event ); + void OnPageSetup( wxCommandEvent& event ); void OnPrintPreview( wxCommandEvent& event ); void OnPrintButtonClick( wxCommandEvent& event ); @@ -130,8 +131,18 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( ) int layer_max = NB_LAYERS; wxString msg; - layer_max = 32; + if( g_pageSetupData == NULL ) + { + g_pageSetupData = new wxPageSetupDialogData; + // Set initial page margins. + // Margins are already set in Pcbnew, so we cans use 0 + g_pageSetupData->SetMarginTopLeft(wxPoint(0, 0)); + g_pageSetupData->SetMarginBottomRight(wxPoint(0, 0)); + } + s_Parameters.m_PageSetupData = g_pageSetupData; + + layer_max = 32; /* Create layer list */ int mask = 1, ii; for( ii = 0; ii < layer_max; ii++, mask <<= 1 ) @@ -326,24 +337,19 @@ void DIALOG_PRINT_USING_PRINTER::SetPrintParameters( ) } /**********************************************************/ -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 ...) */ { - wxPrintDialogData printDialogData( *g_PrintData ); + *g_pageSetupData = *g_PrintData; - if( printDialogData.Ok() ) - { - wxPrintDialog printerDialog( this, &printDialogData ); + wxPageSetupDialog pageSetupDialog(this, g_pageSetupData); + pageSetupDialog.ShowModal(); - printerDialog.ShowModal(); - - *g_PrintData = printerDialog.GetPrintDialogData().GetPrintData(); - } - else - DisplayError( this, _( "Printer Problem!" ) ); + (*g_PrintData) = pageSetupDialog.GetPageSetupDialogData().GetPrintData(); + (*g_pageSetupData) = pageSetupDialog.GetPageSetupDialogData(); } diff --git a/gerbview/dialog_print_using_printer_base.cpp b/gerbview/dialog_print_using_printer_base.cpp index aee5ef35bc..0a71deeb19 100644 --- a/gerbview/dialog_print_using_printer_base.cpp +++ b/gerbview/dialog_print_using_printer_base.cpp @@ -113,7 +113,7 @@ DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* pare // 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_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 ); @@ -123,7 +123,7 @@ 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_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/gerbview/dialog_print_using_printer_base.fbp b/gerbview/dialog_print_using_printer_base.fbp index c553896088..3dbb49ddfb 100644 --- a/gerbview/dialog_print_using_printer_base.fbp +++ b/gerbview/dialog_print_using_printer_base.fbp @@ -625,7 +625,7 @@ - OnPrintSetup + OnPageSetup diff --git a/gerbview/dialog_print_using_printer_base.h b/gerbview/dialog_print_using_printer_base.h index 4d87fc16d4..a43ff13694 100644 --- a/gerbview/dialog_print_using_printer_base.h +++ b/gerbview/dialog_print_using_printer_base.h @@ -59,7 +59,7 @@ class DIALOG_PRINT_USING_PRINTER_base : public wxDialog // 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 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(); } diff --git a/pcbnew/dialog_print_using_printer.cpp b/pcbnew/dialog_print_using_printer.cpp index ae01d09b2c..44d459c6c1 100644 --- a/pcbnew/dialog_print_using_printer.cpp +++ b/pcbnew/dialog_print_using_printer.cpp @@ -36,6 +36,7 @@ static double s_ScaleList[] = // static print data and page setup data, to remember settings during the session static wxPrintData* g_PrintData; +static wxPageSetupDialogData* g_pageSetupData = (wxPageSetupDialogData*) NULL; static PRINT_PARAMETERS s_Parameters; @@ -138,6 +139,16 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( ) int layer_max = NB_LAYERS; wxString msg; BOARD* board = m_Parent->GetBoard(); + if( g_pageSetupData == NULL ) + { + g_pageSetupData = new wxPageSetupDialogData; + // Set initial page margins. + // Margins are already set in Pcbnew, so we cans use 0 + g_pageSetupData->SetMarginTopLeft(wxPoint(0, 0)); + g_pageSetupData->SetMarginBottomRight(wxPoint(0, 0)); + } + + s_Parameters.m_PageSetupData = g_pageSetupData; // Create layer list. int layer; @@ -420,18 +431,13 @@ void DIALOG_PRINT_USING_PRINTER::OnPageSetup( wxCommandEvent& event ) /* Open a dialog box for printer setup (printer options, page size ...) */ { - wxPrintDialogData printDialogData( *g_PrintData ); + *g_pageSetupData = *g_PrintData; - if( printDialogData.Ok() ) - { - wxPrintDialog printerDialog( this, &printDialogData ); + wxPageSetupDialog pageSetupDialog(this, g_pageSetupData); + pageSetupDialog.ShowModal(); - printerDialog.ShowModal(); - - *g_PrintData = printerDialog.GetPrintDialogData().GetPrintData(); - } - else - DisplayError( this, _( "Printer Problem!" ) ); + (*g_PrintData) = pageSetupDialog.GetPageSetupDialogData().GetPrintData(); + (*g_pageSetupData) = pageSetupDialog.GetPageSetupDialogData(); } diff --git a/pcbnew/printout_controler.cpp b/pcbnew/printout_controler.cpp index b438f7b741..9602ac282e 100644 --- a/pcbnew/printout_controler.cpp +++ b/pcbnew/printout_controler.cpp @@ -32,6 +32,7 @@ PRINT_PARAMETERS::PRINT_PARAMETERS() m_ForceCentered = false; m_Flags = 0; m_DrillShapeOpt = PRINT_PARAMETERS::SMALL_DRILL_SHAPE; + m_PageSetupData = NULL; } @@ -116,10 +117,7 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage() { int tmpzoom; wxPoint tmp_startvisu; - wxSize PageSize_in_mm; wxSize SheetSize; // Page size in internal units - wxSize PlotAreaSize; // plot area size in pixels - double scaleX, scaleY, scale; wxPoint old_org; wxPoint DrawOffset; // Offset de trace double userscale; @@ -130,8 +128,6 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage() wxBusyCursor dummy; - GetPageSizeMM( &PageSize_in_mm.x, &PageSize_in_mm.y ); - /* Save old draw scale and draw offset */ tmp_startvisu = ActiveScreen->m_StartVisu; tmpzoom = ActiveScreen->GetZoom(); @@ -151,21 +147,19 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage() SheetSize.x *= m_Parent->m_InternalUnits / 1000; SheetSize.y *= m_Parent->m_InternalUnits / 1000; // size in pixels - // Get the size of the DC in pixels - dc->GetSize( &PlotAreaSize.x, &PlotAreaSize.y ); - WinEDA_BasePcbFrame* pcbframe = (WinEDA_BasePcbFrame*) m_Parent; pcbframe->GetBoard()->ComputeBoundaryBox(); /* Compute the PCB size in internal units*/ userscale = m_PrintParams.m_PrintScale; if( userscale == 0 ) // fit in page { - int extra_margin = 0; // Margin = 8000/2 units pcb = 0,4 inch + int extra_margin = 4000*2; // Margin = 4000 units pcb = 0.4 inch SheetSize.x = pcbframe->GetBoard()->m_BoundaryBox.GetWidth() + extra_margin; SheetSize.y = pcbframe->GetBoard()->m_BoundaryBox.GetHeight() + extra_margin; userscale = 0.99; } + if( (m_PrintParams.m_PrintScale > 1.0) // scale > 1 -> Recadrage || (m_PrintParams.m_PrintScale == 0) ) // fit in page { @@ -173,26 +167,28 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage() DrawOffset.y += pcbframe->GetBoard()->m_BoundaryBox.Centre().y; } - // Calculate a suitable scaling factor - scaleX = (double) SheetSize.x / (double) PlotAreaSize.x; - scaleY = (double) SheetSize.y / (double) PlotAreaSize.y; - scale = wxMax( scaleX, scaleY ) / userscale; // Use x or y scaling factor, whichever fits on the DC - - // ajust the real draw scale - double accurate_Xscale, accurate_Yscale; - dc->SetUserScale( DrawZoom / scale * m_PrintParams.m_XScaleAdjust, - DrawZoom / scale * m_PrintParams.m_YScaleAdjust ); + if( m_PrintParams.m_PageSetupData ) + { + wxSize pagesize; + pagesize.x = (int) (SheetSize.x / userscale); + pagesize.y = (int) (SheetSize.y / userscale); + FitThisSizeToPageMargins(pagesize, *m_PrintParams.m_PageSetupData ); + } // Compute Accurate scale 1 + if( userscale == 1.0 ) { + // We want a 1:1 scale and margins for printing + MapScreenSizeToPaper( ); int w, h; GetPPIPrinter( &w, &h ); - accurate_Xscale = ( (double) ( DrawZoom * w ) ) / (double) PCB_INTERNAL_UNIT; - accurate_Yscale = ( (double) ( DrawZoom * h ) ) / (double) PCB_INTERNAL_UNIT; + double accurate_Xscale = ( (double) ( DrawZoom * w ) ) / (double) PCB_INTERNAL_UNIT; + double accurate_Yscale = ( (double) ( DrawZoom * h ) ) / (double) PCB_INTERNAL_UNIT; if( IsPreview() ) // Scale must take in account the DC size in Preview { // Get the size of the DC in pixels + wxSize PlotAreaSize; dc->GetSize( &PlotAreaSize.x, &PlotAreaSize.y ); GetPageSizePixels( &w, &h ); accurate_Xscale *= PlotAreaSize.x; @@ -202,8 +198,19 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage() } accurate_Xscale *= m_PrintParams.m_XScaleAdjust; accurate_Yscale *= m_PrintParams.m_YScaleAdjust; + // Fine scale adjust + dc->SetUserScale( accurate_Xscale, accurate_Yscale ); } + // Get the final size of the DC in pixels + wxSize PlotAreaSizeInPixels; + dc->GetSize( &PlotAreaSizeInPixels.x, &PlotAreaSizeInPixels.y ); + double scalex, scaley; + dc->GetUserScale(&scalex, &scaley); + wxSize PlotAreaSizeInUserUnits; + PlotAreaSizeInUserUnits.x = (int) (PlotAreaSizeInPixels.x/scalex); + PlotAreaSizeInUserUnits.y = (int) (PlotAreaSizeInPixels.y/scaley); + /* In some cases the plot origin is the centre of the page * when: * - Asked @@ -214,13 +221,9 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage() || (m_PrintParams.m_PrintScale > 1.0) // scale > 1 || (m_PrintParams.m_PrintScale == 0) ) // fit in page { - DrawOffset.x -= wxRound( ( (double) PlotAreaSize.x / 2.0 ) * scale ); - DrawOffset.y -= wxRound( ( (double) PlotAreaSize.y / 2.0 ) * scale ); + DrawOffset.x -= PlotAreaSizeInUserUnits.x / 2; + DrawOffset.y -= PlotAreaSizeInUserUnits.y / 2; } - DrawOffset.x += wxRound( ( (double) SheetSize.x / 2.0 ) * - ( m_PrintParams.m_XScaleAdjust - 1.0 ) ); - DrawOffset.y += wxRound( ( (double) SheetSize.y / 2.0 ) * - ( m_PrintParams.m_YScaleAdjust - 1.0 ) ); ActiveScreen->m_DrawOrg = DrawOffset; @@ -238,14 +241,6 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage() m_Parent->GetBaseScreen()->m_IsPrinting = true; int bg_color = g_DrawBgColor; - if( userscale == 1.0 ) - { - // We want a 1:1 scale and margins for printing - MapScreenSizeToPaper( ); - // Fine scale adjust - dc->SetUserScale( accurate_Xscale, accurate_Yscale ); - } - if( m_PrintParams.m_Print_Sheet_Ref ) m_Parent->TraceWorkSheet( dc, ActiveScreen, m_PrintParams.m_PenDefaultSize ); @@ -263,7 +258,7 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage() * the old draw area in the new draw area, because the draw origin has not moved * (this is the upper left corner) but the Y axis is reversed, therefore the plotting area * is the y coordinate values from - PlotAreaSize.y to 0 */ - int ysize = (int) ( PlotAreaSize.y / sy ); + int ysize = (int) ( PlotAreaSizeInPixels.y / sy ); DrawOffset.y += ysize; /* in order to keep the board position in the sheet diff --git a/pcbnew/printout_controler.h b/pcbnew/printout_controler.h index 090962174e..1255975e71 100644 --- a/pcbnew/printout_controler.h +++ b/pcbnew/printout_controler.h @@ -31,6 +31,7 @@ public: int m_PageCount; // Number of page to print bool m_ForceCentered; // Forge plot origin to page centre (used in modedit) int m_Flags; // auxiliary variable: can be used to pass some other info + wxPageSetupDialogData* m_PageSetupData; // A wxPageSetupDialogData to know page options (margins) enum DrillShapeOptT { NO_DRILL_SHAPE = 0, From b471f8d70cbbe49259b2e659f6d4174487748b01 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 22 Apr 2010 19:47:10 +0200 Subject: [PATCH 3/3] Fixed minor bugs and printing problems, and others minor enhancements --- CHANGELOG.txt | 5 ++ gerbview/dialog_print_using_printer.cpp | 19 ++++++ gerbview/dialog_print_using_printer_base.cpp | 10 ++-- gerbview/dialog_print_using_printer_base.fbp | 10 ++-- gerbview/dialog_print_using_printer_base.h | 1 + pcbnew/dialog_print_using_printer.cpp | 19 ++++++ pcbnew/dialog_print_using_printer_base.cpp | 2 + pcbnew/dialog_print_using_printer_base.fbp | 2 +- pcbnew/dialog_print_using_printer_base.h | 1 + pcbnew/dimension.cpp | 62 ++++++++++++-------- pcbnew/onleftclick.cpp | 6 +- pcbnew/plot_rtn.cpp | 18 +++++- 12 files changed, 118 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c797f5ea78..c72f333641 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,11 @@ KiCad ChangeLog 2010 Please add newer entries at the top, list the date and your name with email address. +2010-apr-22, UPDATE Jean-Pierre Charras +================================================================================ +++Pcbnew+Gerbview: + Fixed minor problems in printing. + 2010-apr-19, UPDATE Jean-Pierre Charras ================================================================================ ++Pcbnew: diff --git a/gerbview/dialog_print_using_printer.cpp b/gerbview/dialog_print_using_printer.cpp index 8c414de4bf..b8702471ef 100644 --- a/gerbview/dialog_print_using_printer.cpp +++ b/gerbview/dialog_print_using_printer.cpp @@ -62,6 +62,7 @@ private: void OnPageSetup( wxCommandEvent& event ); void OnPrintPreview( wxCommandEvent& event ); void OnPrintButtonClick( wxCommandEvent& event ); + void OnScaleSelectionClick( wxCommandEvent& event ); void OnButtonCancelClick( wxCommandEvent& event ) { Close(); } void SetPrintParameters( ); @@ -210,6 +211,8 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( ) } m_ScaleOption->SetSelection( scale_idx ); + scale_idx = m_ScaleOption->GetSelection(); + s_Parameters.m_PrintScale = s_ScaleList[scale_idx]; m_Print_Mirror->SetValue(s_Parameters.m_PrintMirror); @@ -225,6 +228,12 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( ) m_FineAdjustXscaleOpt->SetValue( msg ); msg.Printf( wxT( "%f" ), s_Parameters.m_YScaleAdjust ); m_FineAdjustYscaleOpt->SetValue( msg ); + + bool enable = (s_Parameters.m_PrintScale == 1.0); + if( m_FineAdjustXscaleOpt ) + m_FineAdjustXscaleOpt->Enable(enable); + if( m_FineAdjustYscaleOpt ) + m_FineAdjustYscaleOpt->Enable(enable); } /*************************************************/ @@ -336,6 +345,16 @@ void DIALOG_PRINT_USING_PRINTER::SetPrintParameters( ) g_pcb_plot_options.ScaleAdjX = s_Parameters.m_YScaleAdjust; } +void DIALOG_PRINT_USING_PRINTER::OnScaleSelectionClick( wxCommandEvent& event ) +{ + double scale = s_ScaleList[m_ScaleOption->GetSelection()]; + bool enable = (scale == 1.0); + if( m_FineAdjustXscaleOpt ) + m_FineAdjustXscaleOpt->Enable(enable); + if( m_FineAdjustYscaleOpt ) + m_FineAdjustYscaleOpt->Enable(enable); +} + /**********************************************************/ void DIALOG_PRINT_USING_PRINTER::OnPageSetup( wxCommandEvent& event ) /**********************************************************/ diff --git a/gerbview/dialog_print_using_printer_base.cpp b/gerbview/dialog_print_using_printer_base.cpp index 0a71deeb19..03408f999d 100644 --- a/gerbview/dialog_print_using_printer_base.cpp +++ b/gerbview/dialog_print_using_printer_base.cpp @@ -95,16 +95,16 @@ DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* pare b_buttonsSizer = new wxBoxSizer( wxVERTICAL ); m_buttonOption = new wxButton( this, wxID_PRINT_OPTIONS, _("Page Options"), wxDefaultPosition, wxDefaultSize, 0 ); - b_buttonsSizer->Add( m_buttonOption, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + b_buttonsSizer->Add( m_buttonOption, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); m_buttonPreview = new wxButton( this, wxID_PREVIEW, _("Preview"), wxDefaultPosition, wxDefaultSize, 0 ); - b_buttonsSizer->Add( m_buttonPreview, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + b_buttonsSizer->Add( m_buttonPreview, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); m_buttonPrint = new wxButton( this, wxID_PRINT_ALL, _("Print"), wxDefaultPosition, wxDefaultSize, 0 ); - b_buttonsSizer->Add( m_buttonPrint, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + b_buttonsSizer->Add( m_buttonPrint, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); - b_buttonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + b_buttonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); bMainSizer->Add( b_buttonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 ); @@ -113,6 +113,7 @@ DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* pare // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnCloseWindow ) ); + m_ScaleOption->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnScaleSelectionClick ), NULL, this ); 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 ); @@ -123,6 +124,7 @@ 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_ScaleOption->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnScaleSelectionClick ), NULL, this ); 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 ); diff --git a/gerbview/dialog_print_using_printer_base.fbp b/gerbview/dialog_print_using_printer_base.fbp index 3dbb49ddfb..905768c375 100644 --- a/gerbview/dialog_print_using_printer_base.fbp +++ b/gerbview/dialog_print_using_printer_base.fbp @@ -182,7 +182,7 @@ - + OnScaleSelectionClick @@ -601,7 +601,7 @@ none 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND 0 @@ -653,7 +653,7 @@ 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND 0 @@ -705,7 +705,7 @@ 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND 0 @@ -757,7 +757,7 @@ 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND 0 diff --git a/gerbview/dialog_print_using_printer_base.h b/gerbview/dialog_print_using_printer_base.h index a43ff13694..b00206c7b4 100644 --- a/gerbview/dialog_print_using_printer_base.h +++ b/gerbview/dialog_print_using_printer_base.h @@ -59,6 +59,7 @@ class DIALOG_PRINT_USING_PRINTER_base : public wxDialog // Virtual event handlers, overide them in your derived class virtual void OnCloseWindow( wxCloseEvent& event ){ event.Skip(); } + virtual void OnScaleSelectionClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnPageSetup( wxCommandEvent& event ){ event.Skip(); } virtual void OnPrintPreview( wxCommandEvent& event ){ event.Skip(); } virtual void OnPrintButtonClick( wxCommandEvent& event ){ event.Skip(); } diff --git a/pcbnew/dialog_print_using_printer.cpp b/pcbnew/dialog_print_using_printer.cpp index 44d459c6c1..915333bcfa 100644 --- a/pcbnew/dialog_print_using_printer.cpp +++ b/pcbnew/dialog_print_using_printer.cpp @@ -63,6 +63,7 @@ private: void OnPageSetup( wxCommandEvent& event ); void OnPrintPreview( wxCommandEvent& event ); void OnPrintButtonClick( wxCommandEvent& event ); + void OnScaleSelectionClick( wxCommandEvent& event ); void OnButtonCancelClick( wxCommandEvent& event ) { Close(); } void SetPrintParameters( ); @@ -242,6 +243,8 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( ) } m_ScaleOption->SetSelection( scale_idx ); + scale_idx = m_ScaleOption->GetSelection(); + s_Parameters.m_PrintScale = s_ScaleList[scale_idx]; m_Print_Mirror->SetValue(s_Parameters.m_PrintMirror); m_Exclude_Edges_Pcb->SetValue(m_ExcludeEdgeLayer); m_Print_Sheet_Ref->SetValue( s_Parameters.m_Print_Sheet_Ref ); @@ -265,6 +268,12 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( ) m_FineAdjustXscaleOpt->SetValue( msg ); msg.Printf( wxT( "%f" ), s_Parameters.m_YScaleAdjust ); m_FineAdjustYscaleOpt->SetValue( msg ); + + bool enable = (s_Parameters.m_PrintScale == 1.0); + if( m_FineAdjustXscaleOpt ) + m_FineAdjustXscaleOpt->Enable(enable); + if( m_FineAdjustYscaleOpt ) + m_FineAdjustYscaleOpt->Enable(enable); } @@ -423,6 +432,16 @@ void DIALOG_PRINT_USING_PRINTER::SetPenWidth() ReturnStringFromValue( g_UnitMetric, s_Parameters.m_PenDefaultSize, m_Parent->m_InternalUnits ) ); } +void DIALOG_PRINT_USING_PRINTER::OnScaleSelectionClick( wxCommandEvent& event ) +{ + double scale = s_ScaleList[m_ScaleOption->GetSelection()]; + bool enable = (scale == 1.0); + if( m_FineAdjustXscaleOpt ) + m_FineAdjustXscaleOpt->Enable(enable); + if( m_FineAdjustYscaleOpt ) + m_FineAdjustYscaleOpt->Enable(enable); +} + /**********************************************************/ void DIALOG_PRINT_USING_PRINTER::OnPageSetup( wxCommandEvent& event ) diff --git a/pcbnew/dialog_print_using_printer_base.cpp b/pcbnew/dialog_print_using_printer_base.cpp index d04c8612b1..5a03b9e18f 100644 --- a/pcbnew/dialog_print_using_printer_base.cpp +++ b/pcbnew/dialog_print_using_printer_base.cpp @@ -148,6 +148,7 @@ DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* pare // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnCloseWindow ) ); + m_ScaleOption->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnScaleSelectionClick ), NULL, this ); 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 ); @@ -158,6 +159,7 @@ 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_ScaleOption->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnScaleSelectionClick ), NULL, this ); 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 ); diff --git a/pcbnew/dialog_print_using_printer_base.fbp b/pcbnew/dialog_print_using_printer_base.fbp index d0ff578762..a6621135b6 100644 --- a/pcbnew/dialog_print_using_printer_base.fbp +++ b/pcbnew/dialog_print_using_printer_base.fbp @@ -234,7 +234,7 @@ - + OnScaleSelectionClick diff --git a/pcbnew/dialog_print_using_printer_base.h b/pcbnew/dialog_print_using_printer_base.h index 66cdd24462..38d342159e 100644 --- a/pcbnew/dialog_print_using_printer_base.h +++ b/pcbnew/dialog_print_using_printer_base.h @@ -67,6 +67,7 @@ class DIALOG_PRINT_USING_PRINTER_base : public wxDialog // Virtual event handlers, overide them in your derived class virtual void OnCloseWindow( wxCloseEvent& event ){ event.Skip(); } + virtual void OnScaleSelectionClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnPageSetup( wxCommandEvent& event ){ event.Skip(); } virtual void OnPrintPreview( wxCommandEvent& event ){ event.Skip(); } virtual void OnPrintButtonClick( wxCommandEvent& event ){ event.Skip(); } diff --git a/pcbnew/dimension.cpp b/pcbnew/dimension.cpp index 382e696977..3e97a63b0d 100644 --- a/pcbnew/dimension.cpp +++ b/pcbnew/dimension.cpp @@ -4,10 +4,12 @@ #include "fctsys.h" #include "common.h" +#include "confirm.h" #include "class_drawpanel.h" #include "pcbnew.h" #include "wxPcbStruct.h" #include "class_board_design_settings.h" +#include "drawtxt.h" /* Routines Locales */ static void Exit_EditCotation( WinEDA_DrawPanel* Panel, wxDC* DC ); @@ -23,10 +25,10 @@ static int status_cotation; /* = 0 : pas de cotation en cours * Les routines generent une cotation de la forme * - cote usuelle: * - | | - | dist | - |<---------->| - | | + * | | + * | dist | + * |<---------->| + * | | * */ @@ -40,10 +42,10 @@ enum id_Cotation_properties { }; /************************************/ -/* class WinEDA_CotationPropertiesFrame */ +/* class DIMENSION_EDITOR_DIALOG */ /************************************/ -class WinEDA_CotationPropertiesFrame : public wxDialog +class DIMENSION_EDITOR_DIALOG : public wxDialog { private: @@ -59,9 +61,9 @@ private: public: // Constructor and destructor - WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame* parent, + DIMENSION_EDITOR_DIALOG( WinEDA_PcbFrame* parent, COTATION* Cotation, wxDC* DC, const wxPoint& pos ); - ~WinEDA_CotationPropertiesFrame() + ~DIMENSION_EDITOR_DIALOG() { } @@ -73,13 +75,13 @@ private: DECLARE_EVENT_TABLE() }; -BEGIN_EVENT_TABLE( WinEDA_CotationPropertiesFrame, wxDialog ) -EVT_BUTTON( wxID_OK, WinEDA_CotationPropertiesFrame::OnOkClick ) -EVT_BUTTON( wxID_CANCEL, WinEDA_CotationPropertiesFrame::OnCancelClick ) +BEGIN_EVENT_TABLE( DIMENSION_EDITOR_DIALOG, wxDialog ) +EVT_BUTTON( wxID_OK, DIMENSION_EDITOR_DIALOG::OnOkClick ) +EVT_BUTTON( wxID_CANCEL, DIMENSION_EDITOR_DIALOG::OnCancelClick ) END_EVENT_TABLE() -WinEDA_CotationPropertiesFrame::WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame* parent, +DIMENSION_EDITOR_DIALOG::DIMENSION_EDITOR_DIALOG( WinEDA_PcbFrame* parent, COTATION* Cotation, wxDC* DC, const wxPoint& framepos ) : wxDialog( parent, -1, _( "Dimension properties" ), framepos, wxSize( 340, 270 ), @@ -146,7 +148,7 @@ WinEDA_CotationPropertiesFrame::WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame* /**********************************************************************/ -void WinEDA_CotationPropertiesFrame::OnCancelClick( wxCommandEvent& WXUNUSED (event) ) +void DIMENSION_EDITOR_DIALOG::OnCancelClick( wxCommandEvent& WXUNUSED (event) ) /**********************************************************************/ { EndModal( -1 ); @@ -154,7 +156,7 @@ void WinEDA_CotationPropertiesFrame::OnCancelClick( wxCommandEvent& WXUNUSED (ev /***********************************************************************************/ -void WinEDA_CotationPropertiesFrame::OnOkClick( wxCommandEvent& event ) +void DIMENSION_EDITOR_DIALOG::OnOkClick( wxCommandEvent& event ) /***********************************************************************************/ { if( m_DC ) // Effacement ancien texte @@ -169,8 +171,16 @@ void WinEDA_CotationPropertiesFrame::OnOkClick( wxCommandEvent& event ) } CurrentCotation->m_Text->m_Size = m_TxtSizeCtrl->GetValue(); - CurrentCotation->m_Text->m_Width = CurrentCotation->m_Width = - m_TxtWidthCtrl->GetValue(); + + int width = m_TxtWidthCtrl->GetValue(); + int maxthickness = Clamp_Text_PenSize(width, CurrentCotation->m_Text->m_Size ); + if( width > maxthickness ) + { + DisplayError(NULL, _("The text thickness is too large for the text size. It will be clamped")); + width = maxthickness; + } + CurrentCotation->m_Text->m_Width = CurrentCotation->m_Width = width ; + CurrentCotation->m_Text->m_Mirror = (m_Mirror->GetSelection() == 1) ? true : false; CurrentCotation->SetLayer( m_SelLayerBox->GetChoice() + FIRST_NO_COPPER_LAYER ); @@ -227,8 +237,6 @@ COTATION* WinEDA_PcbFrame::Begin_Cotation( COTATION* Cotation, wxDC* DC ) Cotation->m_Flags = IS_NEW; Cotation->SetLayer( getActiveLayer() ); - Cotation->m_Width = GetBoard()->GetBoardDesignSettings()->m_DrawSegmentWidth; - Cotation->m_Text->m_Width = Cotation->m_Width; Cotation->Barre_ox = Cotation->Barre_fx = pos.x; Cotation->Barre_oy = Cotation->Barre_fy = pos.y; @@ -252,8 +260,14 @@ COTATION* WinEDA_PcbFrame::Begin_Cotation( COTATION* Cotation, wxDC* DC ) Cotation->FlecheD2_oy = Cotation->FlecheD2_fy = pos.y; Cotation->m_Text->m_Size = GetBoard()->GetBoardDesignSettings()->m_PcbTextSize; - Cotation->m_Text->m_Width = GetBoard()->GetBoardDesignSettings()->m_PcbTextWidth; - + int width = GetBoard()->GetBoardDesignSettings()->m_PcbTextWidth; + int maxthickness = Clamp_Text_PenSize(width, Cotation->m_Text->m_Size ); + if( width > maxthickness ) + { + width = maxthickness; + } + Cotation->m_Text->m_Width = Cotation->m_Width = width ; + Ajuste_Details_Cotation( Cotation ); Cotation->Draw( DrawPanel, DC, GR_XOR ); @@ -273,8 +287,11 @@ COTATION* WinEDA_PcbFrame::Begin_Cotation( COTATION* Cotation, wxDC* DC ) Cotation->Draw( DrawPanel, DC, GR_OR ); Cotation->m_Flags = 0; - /* Insertion de la structure dans le Chainage .Drawings du PCB */ + /* ADD this new item in list */ GetBoard()->Add( Cotation ); + + // Add store it in undo/redo list + SaveCopyInUndoList( Cotation, UR_NEW ); OnModify(); DrawPanel->ManageCurseur = NULL; @@ -347,8 +364,7 @@ void WinEDA_PcbFrame::Install_Edit_Cotation( COTATION* Cotation, if( Cotation == NULL ) return; - WinEDA_CotationPropertiesFrame* frame = new WinEDA_CotationPropertiesFrame( this, - Cotation, DC, pos ); + DIMENSION_EDITOR_DIALOG* frame = new DIMENSION_EDITOR_DIALOG( this, Cotation, DC, pos ); Ajuste_Details_Cotation( Cotation, true ); frame->ShowModal(); diff --git a/pcbnew/onleftclick.cpp b/pcbnew/onleftclick.cpp index 75b02e6c2e..12049e933e 100644 --- a/pcbnew/onleftclick.cpp +++ b/pcbnew/onleftclick.cpp @@ -88,6 +88,10 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) } break; + case TYPE_COTATION: + // see above. + break; + default: if( m_ID_current_state == 0 ) { @@ -348,7 +352,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) DrawPanel->m_AutoPAN_Request = true; } else - DisplayError( this, wxT( "Internal err: Struct not COTATION" ) ); + DisplayError( this, wxT( "WinEDA_PcbFrame::OnLeftClick() error item is not a DIMENSION" ) ); break; case ID_PCB_DELETE_ITEM_BUTT: diff --git a/pcbnew/plot_rtn.cpp b/pcbnew/plot_rtn.cpp index 1553089428..b1a25d5172 100644 --- a/pcbnew/plot_rtn.cpp +++ b/pcbnew/plot_rtn.cpp @@ -262,11 +262,17 @@ static void PlotTextModule( PLOTTER* plotter, TEXTE_MODULE* pt_texte, if( pt_texte->m_Mirror ) NEGATE( size.x ); // Text is mirrored + // Non bold texts thickness is clamped at 1/6 char size by the low level draw function. + // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size + // (like bold text) and we manage the thickness. + // So we set bold flag to true + bool allow_bold = pt_texte->m_Bold || thickness; + plotter->text( pos, BLACK, pt_texte->m_Text, orient, size, pt_texte->m_HJustify, pt_texte->m_VJustify, - thickness, pt_texte->m_Italic, pt_texte->m_Bold ); + thickness, pt_texte->m_Italic, allow_bold ); } @@ -511,6 +517,12 @@ void PlotTextePcb( PLOTTER* plotter, TEXTE_PCB* pt_texte, int masque_layer, if( pt_texte->m_Mirror ) size.x = -size.x; + // Non bold texts thickness is clamped at 1/6 char size by the low level draw function. + // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size + // (like bold text) and we manage the thickness. + // So we set bold flag to true + bool allow_bold = pt_texte->m_Bold || thickness; + if( pt_texte->m_MultilineAllowed ) { wxArrayString* list = wxStringSplit( pt_texte->m_Text, '\n' ); @@ -526,7 +538,7 @@ void PlotTextePcb( PLOTTER* plotter, TEXTE_PCB* pt_texte, int masque_layer, txt, orient, size, pt_texte->m_HJustify, pt_texte->m_VJustify, - thickness, pt_texte->m_Italic, pt_texte->m_Bold ); + thickness, pt_texte->m_Italic, allow_bold ); pos += offset; } @@ -537,7 +549,7 @@ void PlotTextePcb( PLOTTER* plotter, TEXTE_PCB* pt_texte, int masque_layer, pt_texte->m_Text, orient, size, pt_texte->m_HJustify, pt_texte->m_VJustify, - thickness, pt_texte->m_Italic, pt_texte->m_Bold ); + thickness, pt_texte->m_Italic, allow_bold ); }