#include "wx/cmndata.h"
#include "wx/log.h"
+#if wxUSE_FONTDLG
+ #include "wx/fontdlg.h"
+#endif // wxUSE_FONTDLG
+
// For compatibility
#if (defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXX11__)|| defined(__WXPM__) || defined(__WXMAC__)) && wxUSE_POSTSCRIPT
#define wxCOMPATIBILITY_WITH_PRINTSETUPDATA 1
}
wxColourData::wxColourData(const wxColourData& data)
+ : wxObject()
{
(*this) = data;
}
{
}
-void wxColourData::SetCustomColour(int i, wxColour& colour)
+void wxColourData::SetCustomColour(int i, const wxColour& colour)
{
if (i > 15 || i < 0)
return;
{
}
+#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.
}
wxPrintData::wxPrintData(const wxPrintData& printData)
+ : wxObject()
{
#ifdef __WXMSW__
m_devMode = (void*) NULL;
#endif
m_macPrintSettings = kPMNoPrintSettings;
}
-
+
#else
wxASSERT( m_macPrintSettings );
// we should perhaps delete
}
#endif // wxCOMPATIBILITY_WITH_PRINTSETUPDATA
+// Is this data OK for showing the print dialog?
+bool wxPrintData::Ok() const
+{
+#ifdef __WXMSW__
+ ((wxPrintData*)this)->ConvertToNative();
+ return (m_devMode != NULL) ;
+#else
+ return TRUE;
+#endif
+}
// ----------------------------------------------------------------------------
// 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