1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-10-30 06:56:12 -05:00
|
|
|
// Name: wx/prntbase.h
|
1998-05-20 10:01:55 -04:00
|
|
|
// Purpose: Base classes for printing framework
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
2003-03-17 05:34:04 -05:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-14 20:23:28 -04:00
|
|
|
#ifndef _WX_PRNTBASEH__
|
|
|
|
#define _WX_PRNTBASEH__
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
#include "wx/defs.h"
|
1999-06-13 18:54:04 -04:00
|
|
|
|
|
|
|
#if wxUSE_PRINTING_ARCHITECTURE
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#include "wx/event.h"
|
|
|
|
#include "wx/cmndata.h"
|
|
|
|
#include "wx/panel.h"
|
|
|
|
#include "wx/scrolwin.h"
|
|
|
|
#include "wx/dialog.h"
|
1998-08-14 20:23:28 -04:00
|
|
|
#include "wx/frame.h"
|
2007-11-30 08:48:22 -05:00
|
|
|
#include "wx/dc.h"
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxDC;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxButton;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxChoice;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxPrintout;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxPrinterBase;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxPrintDialogBase;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxPrintDialog;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxPageSetupDialogBase;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxPageSetupDialog;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxPrintPreviewBase;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxPreviewCanvas;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxPreviewControlBar;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxPreviewFrame;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxPrintFactory;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxPrintNativeDataBase;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2004-10-12 17:07:42 -04:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// error consts
|
|
|
|
//----------------------------------------------------------------------------
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
enum wxPrinterError
|
|
|
|
{
|
|
|
|
wxPRINTER_NO_ERROR = 0,
|
|
|
|
wxPRINTER_CANCELLED,
|
|
|
|
wxPRINTER_ERROR
|
|
|
|
};
|
|
|
|
|
2004-10-12 17:07:42 -04:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// wxPrintFactory
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxPrintFactory
|
2004-10-12 17:07:42 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxPrintFactory() {}
|
|
|
|
virtual ~wxPrintFactory() {}
|
2005-06-13 08:19:33 -04:00
|
|
|
|
2004-10-12 17:07:42 -04:00
|
|
|
virtual wxPrinterBase *CreatePrinter( wxPrintDialogData* data ) = 0;
|
2005-06-13 08:19:33 -04:00
|
|
|
|
|
|
|
virtual wxPrintPreviewBase *CreatePrintPreview( wxPrintout *preview,
|
|
|
|
wxPrintout *printout = NULL,
|
2004-10-12 17:07:42 -04:00
|
|
|
wxPrintDialogData *data = NULL ) = 0;
|
2005-06-13 08:19:33 -04:00
|
|
|
virtual wxPrintPreviewBase *CreatePrintPreview( wxPrintout *preview,
|
|
|
|
wxPrintout *printout,
|
2004-10-12 17:07:42 -04:00
|
|
|
wxPrintData *data ) = 0;
|
2004-10-16 18:11:48 -04:00
|
|
|
|
2005-06-13 08:19:33 -04:00
|
|
|
virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
|
2004-10-16 18:11:48 -04:00
|
|
|
wxPrintDialogData *data = NULL ) = 0;
|
2005-06-13 08:19:33 -04:00
|
|
|
virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
|
2004-10-16 18:11:48 -04:00
|
|
|
wxPrintData *data ) = 0;
|
2005-06-13 08:19:33 -04:00
|
|
|
|
2004-11-20 09:46:25 -05:00
|
|
|
virtual wxPageSetupDialogBase *CreatePageSetupDialog( wxWindow *parent,
|
|
|
|
wxPageSetupDialogData * data = NULL ) = 0;
|
2005-06-13 08:19:33 -04:00
|
|
|
|
2007-11-30 08:48:22 -05:00
|
|
|
virtual wxDCImpl* CreatePrinterDCImpl( wxPrinterDC *owner, const wxPrintData& data ) = 0;
|
2006-10-24 11:41:39 -04:00
|
|
|
|
2004-10-26 15:49:59 -04:00
|
|
|
// What to do and what to show in the wxPrintDialog
|
|
|
|
// a) Use the generic print setup dialog or a native one?
|
|
|
|
virtual bool HasPrintSetupDialog() = 0;
|
|
|
|
virtual wxDialog *CreatePrintSetupDialog( wxWindow *parent, wxPrintData *data ) = 0;
|
|
|
|
// b) Provide the "print to file" option ourselves or via print setup?
|
|
|
|
virtual bool HasOwnPrintToFile() = 0;
|
|
|
|
// c) Show current printer
|
|
|
|
virtual bool HasPrinterLine() = 0;
|
|
|
|
virtual wxString CreatePrinterLine() = 0;
|
|
|
|
// d) Show Status line for current printer?
|
|
|
|
virtual bool HasStatusLine() = 0;
|
|
|
|
virtual wxString CreateStatusLine() = 0;
|
|
|
|
|
2005-06-13 08:19:33 -04:00
|
|
|
|
2004-10-17 13:25:40 -04:00
|
|
|
virtual wxPrintNativeDataBase *CreatePrintNativeData() = 0;
|
2005-06-13 08:19:33 -04:00
|
|
|
|
2004-10-12 17:07:42 -04:00
|
|
|
static void SetPrintFactory( wxPrintFactory *factory );
|
|
|
|
static wxPrintFactory *GetFactory();
|
2005-09-25 10:22:16 -04:00
|
|
|
private:
|
2004-10-12 17:07:42 -04:00
|
|
|
static wxPrintFactory *m_factory;
|
|
|
|
};
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxNativePrintFactory: public wxPrintFactory
|
2004-10-12 17:07:42 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual wxPrinterBase *CreatePrinter( wxPrintDialogData *data );
|
2005-06-13 08:19:33 -04:00
|
|
|
|
|
|
|
virtual wxPrintPreviewBase *CreatePrintPreview( wxPrintout *preview,
|
|
|
|
wxPrintout *printout = NULL,
|
2004-10-12 17:07:42 -04:00
|
|
|
wxPrintDialogData *data = NULL );
|
2005-06-13 08:19:33 -04:00
|
|
|
virtual wxPrintPreviewBase *CreatePrintPreview( wxPrintout *preview,
|
2004-10-12 17:07:42 -04:00
|
|
|
wxPrintout *printout,
|
|
|
|
wxPrintData *data );
|
2005-06-13 08:19:33 -04:00
|
|
|
|
|
|
|
virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
|
2004-10-16 18:11:48 -04:00
|
|
|
wxPrintDialogData *data = NULL );
|
2005-06-13 08:19:33 -04:00
|
|
|
virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
|
2004-10-16 18:11:48 -04:00
|
|
|
wxPrintData *data );
|
2005-06-13 08:19:33 -04:00
|
|
|
|
2004-11-20 09:46:25 -05:00
|
|
|
virtual wxPageSetupDialogBase *CreatePageSetupDialog( wxWindow *parent,
|
|
|
|
wxPageSetupDialogData * data = NULL );
|
2005-06-13 08:19:33 -04:00
|
|
|
|
2007-11-30 08:48:22 -05:00
|
|
|
virtual wxDCImpl* CreatePrinterDCImpl( wxPrinterDC *owner, const wxPrintData& data );
|
2006-10-24 11:41:39 -04:00
|
|
|
|
2004-10-26 15:49:59 -04:00
|
|
|
virtual bool HasPrintSetupDialog();
|
|
|
|
virtual wxDialog *CreatePrintSetupDialog( wxWindow *parent, wxPrintData *data );
|
|
|
|
virtual bool HasOwnPrintToFile();
|
|
|
|
virtual bool HasPrinterLine();
|
|
|
|
virtual wxString CreatePrinterLine();
|
|
|
|
virtual bool HasStatusLine();
|
|
|
|
virtual wxString CreateStatusLine();
|
2005-06-13 08:19:33 -04:00
|
|
|
|
2004-10-17 13:25:40 -04:00
|
|
|
virtual wxPrintNativeDataBase *CreatePrintNativeData();
|
|
|
|
};
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// wxPrintNativeDataBase
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxPrintNativeDataBase: public wxObject
|
2004-10-17 13:25:40 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxPrintNativeDataBase();
|
|
|
|
virtual ~wxPrintNativeDataBase() {}
|
2005-06-13 08:19:33 -04:00
|
|
|
|
2004-10-17 19:00:41 -04:00
|
|
|
virtual bool TransferTo( wxPrintData &data ) = 0;
|
2005-06-13 08:19:33 -04:00
|
|
|
virtual bool TransferFrom( const wxPrintData &data ) = 0;
|
|
|
|
|
2006-10-08 17:56:55 -04:00
|
|
|
virtual bool Ok() const { return IsOk(); }
|
|
|
|
virtual bool IsOk() const = 0;
|
2005-06-13 08:19:33 -04:00
|
|
|
|
2004-10-17 13:25:40 -04:00
|
|
|
int m_ref;
|
2005-06-13 08:19:33 -04:00
|
|
|
|
2004-10-17 13:25:40 -04:00
|
|
|
private:
|
|
|
|
DECLARE_CLASS(wxPrintNativeDataBase)
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxPrintNativeDataBase);
|
2004-10-12 17:07:42 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// wxPrinterBase
|
|
|
|
//----------------------------------------------------------------------------
|
2000-07-15 15:51:35 -04:00
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
/*
|
|
|
|
* Represents the printer: manages printing a wxPrintout object
|
|
|
|
*/
|
1999-03-29 15:49:05 -05:00
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxPrinterBase: public wxObject
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1998-08-28 07:00:50 -04:00
|
|
|
public:
|
2009-01-19 08:55:27 -05:00
|
|
|
wxPrinterBase(wxPrintDialogData *data = NULL);
|
1999-03-29 15:49:05 -05:00
|
|
|
virtual ~wxPrinterBase();
|
|
|
|
|
|
|
|
virtual wxWindow *CreateAbortWindow(wxWindow *parent, wxPrintout *printout);
|
2001-06-02 22:58:56 -04:00
|
|
|
virtual void ReportError(wxWindow *parent, wxPrintout *printout, const wxString& message);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2004-10-16 18:11:48 -04:00
|
|
|
virtual wxPrintDialogData& GetPrintDialogData() const;
|
1999-03-29 15:49:05 -05:00
|
|
|
bool GetAbort() const { return sm_abortIt; }
|
2004-09-20 07:31:49 -04:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
static wxPrinterError GetLastError() { return sm_lastError; }
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
// OVERRIDES
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
virtual bool Setup(wxWindow *parent) = 0;
|
2004-09-20 07:31:49 -04:00
|
|
|
virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = true) = 0;
|
1999-03-29 15:49:05 -05:00
|
|
|
virtual wxDC* PrintDialog(wxWindow *parent) = 0;
|
1998-08-28 07:00:50 -04:00
|
|
|
|
|
|
|
protected:
|
1999-03-29 15:49:05 -05:00
|
|
|
wxPrintDialogData m_printDialogData;
|
|
|
|
wxPrintout* m_currentPrintout;
|
2004-09-20 07:31:49 -04:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
static wxPrinterError sm_lastError;
|
2004-09-20 07:31:49 -04:00
|
|
|
|
1998-08-28 07:00:50 -04:00
|
|
|
public:
|
1999-03-29 15:49:05 -05:00
|
|
|
static wxWindow* sm_abortWindow;
|
|
|
|
static bool sm_abortIt;
|
1998-08-28 07:00:50 -04:00
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
private:
|
|
|
|
DECLARE_CLASS(wxPrinterBase)
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxPrinterBase);
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
2004-10-12 17:07:42 -04:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// wxPrinter
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxPrinter: public wxPrinterBase
|
2004-10-12 17:07:42 -04:00
|
|
|
{
|
|
|
|
public:
|
2009-01-19 08:55:27 -05:00
|
|
|
wxPrinter(wxPrintDialogData *data = NULL);
|
2004-10-12 17:07:42 -04:00
|
|
|
virtual ~wxPrinter();
|
|
|
|
|
|
|
|
virtual wxWindow *CreateAbortWindow(wxWindow *parent, wxPrintout *printout);
|
|
|
|
virtual void ReportError(wxWindow *parent, wxPrintout *printout, const wxString& message);
|
|
|
|
|
|
|
|
virtual bool Setup(wxWindow *parent);
|
|
|
|
virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = true);
|
|
|
|
virtual wxDC* PrintDialog(wxWindow *parent);
|
2005-06-13 08:19:33 -04:00
|
|
|
|
2004-10-16 18:11:48 -04:00
|
|
|
virtual wxPrintDialogData& GetPrintDialogData() const;
|
2004-10-12 17:07:42 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
wxPrinterBase *m_pimpl;
|
2005-06-13 08:19:33 -04:00
|
|
|
|
2004-10-12 17:07:42 -04:00
|
|
|
private:
|
|
|
|
DECLARE_CLASS(wxPrinter)
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxPrinter);
|
2004-10-12 17:07:42 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// wxPrintout
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
/*
|
|
|
|
* Represents an object via which a document may be printed.
|
|
|
|
* The programmer derives from this, overrides (at least) OnPrintPage,
|
|
|
|
* and passes it to a wxPrinter object for printing, or a wxPrintPreview
|
|
|
|
* object for previewing.
|
|
|
|
*/
|
1999-03-29 15:49:05 -05:00
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxPrintout: public wxObject
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1998-08-28 07:00:50 -04:00
|
|
|
public:
|
2002-12-04 09:11:26 -05:00
|
|
|
wxPrintout(const wxString& title = wxT("Printout"));
|
1999-03-29 15:49:05 -05:00
|
|
|
virtual ~wxPrintout();
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
virtual bool OnBeginDocument(int startPage, int endPage);
|
|
|
|
virtual void OnEndDocument();
|
|
|
|
virtual void OnBeginPrinting();
|
|
|
|
virtual void OnEndPrinting();
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
// Guaranteed to be before any other functions are called
|
|
|
|
virtual void OnPreparePrinting() { }
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
virtual bool HasPage(int page);
|
|
|
|
virtual bool OnPrintPage(int page) = 0;
|
|
|
|
virtual void GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
virtual wxString GetTitle() const { return m_printoutTitle; }
|
1998-08-28 07:00:50 -04:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
wxDC *GetDC() const { return m_printoutDC; }
|
|
|
|
void SetDC(wxDC *dc) { m_printoutDC = dc; }
|
2006-10-27 09:07:40 -04:00
|
|
|
|
|
|
|
void FitThisSizeToPaper(const wxSize& imageSize);
|
|
|
|
void FitThisSizeToPage(const wxSize& imageSize);
|
|
|
|
void FitThisSizeToPageMargins(const wxSize& imageSize, const wxPageSetupDialogData& pageSetupData);
|
|
|
|
void MapScreenSizeToPaper();
|
|
|
|
void MapScreenSizeToPage();
|
|
|
|
void MapScreenSizeToPageMargins(const wxPageSetupDialogData& pageSetupData);
|
|
|
|
void MapScreenSizeToDevice();
|
|
|
|
|
|
|
|
wxRect GetLogicalPaperRect() const;
|
|
|
|
wxRect GetLogicalPageRect() const;
|
|
|
|
wxRect GetLogicalPageMarginsRect(const wxPageSetupDialogData& pageSetupData) const;
|
|
|
|
|
|
|
|
void SetLogicalOrigin(wxCoord x, wxCoord y);
|
|
|
|
void OffsetLogicalOrigin(wxCoord xoff, wxCoord yoff);
|
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
void SetPageSizePixels(int w, int h) { m_pageWidthPixels = w; m_pageHeightPixels = h; }
|
|
|
|
void GetPageSizePixels(int *w, int *h) const { *w = m_pageWidthPixels; *h = m_pageHeightPixels; }
|
|
|
|
void SetPageSizeMM(int w, int h) { m_pageWidthMM = w; m_pageHeightMM = h; }
|
|
|
|
void GetPageSizeMM(int *w, int *h) const { *w = m_pageWidthMM; *h = m_pageHeightMM; }
|
1998-08-28 07:00:50 -04:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
void SetPPIScreen(int x, int y) { m_PPIScreenX = x; m_PPIScreenY = y; }
|
2008-09-21 05:35:49 -04:00
|
|
|
void SetPPIScreen(const wxSize& ppi) { SetPPIScreen(ppi.x, ppi.y); }
|
1999-03-29 15:49:05 -05:00
|
|
|
void GetPPIScreen(int *x, int *y) const { *x = m_PPIScreenX; *y = m_PPIScreenY; }
|
|
|
|
void SetPPIPrinter(int x, int y) { m_PPIPrinterX = x; m_PPIPrinterY = y; }
|
2008-09-21 05:35:49 -04:00
|
|
|
void SetPPIPrinter(const wxSize& ppi) { SetPPIPrinter(ppi.x, ppi.y); }
|
1999-03-29 15:49:05 -05:00
|
|
|
void GetPPIPrinter(int *x, int *y) const { *x = m_PPIPrinterX; *y = m_PPIPrinterY; }
|
1998-08-28 07:00:50 -04:00
|
|
|
|
2006-10-27 09:07:40 -04:00
|
|
|
void SetPaperRectPixels(const wxRect& paperRectPixels) { m_paperRectPixels = paperRectPixels; }
|
|
|
|
wxRect GetPaperRectPixels() const { return m_paperRectPixels; }
|
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
virtual bool IsPreview() const { return m_isPreview; }
|
1998-08-28 07:00:50 -04:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
virtual void SetIsPreview(bool p) { m_isPreview = p; }
|
1998-08-28 07:00:50 -04:00
|
|
|
|
|
|
|
private:
|
1999-03-29 15:49:05 -05:00
|
|
|
wxString m_printoutTitle;
|
|
|
|
wxDC* m_printoutDC;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
int m_pageWidthPixels;
|
|
|
|
int m_pageHeightPixels;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
int m_pageWidthMM;
|
|
|
|
int m_pageHeightMM;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
int m_PPIScreenX;
|
|
|
|
int m_PPIScreenY;
|
|
|
|
int m_PPIPrinterX;
|
|
|
|
int m_PPIPrinterY;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2006-10-27 09:07:40 -04:00
|
|
|
wxRect m_paperRectPixels;
|
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
bool m_isPreview;
|
2002-12-04 09:11:26 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_ABSTRACT_CLASS(wxPrintout)
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxPrintout);
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
2006-10-27 09:07:40 -04:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// wxPreviewCanvas
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
/*
|
|
|
|
* Canvas upon which a preview is drawn.
|
|
|
|
*/
|
1999-03-29 15:49:05 -05:00
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxPreviewCanvas: public wxScrolledWindow
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1998-08-28 07:00:50 -04:00
|
|
|
public:
|
1999-03-29 15:49:05 -05:00
|
|
|
wxPreviewCanvas(wxPrintPreviewBase *preview,
|
|
|
|
wxWindow *parent,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
2002-12-04 09:11:26 -05:00
|
|
|
const wxString& name = wxT("canvas"));
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxPreviewCanvas();
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2008-06-11 16:56:41 -04:00
|
|
|
void SetPreview(wxPrintPreviewBase *preview) { m_printPreview = preview; }
|
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
void OnPaint(wxPaintEvent& event);
|
2003-07-23 16:30:19 -04:00
|
|
|
void OnChar(wxKeyEvent &event);
|
1999-03-29 15:49:05 -05:00
|
|
|
// Responds to colour changes
|
|
|
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1998-08-28 07:00:50 -04:00
|
|
|
private:
|
2005-07-28 18:20:06 -04:00
|
|
|
#if wxUSE_MOUSEWHEEL
|
|
|
|
void OnMouseWheel(wxMouseEvent& event);
|
|
|
|
#endif // wxUSE_MOUSEWHEEL
|
2008-06-11 16:56:41 -04:00
|
|
|
void OnIdle(wxIdleEvent& event);
|
2005-07-28 18:20:06 -04:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
wxPrintPreviewBase* m_printPreview;
|
1998-08-28 07:00:50 -04:00
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
DECLARE_CLASS(wxPreviewCanvas)
|
1999-03-29 15:49:05 -05:00
|
|
|
DECLARE_EVENT_TABLE()
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxPreviewCanvas);
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
2006-10-27 09:07:40 -04:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// wxPreviewFrame
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
/*
|
|
|
|
* Default frame for showing preview.
|
|
|
|
*/
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxPreviewFrame: public wxFrame
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1998-08-28 07:00:50 -04:00
|
|
|
public:
|
1999-03-29 15:49:05 -05:00
|
|
|
wxPreviewFrame(wxPrintPreviewBase *preview,
|
2003-05-26 05:55:28 -04:00
|
|
|
wxWindow *parent,
|
2002-12-04 09:11:26 -05:00
|
|
|
const wxString& title = wxT("Print Preview"),
|
1999-03-29 15:49:05 -05:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2009-01-16 13:49:04 -05:00
|
|
|
long style = wxDEFAULT_FRAME_STYLE | wxFRAME_FLOAT_ON_PARENT,
|
2008-11-08 10:01:00 -05:00
|
|
|
const wxString& name = wxFrameNameStr);
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxPreviewFrame();
|
1999-03-29 15:49:05 -05:00
|
|
|
|
|
|
|
void OnCloseWindow(wxCloseEvent& event);
|
|
|
|
virtual void Initialize();
|
|
|
|
virtual void CreateCanvas();
|
|
|
|
virtual void CreateControlBar();
|
2003-07-23 16:30:19 -04:00
|
|
|
|
|
|
|
inline wxPreviewControlBar* GetControlBar() const { return m_controlBar; }
|
|
|
|
|
1998-08-28 07:00:50 -04:00
|
|
|
protected:
|
2003-07-23 16:30:19 -04:00
|
|
|
wxPreviewCanvas* m_previewCanvas;
|
1999-03-29 15:49:05 -05:00
|
|
|
wxPreviewControlBar* m_controlBar;
|
|
|
|
wxPrintPreviewBase* m_printPreview;
|
2004-07-25 13:09:30 -04:00
|
|
|
wxWindowDisabler* m_windowDisabler;
|
1999-02-05 18:55:04 -05:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
private:
|
2007-09-20 19:11:22 -04:00
|
|
|
void OnChar(wxKeyEvent& event);
|
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
DECLARE_EVENT_TABLE()
|
2007-09-20 19:11:22 -04:00
|
|
|
DECLARE_CLASS(wxPreviewFrame)
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxPreviewFrame);
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
2006-10-27 09:07:40 -04:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// wxPreviewControlBar
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
/*
|
|
|
|
* A panel with buttons for controlling a print preview.
|
|
|
|
* The programmer may wish to use other means for controlling
|
|
|
|
* the print preview.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define wxPREVIEW_PRINT 1
|
|
|
|
#define wxPREVIEW_PREVIOUS 2
|
|
|
|
#define wxPREVIEW_NEXT 4
|
|
|
|
#define wxPREVIEW_ZOOM 8
|
2002-08-16 12:18:28 -04:00
|
|
|
#define wxPREVIEW_FIRST 16
|
|
|
|
#define wxPREVIEW_LAST 32
|
|
|
|
#define wxPREVIEW_GOTO 64
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2005-06-13 08:19:33 -04:00
|
|
|
#define wxPREVIEW_DEFAULT (wxPREVIEW_PREVIOUS|wxPREVIEW_NEXT|wxPREVIEW_ZOOM\
|
|
|
|
|wxPREVIEW_FIRST|wxPREVIEW_GOTO|wxPREVIEW_LAST)
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
// Ids for controls
|
|
|
|
#define wxID_PREVIEW_CLOSE 1
|
|
|
|
#define wxID_PREVIEW_NEXT 2
|
|
|
|
#define wxID_PREVIEW_PREVIOUS 3
|
|
|
|
#define wxID_PREVIEW_PRINT 4
|
|
|
|
#define wxID_PREVIEW_ZOOM 5
|
2002-08-16 12:18:28 -04:00
|
|
|
#define wxID_PREVIEW_FIRST 6
|
|
|
|
#define wxID_PREVIEW_LAST 7
|
|
|
|
#define wxID_PREVIEW_GOTO 8
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxPreviewControlBar: public wxPanel
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1999-03-29 15:49:05 -05:00
|
|
|
DECLARE_CLASS(wxPreviewControlBar)
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1998-08-28 07:00:50 -04:00
|
|
|
public:
|
1999-03-29 15:49:05 -05:00
|
|
|
wxPreviewControlBar(wxPrintPreviewBase *preview,
|
|
|
|
long buttons,
|
|
|
|
wxWindow *parent,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2003-07-23 16:30:19 -04:00
|
|
|
long style = wxTAB_TRAVERSAL,
|
2002-12-04 09:11:26 -05:00
|
|
|
const wxString& name = wxT("panel"));
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxPreviewControlBar();
|
1999-03-29 15:49:05 -05:00
|
|
|
|
|
|
|
virtual void CreateButtons();
|
|
|
|
virtual void SetZoomControl(int zoom);
|
|
|
|
virtual int GetZoomControl();
|
|
|
|
virtual wxPrintPreviewBase *GetPrintPreview() const
|
|
|
|
{ return m_printPreview; }
|
|
|
|
|
|
|
|
void OnWindowClose(wxCommandEvent& event);
|
1999-06-21 17:00:36 -04:00
|
|
|
void OnNext();
|
|
|
|
void OnPrevious();
|
2002-08-16 12:18:28 -04:00
|
|
|
void OnFirst();
|
|
|
|
void OnLast();
|
|
|
|
void OnGoto();
|
2003-07-24 06:07:43 -04:00
|
|
|
void OnPrint();
|
2003-07-24 16:06:02 -04:00
|
|
|
void OnPrintButton(wxCommandEvent& WXUNUSED(event)) { OnPrint(); }
|
1999-09-18 12:49:30 -04:00
|
|
|
void OnNextButton(wxCommandEvent & WXUNUSED(event)) { OnNext(); }
|
|
|
|
void OnPreviousButton(wxCommandEvent & WXUNUSED(event)) { OnPrevious(); }
|
2002-08-16 12:18:28 -04:00
|
|
|
void OnFirstButton(wxCommandEvent & WXUNUSED(event)) { OnFirst(); }
|
|
|
|
void OnLastButton(wxCommandEvent & WXUNUSED(event)) { OnLast(); }
|
|
|
|
void OnGotoButton(wxCommandEvent & WXUNUSED(event)) { OnGoto(); }
|
1999-03-29 15:49:05 -05:00
|
|
|
void OnZoom(wxCommandEvent& event);
|
|
|
|
void OnPaint(wxPaintEvent& event);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1998-08-28 07:00:50 -04:00
|
|
|
protected:
|
1999-03-29 15:49:05 -05:00
|
|
|
wxPrintPreviewBase* m_printPreview;
|
|
|
|
wxButton* m_closeButton;
|
|
|
|
wxButton* m_nextPageButton;
|
|
|
|
wxButton* m_previousPageButton;
|
|
|
|
wxButton* m_printButton;
|
|
|
|
wxChoice* m_zoomControl;
|
2002-08-16 12:18:28 -04:00
|
|
|
wxButton* m_firstPageButton;
|
|
|
|
wxButton* m_lastPageButton;
|
|
|
|
wxButton* m_gotoPageButton;
|
1999-03-29 15:49:05 -05:00
|
|
|
long m_buttonFlags;
|
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE()
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxPreviewControlBar);
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
2004-10-12 17:07:42 -04:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// wxPrintPreviewBase
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
/*
|
|
|
|
* Programmer creates an object of this class to preview a wxPrintout.
|
|
|
|
*/
|
1999-03-29 15:49:05 -05:00
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxPrintPreviewBase: public wxObject
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1998-08-28 07:00:50 -04:00
|
|
|
public:
|
1999-03-29 15:49:05 -05:00
|
|
|
wxPrintPreviewBase(wxPrintout *printout,
|
2009-01-19 08:55:27 -05:00
|
|
|
wxPrintout *printoutForPrinting = NULL,
|
|
|
|
wxPrintDialogData *data = NULL);
|
1999-03-29 15:49:05 -05:00
|
|
|
wxPrintPreviewBase(wxPrintout *printout,
|
|
|
|
wxPrintout *printoutForPrinting,
|
|
|
|
wxPrintData *data);
|
|
|
|
virtual ~wxPrintPreviewBase();
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
virtual bool SetCurrentPage(int pageNum);
|
2004-10-12 17:07:42 -04:00
|
|
|
virtual int GetCurrentPage() const;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2004-10-12 17:07:42 -04:00
|
|
|
virtual void SetPrintout(wxPrintout *printout);
|
|
|
|
virtual wxPrintout *GetPrintout() const;
|
|
|
|
virtual wxPrintout *GetPrintoutForPrinting() const;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2004-10-12 17:07:42 -04:00
|
|
|
virtual void SetFrame(wxFrame *frame);
|
|
|
|
virtual void SetCanvas(wxPreviewCanvas *canvas);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2004-10-12 17:07:42 -04:00
|
|
|
virtual wxFrame *GetFrame() const;
|
|
|
|
virtual wxPreviewCanvas *GetCanvas() const;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2006-10-27 09:07:40 -04:00
|
|
|
// This is a helper routine, used by the next 4 routines.
|
|
|
|
|
|
|
|
virtual void CalcRects(wxPreviewCanvas *canvas, wxRect& printableAreaRect, wxRect& paperRect);
|
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
// The preview canvas should call this from OnPaint
|
2003-07-23 16:30:19 -04:00
|
|
|
virtual bool PaintPage(wxPreviewCanvas *canvas, wxDC& dc);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2008-06-11 16:56:41 -04:00
|
|
|
// Updates rendered page by calling RenderPage() if needed, returns true
|
|
|
|
// if there was some change. Preview canvas should call it at idle time
|
|
|
|
virtual bool UpdatePageRendering();
|
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
// This draws a blank page onto the preview canvas
|
2003-07-23 16:30:19 -04:00
|
|
|
virtual bool DrawBlankPage(wxPreviewCanvas *canvas, wxDC& dc);
|
|
|
|
|
|
|
|
// Adjusts the scrollbars for the current scale
|
|
|
|
virtual void AdjustScrollbars(wxPreviewCanvas *canvas);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
// This is called by wxPrintPreview to render a page into a wxMemoryDC.
|
|
|
|
virtual bool RenderPage(int pageNum);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
virtual void SetZoom(int percent);
|
2004-10-12 17:07:42 -04:00
|
|
|
virtual int GetZoom() const;
|
1998-08-28 07:00:50 -04:00
|
|
|
|
2004-10-12 17:07:42 -04:00
|
|
|
virtual wxPrintDialogData& GetPrintDialogData();
|
2005-06-13 08:19:33 -04:00
|
|
|
|
2004-10-12 17:07:42 -04:00
|
|
|
virtual int GetMaxPage() const;
|
|
|
|
virtual int GetMinPage() const;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2006-10-08 17:56:55 -04:00
|
|
|
virtual bool Ok() const { return IsOk(); }
|
|
|
|
virtual bool IsOk() const;
|
2004-10-12 17:07:42 -04:00
|
|
|
virtual void SetOk(bool ok);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
// OVERRIDES
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
// If we own a wxPrintout that can be used for printing, this
|
|
|
|
// will invoke the actual printing procedure. Called
|
|
|
|
// by the wxPreviewControlBar.
|
|
|
|
virtual bool Print(bool interactive) = 0;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
// Calculate scaling that needs to be done to get roughly
|
|
|
|
// the right scaling for the screen pretending to be
|
|
|
|
// the currently selected printer.
|
|
|
|
virtual void DetermineScaling() = 0;
|
1998-08-28 07:00:50 -04:00
|
|
|
|
2008-06-16 03:43:59 -04:00
|
|
|
protected:
|
2008-06-16 04:41:51 -04:00
|
|
|
// helpers for RenderPage():
|
|
|
|
virtual bool RenderPageIntoDC(wxDC& dc, int pageNum);
|
|
|
|
// renders preview into m_previewBitmap
|
|
|
|
virtual bool RenderPageIntoBitmap(wxBitmap& bmp, int pageNum);
|
|
|
|
|
2008-06-16 03:43:59 -04:00
|
|
|
void InvalidatePreviewBitmap();
|
|
|
|
|
1998-08-28 07:00:50 -04:00
|
|
|
protected:
|
1999-03-29 15:49:05 -05:00
|
|
|
wxPrintDialogData m_printDialogData;
|
2003-07-23 16:30:19 -04:00
|
|
|
wxPreviewCanvas* m_previewCanvas;
|
1999-03-29 15:49:05 -05:00
|
|
|
wxFrame* m_previewFrame;
|
|
|
|
wxBitmap* m_previewBitmap;
|
2008-06-16 03:43:59 -04:00
|
|
|
bool m_previewFailed;
|
1999-03-29 15:49:05 -05:00
|
|
|
wxPrintout* m_previewPrintout;
|
|
|
|
wxPrintout* m_printPrintout;
|
|
|
|
int m_currentPage;
|
|
|
|
int m_currentZoom;
|
2006-10-27 09:07:40 -04:00
|
|
|
float m_previewScaleX;
|
|
|
|
float m_previewScaleY;
|
1999-03-29 15:49:05 -05:00
|
|
|
int m_topMargin;
|
|
|
|
int m_leftMargin;
|
|
|
|
int m_pageWidth;
|
|
|
|
int m_pageHeight;
|
|
|
|
int m_minPage;
|
|
|
|
int m_maxPage;
|
|
|
|
|
|
|
|
bool m_isOk;
|
1999-09-05 11:14:50 -04:00
|
|
|
bool m_printingPrepared; // Called OnPreparePrinting?
|
1999-03-29 15:49:05 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
void Init(wxPrintout *printout, wxPrintout *printoutForPrinting);
|
2003-01-02 18:38:11 -05:00
|
|
|
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxPrintPreviewBase);
|
2004-10-12 17:07:42 -04:00
|
|
|
DECLARE_CLASS(wxPrintPreviewBase)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
2004-10-12 17:07:42 -04:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// wxPrintPreview
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxPrintPreview: public wxPrintPreviewBase
|
2004-10-12 17:07:42 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxPrintPreview(wxPrintout *printout,
|
2009-01-19 08:55:27 -05:00
|
|
|
wxPrintout *printoutForPrinting = NULL,
|
|
|
|
wxPrintDialogData *data = NULL);
|
2004-10-12 17:07:42 -04:00
|
|
|
wxPrintPreview(wxPrintout *printout,
|
|
|
|
wxPrintout *printoutForPrinting,
|
|
|
|
wxPrintData *data);
|
|
|
|
virtual ~wxPrintPreview();
|
|
|
|
|
|
|
|
virtual bool SetCurrentPage(int pageNum);
|
|
|
|
virtual int GetCurrentPage() const;
|
|
|
|
virtual void SetPrintout(wxPrintout *printout);
|
|
|
|
virtual wxPrintout *GetPrintout() const;
|
|
|
|
virtual wxPrintout *GetPrintoutForPrinting() const;
|
|
|
|
virtual void SetFrame(wxFrame *frame);
|
|
|
|
virtual void SetCanvas(wxPreviewCanvas *canvas);
|
|
|
|
|
|
|
|
virtual wxFrame *GetFrame() const;
|
|
|
|
virtual wxPreviewCanvas *GetCanvas() const;
|
|
|
|
virtual bool PaintPage(wxPreviewCanvas *canvas, wxDC& dc);
|
2008-06-11 16:56:41 -04:00
|
|
|
virtual bool UpdatePageRendering();
|
2004-10-12 17:07:42 -04:00
|
|
|
virtual bool DrawBlankPage(wxPreviewCanvas *canvas, wxDC& dc);
|
|
|
|
virtual void AdjustScrollbars(wxPreviewCanvas *canvas);
|
|
|
|
virtual bool RenderPage(int pageNum);
|
|
|
|
virtual void SetZoom(int percent);
|
2006-06-28 08:56:05 -04:00
|
|
|
virtual int GetZoom() const;
|
2004-10-12 17:07:42 -04:00
|
|
|
|
|
|
|
virtual bool Print(bool interactive);
|
|
|
|
virtual void DetermineScaling();
|
2005-06-13 08:19:33 -04:00
|
|
|
|
2004-10-12 17:07:42 -04:00
|
|
|
virtual wxPrintDialogData& GetPrintDialogData();
|
2005-06-13 08:19:33 -04:00
|
|
|
|
2004-10-12 17:07:42 -04:00
|
|
|
virtual int GetMaxPage() const;
|
|
|
|
virtual int GetMinPage() const;
|
|
|
|
|
2006-10-08 17:56:55 -04:00
|
|
|
virtual bool Ok() const { return IsOk(); }
|
|
|
|
virtual bool IsOk() const;
|
2004-10-12 17:07:42 -04:00
|
|
|
virtual void SetOk(bool ok);
|
2005-06-13 08:19:33 -04:00
|
|
|
|
2004-10-12 17:07:42 -04:00
|
|
|
private:
|
|
|
|
wxPrintPreviewBase *m_pimpl;
|
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_CLASS(wxPrintPreview)
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxPrintPreview);
|
2004-10-12 17:07:42 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// wxPrintAbortDialog
|
|
|
|
//----------------------------------------------------------------------------
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxPrintAbortDialog: public wxDialog
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
|
|
|
public:
|
1999-03-29 15:49:05 -05:00
|
|
|
wxPrintAbortDialog(wxWindow *parent,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
2002-12-04 09:11:26 -05:00
|
|
|
const wxString& name = wxT("dialog"))
|
2004-09-20 07:31:49 -04:00
|
|
|
: wxDialog(parent, wxID_ANY, title, pos, size, style, name)
|
1999-03-29 15:49:05 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void OnCancel(wxCommandEvent& event);
|
1998-08-28 07:00:50 -04:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE()
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxPrintAbortDialog);
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
1999-06-13 18:54:04 -04:00
|
|
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
1998-08-14 20:23:28 -04:00
|
|
|
// _WX_PRNTBASEH__
|