// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "cmndata.h"
#endif
#endif // wxUSE_PRINTING_ARCHITECTURE
#ifdef __WXMSW__
- #include <windows.h>
+ #include <windowsx.h>
#include "wx/msw/private.h"
- #if !defined(__WIN32__)
- #include <print.h>
+ #ifndef __SMARTPHONE__
#include <commdlg.h>
- #endif // Win16
+ #endif
#if defined(__WATCOMC__) || defined(__SYMANTEC__) || defined(__SALFORDC__)
#include <windowsx.h>
wxColourData::wxColourData()
{
- int i;
- for (i = 0; i < 16; i++)
- custColours[i].Set(255, 255, 255);
-
- chooseFull = FALSE;
- dataColour.Set(0,0,0);
+ 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") );
- custColours[i] = colour;
+ 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 custColours[i];
+ return m_custColours[i];
}
void wxColourData::operator=(const wxColourData& data)
{
int i;
for (i = 0; i < 16; i++)
- custColours[i] = data.custColours[i];
+ m_custColours[i] = data.m_custColours[i];
- dataColour = (wxColour&)data.dataColour;
- chooseFull = data.chooseFull;
+ m_dataColour = (wxColour&)data.m_dataColour;
+ m_chooseFull = data.m_chooseFull;
}
// ----------------------------------------------------------------------------
wxFontData::wxFontData()
{
// Intialize colour to black.
- fontColour = wxNullColour;
+ m_fontColour = wxNullColour;
- showHelp = FALSE;
- allowSymbols = TRUE;
- enableEffects = TRUE;
- minSize = 0;
- maxSize = 0;
+ m_showHelp = FALSE;
+ m_allowSymbols = TRUE;
+ m_enableEffects = TRUE;
+ m_minSize = 0;
+ m_maxSize = 0;
m_encoding = wxFONTENCODING_SYSTEM;
}
m_printerTranslateX = 0;
m_printerTranslateY = 0;
m_printMode = wxPRINT_MODE_FILE;
+
+#ifdef wxUSE_STREAMS
+ m_outputstream = NULL;
+#endif
}
wxPrintData::wxPrintData(const wxPrintData& printData)
pd.lStructSize = 66;
#else
memset(&pd, 0, sizeof(PRINTDLG));
+#ifdef __WXWINCE__
+ pd.cbStruct = sizeof(PRINTDLG);
+#else
pd.lStructSize = sizeof(PRINTDLG);
+#endif
#endif
pd.hwndOwner = (HWND)NULL;
//// 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;