// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "cmndata.h"
#endif
#include <windowsx.h>
#include "wx/msw/private.h"
- #ifdef __WXWINCE__
+ #ifndef __SMARTPHONE__
#include <commdlg.h>
#endif
wxColourData::wxColourData()
{
- int i;
- for (i = 0; i < 16; i++)
- m_custColours[i].Set(255, 255, 255);
-
- m_chooseFull = FALSE;
+ m_chooseFull = false;
m_dataColour.Set(0,0,0);
+ // m_custColours are wxNullColours initially
}
wxColourData::wxColourData(const wxColourData& data)
void wxColourData::SetCustomColour(int i, const wxColour& colour)
{
- if (i > 15 || i < 0)
- return;
+ wxCHECK_RET( (i >= 0 && i < 16), _T("custom colour index out of range") );
m_custColours[i] = colour;
}
wxColour wxColourData::GetCustomColour(int i)
{
- if (i > 15 || i < 0)
- return wxColour(0,0,0);
+ wxCHECK_MSG( (i >= 0 && i < 16), wxColour(0,0,0),
+ _T("custom colour index out of range") );
return m_custColours[i];
}
m_printerTranslateX = 0;
m_printerTranslateY = 0;
m_printMode = wxPRINT_MODE_FILE;
+
+#ifdef wxUSE_STREAMS
+ m_outputstream = NULL;
+#endif
}
wxPrintData::wxPrintData(const wxPrintData& printData)
//// Collation
-#ifndef __WIN16__
devMode->dmCollate = (m_printCollate ? DMCOLLATE_TRUE : DMCOLLATE_FALSE);
devMode->dmFields |= DM_COLLATE;
-#endif
//// Number of copies
//// Collation
-#ifndef __WIN16__
if (devMode->dmFields & DM_COLLATE)
{
if (devMode->dmCollate == DMCOLLATE_TRUE)
else
m_printCollate = FALSE;
}
-#endif
//// Number of copies
m_printQuality = data.m_printQuality;
m_paperId = data.m_paperId;
m_paperSize = data.m_paperSize;
+#ifdef wxUSE_STREAMS
+ m_outputstream = data.m_outputstream;
+#endif
// PostScript-specific data
m_printerCommand = data.m_printerCommand;
#ifdef __WXMSW__
m_printDlgData = NULL;
#endif
- m_printFromPage = 0;
+ m_printFromPage = 1;
m_printToPage = 0;
- m_printMinPage = 0;
- m_printMaxPage = 0;
+ m_printMinPage = 1;
+ m_printMaxPage = 9999;
m_printNoCopies = 1;
m_printAllPages = FALSE;
m_printCollate = FALSE;
pd->Flags |= PD_NOSELECTION;
if ( !m_printEnablePageNumbers )
pd->Flags |= PD_NOPAGENUMS;
- else if ( (!m_printAllPages) && (!m_printSelection) )
+ else if ( (!m_printAllPages) && (!m_printSelection) && (m_printFromPage != 0) && (m_printToPage != 0))
pd->Flags |= PD_PAGENUMS;
if ( m_printEnableHelp )
pd->Flags |= PD_SHOWHELP;
}
// Now convert the DEVMODE object, passed down from the PRINTDLG object,
- // into wxWindows form.
+ // into wxWidgets form.
m_printData.ConvertFromNative();
m_printFromPage = pd->nFromPage;