Made wxPageSetupDialog a pimpl implementation.
Added a few clean-ups. Added native GNOME page setup dialog. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30669 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -221,20 +221,20 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
// wxUSE_POSTSCRIPT
|
// wxUSE_POSTSCRIPT
|
||||||
|
|
||||||
class WXDLLEXPORT wxGenericPageSetupDialog : public wxDialog
|
class WXDLLEXPORT wxGenericPageSetupDialog : public wxPageSetupDialogBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxGenericPageSetupDialog(wxWindow *parent = NULL,
|
wxGenericPageSetupDialog(wxWindow *parent = NULL,
|
||||||
wxPageSetupData* data = NULL);
|
wxPageSetupDialogData* data = NULL);
|
||||||
virtual ~wxGenericPageSetupDialog();
|
virtual ~wxGenericPageSetupDialog();
|
||||||
|
|
||||||
virtual bool TransferDataFromWindow();
|
virtual bool TransferDataFromWindow();
|
||||||
virtual bool TransferDataToWindow();
|
virtual bool TransferDataToWindow();
|
||||||
|
|
||||||
void OnPrinter(wxCommandEvent& event);
|
virtual wxPageSetupDialogData& GetPageSetupDialogData();
|
||||||
|
|
||||||
|
void OnPrinter(wxCommandEvent& event);
|
||||||
wxComboBox *CreatePaperTypeChoice(int* x, int* y);
|
wxComboBox *CreatePaperTypeChoice(int* x, int* y);
|
||||||
wxPageSetupData& GetPageSetupData() { return m_pageData; }
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxButton* m_printerButton;
|
wxButton* m_printerButton;
|
||||||
@@ -245,7 +245,7 @@ public:
|
|||||||
wxTextCtrl* m_marginBottomText;
|
wxTextCtrl* m_marginBottomText;
|
||||||
wxComboBox* m_paperTypeChoice;
|
wxComboBox* m_paperTypeChoice;
|
||||||
|
|
||||||
wxPageSetupData m_pageData;
|
wxPageSetupDialogData m_pageData;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
|
@@ -77,7 +77,10 @@ public:
|
|||||||
wxPrintDialogData *data = NULL );
|
wxPrintDialogData *data = NULL );
|
||||||
virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
|
virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
|
||||||
wxPrintData *data );
|
wxPrintData *data );
|
||||||
|
|
||||||
|
virtual wxPageSetupDialogBase *CreatePageSetupDialog( wxWindow *parent,
|
||||||
|
wxPageSetupDialogData * data = NULL );
|
||||||
|
|
||||||
virtual bool HasPrintSetupDialog();
|
virtual bool HasPrintSetupDialog();
|
||||||
virtual wxDialog *CreatePrintSetupDialog( wxWindow *parent, wxPrintData *data );
|
virtual wxDialog *CreatePrintSetupDialog( wxWindow *parent, wxPrintData *data );
|
||||||
virtual bool HasOwnPrintToFile();
|
virtual bool HasOwnPrintToFile();
|
||||||
@@ -97,7 +100,7 @@ class wxGnomePrintDialog: public wxPrintDialogBase
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxGnomePrintDialog( wxWindow *parent,
|
wxGnomePrintDialog( wxWindow *parent,
|
||||||
wxPrintDialogData* data = (wxPrintDialogData*)NULL );
|
wxPrintDialogData* data = NULL );
|
||||||
wxGnomePrintDialog( wxWindow *parent, wxPrintData* data);
|
wxGnomePrintDialog( wxWindow *parent, wxPrintData* data);
|
||||||
~wxGnomePrintDialog();
|
~wxGnomePrintDialog();
|
||||||
|
|
||||||
@@ -130,6 +133,40 @@ private:
|
|||||||
DECLARE_DYNAMIC_CLASS(wxGnomePrintDialog)
|
DECLARE_DYNAMIC_CLASS(wxGnomePrintDialog)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
// wxGnomePageSetupDialog
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class wxGnomePageSetupDialog: public wxPageSetupDialogBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxGnomePageSetupDialog( wxWindow *parent,
|
||||||
|
wxPageSetupDialogData* data = NULL );
|
||||||
|
~wxGnomePageSetupDialog();
|
||||||
|
|
||||||
|
virtual wxPageSetupDialogData& GetPageSetupDialogData();
|
||||||
|
|
||||||
|
virtual int ShowModal();
|
||||||
|
|
||||||
|
virtual bool Validate();
|
||||||
|
virtual bool TransferDataToWindow();
|
||||||
|
virtual bool TransferDataFromWindow();
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Implement some base class methods to do nothing to avoid asserts and
|
||||||
|
// GTK warnings, since this is not a real wxDialog.
|
||||||
|
virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
|
||||||
|
int WXUNUSED(width), int WXUNUSED(height),
|
||||||
|
int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {}
|
||||||
|
virtual void DoMoveWindow(int WXUNUSED(x), int WXUNUSED(y),
|
||||||
|
int WXUNUSED(width), int WXUNUSED(height)) {}
|
||||||
|
|
||||||
|
wxPageSetupDialogData m_pageDialogData;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxGnomePageSetupDialog)
|
||||||
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// wxGnomePrinter
|
// wxGnomePrinter
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@@ -77,7 +77,10 @@ public:
|
|||||||
wxPrintDialogData *data = NULL );
|
wxPrintDialogData *data = NULL );
|
||||||
virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
|
virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
|
||||||
wxPrintData *data );
|
wxPrintData *data );
|
||||||
|
|
||||||
|
virtual wxPageSetupDialogBase *CreatePageSetupDialog( wxWindow *parent,
|
||||||
|
wxPageSetupDialogData * data = NULL );
|
||||||
|
|
||||||
virtual bool HasPrintSetupDialog();
|
virtual bool HasPrintSetupDialog();
|
||||||
virtual wxDialog *CreatePrintSetupDialog( wxWindow *parent, wxPrintData *data );
|
virtual wxDialog *CreatePrintSetupDialog( wxWindow *parent, wxPrintData *data );
|
||||||
virtual bool HasOwnPrintToFile();
|
virtual bool HasOwnPrintToFile();
|
||||||
@@ -97,7 +100,7 @@ class wxGnomePrintDialog: public wxPrintDialogBase
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxGnomePrintDialog( wxWindow *parent,
|
wxGnomePrintDialog( wxWindow *parent,
|
||||||
wxPrintDialogData* data = (wxPrintDialogData*)NULL );
|
wxPrintDialogData* data = NULL );
|
||||||
wxGnomePrintDialog( wxWindow *parent, wxPrintData* data);
|
wxGnomePrintDialog( wxWindow *parent, wxPrintData* data);
|
||||||
~wxGnomePrintDialog();
|
~wxGnomePrintDialog();
|
||||||
|
|
||||||
@@ -130,6 +133,40 @@ private:
|
|||||||
DECLARE_DYNAMIC_CLASS(wxGnomePrintDialog)
|
DECLARE_DYNAMIC_CLASS(wxGnomePrintDialog)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
// wxGnomePageSetupDialog
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class wxGnomePageSetupDialog: public wxPageSetupDialogBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxGnomePageSetupDialog( wxWindow *parent,
|
||||||
|
wxPageSetupDialogData* data = NULL );
|
||||||
|
~wxGnomePageSetupDialog();
|
||||||
|
|
||||||
|
virtual wxPageSetupDialogData& GetPageSetupDialogData();
|
||||||
|
|
||||||
|
virtual int ShowModal();
|
||||||
|
|
||||||
|
virtual bool Validate();
|
||||||
|
virtual bool TransferDataToWindow();
|
||||||
|
virtual bool TransferDataFromWindow();
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Implement some base class methods to do nothing to avoid asserts and
|
||||||
|
// GTK warnings, since this is not a real wxDialog.
|
||||||
|
virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
|
||||||
|
int WXUNUSED(width), int WXUNUSED(height),
|
||||||
|
int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {}
|
||||||
|
virtual void DoMoveWindow(int WXUNUSED(x), int WXUNUSED(y),
|
||||||
|
int WXUNUSED(width), int WXUNUSED(height)) {}
|
||||||
|
|
||||||
|
wxPageSetupDialogData m_pageDialogData;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxGnomePageSetupDialog)
|
||||||
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// wxGnomePrinter
|
// wxGnomePrinter
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@@ -40,8 +40,8 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* wxPrinterDialog
|
* wxMacPrintDialog
|
||||||
* The common dialog for printing.
|
* The Mac dialog for printing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class WXDLLEXPORT wxDC;
|
class WXDLLEXPORT wxDC;
|
||||||
@@ -70,22 +70,28 @@ private:
|
|||||||
DECLARE_DYNAMIC_CLASS(wxPrintDialog)
|
DECLARE_DYNAMIC_CLASS(wxPrintDialog)
|
||||||
};
|
};
|
||||||
|
|
||||||
class WXDLLEXPORT wxPageSetupDialog: public wxDialog
|
/*
|
||||||
|
* wxMacPageSetupDialog
|
||||||
|
* The Mac page setup dialog
|
||||||
|
*/
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxMacPageSetupDialog: public wxPageSetupDialogBase
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxPageSetupDialog)
|
public:
|
||||||
|
wxMacPageSetupDialog(wxWindow *parent, wxPageSetupDialogData *data = NULL);
|
||||||
|
~wxMacPageSetupDialog();
|
||||||
|
|
||||||
public:
|
virtual wxPageSetupData& GetPageSetupDialogData();
|
||||||
wxPageSetupDialog();
|
|
||||||
wxPageSetupDialog(wxWindow *parent, wxPageSetupData *data = NULL);
|
bool Create(wxWindow *parent, wxPageSetupDialogData *data = NULL);
|
||||||
~wxPageSetupDialog();
|
virtual int ShowModal();
|
||||||
|
|
||||||
bool Create(wxWindow *parent, wxPageSetupData *data = NULL);
|
private:
|
||||||
virtual int ShowModal();
|
wxPageSetupDialogData m_pageSetupData;
|
||||||
|
wxWindow* m_dialogParent;
|
||||||
inline wxPageSetupData& GetPageSetupData() { return m_pageSetupData; }
|
|
||||||
private:
|
private:
|
||||||
wxPageSetupData m_pageSetupData;
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMacPageSetupDialog)
|
||||||
wxWindow* m_dialogParent;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -54,7 +54,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// wxPrinterDialog: the common dialog for printing.
|
// wxWindowsPrintDialog: the MSW dialog for printing
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLEXPORT wxWindowsPrintDialog : public wxPrintDialogBase
|
class WXDLLEXPORT wxWindowsPrintDialog : public wxPrintDialogBase
|
||||||
@@ -89,28 +89,33 @@ private:
|
|||||||
DECLARE_CLASS(wxWindowsPrintDialog)
|
DECLARE_CLASS(wxWindowsPrintDialog)
|
||||||
};
|
};
|
||||||
|
|
||||||
class WXDLLEXPORT wxPageSetupDialog: public wxDialog
|
// ---------------------------------------------------------------------------
|
||||||
|
// wxWindowsPageSetupDialog: the MSW page setup dialog
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxWindowsPageSetupDialog: public wxPageSetupDialogBase
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxPageSetupDialog)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxPageSetupDialog();
|
wxWindowsPageSetupDialog();
|
||||||
wxPageSetupDialog(wxWindow *parent, wxPageSetupData *data = NULL);
|
wxWindowsPageSetupDialog(wxWindow *parent, wxPageSetupDialogData *data = NULL);
|
||||||
virtual ~wxPageSetupDialog();
|
virtual ~wxWindowsPageSetupDialog();
|
||||||
|
|
||||||
bool Create(wxWindow *parent, wxPageSetupData *data = NULL);
|
bool Create(wxWindow *parent, wxPageSetupDialogData *data = NULL);
|
||||||
virtual int ShowModal();
|
virtual int ShowModal();
|
||||||
bool ConvertToNative( wxPageSetupDialogData &data );
|
bool ConvertToNative( wxPageSetupDialogData &data );
|
||||||
bool ConvertFromNative( wxPageSetupDialogData &data );
|
bool ConvertFromNative( wxPageSetupDialogData &data );
|
||||||
|
|
||||||
wxPageSetupData& GetPageSetupData() { return m_pageSetupData; }
|
virtual wxPageSetupData& GetPageSetupDialogData() { return m_pageSetupData; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxPageSetupData m_pageSetupData;
|
wxPageSetupDialogData m_pageSetupData;
|
||||||
wxWindow* m_dialogParent;
|
wxWindow* m_dialogParent;
|
||||||
void* m_pageDlg;
|
|
||||||
|
// holds MSW handle
|
||||||
|
void* m_pageDlg;
|
||||||
|
|
||||||
DECLARE_NO_COPY_CLASS(wxPageSetupDialog)
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxWindowsPageSetupDialog)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // wxUSE_PRINTING_ARCHITECTURE
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// wxPrintDialogBase: interface for the common dialog for printing.
|
// wxPrintDialogBase: interface for the dialog for printing
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLEXPORT wxPrintDialogBase : public wxDialog
|
class WXDLLEXPORT wxPrintDialogBase : public wxDialog
|
||||||
@@ -30,8 +30,6 @@ public:
|
|||||||
const wxSize &size = wxDefaultSize,
|
const wxSize &size = wxDefaultSize,
|
||||||
long style = wxDEFAULT_DIALOG_STYLE);
|
long style = wxDEFAULT_DIALOG_STYLE);
|
||||||
|
|
||||||
virtual int ShowModal() = 0;
|
|
||||||
|
|
||||||
virtual wxPrintDialogData& GetPrintDialogData() = 0;
|
virtual wxPrintDialogData& GetPrintDialogData() = 0;
|
||||||
virtual wxPrintData& GetPrintData() = 0;
|
virtual wxPrintData& GetPrintData() = 0;
|
||||||
virtual wxDC *GetPrintDC() = 0;
|
virtual wxDC *GetPrintDC() = 0;
|
||||||
@@ -42,7 +40,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// wxPrintDialog: the common dialog for printing.
|
// wxPrintDialog: the dialog for printing.
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLEXPORT wxPrintDialog : public wxObject
|
class WXDLLEXPORT wxPrintDialog : public wxObject
|
||||||
@@ -66,31 +64,51 @@ private:
|
|||||||
DECLARE_NO_COPY_CLASS(wxPrintDialog)
|
DECLARE_NO_COPY_CLASS(wxPrintDialog)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
// ---------------------------------------------------------------------------
|
||||||
|
// wxPageSetupDialogBase: interface for the page setup dialog
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
#if defined(__WXUNIVERSAL__) && (!defined(__WXMSW__) || wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW)
|
class WXDLLEXPORT wxPageSetupDialogBase: public wxDialog
|
||||||
#include "wx/generic/prntdlgg.h"
|
{
|
||||||
#elif defined(__PALMOS__)
|
public:
|
||||||
#include "wx/palmos/printdlg.h"
|
wxPageSetupDialogBase() { }
|
||||||
#elif defined(__WXMSW__)
|
wxPageSetupDialogBase(wxWindow *parent,
|
||||||
#include "wx/msw/printdlg.h"
|
wxWindowID id = wxID_ANY,
|
||||||
#elif defined(__WXMOTIF__)
|
const wxString &title = wxEmptyString,
|
||||||
#include "wx/generic/prntdlgg.h"
|
const wxPoint &pos = wxDefaultPosition,
|
||||||
#elif defined(__WXGTK__)
|
const wxSize &size = wxDefaultSize,
|
||||||
#include "wx/generic/prntdlgg.h"
|
long style = wxDEFAULT_DIALOG_STYLE);
|
||||||
#elif defined(__WXX11__)
|
|
||||||
#include "wx/generic/prntdlgg.h"
|
virtual wxPageSetupDialogData& GetPageSetupDialogData() = 0;
|
||||||
#elif defined(__WXMGL__)
|
|
||||||
#include "wx/generic/prntdlgg.h"
|
private:
|
||||||
#elif defined(__WXMAC__)
|
DECLARE_ABSTRACT_CLASS(wxPageSetupDialogBase)
|
||||||
#include "wx/mac/printdlg.h"
|
DECLARE_NO_COPY_CLASS(wxPageSetupDialogBase)
|
||||||
#elif defined(__WXPM__)
|
};
|
||||||
#include "wx/generic/prntdlgg.h"
|
|
||||||
#endif
|
// ---------------------------------------------------------------------------
|
||||||
|
// wxPageSetupDialog: the page setup dialog
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxPageSetupDialog: public wxObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxPageSetupDialog(wxWindow *parent, wxPageSetupDialogData *data = NULL);
|
||||||
|
~wxPageSetupDialog();
|
||||||
|
|
||||||
|
int ShowModal();
|
||||||
|
wxPageSetupDialogData& GetPageSetupDialogData();
|
||||||
|
// old name
|
||||||
|
wxPageSetupDialogData& GetPageSetupData();
|
||||||
|
|
||||||
|
private:
|
||||||
|
wxPageSetupDialogBase *m_pimpl;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxPageSetupDialog)
|
||||||
|
DECLARE_NO_COPY_CLASS(wxPageSetupDialog)
|
||||||
|
};
|
||||||
|
|
||||||
#if (defined(__WXUNIVERSAL__) && (!defined(__WXMSW__) || wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW) ) || (!defined(__WXMSW__) && !defined(__WXMAC__))
|
|
||||||
#define wxPrintSetupDialog wxGenericPrintSetupDialog
|
|
||||||
#define wxPageSetupDialog wxGenericPageSetupDialog
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -32,8 +32,10 @@ class WXDLLEXPORT wxButton;
|
|||||||
class WXDLLEXPORT wxChoice;
|
class WXDLLEXPORT wxChoice;
|
||||||
class WXDLLEXPORT wxPrintout;
|
class WXDLLEXPORT wxPrintout;
|
||||||
class WXDLLEXPORT wxPrinterBase;
|
class WXDLLEXPORT wxPrinterBase;
|
||||||
class WXDLLEXPORT wxPrintDialog;
|
|
||||||
class WXDLLEXPORT wxPrintDialogBase;
|
class WXDLLEXPORT wxPrintDialogBase;
|
||||||
|
class WXDLLEXPORT wxPrintDialog;
|
||||||
|
class WXDLLEXPORT wxPageSetupDialogBase;
|
||||||
|
class WXDLLEXPORT wxPageSetupDialog;
|
||||||
class WXDLLEXPORT wxPrintPreviewBase;
|
class WXDLLEXPORT wxPrintPreviewBase;
|
||||||
class WXDLLEXPORT wxPreviewCanvas;
|
class WXDLLEXPORT wxPreviewCanvas;
|
||||||
class WXDLLEXPORT wxPreviewControlBar;
|
class WXDLLEXPORT wxPreviewControlBar;
|
||||||
@@ -76,6 +78,9 @@ public:
|
|||||||
virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
|
virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
|
||||||
wxPrintData *data ) = 0;
|
wxPrintData *data ) = 0;
|
||||||
|
|
||||||
|
virtual wxPageSetupDialogBase *CreatePageSetupDialog( wxWindow *parent,
|
||||||
|
wxPageSetupDialogData * data = NULL ) = 0;
|
||||||
|
|
||||||
// What to do and what to show in the wxPrintDialog
|
// What to do and what to show in the wxPrintDialog
|
||||||
// a) Use the generic print setup dialog or a native one?
|
// a) Use the generic print setup dialog or a native one?
|
||||||
virtual bool HasPrintSetupDialog() = 0;
|
virtual bool HasPrintSetupDialog() = 0;
|
||||||
@@ -114,6 +119,9 @@ public:
|
|||||||
virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
|
virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
|
||||||
wxPrintData *data );
|
wxPrintData *data );
|
||||||
|
|
||||||
|
virtual wxPageSetupDialogBase *CreatePageSetupDialog( wxWindow *parent,
|
||||||
|
wxPageSetupDialogData * data = NULL );
|
||||||
|
|
||||||
virtual bool HasPrintSetupDialog();
|
virtual bool HasPrintSetupDialog();
|
||||||
virtual wxDialog *CreatePrintSetupDialog( wxWindow *parent, wxPrintData *data );
|
virtual wxDialog *CreatePrintSetupDialog( wxWindow *parent, wxPrintData *data );
|
||||||
virtual bool HasOwnPrintToFile();
|
virtual bool HasOwnPrintToFile();
|
||||||
|
@@ -810,49 +810,15 @@ wxComboBox *wxGenericPrintSetupDialog::CreatePaperTypeChoice()
|
|||||||
// Generic page setup dialog
|
// Generic page setup dialog
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_CLASS(wxGenericPageSetupDialog, wxDialog)
|
IMPLEMENT_CLASS(wxGenericPageSetupDialog, wxPageSetupDialogBase)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxGenericPageSetupDialog, wxDialog)
|
BEGIN_EVENT_TABLE(wxGenericPageSetupDialog, wxPageSetupDialogBase)
|
||||||
EVT_BUTTON(wxPRINTID_SETUP, wxGenericPageSetupDialog::OnPrinter)
|
EVT_BUTTON(wxPRINTID_SETUP, wxGenericPageSetupDialog::OnPrinter)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
void wxGenericPageSetupDialog::OnPrinter(wxCommandEvent& WXUNUSED(event))
|
|
||||||
{
|
|
||||||
// We no longer query GetPrintMode, so we can eliminate the need
|
|
||||||
// to call SetPrintMode.
|
|
||||||
// This has the limitation that we can't explicitly call the PostScript
|
|
||||||
// print setup dialog from the generic Page Setup dialog under Windows,
|
|
||||||
// but since this choice would only happen when trying to do PostScript
|
|
||||||
// printing under Windows (and only in 16-bit Windows which
|
|
||||||
// doesn't have a Windows-specific page setup dialog) it's worth it.
|
|
||||||
|
|
||||||
// First save the current settings, so the wxPrintData object is up to date.
|
|
||||||
TransferDataFromWindow();
|
|
||||||
|
|
||||||
// Transfer the current print settings from this dialog to the page setup dialog.
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
// Use print factory later
|
|
||||||
|
|
||||||
wxPrintDialogData data;
|
|
||||||
data = GetPageSetupData().GetPrintData();
|
|
||||||
data.SetSetupDialog(true);
|
|
||||||
wxPrintDialog printDialog(this, & data);
|
|
||||||
printDialog.ShowModal();
|
|
||||||
|
|
||||||
// Transfer the page setup print settings from the page dialog to this dialog again, in case
|
|
||||||
// the page setup dialog changed something.
|
|
||||||
GetPageSetupData().GetPrintData() = printDialog.GetPrintDialogData().GetPrintData();
|
|
||||||
GetPageSetupData().CalculatePaperSizeFromId(); // Make sure page size reflects the id in wxPrintData
|
|
||||||
|
|
||||||
// Now update the dialog in case the page setup dialog changed some of our settings.
|
|
||||||
TransferDataToWindow();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
wxGenericPageSetupDialog::wxGenericPageSetupDialog( wxWindow *parent,
|
wxGenericPageSetupDialog::wxGenericPageSetupDialog( wxWindow *parent,
|
||||||
wxPageSetupData* data)
|
wxPageSetupDialogData* data)
|
||||||
: wxDialog( parent,
|
: wxPageSetupDialogBase( parent,
|
||||||
wxID_ANY,
|
wxID_ANY,
|
||||||
_("Page Setup"),
|
_("Page Setup"),
|
||||||
wxPoint(0, 0),
|
wxPoint(0, 0),
|
||||||
@@ -939,10 +905,19 @@ wxGenericPageSetupDialog::wxGenericPageSetupDialog( wxWindow *parent,
|
|||||||
// 6) buttons
|
// 6) buttons
|
||||||
|
|
||||||
wxSizer* buttonsizer = CreateButtonSizer( wxOK|wxCANCEL);
|
wxSizer* buttonsizer = CreateButtonSizer( wxOK|wxCANCEL);
|
||||||
m_printerButton = new wxButton(this, wxPRINTID_SETUP, _("Printer...") );
|
|
||||||
buttonsizer->Add( m_printerButton, 0, wxLEFT|wxRIGHT, 10 );
|
if (wxPrintFactory::GetFactory()->HasPrintSetupDialog())
|
||||||
if ( !m_pageData.GetEnablePrinter() )
|
{
|
||||||
m_printerButton->Enable(false);
|
m_printerButton = new wxButton(this, wxPRINTID_SETUP, _("Printer...") );
|
||||||
|
buttonsizer->Add( m_printerButton, 0, wxLEFT|wxRIGHT, 10 );
|
||||||
|
if ( !m_pageData.GetEnablePrinter() )
|
||||||
|
m_printerButton->Enable(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_printerButton = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// if (m_printData.GetEnableHelp())
|
// if (m_printData.GetEnableHelp())
|
||||||
// wxButton *helpButton = new wxButton(this, (wxFunction)wxGenericPageSetupHelpProc, _("Help"), wxDefaultCoord, wxDefaultCoord, buttonWidth, buttonHeight);
|
// wxButton *helpButton = new wxButton(this, (wxFunction)wxGenericPageSetupHelpProc, _("Help"), wxDefaultCoord, wxDefaultCoord, buttonWidth, buttonHeight);
|
||||||
mainsizer->Add( buttonsizer, 0, wxCENTER|wxALL, 10 );
|
mainsizer->Add( buttonsizer, 0, wxCENTER|wxALL, 10 );
|
||||||
@@ -964,6 +939,11 @@ wxGenericPageSetupDialog::~wxGenericPageSetupDialog()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxPageSetupDialogData& wxGenericPageSetupDialog::GetPageSetupDialogData()
|
||||||
|
{
|
||||||
|
return m_pageData;
|
||||||
|
}
|
||||||
|
|
||||||
bool wxGenericPageSetupDialog::TransferDataToWindow()
|
bool wxGenericPageSetupDialog::TransferDataToWindow()
|
||||||
{
|
{
|
||||||
if (m_marginLeftText)
|
if (m_marginLeftText)
|
||||||
@@ -1080,5 +1060,39 @@ wxComboBox *wxGenericPageSetupDialog::CreatePaperTypeChoice(int *x, int *y)
|
|||||||
return choice;
|
return choice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxGenericPageSetupDialog::OnPrinter(wxCommandEvent& WXUNUSED(event))
|
||||||
|
{
|
||||||
|
// We no longer query GetPrintMode, so we can eliminate the need
|
||||||
|
// to call SetPrintMode.
|
||||||
|
// This has the limitation that we can't explicitly call the PostScript
|
||||||
|
// print setup dialog from the generic Page Setup dialog under Windows,
|
||||||
|
// but since this choice would only happen when trying to do PostScript
|
||||||
|
// printing under Windows (and only in 16-bit Windows which
|
||||||
|
// doesn't have a Windows-specific page setup dialog) it's worth it.
|
||||||
|
|
||||||
|
// First save the current settings, so the wxPrintData object is up to date.
|
||||||
|
TransferDataFromWindow();
|
||||||
|
|
||||||
|
// Transfer the current print settings from this dialog to the page setup dialog.
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
// Use print factory later
|
||||||
|
|
||||||
|
wxPrintDialogData data;
|
||||||
|
data = GetPageSetupData().GetPrintData();
|
||||||
|
data.SetSetupDialog(true);
|
||||||
|
wxPrintDialog printDialog(this, & data);
|
||||||
|
printDialog.ShowModal();
|
||||||
|
|
||||||
|
// Transfer the page setup print settings from the page dialog to this dialog again, in case
|
||||||
|
// the page setup dialog changed something.
|
||||||
|
GetPageSetupData().GetPrintData() = printDialog.GetPrintDialogData().GetPrintData();
|
||||||
|
GetPageSetupData().CalculatePaperSizeFromId(); // Make sure page size reflects the id in wxPrintData
|
||||||
|
|
||||||
|
// Now update the dialog in case the page setup dialog changed some of our settings.
|
||||||
|
TransferDataToWindow();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -27,11 +27,13 @@
|
|||||||
#include "wx/fontutil.h"
|
#include "wx/fontutil.h"
|
||||||
#include "wx/printdlg.h"
|
#include "wx/printdlg.h"
|
||||||
#include "wx/gtk/private.h"
|
#include "wx/gtk/private.h"
|
||||||
|
#include "wx/module.h"
|
||||||
|
|
||||||
#include <libgnomeprint/gnome-print.h>
|
#include <libgnomeprint/gnome-print.h>
|
||||||
#include <libgnomeprint/gnome-print-pango.h>
|
#include <libgnomeprint/gnome-print-pango.h>
|
||||||
#include <libgnomeprintui/gnome-print-dialog.h>
|
#include <libgnomeprintui/gnome-print-dialog.h>
|
||||||
#include <libgnomeprintui/gnome-print-job-preview.h>
|
#include <libgnomeprintui/gnome-print-job-preview.h>
|
||||||
|
#include <libgnomeprintui/gnome-print-paper-selector.h>
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// wxGnomePrintNativeData
|
// wxGnomePrintNativeData
|
||||||
@@ -98,6 +100,12 @@ wxPrintDialogBase *wxGnomePrintFactory::CreatePrintDialog( wxWindow *parent,
|
|||||||
return new wxGnomePrintDialog( parent, data );
|
return new wxGnomePrintDialog( parent, data );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxPageSetupDialogBase *wxGnomePrintFactory::CreatePageSetupDialog( wxWindow *parent,
|
||||||
|
wxPageSetupDialogData * data )
|
||||||
|
{
|
||||||
|
return new wxGnomePageSetupDialog( parent, data );
|
||||||
|
}
|
||||||
|
|
||||||
bool wxGnomePrintFactory::HasPrintSetupDialog()
|
bool wxGnomePrintFactory::HasPrintSetupDialog()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@@ -270,6 +278,90 @@ bool wxGnomePrintDialog::TransferDataFromWindow()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
// wxGnomePageSetupDialog
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
IMPLEMENT_CLASS(wxGnomePageSetupDialog, wxPageSetupDialogBase)
|
||||||
|
|
||||||
|
wxGnomePageSetupDialog::wxGnomePageSetupDialog( wxWindow *parent,
|
||||||
|
wxPageSetupDialogData* data )
|
||||||
|
{
|
||||||
|
if (data)
|
||||||
|
m_pageDialogData = *data;
|
||||||
|
|
||||||
|
wxGnomePrintNativeData *native =
|
||||||
|
(wxGnomePrintNativeData*) m_pageDialogData.GetPrintData().GetNativeData();
|
||||||
|
|
||||||
|
m_widget = gtk_dialog_new();
|
||||||
|
|
||||||
|
gtk_window_set_title( GTK_WINDOW(m_widget), wxGTK_CONV( _("Page setup") ) );
|
||||||
|
|
||||||
|
GtkWidget *main = gnome_paper_selector_new_with_flags( native->GetPrintConfig(),
|
||||||
|
GNOME_PAPER_SELECTOR_MARGINS|GNOME_PAPER_SELECTOR_FEED_ORIENTATION );
|
||||||
|
gtk_container_set_border_width (GTK_CONTAINER (main), 8);
|
||||||
|
gtk_widget_show (main);
|
||||||
|
|
||||||
|
gtk_container_add( GTK_CONTAINER (GTK_DIALOG (m_widget)->vbox), main );
|
||||||
|
|
||||||
|
gtk_dialog_set_has_separator (GTK_DIALOG (m_widget), TRUE);
|
||||||
|
|
||||||
|
gtk_dialog_add_buttons (GTK_DIALOG (m_widget),
|
||||||
|
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||||
|
GTK_STOCK_OK, GTK_RESPONSE_OK,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
gtk_dialog_set_default_response (GTK_DIALOG (m_widget),
|
||||||
|
GTK_RESPONSE_OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxGnomePageSetupDialog::~wxGnomePageSetupDialog()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
wxPageSetupDialogData& wxGnomePageSetupDialog::GetPageSetupDialogData()
|
||||||
|
{
|
||||||
|
return m_pageDialogData;
|
||||||
|
}
|
||||||
|
|
||||||
|
int wxGnomePageSetupDialog::ShowModal()
|
||||||
|
{
|
||||||
|
// Transfer data from m_pageDialogData to native dialog
|
||||||
|
|
||||||
|
int ret = gtk_dialog_run( GTK_DIALOG(m_widget) );
|
||||||
|
|
||||||
|
if (ret == GTK_RESPONSE_OK)
|
||||||
|
{
|
||||||
|
// Transfer data back to m_pageDialogData
|
||||||
|
|
||||||
|
ret = wxID_OK;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ret = wxID_CANCEL;
|
||||||
|
}
|
||||||
|
|
||||||
|
gtk_widget_destroy( m_widget );
|
||||||
|
m_widget = NULL;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxGnomePageSetupDialog::Validate()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxGnomePageSetupDialog::TransferDataToWindow()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxGnomePageSetupDialog::TransferDataFromWindow()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// wxGnomePrinter
|
// wxGnomePrinter
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@@ -27,11 +27,13 @@
|
|||||||
#include "wx/fontutil.h"
|
#include "wx/fontutil.h"
|
||||||
#include "wx/printdlg.h"
|
#include "wx/printdlg.h"
|
||||||
#include "wx/gtk/private.h"
|
#include "wx/gtk/private.h"
|
||||||
|
#include "wx/module.h"
|
||||||
|
|
||||||
#include <libgnomeprint/gnome-print.h>
|
#include <libgnomeprint/gnome-print.h>
|
||||||
#include <libgnomeprint/gnome-print-pango.h>
|
#include <libgnomeprint/gnome-print-pango.h>
|
||||||
#include <libgnomeprintui/gnome-print-dialog.h>
|
#include <libgnomeprintui/gnome-print-dialog.h>
|
||||||
#include <libgnomeprintui/gnome-print-job-preview.h>
|
#include <libgnomeprintui/gnome-print-job-preview.h>
|
||||||
|
#include <libgnomeprintui/gnome-print-paper-selector.h>
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// wxGnomePrintNativeData
|
// wxGnomePrintNativeData
|
||||||
@@ -98,6 +100,12 @@ wxPrintDialogBase *wxGnomePrintFactory::CreatePrintDialog( wxWindow *parent,
|
|||||||
return new wxGnomePrintDialog( parent, data );
|
return new wxGnomePrintDialog( parent, data );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxPageSetupDialogBase *wxGnomePrintFactory::CreatePageSetupDialog( wxWindow *parent,
|
||||||
|
wxPageSetupDialogData * data )
|
||||||
|
{
|
||||||
|
return new wxGnomePageSetupDialog( parent, data );
|
||||||
|
}
|
||||||
|
|
||||||
bool wxGnomePrintFactory::HasPrintSetupDialog()
|
bool wxGnomePrintFactory::HasPrintSetupDialog()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@@ -270,6 +278,90 @@ bool wxGnomePrintDialog::TransferDataFromWindow()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
// wxGnomePageSetupDialog
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
IMPLEMENT_CLASS(wxGnomePageSetupDialog, wxPageSetupDialogBase)
|
||||||
|
|
||||||
|
wxGnomePageSetupDialog::wxGnomePageSetupDialog( wxWindow *parent,
|
||||||
|
wxPageSetupDialogData* data )
|
||||||
|
{
|
||||||
|
if (data)
|
||||||
|
m_pageDialogData = *data;
|
||||||
|
|
||||||
|
wxGnomePrintNativeData *native =
|
||||||
|
(wxGnomePrintNativeData*) m_pageDialogData.GetPrintData().GetNativeData();
|
||||||
|
|
||||||
|
m_widget = gtk_dialog_new();
|
||||||
|
|
||||||
|
gtk_window_set_title( GTK_WINDOW(m_widget), wxGTK_CONV( _("Page setup") ) );
|
||||||
|
|
||||||
|
GtkWidget *main = gnome_paper_selector_new_with_flags( native->GetPrintConfig(),
|
||||||
|
GNOME_PAPER_SELECTOR_MARGINS|GNOME_PAPER_SELECTOR_FEED_ORIENTATION );
|
||||||
|
gtk_container_set_border_width (GTK_CONTAINER (main), 8);
|
||||||
|
gtk_widget_show (main);
|
||||||
|
|
||||||
|
gtk_container_add( GTK_CONTAINER (GTK_DIALOG (m_widget)->vbox), main );
|
||||||
|
|
||||||
|
gtk_dialog_set_has_separator (GTK_DIALOG (m_widget), TRUE);
|
||||||
|
|
||||||
|
gtk_dialog_add_buttons (GTK_DIALOG (m_widget),
|
||||||
|
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||||
|
GTK_STOCK_OK, GTK_RESPONSE_OK,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
gtk_dialog_set_default_response (GTK_DIALOG (m_widget),
|
||||||
|
GTK_RESPONSE_OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxGnomePageSetupDialog::~wxGnomePageSetupDialog()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
wxPageSetupDialogData& wxGnomePageSetupDialog::GetPageSetupDialogData()
|
||||||
|
{
|
||||||
|
return m_pageDialogData;
|
||||||
|
}
|
||||||
|
|
||||||
|
int wxGnomePageSetupDialog::ShowModal()
|
||||||
|
{
|
||||||
|
// Transfer data from m_pageDialogData to native dialog
|
||||||
|
|
||||||
|
int ret = gtk_dialog_run( GTK_DIALOG(m_widget) );
|
||||||
|
|
||||||
|
if (ret == GTK_RESPONSE_OK)
|
||||||
|
{
|
||||||
|
// Transfer data back to m_pageDialogData
|
||||||
|
|
||||||
|
ret = wxID_OK;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ret = wxID_CANCEL;
|
||||||
|
}
|
||||||
|
|
||||||
|
gtk_widget_destroy( m_widget );
|
||||||
|
m_widget = NULL;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxGnomePageSetupDialog::Validate()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxGnomePageSetupDialog::TransferDataToWindow()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxGnomePageSetupDialog::TransferDataFromWindow()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// wxGnomePrinter
|
// wxGnomePrinter
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
#include "wx/object.h"
|
#include "wx/object.h"
|
||||||
#include "wx/printdlg.h"
|
#include "wx/printdlg.h"
|
||||||
|
#include "wx/mac/printdlg.h"
|
||||||
#include "wx/dcprint.h"
|
#include "wx/dcprint.h"
|
||||||
#include "wx/msgdlg.h"
|
#include "wx/msgdlg.h"
|
||||||
#include "wx/mac/private/print.h"
|
#include "wx/mac/private/print.h"
|
||||||
@@ -22,7 +23,6 @@
|
|||||||
// Use generic page setup dialog: use your own native one if one exists.
|
// Use generic page setup dialog: use your own native one if one exists.
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMacPrintDialog, wxPrintDialogBase)
|
IMPLEMENT_DYNAMIC_CLASS(wxMacPrintDialog, wxPrintDialogBase)
|
||||||
IMPLEMENT_CLASS(wxPageSetupDialog, wxDialog)
|
|
||||||
|
|
||||||
wxMacPrintDialog::wxMacPrintDialog()
|
wxMacPrintDialog::wxMacPrintDialog()
|
||||||
{
|
{
|
||||||
@@ -81,22 +81,18 @@ wxDC *wxMacPrintDialog::GetPrintDC()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* wxPageSetupDialog
|
* wxMacPageSetupDialog
|
||||||
*/
|
*/
|
||||||
|
|
||||||
wxPageSetupDialog::wxPageSetupDialog():
|
IMPLEMENT_CLASS(wxMacPageSetupDialog, wxPageSetupDialogBase)
|
||||||
wxDialog()
|
|
||||||
{
|
|
||||||
m_dialogParent = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxPageSetupDialog::wxPageSetupDialog(wxWindow *p, wxPageSetupData *data):
|
wxMacPageSetupDialog::wxMacPageSetupDialog(wxWindow *p, wxPageSetupDialogData *data) :
|
||||||
wxDialog()
|
wxPageSetupDialogBase()
|
||||||
{
|
{
|
||||||
Create(p, data);
|
Create(p, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxPageSetupDialog::Create(wxWindow *p, wxPageSetupData *data)
|
bool wxMacPageSetupDialog::Create(wxWindow *p, wxPageSetupDialogData *data)
|
||||||
{
|
{
|
||||||
m_dialogParent = p;
|
m_dialogParent = p;
|
||||||
|
|
||||||
@@ -106,17 +102,24 @@ bool wxPageSetupDialog::Create(wxWindow *p, wxPageSetupData *data)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxPageSetupDialog::~wxPageSetupDialog()
|
wxMacPageSetupDialog::~wxMacPageSetupDialog()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxPageSetupDialog::ShowModal()
|
wxPageSetupData& wxMacPageSetupDialog::GetPageSetupDialogData()
|
||||||
|
{
|
||||||
|
return m_pageSetupData;
|
||||||
|
}
|
||||||
|
|
||||||
|
int wxMacPageSetupDialog::ShowModal()
|
||||||
{
|
{
|
||||||
m_pageSetupData.ConvertToNative() ;
|
m_pageSetupData.ConvertToNative();
|
||||||
int result = m_pageSetupData.GetPrintData().m_nativePrintData->ShowPageSetupDialog() ;
|
|
||||||
|
int result = m_pageSetupData.GetPrintData().m_nativePrintData->ShowPageSetupDialog();
|
||||||
|
|
||||||
if (result == wxID_OK )
|
if (result == wxID_OK )
|
||||||
m_pageSetupData.ConvertFromNative() ;
|
m_pageSetupData.ConvertFromNative();
|
||||||
|
|
||||||
return result ;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
#include "wx/dcprint.h"
|
#include "wx/dcprint.h"
|
||||||
#include "wx/printdlg.h"
|
#include "wx/printdlg.h"
|
||||||
|
#include "wx/mac/printdlg.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
@@ -45,6 +45,7 @@
|
|||||||
|
|
||||||
#include "wx/dcprint.h"
|
#include "wx/dcprint.h"
|
||||||
#include "wx/printdlg.h"
|
#include "wx/printdlg.h"
|
||||||
|
#include "wx/msw/printdlg.h"
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
|
|
||||||
#if wxUSE_COMMON_DIALOGS
|
#if wxUSE_COMMON_DIALOGS
|
||||||
|
@@ -38,6 +38,7 @@
|
|||||||
|
|
||||||
#include "wx/cmndata.h"
|
#include "wx/cmndata.h"
|
||||||
#include "wx/printdlg.h"
|
#include "wx/printdlg.h"
|
||||||
|
#include "wx/msw/printdlg.h"
|
||||||
#include "wx/dcprint.h"
|
#include "wx/dcprint.h"
|
||||||
#include "wx/paper.h"
|
#include "wx/paper.h"
|
||||||
|
|
||||||
@@ -756,23 +757,23 @@ bool wxWindowsPrintDialog::ConvertFromNative( wxPrintDialogData &data )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// wxPageSetupDialog
|
// wxWidnowsPageSetupDialog
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_CLASS(wxPageSetupDialog, wxDialog)
|
IMPLEMENT_CLASS(wxWindowsPageSetupDialog, wxPageSetupDialogBase)
|
||||||
|
|
||||||
wxPageSetupDialog::wxPageSetupDialog()
|
wxWindowsPageSetupDialog::wxWindowsPageSetupDialog()
|
||||||
{
|
{
|
||||||
m_dialogParent = NULL;
|
m_dialogParent = NULL;
|
||||||
m_pageDlg = NULL;
|
m_pageDlg = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxPageSetupDialog::wxPageSetupDialog(wxWindow *p, wxPageSetupDialogData *data)
|
wxWindowsPageSetupDialog::wxWindowsPageSetupDialog(wxWindow *p, wxPageSetupDialogData *data)
|
||||||
{
|
{
|
||||||
Create(p, data);
|
Create(p, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxPageSetupDialog::Create(wxWindow *p, wxPageSetupDialogData *data)
|
bool wxWindowsPageSetupDialog::Create(wxWindow *p, wxPageSetupDialogData *data)
|
||||||
{
|
{
|
||||||
m_dialogParent = p;
|
m_dialogParent = p;
|
||||||
m_pageDlg = NULL;
|
m_pageDlg = NULL;
|
||||||
@@ -783,7 +784,7 @@ bool wxPageSetupDialog::Create(wxWindow *p, wxPageSetupDialogData *data)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxPageSetupDialog::~wxPageSetupDialog()
|
wxWindowsPageSetupDialog::~wxWindowsPageSetupDialog()
|
||||||
{
|
{
|
||||||
PAGESETUPDLG *pd = (PAGESETUPDLG *)m_pageDlg;
|
PAGESETUPDLG *pd = (PAGESETUPDLG *)m_pageDlg;
|
||||||
if ( pd && pd->hDevMode )
|
if ( pd && pd->hDevMode )
|
||||||
@@ -794,7 +795,7 @@ wxPageSetupDialog::~wxPageSetupDialog()
|
|||||||
delete pd;
|
delete pd;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxPageSetupDialog::ShowModal()
|
int wxWindowsPageSetupDialog::ShowModal()
|
||||||
{
|
{
|
||||||
ConvertToNative( m_pageSetupData );
|
ConvertToNative( m_pageSetupData );
|
||||||
|
|
||||||
@@ -816,7 +817,7 @@ int wxPageSetupDialog::ShowModal()
|
|||||||
return wxID_CANCEL;
|
return wxID_CANCEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxPageSetupDialog::ConvertToNative( wxPageSetupDialogData &data )
|
bool wxWindowsPageSetupDialog::ConvertToNative( wxPageSetupDialogData &data )
|
||||||
{
|
{
|
||||||
wxWindowsPrintNativeData *native_data =
|
wxWindowsPrintNativeData *native_data =
|
||||||
(wxWindowsPrintNativeData *) data.GetPrintData().GetNativeData();
|
(wxWindowsPrintNativeData *) data.GetPrintData().GetNativeData();
|
||||||
@@ -920,7 +921,7 @@ bool wxPageSetupDialog::ConvertToNative( wxPageSetupDialogData &data )
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxPageSetupDialog::ConvertFromNative( wxPageSetupDialogData &data )
|
bool wxWindowsPageSetupDialog::ConvertFromNative( wxPageSetupDialogData &data )
|
||||||
{
|
{
|
||||||
PAGESETUPDLG *pd = (PAGESETUPDLG *) m_pageDlg;
|
PAGESETUPDLG *pd = (PAGESETUPDLG *) m_pageDlg;
|
||||||
if ( !pd )
|
if ( !pd )
|
||||||
|
Reference in New Issue
Block a user