X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f5419957e5794f2d10f4e125f77b2c2e2cd222d6..a5dec9e54d060377eb6009baa3db86aafa6a018a:/include/wx/prntbase.h diff --git a/include/wx/prntbase.h b/include/wx/prntbase.h index f484b7a925..6861da9218 100644 --- a/include/wx/prntbase.h +++ b/include/wx/prntbase.h @@ -49,8 +49,8 @@ public: virtual wxWindow *CreateAbortWindow(wxWindow *parent, wxPrintout *printout); virtual void ReportError(wxWindow *parent, wxPrintout *printout, char *message); - inline wxPrintData& GetPrintData() { return m_printData; }; - inline bool GetAbort() { return sm_abortIt; } + inline wxPrintData& GetPrintData() const { return (wxPrintData&) m_printData; }; + inline bool GetAbort() const { return sm_abortIt; } /////////////////////////////////////////////////////////////////////////// // OVERRIDES @@ -96,21 +96,21 @@ public: virtual bool OnPrintPage(int page) = 0; virtual void GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo); - inline virtual wxString GetTitle() { return m_printoutTitle; } + inline virtual wxString GetTitle() const { return m_printoutTitle; } - inline wxDC *GetDC() { return m_printoutDC; } + inline wxDC *GetDC() const { return m_printoutDC; } inline void SetDC(wxDC *dc) { m_printoutDC = dc; } inline void SetPageSizePixels(int w, int h) { m_pageWidthPixels = w; m_pageHeightPixels = h; } - inline void GetPageSizePixels(int *w, int *h) { *w = m_pageWidthPixels; *h = m_pageHeightPixels; } + inline void GetPageSizePixels(int *w, int *h) const { *w = m_pageWidthPixels; *h = m_pageHeightPixels; } inline void SetPageSizeMM(int w, int h) { m_pageWidthMM = w; m_pageHeightMM = h; } - inline void GetPageSizeMM(int *w, int *h) { *w = m_pageWidthMM; *h = m_pageHeightMM; } + inline void GetPageSizeMM(int *w, int *h) const { *w = m_pageWidthMM; *h = m_pageHeightMM; } inline void SetPPIScreen(int x, int y) { m_PPIScreenX = x; m_PPIScreenY = y; } - inline void GetPPIScreen(int *x, int *y) { *x = m_PPIScreenX; *y = m_PPIScreenY; } + inline void GetPPIScreen(int *x, int *y) const { *x = m_PPIScreenX; *y = m_PPIScreenY; } inline void SetPPIPrinter(int x, int y) { m_PPIPrinterX = x; m_PPIPrinterY = y; } - inline void GetPPIPrinter(int *x, int *y) { *x = m_PPIPrinterX; *y = m_PPIPrinterY; } + inline void GetPPIPrinter(int *x, int *y) const { *x = m_PPIPrinterX; *y = m_PPIPrinterY; } - inline virtual bool IsPreview() { return m_isPreview; } + inline virtual bool IsPreview() const { return m_isPreview; } inline virtual void SetIsPreview(bool p) { m_isPreview = p; } @@ -173,7 +173,7 @@ public: long style = wxDEFAULT_FRAME_STYLE, const wxString& name = "frame"); ~wxPreviewFrame(); - bool OnClose(); + void OnCloseWindow(wxCloseEvent& event); virtual void Initialize(); virtual void CreateCanvas(); virtual void CreateControlBar(); @@ -182,6 +182,8 @@ protected: wxWindow* m_previewCanvas; wxPreviewControlBar* m_controlBar; wxPrintPreviewBase* m_printPreview; + +DECLARE_EVENT_TABLE() }; /* @@ -221,7 +223,7 @@ public: inline virtual wxPrintPreviewBase *GetPrintPreview() const { return m_printPreview; } void OnPrint(wxCommandEvent& event); - void OnClose(wxCommandEvent& event); + void OnWindowClose(wxCommandEvent& event); void OnNext(wxCommandEvent& event); void OnPrevious(wxCommandEvent& event); void OnZoom(wxCommandEvent& event); @@ -338,5 +340,47 @@ public: DECLARE_EVENT_TABLE() }; +/* + * Again, this only really needed for non-Windows platforms + * or if you want to test the PostScript printing under Windows, + * or if you're using the generic page setup dialog under e.g. Win16. + */ + +class WXDLLEXPORT wxPrintPaperType: public wxObject +{ +public: + wxPrintPaperType(const char *name = (const char *) NULL, int wmm = 0, int hmm = 0, int wp = 0, int hp = 0); + ~wxPrintPaperType(); + +public: + int widthMM; + int heightMM; + int widthPixels; + int heightPixels; + char *pageName; + +private: + DECLARE_DYNAMIC_CLASS(wxPrintPaperType) +}; + +class WXDLLEXPORT wxPrintPaperDatabase: public wxList +{ +public: + wxPrintPaperDatabase(); + ~wxPrintPaperDatabase(); + + void CreateDatabase(); + void ClearDatabase(); + + void AddPaperType(const char *name, int wmm, int hmm, int wp, int hp); + wxPrintPaperType *FindPaperType(const char *name); + +private: + DECLARE_DYNAMIC_CLASS(wxPrintPaperDatabase) +}; + +WXDLLEXPORT_DATA(extern wxPrintPaperDatabase*) wxThePrintPaperDatabase; + + #endif // _WX_PRNTBASEH__