- PAGESETUPDLG *pd = (PAGESETUPDLG*) m_pageSetupData;
- if ( m_pageSetupData == NULL )
- {
- pd = new PAGESETUPDLG;
- pd->hDevMode = GlobalAlloc(GMEM_MOVEABLE, sizeof(DEVMODE));
- m_pageSetupData = (void *)pd;
- }
-
- pd->Flags = PSD_MARGINS|PSD_MINMARGINS;
-
- if ( m_defaultMinMargins )
- pd->Flags |= PSD_DEFAULTMINMARGINS;
- if ( !m_enableMargins )
- pd->Flags |= PSD_DISABLEMARGINS;
- if ( !m_enableOrientation )
- pd->Flags |= PSD_DISABLEORIENTATION;
- if ( !m_enablePaper )
- pd->Flags |= PSD_DISABLEPAPER;
- if ( !m_enablePrinter )
- pd->Flags |= PSD_DISABLEPRINTER;
- if ( m_getDefaultInfo )
- pd->Flags |= PSD_RETURNDEFAULT;
- if ( m_enableHelp )
- pd->Flags |= PSD_SHOWHELP;
-
- pd->lStructSize = sizeof( PAGESETUPDLG );
- pd->hwndOwner=(HWND)NULL;
- pd->hDevNames=(HWND)NULL;
- pd->hInstance=(HINSTANCE)NULL;
-
- pd->ptPaperSize.x = m_paperSize.x;
- pd->ptPaperSize.y = m_paperSize.y;
-
- pd->rtMinMargin.left = m_minMarginTopLeft.x;
- pd->rtMinMargin.top = m_minMarginTopLeft.y;
- pd->rtMinMargin.right = m_minMarginBottomRight.x;
- pd->rtMinMargin.bottom = m_minMarginBottomRight.y;
-
- pd->rtMargin.left = m_marginTopLeft.x;
- pd->rtMargin.top = m_marginTopLeft.y;
- pd->rtMargin.right = m_marginBottomRight.x;
- pd->rtMargin.bottom = m_marginBottomRight.y;
-
- pd->lCustData = 0;
- pd->lpfnPageSetupHook = NULL;
- pd->lpfnPagePaintHook = NULL;
- pd->hPageSetupTemplate = NULL;
- pd->lpPageSetupTemplateName = NULL;
-
- if ( pd->hDevMode )
- {
- DEVMODE *devMode = (DEVMODE*) GlobalLock(pd->hDevMode);
- memset(devMode, 0, sizeof(DEVMODE));
- devMode->dmSize = sizeof(DEVMODE);
- devMode->dmOrientation = m_orientation;
- devMode->dmFields = DM_ORIENTATION;
- GlobalUnlock(pd->hDevMode);
- }
+ m_printData = data;
+}
+
+// ----------------------------------------------------------------------------
+// wxPageSetupDialogData
+// ----------------------------------------------------------------------------
+
+wxPageSetupDialogData::wxPageSetupDialogData()
+{
+ m_paperSize = wxSize(0,0);
+
+ CalculatePaperSizeFromId();
+
+ m_minMarginTopLeft =
+ m_minMarginBottomRight =
+ m_marginTopLeft =
+ m_marginBottomRight = wxPoint(0,0);
+
+ // Flags
+ m_defaultMinMargins = false;
+ m_enableMargins = true;
+ m_enableOrientation = true;
+ m_enablePaper = true;
+ m_enablePrinter = true;
+ m_enableHelp = false;
+ m_getDefaultInfo = false;