Replace wxPrintout::SetIsPreview() with SetPreview().

Unlike the old function just indicating whether a printout is being used for
previewing, the new one associates the preview object with it. This can be
useful if we need to access the window used for the preview, for example.

Also remove a bunch of apparently unnecessary SetIsPreview(false) calls as
printing (and not previewing) is already the default.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64212 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-05-05 12:19:59 +00:00
parent 5009cb6acc
commit 1bd122ddfa
8 changed files with 26 additions and 19 deletions

View File

@@ -39,6 +39,7 @@ class WXDLLIMPEXP_FWD_CORE wxPreviewControlBar;
class WXDLLIMPEXP_FWD_CORE wxPreviewFrame;
class WXDLLIMPEXP_FWD_CORE wxPrintFactory;
class WXDLLIMPEXP_FWD_CORE wxPrintNativeDataBase;
class WXDLLIMPEXP_FWD_CORE wxPrintPreview;
//----------------------------------------------------------------------------
// error consts
@@ -293,13 +294,17 @@ public:
void SetPaperRectPixels(const wxRect& paperRectPixels) { m_paperRectPixels = paperRectPixels; }
wxRect GetPaperRectPixels() const { return m_paperRectPixels; }
virtual bool IsPreview() const { return m_isPreview; }
// This must be called by wxPrintPreview to associate itself with the
// printout it uses.
virtual void SetPreview(wxPrintPreview *preview) { m_preview = preview; }
virtual void SetIsPreview(bool p) { m_isPreview = p; }
wxPrintPreview *GetPreview() const { return m_preview; }
virtual bool IsPreview() const { return GetPreview() != NULL; }
private:
wxString m_printoutTitle;
wxDC* m_printoutDC;
wxPrintPreview *m_preview;
int m_pageWidthPixels;
int m_pageHeightPixels;
@@ -314,8 +319,6 @@ private:
wxRect m_paperRectPixels;
bool m_isPreview;
private:
DECLARE_ABSTRACT_CLASS(wxPrintout)
wxDECLARE_NO_COPY_CLASS(wxPrintout);