adding reverse orientation

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43232 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2006-11-09 19:48:18 +00:00
parent 4d5364211d
commit 01294df09b
2 changed files with 15 additions and 2 deletions

View 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;

View File

@@ -130,6 +130,10 @@ bool wxMacCarbonPrintData::TransferFrom( const wxPrintData &data )
{
ValidateOrCreate() ;
PMSetCopies( (PMPrintSettings) m_macPrintSettings , data.GetNoCopies() , 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
@@ -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