From 01294df09b99a7909f9478583fd6984fc3162f2b Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 9 Nov 2006 19:48:18 +0000 Subject: [PATCH] adding reverse orientation git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43232 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/cmndata.h | 3 +++ src/mac/carbon/printmac.cpp | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/include/wx/cmndata.h b/include/wx/cmndata.h index 2af5f9e2e3..8127d23d07 100644 --- a/include/wx/cmndata.h +++ b/include/wx/cmndata.h @@ -178,6 +178,7 @@ public: int GetNoCopies() const { return m_printNoCopies; } bool GetCollate() const { return m_printCollate; } int GetOrientation() const { return m_printOrientation; } + bool IsOrientationReversed() const { return m_printOrientationReversed; } // Is this data OK for showing the print dialog? bool Ok() const { return IsOk(); } @@ -197,6 +198,7 @@ public: void SetNoCopies(int v) { m_printNoCopies = v; } void SetCollate(bool flag) { m_printCollate = flag; } void SetOrientation(int orient) { m_printOrientation = orient; } + void SetOrientationReversed(bool reversed) { m_printOrientationReversed = reversed; } void SetPrinterName(const wxString& name) { m_printerName = name; } void SetColour(bool colour) { m_colour = colour; } @@ -254,6 +256,7 @@ private: int m_printNoCopies; int m_printOrientation; + bool m_printOrientationReversed; bool m_printCollate; wxString m_printerName; diff --git a/src/mac/carbon/printmac.cpp b/src/mac/carbon/printmac.cpp index 6df266562e..1a1086cd93 100644 --- a/src/mac/carbon/printmac.cpp +++ b/src/mac/carbon/printmac.cpp @@ -130,8 +130,12 @@ bool wxMacCarbonPrintData::TransferFrom( const wxPrintData &data ) { ValidateOrCreate() ; PMSetCopies( (PMPrintSettings) m_macPrintSettings , data.GetNoCopies() , false ) ; - PMSetOrientation( (PMPageFormat) m_macPageFormat , ( data.GetOrientation() == wxLANDSCAPE ) ? - kPMLandscape : kPMPortrait , false ) ; + if ( data.IsOrientationReversed() ) + PMSetOrientation( (PMPageFormat) m_macPageFormat , ( data.GetOrientation() == wxLANDSCAPE ) ? + kPMReverseLandscape : kPMReversePortrait , false ) ; + else + PMSetOrientation( (PMPageFormat) m_macPageFormat , ( data.GetOrientation() == wxLANDSCAPE ) ? + kPMLandscape : kPMPortrait , false ) ; // collate cannot be set #if 0 // not yet tested if ( !m_printerName.empty() ) @@ -188,9 +192,15 @@ bool wxMacCarbonPrintData::TransferTo( wxPrintData &data ) if ( err == noErr ) { if ( orientation == kPMPortrait || orientation == kPMReversePortrait ) + { data.SetOrientation( wxPORTRAIT ); + data.SetOrientationReversed( orientation == kPMReversePortrait ); + } else + { data.SetOrientation( wxLANDSCAPE ); + data.SetOrientationReversed( orientation == kPMReverseLandscape ); + } } // collate cannot be set -- 2.45.2