X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6df6e35a3eae74404f15f8f7c09ce19c29f47b4a..19f87dbe255b5e85236547bfb4e20ad310644373:/include/wx/richtext/richtextprint.h?ds=inline diff --git a/include/wx/richtext/richtextprint.h b/include/wx/richtext/richtextprint.h index 4a45c4e343..8ca2e80bb3 100644 --- a/include/wx/richtext/richtextprint.h +++ b/include/wx/richtext/richtextprint.h @@ -44,7 +44,7 @@ class WXDLLIMPEXP_RICHTEXT wxRichTextHeaderFooterData: public wxObject { public: wxRichTextHeaderFooterData() { Init(); } - wxRichTextHeaderFooterData(const wxRichTextHeaderFooterData& data) { Copy(data); } + wxRichTextHeaderFooterData(const wxRichTextHeaderFooterData& data): wxObject() { Copy(data); } /// Initialise void Init() { m_headerMargin = 20; m_footerMargin = 20; m_showOnFirstPage = true; } @@ -107,7 +107,7 @@ private: class WXDLLIMPEXP_RICHTEXT wxRichTextPrintout : public wxPrintout { public: - wxRichTextPrintout(const wxString& title = wxT("Printout")); + wxRichTextPrintout(const wxString& title = _("Printout")); virtual ~wxRichTextPrintout(); /// The buffer to print @@ -119,7 +119,7 @@ public: const wxRichTextHeaderFooterData& GetHeaderFooterData() const { return m_headerFooterData; } /// Sets margins in 10ths of millimetre. Defaults to 1 inch for margins. - void SetMargins(int top = 252, int bottom = 252, int left = 252, int right = 252); + void SetMargins(int top = 254, int bottom = 254, int left = 254, int right = 254); /// Calculate scaling and rectangles, setting the device context scaling void CalculateScaling(wxDC* dc, wxRect& textRect, wxRect& headerRect, wxRect& footerRect); @@ -145,11 +145,12 @@ private: int m_numPages; wxArrayInt m_pageBreaksStart; wxArrayInt m_pageBreaksEnd; + wxArrayInt m_pageYOffsets; int m_marginLeft, m_marginTop, m_marginRight, m_marginBottom; wxRichTextHeaderFooterData m_headerFooterData; - DECLARE_NO_COPY_CLASS(wxRichTextPrintout) + wxDECLARE_NO_COPY_CLASS(wxRichTextPrintout); }; /* @@ -160,7 +161,7 @@ private: class WXDLLIMPEXP_RICHTEXT wxRichTextPrinting : public wxObject { public: - wxRichTextPrinting(const wxString& name = wxT("Printing"), wxWindow *parentWindow = NULL); + wxRichTextPrinting(const wxString& name = _("Printing"), wxWindow *parentWindow = NULL); virtual ~wxRichTextPrinting(); /// Preview the file or buffer @@ -168,8 +169,8 @@ public: bool PreviewBuffer(const wxRichTextBuffer& buffer); /// Print the file or buffer - bool PrintFile(const wxString& richTextFile); - bool PrintBuffer(const wxRichTextBuffer& buffer); + bool PrintFile(const wxString& richTextFile, bool showPrintDialog = true); + bool PrintBuffer(const wxRichTextBuffer& buffer, bool showPrintDialog = true); /// Shows page setup dialog void PageSetup(); @@ -189,10 +190,20 @@ public: /// Show header/footer on first page, or not void SetShowOnFirstPage(bool show) { m_headerFooterData.SetShowOnFirstPage(show); } + /// Set the font + void SetHeaderFooterFont(const wxFont& font) { m_headerFooterData.SetFont(font); } + + /// Set the colour + void SetHeaderFooterTextColour(const wxColour& font) { m_headerFooterData.SetTextColour(font); } + /// Get print and page setup data wxPrintData *GetPrintData(); wxPageSetupDialogData *GetPageSetupData() { return m_pageSetupData; } + /// Set print and page setup data + void SetPrintData(const wxPrintData& printData); + void SetPageSetupData(const wxPageSetupDialogData& pageSetupData); + /// Set the rich text buffer pointer, deleting the existing object if present void SetRichTextBufferPreview(wxRichTextBuffer* buf); wxRichTextBuffer* GetRichTextBufferPreview() const { return m_richTextBufferPreview; } @@ -215,7 +226,7 @@ public: protected: virtual wxRichTextPrintout *CreatePrintout(); virtual bool DoPreview(wxRichTextPrintout *printout1, wxRichTextPrintout *printout2); - virtual bool DoPrint(wxRichTextPrintout *printout); + virtual bool DoPrint(wxRichTextPrintout *printout, bool showPrintDialog); private: wxPrintData* m_printData; @@ -228,7 +239,7 @@ private: wxRichTextBuffer* m_richTextBufferPrinting; wxRect m_previewRect; - DECLARE_NO_COPY_CLASS(wxRichTextPrinting) + wxDECLARE_NO_COPY_CLASS(wxRichTextPrinting); }; #endif // wxUSE_RICHTEXT & wxUSE_PRINTING_ARCHITECTURE