1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: prntdlgg.h
|
|
|
|
// Purpose: wxGenericPrintDialog, wxGenericPrintSetupDialog,
|
|
|
|
// wxGenericPageSetupDialog
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
2005-05-04 14:57:50 -04:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __PRINTDLGH_G_
|
|
|
|
#define __PRINTDLGH_G_
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
1999-06-15 16:21:59 -04:00
|
|
|
|
|
|
|
#if wxUSE_PRINTING_ARCHITECTURE
|
|
|
|
|
1999-01-22 06:06:20 -05:00
|
|
|
#include "wx/dialog.h"
|
2002-08-05 14:00:55 -04:00
|
|
|
#include "wx/cmndata.h"
|
2004-10-17 13:25:40 -04:00
|
|
|
#include "wx/prntbase.h"
|
2004-10-16 18:11:48 -04:00
|
|
|
#include "wx/printdlg.h"
|
2004-11-01 10:24:44 -05:00
|
|
|
#include "wx/listctrl.h"
|
1999-01-22 06:06:20 -05:00
|
|
|
|
|
|
|
#if wxUSE_POSTSCRIPT
|
1999-03-29 15:49:05 -05:00
|
|
|
#include "wx/dcps.h"
|
1999-01-22 06:06:20 -05:00
|
|
|
#endif
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxButton;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxCheckBox;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxComboBox;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxStaticText;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxRadioBox;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxPageSetupData;
|
2004-10-17 13:25:40 -04:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// constants
|
|
|
|
// ----------------------------------------------------------------------------
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2004-12-06 12:37:31 -05:00
|
|
|
// This is not clear why all these enums start with 10 or 30 but do not change it
|
|
|
|
// without good reason to avoid some subtle backwards compatibility breakage
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
wxPRINTID_STATIC = 10,
|
|
|
|
wxPRINTID_RANGE,
|
|
|
|
wxPRINTID_FROM,
|
|
|
|
wxPRINTID_TO,
|
|
|
|
wxPRINTID_COPIES,
|
|
|
|
wxPRINTID_PRINTTOFILE,
|
|
|
|
wxPRINTID_SETUP
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
wxPRINTID_LEFTMARGIN = 30,
|
|
|
|
wxPRINTID_RIGHTMARGIN,
|
|
|
|
wxPRINTID_TOPMARGIN,
|
|
|
|
wxPRINTID_BOTTOMMARGIN
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
wxPRINTID_PRINTCOLOUR = 10,
|
|
|
|
wxPRINTID_ORIENTATION,
|
|
|
|
wxPRINTID_COMMAND,
|
|
|
|
wxPRINTID_OPTIONS,
|
2004-11-01 10:24:44 -05:00
|
|
|
wxPRINTID_PAPERSIZE,
|
|
|
|
wxPRINTID_PRINTER
|
1999-03-29 15:49:05 -05:00
|
|
|
};
|
|
|
|
|
2004-10-17 13:25:40 -04:00
|
|
|
#if wxUSE_POSTSCRIPT
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// wxPostScriptNativeData
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxPostScriptPrintNativeData: public wxPrintNativeDataBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxPostScriptPrintNativeData();
|
|
|
|
virtual ~wxPostScriptPrintNativeData();
|
2004-12-06 12:37:31 -05:00
|
|
|
|
2004-10-17 19:00:41 -04:00
|
|
|
virtual bool TransferTo( wxPrintData &data );
|
|
|
|
virtual bool TransferFrom( const wxPrintData &data );
|
2004-12-06 12:37:31 -05:00
|
|
|
|
2006-10-08 17:56:55 -04:00
|
|
|
virtual bool Ok() const { return IsOk(); }
|
|
|
|
virtual bool IsOk() const { return true; }
|
2004-12-06 12:37:31 -05:00
|
|
|
|
2004-10-17 13:25:40 -04:00
|
|
|
const wxString& GetPrinterCommand() const { return m_printerCommand; }
|
|
|
|
const wxString& GetPrinterOptions() const { return m_printerOptions; }
|
|
|
|
const wxString& GetPreviewCommand() const { return m_previewCommand; }
|
|
|
|
const wxString& GetFontMetricPath() const { return m_afmPath; }
|
|
|
|
double GetPrinterScaleX() const { return m_printerScaleX; }
|
|
|
|
double GetPrinterScaleY() const { return m_printerScaleY; }
|
|
|
|
long GetPrinterTranslateX() const { return m_printerTranslateX; }
|
|
|
|
long GetPrinterTranslateY() const { return m_printerTranslateY; }
|
|
|
|
|
|
|
|
void SetPrinterCommand(const wxString& command) { m_printerCommand = command; }
|
|
|
|
void SetPrinterOptions(const wxString& options) { m_printerOptions = options; }
|
|
|
|
void SetPreviewCommand(const wxString& command) { m_previewCommand = command; }
|
|
|
|
void SetFontMetricPath(const wxString& path) { m_afmPath = path; }
|
|
|
|
void SetPrinterScaleX(double x) { m_printerScaleX = x; }
|
|
|
|
void SetPrinterScaleY(double y) { m_printerScaleY = y; }
|
|
|
|
void SetPrinterScaling(double x, double y) { m_printerScaleX = x; m_printerScaleY = y; }
|
|
|
|
void SetPrinterTranslateX(long x) { m_printerTranslateX = x; }
|
|
|
|
void SetPrinterTranslateY(long y) { m_printerTranslateY = y; }
|
|
|
|
void SetPrinterTranslation(long x, long y) { m_printerTranslateX = x; m_printerTranslateY = y; }
|
|
|
|
|
|
|
|
#if wxUSE_STREAMS
|
|
|
|
wxOutputStream *GetOutputStream() { return m_outputStream; }
|
|
|
|
void SetOutputStream( wxOutputStream *output ) { m_outputStream = output; }
|
|
|
|
#endif
|
|
|
|
|
|
|
|
private:
|
|
|
|
wxString m_printerCommand;
|
|
|
|
wxString m_previewCommand;
|
|
|
|
wxString m_printerOptions;
|
|
|
|
wxString m_afmPath;
|
|
|
|
double m_printerScaleX;
|
|
|
|
double m_printerScaleY;
|
|
|
|
long m_printerTranslateX;
|
|
|
|
long m_printerTranslateY;
|
|
|
|
#if wxUSE_STREAMS
|
|
|
|
wxOutputStream *m_outputStream;
|
|
|
|
#endif
|
2004-12-06 12:37:31 -05:00
|
|
|
|
2004-10-17 13:25:40 -04:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxPostScriptPrintNativeData)
|
|
|
|
};
|
2004-12-06 12:37:31 -05:00
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Simulated Print and Print Setup dialogs for non-Windows platforms (and
|
|
|
|
// Windows using PostScript print/preview)
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2004-10-16 18:11:48 -04:00
|
|
|
class WXDLLEXPORT wxGenericPrintDialog : public wxPrintDialogBase
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1999-03-25 18:06:01 -05:00
|
|
|
public:
|
1999-03-29 15:49:05 -05:00
|
|
|
wxGenericPrintDialog(wxWindow *parent,
|
|
|
|
wxPrintDialogData* data = (wxPrintDialogData*)NULL);
|
|
|
|
wxGenericPrintDialog(wxWindow *parent, wxPrintData* data);
|
|
|
|
|
|
|
|
virtual ~wxGenericPrintDialog();
|
1999-03-25 18:06:01 -05:00
|
|
|
|
|
|
|
void OnSetup(wxCommandEvent& event);
|
|
|
|
void OnRange(wxCommandEvent& event);
|
|
|
|
void OnOK(wxCommandEvent& event);
|
1999-03-29 15:49:05 -05:00
|
|
|
|
1999-03-25 18:06:01 -05:00
|
|
|
virtual bool TransferDataFromWindow();
|
|
|
|
virtual bool TransferDataToWindow();
|
|
|
|
|
|
|
|
virtual int ShowModal();
|
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
wxPrintData& GetPrintData()
|
|
|
|
{ return m_printDialogData.GetPrintData(); }
|
|
|
|
|
|
|
|
wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; }
|
1999-03-25 18:06:01 -05:00
|
|
|
wxDC *GetPrintDC();
|
|
|
|
|
|
|
|
public:
|
1999-04-04 07:24:51 -04:00
|
|
|
// wxStaticText* m_printerMessage;
|
1999-03-25 18:06:01 -05:00
|
|
|
wxButton* m_setupButton;
|
1999-04-04 07:24:51 -04:00
|
|
|
// wxButton* m_helpButton;
|
1999-03-25 18:06:01 -05:00
|
|
|
wxRadioBox* m_rangeRadioBox;
|
|
|
|
wxTextCtrl* m_fromText;
|
|
|
|
wxTextCtrl* m_toText;
|
|
|
|
wxTextCtrl* m_noCopiesText;
|
|
|
|
wxCheckBox* m_printToFileCheckBox;
|
1999-04-04 07:24:51 -04:00
|
|
|
// wxCheckBox* m_collateCopiesCheckBox;
|
1999-03-29 15:49:05 -05:00
|
|
|
|
1999-03-25 18:06:01 -05:00
|
|
|
wxPrintDialogData m_printDialogData;
|
1999-03-29 15:49:05 -05:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void Init(wxWindow *parent);
|
|
|
|
|
|
|
|
private:
|
1999-03-25 18:06:01 -05:00
|
|
|
DECLARE_EVENT_TABLE()
|
2002-09-13 18:00:45 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
1999-03-29 15:49:05 -05:00
|
|
|
class WXDLLEXPORT wxGenericPrintSetupDialog : public wxDialog
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1999-03-25 18:06:01 -05:00
|
|
|
public:
|
|
|
|
// There are no configuration options for the dialog, so we
|
|
|
|
// just pass the wxPrintData object (no wxPrintSetupDialogData class needed)
|
|
|
|
wxGenericPrintSetupDialog(wxWindow *parent, wxPrintData* data);
|
1999-03-29 15:49:05 -05:00
|
|
|
virtual ~wxGenericPrintSetupDialog();
|
1999-03-25 18:06:01 -05:00
|
|
|
|
|
|
|
void Init(wxPrintData* data);
|
|
|
|
|
2004-11-01 10:24:44 -05:00
|
|
|
void OnPrinter(wxListEvent& event);
|
2004-12-06 12:37:31 -05:00
|
|
|
|
1999-03-25 18:06:01 -05:00
|
|
|
virtual bool TransferDataFromWindow();
|
|
|
|
virtual bool TransferDataToWindow();
|
|
|
|
|
2004-10-26 15:49:59 -04:00
|
|
|
virtual wxComboBox *CreatePaperTypeChoice();
|
1999-03-29 15:49:05 -05:00
|
|
|
|
1999-03-25 18:06:01 -05:00
|
|
|
public:
|
2004-11-01 10:24:44 -05:00
|
|
|
wxListCtrl* m_printerListCtrl;
|
1999-03-25 18:06:01 -05:00
|
|
|
wxRadioBox* m_orientationRadioBox;
|
|
|
|
wxTextCtrl* m_printerCommandText;
|
|
|
|
wxTextCtrl* m_printerOptionsText;
|
|
|
|
wxCheckBox* m_colourCheckBox;
|
2004-11-01 10:24:44 -05:00
|
|
|
wxComboBox* m_paperTypeChoice;
|
1999-03-29 15:49:05 -05:00
|
|
|
|
1999-03-25 18:06:01 -05:00
|
|
|
wxPrintData m_printData;
|
1999-03-29 15:49:05 -05:00
|
|
|
wxPrintData& GetPrintData() { return m_printData; }
|
2004-12-06 12:37:31 -05:00
|
|
|
|
2004-11-01 10:24:44 -05:00
|
|
|
// After pressing OK, write data here.
|
|
|
|
wxPrintData* m_targetData;
|
2002-09-13 18:00:45 -04:00
|
|
|
|
|
|
|
private:
|
2004-11-01 10:24:44 -05:00
|
|
|
DECLARE_EVENT_TABLE()
|
2002-09-13 18:00:45 -04:00
|
|
|
DECLARE_CLASS(wxGenericPrintSetupDialog)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
1999-06-09 14:16:38 -04:00
|
|
|
#endif
|
|
|
|
// wxUSE_POSTSCRIPT
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2004-11-20 09:46:25 -05:00
|
|
|
class WXDLLEXPORT wxGenericPageSetupDialog : public wxPageSetupDialogBase
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1999-03-25 18:06:01 -05:00
|
|
|
public:
|
2003-07-22 17:50:05 -04:00
|
|
|
wxGenericPageSetupDialog(wxWindow *parent = NULL,
|
2004-11-20 09:46:25 -05:00
|
|
|
wxPageSetupDialogData* data = NULL);
|
1999-03-29 15:49:05 -05:00
|
|
|
virtual ~wxGenericPageSetupDialog();
|
1999-03-25 18:06:01 -05:00
|
|
|
|
|
|
|
virtual bool TransferDataFromWindow();
|
|
|
|
virtual bool TransferDataToWindow();
|
|
|
|
|
2004-11-20 09:46:25 -05:00
|
|
|
virtual wxPageSetupDialogData& GetPageSetupDialogData();
|
1999-03-29 15:49:05 -05:00
|
|
|
|
2004-11-20 09:46:25 -05:00
|
|
|
void OnPrinter(wxCommandEvent& event);
|
1999-08-03 11:20:23 -04:00
|
|
|
wxComboBox *CreatePaperTypeChoice(int* x, int* y);
|
1999-03-25 18:06:01 -05:00
|
|
|
|
|
|
|
public:
|
|
|
|
wxButton* m_printerButton;
|
|
|
|
wxRadioBox* m_orientationRadioBox;
|
|
|
|
wxTextCtrl* m_marginLeftText;
|
|
|
|
wxTextCtrl* m_marginTopText;
|
|
|
|
wxTextCtrl* m_marginRightText;
|
|
|
|
wxTextCtrl* m_marginBottomText;
|
1999-08-03 11:20:23 -04:00
|
|
|
wxComboBox* m_paperTypeChoice;
|
1999-03-29 15:49:05 -05:00
|
|
|
|
2004-11-20 09:46:25 -05:00
|
|
|
wxPageSetupDialogData m_pageData;
|
1999-03-29 15:49:05 -05:00
|
|
|
|
|
|
|
private:
|
1999-03-25 18:06:01 -05:00
|
|
|
DECLARE_EVENT_TABLE()
|
2003-07-22 17:50:05 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericPageSetupDialog)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
1999-06-15 16:21:59 -04:00
|
|
|
#endif
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
2004-11-12 16:43:25 -05:00
|
|
|
// __PRINTDLGH_G_
|