#include "wx/cmndata.h"
#include "wx/log.h"
-// For compatibility
-#if (defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXX11__)|| defined(__WXPM__) || defined(__WXMAC__)) && wxUSE_POSTSCRIPT
- #define wxCOMPATIBILITY_WITH_PRINTSETUPDATA 1
-#endif
+#if wxUSE_FONTDLG
+ #include "wx/fontdlg.h"
+#endif // wxUSE_FONTDLG
#if wxUSE_PRINTING_ARCHITECTURE
#include "wx/paper.h"
-
- #if wxCOMPATIBILITY_WITH_PRINTSETUPDATA
- #include "wx/generic/dcpsg.h"
- #endif
#endif // wxUSE_PRINTING_ARCHITECTURE
#ifdef __WXMSW__
}
wxColourData::wxColourData(const wxColourData& data)
+ : wxObject()
{
(*this) = data;
}
{
}
+#if wxUSE_FONTDLG
+
+wxFontDialogBase::~wxFontDialogBase()
+{
+}
+
+#endif // wxUSE_FONTDLG
+
#if wxUSE_PRINTING_ARCHITECTURE
// ----------------------------------------------------------------------------
// Print data
#if TARGET_CARBON
m_macPageFormat = kPMNoPageFormat;
m_macPrintSettings = kPMNoPrintSettings;
-
+
#if PM_USE_SESSION_APIS
PMPrintSession macPrintSession = kPMNoReference;
OSStatus err;
-
+
err = ::UMAPrOpen(&macPrintSession) ;
if ( err == noErr )
- {
+ {
err = PMCreatePageFormat((PMPageFormat *)&m_macPageFormat);
-
+
// Note that PMPageFormat is not session-specific, but calling
// PMSessionDefaultPageFormat assigns values specific to the printer
// associated with the current printing session.
err = PMSessionDefaultPageFormat((PMPrintSession)macPrintSession,
(PMPageFormat)m_macPageFormat);
}
-
+
err = PMCreatePrintSettings((PMPrintSettings *)&m_macPrintSettings);
-
+
// Note that PMPrintSettings is not session-specific, but calling
// PMSessionDefaultPrintSettings assigns values specific to the printer
// associated with the current printing session.
m_paperSize = wxSize(210, 297);
// PostScript-specific data
- m_printerCommand = "";
- m_previewCommand = "";
- m_printerOptions = "";
- m_filename = "";
- m_afmPath = "";
+ m_previewCommand = wxT("");
+ m_filename = wxT("");
+#ifdef __VMS__
+ m_printerCommand = wxT("print");
+ m_printerOptions = wxT("/nonotify/queue=psqueue");
+ m_afmPath = wxT("sys$ps_font_metrics:");
+#endif
+
+#ifdef __WXMSW__
+ m_printerCommand = wxT("print");
+ m_printerOptions = wxT("");
+ m_afmPath = wxT("c:\\windows\\system\\");
+#endif
+
+#if !defined(__VMS__) && !defined(__WXMSW__)
+ m_printerCommand = wxT("lpr");
+ m_printerOptions = wxT("");
+ m_afmPath = wxT("");
+#endif
+
m_printerScaleX = 1.0;
m_printerScaleY = 1.0;
m_printerTranslateX = 0;
}
wxPrintData::wxPrintData(const wxPrintData& printData)
+ : wxObject()
{
#ifdef __WXMSW__
m_devMode = (void*) NULL;
#endif
m_macPrintSettings = kPMNoPrintSettings;
}
-
+
#else
wxASSERT( m_macPrintSettings );
// we should perhaps delete
m_printMode = data.m_printMode;
}
-// For compatibility
-#if wxCOMPATIBILITY_WITH_PRINTSETUPDATA
-void wxPrintData::operator=(const wxPrintSetupData& setupData)
+// Is this data OK for showing the print dialog?
+bool wxPrintData::Ok() const
{
- SetPrinterCommand(setupData.GetPrinterCommand());
- SetPreviewCommand(setupData.GetPrintPreviewCommand());
- SetPrinterOptions(setupData.GetPrinterOptions());
-
- long xt, yt;
- setupData.GetPrinterTranslation(& xt, & yt);
- SetPrinterTranslation(xt, yt);
-
- double xs, ys;
- setupData.GetPrinterScaling(& xs, & ys);
- SetPrinterScaling(xs, ys);
-
- SetOrientation(setupData.GetPrinterOrientation());
- SetPrintMode((wxPrintMode) setupData.GetPrinterMode());
- SetFontMetricPath(setupData.GetAFMPath());
- if (setupData.GetPaperName() != "")
- SetPaperId(wxThePrintPaperDatabase->ConvertNameToId(setupData.GetPaperName()));
- SetColour(setupData.GetColour());
- SetFilename(setupData.GetPrinterFile());
+#ifdef __WXMSW__
+ ((wxPrintData*)this)->ConvertToNative();
+ return (m_devMode != NULL) ;
+#else
+ return TRUE;
+#endif
}
-#endif // wxCOMPATIBILITY_WITH_PRINTSETUPDATA
-
// ----------------------------------------------------------------------------
// Print dialog data
}
wxPrintDialogData::wxPrintDialogData(const wxPrintDialogData& dialogData)
+ : wxObject()
{
#ifdef __WXMSW__
m_printDlgData = NULL;
m_printData.SetNativeData((void*) NULL);
- wxASSERT_MSG( (pd->hDevMode), wxT("hDevMode must be non-NULL in ConvertToNative!"));
+ // Shouldn't assert; we should be able to test Ok-ness at a higher level
+ //wxASSERT_MSG( (pd->hDevMode), wxT("hDevMode must be non-NULL in ConvertToNative!"));
pd->hDevNames = (HGLOBAL)(DWORD) m_printData.GetNativeDataDevNames();
}
wxPageSetupDialogData::wxPageSetupDialogData(const wxPageSetupDialogData& dialogData)
+ : wxObject()
{
#if defined(__WIN95__)
m_pageSetupData = NULL;
#endif
}
-void wxPageSetupDialogData::operator=(const wxPageSetupDialogData& data)
+wxPageSetupDialogData& wxPageSetupDialogData::operator=(const wxPageSetupDialogData& data)
{
m_paperSize = data.m_paperSize;
m_minMarginTopLeft = data.m_minMarginTopLeft;
m_enableHelp = data.m_enableHelp;
m_printData = data.m_printData;
+
+ return *this;
}
-void wxPageSetupDialogData::operator=(const wxPrintData& data)
+wxPageSetupDialogData& wxPageSetupDialogData::operator=(const wxPrintData& data)
{
m_printData = data;
+
+ return *this;
}
#if defined(__WIN95__)
m_printData.SetNativeData((void*) NULL);
- wxASSERT_MSG( (pd->hDevMode), wxT("hDevMode must be non-NULL in ConvertToNative!"));
+ // Shouldn't assert; we should be able to test Ok-ness at a higher level
+ //wxASSERT_MSG( (pd->hDevMode), wxT("hDevMode must be non-NULL in ConvertToNative!"));
// Pass the devnames data (created in m_printData.ConvertToNative)
// to the PRINTDLG structure, since it'll
wxSize sz = wxThePrintPaperDatabase->GetSize(m_printData.GetPaperId());
- if (sz.x != 0)
- {
- // sz is in 10ths of a mm, so multiply by 10.
- m_paperSize.x = sz.x * 10;
- m_paperSize.y = sz.y * 10;
- }
+ // sz is in 10ths of a mm, while paper size is in mm
+ m_paperSize.x = sz.x / 10;
+ m_paperSize.y = sz.y / 10;
}
#endif // wxUSE_PRINTING_ARCHITECTURE