From b142b9defe0a4285e24c2fd55c6a1401f755071f Mon Sep 17 00:00:00 2001 From: Dick Hollenbeck Date: Tue, 17 Jan 2012 09:34:05 -0600 Subject: [PATCH] set paper orientation into wxPrintData when possible --- gerbview/dialogs/dialog_print_using_printer.cpp | 8 +++++--- pcbnew/dialogs/dialog_print_for_modedit.cpp | 6 ++++-- pcbnew/dialogs/dialog_print_using_printer.cpp | 5 +++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/gerbview/dialogs/dialog_print_using_printer.cpp b/gerbview/dialogs/dialog_print_using_printer.cpp index a55a704374..fecd700cb0 100644 --- a/gerbview/dialogs/dialog_print_using_printer.cpp +++ b/gerbview/dialogs/dialog_print_using_printer.cpp @@ -59,7 +59,7 @@ private: void OnPageSetup( wxCommandEvent& event ); void OnPrintPreview( wxCommandEvent& event ); void OnPrintButtonClick( wxCommandEvent& event ); - void OnScaleSelectionClick( wxCommandEvent& event ); + void OnScaleSelectionClick( wxCommandEvent& event ); void OnButtonCancelClick( wxCommandEvent& event ) { Close(); } void SetPrintParameters( ); @@ -95,12 +95,14 @@ void GERBVIEW_FRAME::ToPrinter( wxCommandEvent& event ) DisplayError( this, _( "Error Init Printer info" ) ); } g_PrintData->SetQuality( wxPRINT_QUALITY_HIGH ); // Default resolution = HIGHT; - g_PrintData->SetOrientation( DEFAULT_ORIENTATION_PAPER ); } + g_PrintData->SetOrientation( GetPageSettings().IsPortrait() ? wxPORTRAIT : wxLANDSCAPE ); + DIALOG_PRINT_USING_PRINTER* frame = new DIALOG_PRINT_USING_PRINTER( this ); - frame->ShowModal(); frame->Destroy(); + frame->ShowModal(); + frame->Destroy(); } diff --git a/pcbnew/dialogs/dialog_print_for_modedit.cpp b/pcbnew/dialogs/dialog_print_for_modedit.cpp index 38602c898b..88259fbe10 100644 --- a/pcbnew/dialogs/dialog_print_for_modedit.cpp +++ b/pcbnew/dialogs/dialog_print_for_modedit.cpp @@ -70,12 +70,14 @@ void FOOTPRINT_EDIT_FRAME::ToPrinter( wxCommandEvent& event ) DisplayError( this, _( "Error Init Printer info" ) ); } s_PrintData->SetQuality( wxPRINT_QUALITY_HIGH ); // Default resolution = HIGHT; - s_PrintData->SetOrientation( DEFAULT_ORIENTATION_PAPER ); } + s_PrintData->SetOrientation( GetPageSettings().IsPortrait() ? wxPORTRAIT : wxLANDSCAPE ); + DIALOG_PRINT_FOR_MODEDIT* frame = new DIALOG_PRINT_FOR_MODEDIT( this ); - frame->ShowModal(); frame->Destroy(); + frame->ShowModal(); + frame->Destroy(); } /*************************************************************************************/ diff --git a/pcbnew/dialogs/dialog_print_using_printer.cpp b/pcbnew/dialogs/dialog_print_using_printer.cpp index ccf6be3f37..70e32b69d7 100644 --- a/pcbnew/dialogs/dialog_print_using_printer.cpp +++ b/pcbnew/dialogs/dialog_print_using_printer.cpp @@ -64,7 +64,7 @@ private: void OnPageSetup( wxCommandEvent& event ); void OnPrintPreview( wxCommandEvent& event ); void OnPrintButtonClick( wxCommandEvent& event ); - void OnScaleSelectionClick( wxCommandEvent& event ); + void OnScaleSelectionClick( wxCommandEvent& event ); void OnButtonCancelClick( wxCommandEvent& event ) { Close(); } void SetPrintParameters( ); @@ -105,9 +105,10 @@ void PCB_EDIT_FRAME::ToPrinter( wxCommandEvent& event ) DisplayError( this, _( "Error Init Printer info" ) ); } s_PrintData->SetQuality( wxPRINT_QUALITY_HIGH ); // Default resolution = HIGHT; - s_PrintData->SetOrientation( DEFAULT_ORIENTATION_PAPER ); } + s_PrintData->SetOrientation( GetPageSettings().IsPortrait() ? wxPORTRAIT : wxLANDSCAPE ); + DIALOG_PRINT_USING_PRINTER* frame = new DIALOG_PRINT_USING_PRINTER( this ); frame->ShowModal(); frame->Destroy();