- public:
-#if defined(__WIN95__)
- void* m_pageSetupData;
-#endif
- wxPoint m_paperSize;
- wxPoint m_minMarginTopLeft;
- wxPoint m_minMarginBottomRight;
- wxPoint m_marginTopLeft;
- wxPoint m_marginBottomRight;
- int m_orientation;
-
- // Flags
- bool m_defaultMinMargins;
- bool m_enableMargins;
- bool m_enableOrientation;
- bool m_enablePaper;
- bool m_enablePrinter;
- bool m_getDefaultInfo; // Equiv. to PSD_RETURNDEFAULT
- bool m_enableHelp;
-
- wxPageSetupData(void);
- ~wxPageSetupData(void);
-
- inline wxPoint GetPaperSize(void) { return m_paperSize; };
- inline wxPoint GetMinMarginTopLeft(void) { return m_minMarginTopLeft; };
- inline wxPoint GetMinMarginBottomRight(void) { return m_minMarginBottomRight; };
- inline wxPoint GetMarginTopLeft(void) { return m_marginTopLeft; };
- inline wxPoint GetMarginBottomRight(void) { return m_marginBottomRight; };
- inline int GetOrientation(void) { return m_orientation; };
-
- inline bool GetDefaultMinMargins(void) { return m_defaultMinMargins; };
- inline bool GetEnableMargins(void) { return m_enableMargins; };
- inline bool GetEnableOrientation(void) { return m_enableOrientation; };
- inline bool GetEnablePaper(void) { return m_enablePaper; };
- inline bool GetEnablePrinter(void) { return m_enablePrinter; };
- inline bool GetDefaultInfo(void) { return m_getDefaultInfo; };
- inline bool GetEnableHelp(void) { return m_enableHelp; };
-
- inline void SetPaperSize(const wxPoint& pt) { m_paperSize = pt; };
- inline void SetMinMarginTopLeft(const wxPoint& pt) { m_minMarginTopLeft = pt; };
- inline void SetMinMarginBottomRight(const wxPoint& pt) { m_minMarginBottomRight = pt; };
- inline void SetMarginTopLeft(const wxPoint& pt) { m_marginTopLeft = pt; };
- inline void SetMarginBottomRight(const wxPoint& pt) { m_marginBottomRight = pt; };
- inline void SetOrientation(int orient) { m_orientation = orient; };
- inline void SetDefaultMinMargins(bool flag) { m_defaultMinMargins = flag; };
- inline void SetDefaultInfo(bool flag) { m_getDefaultInfo = flag; };
-
- inline void EnableMargins(bool flag) { m_enableMargins = flag; };
- inline void EnableOrientation(bool flag) { m_enableOrientation = flag; };
- inline void EnablePaper(bool flag) { m_enablePaper = flag; };
- inline void EnablePrinter(bool flag) { m_enablePrinter = flag; };
- inline void EnableHelp(bool flag) { m_enableHelp = flag; };
-
-#if defined(__WIN95__)
- // Convert to/from the PAGESETUPDLG structure
- void ConvertToNative(void);
- void ConvertFromNative(void);
- void SetOwnerWindow(wxWindow* win);
- inline void* GetNativeData(void) { return m_pageSetupData; }
-#endif
-
- void operator=(const wxPageSetupData& data);
+class WXDLLIMPEXP_CORE wxPageSetupDialogData: public wxObject
+{
+public:
+ wxPageSetupDialogData();
+ wxPageSetupDialogData(const wxPageSetupDialogData& dialogData);
+ wxPageSetupDialogData(const wxPrintData& printData);
+ virtual ~wxPageSetupDialogData();
+
+ wxSize GetPaperSize() const { return m_paperSize; }
+ wxPaperSize GetPaperId() const { return m_printData.GetPaperId(); }
+ wxPoint GetMinMarginTopLeft() const { return m_minMarginTopLeft; }
+ wxPoint GetMinMarginBottomRight() const { return m_minMarginBottomRight; }
+ wxPoint GetMarginTopLeft() const { return m_marginTopLeft; }
+ wxPoint GetMarginBottomRight() const { return m_marginBottomRight; }
+
+ bool GetDefaultMinMargins() const { return m_defaultMinMargins; }
+ bool GetEnableMargins() const { return m_enableMargins; }
+ bool GetEnableOrientation() const { return m_enableOrientation; }
+ bool GetEnablePaper() const { return m_enablePaper; }
+ bool GetEnablePrinter() const { return m_enablePrinter; }
+ bool GetDefaultInfo() const { return m_getDefaultInfo; }
+ bool GetEnableHelp() const { return m_enableHelp; }
+
+ // Is this data OK for showing the page setup dialog?
+ bool Ok() const { return IsOk(); }
+ bool IsOk() const { return m_printData.IsOk() ; }
+
+ // If a corresponding paper type is found in the paper database, will set the m_printData
+ // paper size id member as well.
+ void SetPaperSize(const wxSize& sz);
+
+ void SetPaperId(wxPaperSize id) { m_printData.SetPaperId(id); }
+
+ // Sets the wxPrintData id, plus the paper width/height if found in the paper database.
+ void SetPaperSize(wxPaperSize id);
+
+ void SetMinMarginTopLeft(const wxPoint& pt) { m_minMarginTopLeft = pt; }
+ void SetMinMarginBottomRight(const wxPoint& pt) { m_minMarginBottomRight = pt; }
+ void SetMarginTopLeft(const wxPoint& pt) { m_marginTopLeft = pt; }
+ void SetMarginBottomRight(const wxPoint& pt) { m_marginBottomRight = pt; }
+ void SetDefaultMinMargins(bool flag) { m_defaultMinMargins = flag; }
+ void SetDefaultInfo(bool flag) { m_getDefaultInfo = flag; }
+
+ void EnableMargins(bool flag) { m_enableMargins = flag; }
+ void EnableOrientation(bool flag) { m_enableOrientation = flag; }
+ void EnablePaper(bool flag) { m_enablePaper = flag; }
+ void EnablePrinter(bool flag) { m_enablePrinter = flag; }
+ void EnableHelp(bool flag) { m_enableHelp = flag; }
+
+ // Use paper size defined in this object to set the wxPrintData
+ // paper id
+ void CalculateIdFromPaperSize();
+
+ // Use paper id in wxPrintData to set this object's paper size
+ void CalculatePaperSizeFromId();
+
+ wxPageSetupDialogData& operator=(const wxPageSetupData& data);
+ wxPageSetupDialogData& operator=(const wxPrintData& data);
+
+ wxPrintData& GetPrintData() { return m_printData; }
+ const wxPrintData& GetPrintData() const { return m_printData; }
+ void SetPrintData(const wxPrintData& printData);
+
+private:
+ wxSize m_paperSize; // The dimensions selected by the user (on return, same as in wxPrintData?)
+ wxPoint m_minMarginTopLeft;
+ wxPoint m_minMarginBottomRight;
+ wxPoint m_marginTopLeft;
+ wxPoint m_marginBottomRight;
+ bool m_defaultMinMargins;
+ bool m_enableMargins;
+ bool m_enableOrientation;
+ bool m_enablePaper;
+ bool m_enablePrinter;
+ bool m_getDefaultInfo; // Equiv. to PSD_RETURNDEFAULT
+ bool m_enableHelp;
+ wxPrintData m_printData;
+
+private:
+ DECLARE_DYNAMIC_CLASS(wxPageSetupDialogData)