]> git.saurik.com Git - wxWidgets.git/commitdiff
adding reverse orientation
authorStefan Csomor <csomor@advancedconcepts.ch>
Thu, 9 Nov 2006 19:48:18 +0000 (19:48 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Thu, 9 Nov 2006 19:48:18 +0000 (19:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43232 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/cmndata.h
src/mac/carbon/printmac.cpp

index 2af5f9e2e3d52c5afb37d7414e89c5a7c941d1d8..8127d23d073f43d002f6ef2371c53fac5a697f3f 100644 (file)
@@ -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;
index 6df266562e57e352bfe3e06023ae63e6ce37aaa7..1a1086cd93d9bcf11fa714e6115a9967bf9ba3bd 100644 (file)
@@ -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