Change wxPrintData::SetOrientation() to take wxPrintOrientation instead of
int.
Closes #11393.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62823
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- wxValidator::SetBellOnError() incorrectly interpreted its argument (it
disabled the bell when it was true) and was replaced by SuppressBellOnError()
with more expected semantics.
- wxValidator::SetBellOnError() incorrectly interpreted its argument (it
disabled the bell when it was true) and was replaced by SuppressBellOnError()
with more expected semantics.
+- wxPORTRAIT and wxLANDSCAPE are now elements of wxPrintOrientation enum and
+ wxPrintData::SetOrientation(int) takes wxPrintOrientation and not int.
Major new features in this release
Major new features in this release
int GetNoCopies() const { return m_printNoCopies; }
bool GetCollate() const { return m_printCollate; }
int GetNoCopies() const { return m_printNoCopies; }
bool GetCollate() const { return m_printCollate; }
- int GetOrientation() const { return m_printOrientation; }
+ wxPrintOrientation GetOrientation() const { return m_printOrientation; }
bool IsOrientationReversed() const { return m_printOrientationReversed; }
// Is this data OK for showing the print dialog?
bool IsOrientationReversed() const { return m_printOrientationReversed; }
// Is this data OK for showing the print dialog?
void SetNoCopies(int v) { m_printNoCopies = v; }
void SetCollate(bool flag) { m_printCollate = flag; }
void SetNoCopies(int v) { m_printNoCopies = v; }
void SetCollate(bool flag) { m_printCollate = flag; }
- void SetOrientation(int orient) { m_printOrientation = orient; }
+
+ // Please use the overloaded method below
+ wxDEPRECATED_INLINE(void SetOrientation(int orient),
+ m_printOrientation = (wxPrintOrientation)orient; )
+ void SetOrientation(wxPrintOrientation orient) { m_printOrientation = orient; }
void SetOrientationReversed(bool reversed) { m_printOrientationReversed = reversed; }
void SetPrinterName(const wxString& name) { m_printerName = name; }
void SetOrientationReversed(bool reversed) { m_printOrientationReversed = reversed; }
void SetPrinterName(const wxString& name) { m_printerName = name; }
wxPrintMode m_printMode;
int m_printNoCopies;
wxPrintMode m_printMode;
int m_printNoCopies;
- int m_printOrientation;
+ wxPrintOrientation m_printOrientation;
bool m_printOrientationReversed;
bool m_printCollate;
bool m_printOrientationReversed;
bool m_printCollate;
} wxPaperSize;
/* Printing orientation */
} wxPaperSize;
/* Printing orientation */
-#ifndef wxPORTRAIT
-#define wxPORTRAIT 1
-#define wxLANDSCAPE 2
-#endif
+enum wxPrintOrientation
+{
+ wxPORTRAIT = 1,
+ wxLANDSCAPE
+};
/* Duplex printing modes
*/
/* Duplex printing modes
*/
wxPrinterDCImpl(const wxString& driver, const wxString& device,
const wxString& output,
bool interactive = true,
wxPrinterDCImpl(const wxString& driver, const wxString& device,
const wxString& output,
bool interactive = true,
- int orientation = wxPORTRAIT);
+ wxPrintOrientation orientation = wxPORTRAIT);
virtual ~wxPrinterDC();
wxRect GetPaperRect() const;
virtual ~wxPrinterDC();
wxRect GetPaperRect() const;
{
public:
// Create a printer DC (obsolete function: use wxPrintData version now)
{
public:
// Create a printer DC (obsolete function: use wxPrintData version now)
- wxPrinterDC(const wxString& driver, const wxString& device, const wxString& output, bool interactive = TRUE, int orientation = wxPORTRAIT);
+ wxPrinterDC(const wxString& driver, const wxString& device, const wxString& output, bool interactive = TRUE, wxPrintOrientation orientation = wxPORTRAIT);
// Create from print data
wxPrinterDC(const wxPrintData& data);
// Create from print data
wxPrinterDC(const wxPrintData& data);
DECLARE_CLASS(wxPrinterDC)
// Create a printer DC
DECLARE_CLASS(wxPrinterDC)
// Create a printer DC
- wxPrinterDC(const wxString& driver, const wxString& device, const wxString& output, bool interactive = TRUE, int orientation = wxPORTRAIT);
+ wxPrinterDC(const wxString& driver, const wxString& device, const wxString& output, bool interactive = TRUE, wxPrintOrientation orientation = wxPORTRAIT);
virtual ~wxPrinterDC();
};
virtual ~wxPrinterDC();
};
/**
Gets the orientation. This can be wxLANDSCAPE or wxPORTRAIT.
*/
/**
Gets the orientation. This can be wxLANDSCAPE or wxPORTRAIT.
*/
- int GetOrientation() const;
+ wxPrintOrientation GetOrientation() const;
/**
Returns the paper size id.
/**
Returns the paper size id.
/**
Sets the orientation. This can be wxLANDSCAPE or wxPORTRAIT.
*/
/**
Sets the orientation. This can be wxLANDSCAPE or wxPORTRAIT.
*/
- void SetOrientation(int orientation);
+ void SetOrientation(wxPrintOrientation orientation);
/**
Sets the paper id. This indicates the type of paper to be used. For a
/**
Sets the paper id. This indicates the type of paper to be used. For a
wxPAPER_PENV_10_ROTATED ///< PRC Envelope #10 Rotated 458 x 324 m
};
wxPAPER_PENV_10_ROTATED ///< PRC Envelope #10 Rotated 458 x 324 m
};
+/**
+ Printing orientation
+*/
+
+enum wxPrintOrientation
+{
+ wxPORTRAIT,
+ wxLANDSCAPE
+};
/**
Duplex printing modes.
/**
Duplex printing modes.
const wxString& device_name,
const wxString& file,
bool interactive,
const wxString& device_name,
const wxString& file,
bool interactive,
+ wxPrintOrientation orientation)
{
m_isInteractive = interactive;
{
m_isInteractive = interactive;
//// Orientation
if (devMode->dmFields & DM_ORIENTATION)
//// Orientation
if (devMode->dmFields & DM_ORIENTATION)
- data.SetOrientation( devMode->dmOrientation );
+ data.SetOrientation( (wxPrintOrientation)devMode->dmOrientation );
//// Collation
if (devMode->dmFields & DM_COLLATE)
//// Collation
if (devMode->dmFields & DM_COLLATE)
const wxString& device_name,
const wxString& file,
bool interactive,
const wxString& device_name,
const wxString& file,
bool interactive,
+ wxPrintOrientation orientation)