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
|
||||
// wxUSE_POSTSCRIPT
|
||||
|
||||
class WXDLLEXPORT wxGenericPageSetupDialog : public wxDialog
|
||||
class WXDLLEXPORT wxGenericPageSetupDialog : public wxPageSetupDialogBase
|
||||
{
|
||||
public:
|
||||
wxGenericPageSetupDialog(wxWindow *parent = NULL,
|
||||
wxPageSetupData* data = NULL);
|
||||
wxPageSetupDialogData* data = NULL);
|
||||
virtual ~wxGenericPageSetupDialog();
|
||||
|
||||
virtual bool TransferDataFromWindow();
|
||||
virtual bool TransferDataToWindow();
|
||||
|
||||
void OnPrinter(wxCommandEvent& event);
|
||||
virtual wxPageSetupDialogData& GetPageSetupDialogData();
|
||||
|
||||
void OnPrinter(wxCommandEvent& event);
|
||||
wxComboBox *CreatePaperTypeChoice(int* x, int* y);
|
||||
wxPageSetupData& GetPageSetupData() { return m_pageData; }
|
||||
|
||||
public:
|
||||
wxButton* m_printerButton;
|
||||
@@ -245,7 +245,7 @@ public:
|
||||
wxTextCtrl* m_marginBottomText;
|
||||
wxComboBox* m_paperTypeChoice;
|
||||
|
||||
wxPageSetupData m_pageData;
|
||||
wxPageSetupDialogData m_pageData;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
@@ -77,7 +77,10 @@ public:
|
||||
wxPrintDialogData *data = NULL );
|
||||
virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
|
||||
wxPrintData *data );
|
||||
|
||||
|
||||
virtual wxPageSetupDialogBase *CreatePageSetupDialog( wxWindow *parent,
|
||||
wxPageSetupDialogData * data = NULL );
|
||||
|
||||
virtual bool HasPrintSetupDialog();
|
||||
virtual wxDialog *CreatePrintSetupDialog( wxWindow *parent, wxPrintData *data );
|
||||
virtual bool HasOwnPrintToFile();
|
||||
@@ -97,7 +100,7 @@ class wxGnomePrintDialog: public wxPrintDialogBase
|
||||
{
|
||||
public:
|
||||
wxGnomePrintDialog( wxWindow *parent,
|
||||
wxPrintDialogData* data = (wxPrintDialogData*)NULL );
|
||||
wxPrintDialogData* data = NULL );
|
||||
wxGnomePrintDialog( wxWindow *parent, wxPrintData* data);
|
||||
~wxGnomePrintDialog();
|
||||
|
||||
@@ -130,6 +133,40 @@ private:
|
||||
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
|
||||
//----------------------------------------------------------------------------
|
||||
|
@@ -77,7 +77,10 @@ public:
|
||||
wxPrintDialogData *data = NULL );
|
||||
virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
|
||||
wxPrintData *data );
|
||||
|
||||
|
||||
virtual wxPageSetupDialogBase *CreatePageSetupDialog( wxWindow *parent,
|
||||
wxPageSetupDialogData * data = NULL );
|
||||
|
||||
virtual bool HasPrintSetupDialog();
|
||||
virtual wxDialog *CreatePrintSetupDialog( wxWindow *parent, wxPrintData *data );
|
||||
virtual bool HasOwnPrintToFile();
|
||||
@@ -97,7 +100,7 @@ class wxGnomePrintDialog: public wxPrintDialogBase
|
||||
{
|
||||
public:
|
||||
wxGnomePrintDialog( wxWindow *parent,
|
||||
wxPrintDialogData* data = (wxPrintDialogData*)NULL );
|
||||
wxPrintDialogData* data = NULL );
|
||||
wxGnomePrintDialog( wxWindow *parent, wxPrintData* data);
|
||||
~wxGnomePrintDialog();
|
||||
|
||||
@@ -130,6 +133,40 @@ private:
|
||||
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
|
||||
//----------------------------------------------------------------------------
|
||||
|
@@ -40,8 +40,8 @@ public:
|
||||
};
|
||||
|
||||
/*
|
||||
* wxPrinterDialog
|
||||
* The common dialog for printing.
|
||||
* wxMacPrintDialog
|
||||
* The Mac dialog for printing
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxDC;
|
||||
@@ -70,22 +70,28 @@ private:
|
||||
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:
|
||||
wxPageSetupDialog();
|
||||
wxPageSetupDialog(wxWindow *parent, wxPageSetupData *data = NULL);
|
||||
~wxPageSetupDialog();
|
||||
|
||||
bool Create(wxWindow *parent, wxPageSetupData *data = NULL);
|
||||
virtual int ShowModal();
|
||||
|
||||
inline wxPageSetupData& GetPageSetupData() { return m_pageSetupData; }
|
||||
private:
|
||||
wxPageSetupData m_pageSetupData;
|
||||
wxWindow* m_dialogParent;
|
||||
virtual wxPageSetupData& GetPageSetupDialogData();
|
||||
|
||||
bool Create(wxWindow *parent, wxPageSetupDialogData *data = NULL);
|
||||
virtual int ShowModal();
|
||||
|
||||
private:
|
||||
wxPageSetupDialogData m_pageSetupData;
|
||||
wxWindow* m_dialogParent;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMacPageSetupDialog)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -54,7 +54,7 @@ private:
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxPrinterDialog: the common dialog for printing.
|
||||
// wxWindowsPrintDialog: the MSW dialog for printing
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxWindowsPrintDialog : public wxPrintDialogBase
|
||||
@@ -89,28 +89,33 @@ private:
|
||||
DECLARE_CLASS(wxWindowsPrintDialog)
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxPageSetupDialog: public wxDialog
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxWindowsPageSetupDialog: the MSW page setup dialog
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxWindowsPageSetupDialog: public wxPageSetupDialogBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPageSetupDialog)
|
||||
|
||||
public:
|
||||
wxPageSetupDialog();
|
||||
wxPageSetupDialog(wxWindow *parent, wxPageSetupData *data = NULL);
|
||||
virtual ~wxPageSetupDialog();
|
||||
wxWindowsPageSetupDialog();
|
||||
wxWindowsPageSetupDialog(wxWindow *parent, wxPageSetupDialogData *data = NULL);
|
||||
virtual ~wxWindowsPageSetupDialog();
|
||||
|
||||
bool Create(wxWindow *parent, wxPageSetupData *data = NULL);
|
||||
bool Create(wxWindow *parent, wxPageSetupDialogData *data = NULL);
|
||||
virtual int ShowModal();
|
||||
bool ConvertToNative( wxPageSetupDialogData &data );
|
||||
bool ConvertFromNative( wxPageSetupDialogData &data );
|
||||
|
||||
wxPageSetupData& GetPageSetupData() { return m_pageSetupData; }
|
||||
virtual wxPageSetupData& GetPageSetupDialogData() { return m_pageSetupData; }
|
||||
|
||||
private:
|
||||
wxPageSetupData m_pageSetupData;
|
||||
wxWindow* m_dialogParent;
|
||||
void* m_pageDlg;
|
||||
wxPageSetupDialogData m_pageSetupData;
|
||||
wxWindow* m_dialogParent;
|
||||
|
||||
// holds MSW handle
|
||||
void* m_pageDlg;
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxPageSetupDialog)
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxWindowsPageSetupDialog)
|
||||
};
|
||||
|
||||
#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
|
||||
@@ -30,8 +30,6 @@ public:
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE);
|
||||
|
||||
virtual int ShowModal() = 0;
|
||||
|
||||
virtual wxPrintDialogData& GetPrintDialogData() = 0;
|
||||
virtual wxPrintData& GetPrintData() = 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
|
||||
@@ -66,31 +64,51 @@ private:
|
||||
DECLARE_NO_COPY_CLASS(wxPrintDialog)
|
||||
};
|
||||
|
||||
#endif
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxPageSetupDialogBase: interface for the page setup dialog
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXUNIVERSAL__) && (!defined(__WXMSW__) || wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW)
|
||||
#include "wx/generic/prntdlgg.h"
|
||||
#elif defined(__PALMOS__)
|
||||
#include "wx/palmos/printdlg.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/printdlg.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/generic/prntdlgg.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/generic/prntdlgg.h"
|
||||
#elif defined(__WXX11__)
|
||||
#include "wx/generic/prntdlgg.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/generic/prntdlgg.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/printdlg.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/generic/prntdlgg.h"
|
||||
#endif
|
||||
class WXDLLEXPORT wxPageSetupDialogBase: public wxDialog
|
||||
{
|
||||
public:
|
||||
wxPageSetupDialogBase() { }
|
||||
wxPageSetupDialogBase(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString &title = wxEmptyString,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE);
|
||||
|
||||
virtual wxPageSetupDialogData& GetPageSetupDialogData() = 0;
|
||||
|
||||
private:
|
||||
DECLARE_ABSTRACT_CLASS(wxPageSetupDialogBase)
|
||||
DECLARE_NO_COPY_CLASS(wxPageSetupDialogBase)
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// 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
|
||||
|
@@ -32,8 +32,10 @@ class WXDLLEXPORT wxButton;
|
||||
class WXDLLEXPORT wxChoice;
|
||||
class WXDLLEXPORT wxPrintout;
|
||||
class WXDLLEXPORT wxPrinterBase;
|
||||
class WXDLLEXPORT wxPrintDialog;
|
||||
class WXDLLEXPORT wxPrintDialogBase;
|
||||
class WXDLLEXPORT wxPrintDialog;
|
||||
class WXDLLEXPORT wxPageSetupDialogBase;
|
||||
class WXDLLEXPORT wxPageSetupDialog;
|
||||
class WXDLLEXPORT wxPrintPreviewBase;
|
||||
class WXDLLEXPORT wxPreviewCanvas;
|
||||
class WXDLLEXPORT wxPreviewControlBar;
|
||||
@@ -76,6 +78,9 @@ public:
|
||||
virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
|
||||
wxPrintData *data ) = 0;
|
||||
|
||||
virtual wxPageSetupDialogBase *CreatePageSetupDialog( wxWindow *parent,
|
||||
wxPageSetupDialogData * data = NULL ) = 0;
|
||||
|
||||
// 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;
|
||||
@@ -114,6 +119,9 @@ public:
|
||||
virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent,
|
||||
wxPrintData *data );
|
||||
|
||||
virtual wxPageSetupDialogBase *CreatePageSetupDialog( wxWindow *parent,
|
||||
wxPageSetupDialogData * data = NULL );
|
||||
|
||||
virtual bool HasPrintSetupDialog();
|
||||
virtual wxDialog *CreatePrintSetupDialog( wxWindow *parent, wxPrintData *data );
|
||||
virtual bool HasOwnPrintToFile();
|
||||
|
Reference in New Issue
Block a user