-
- pd->hwndOwner=(HWND)NULL;
-// pd->hDevNames=(HANDLE)NULL;
- pd->hInstance=(HINSTANCE)NULL;
- pd->lCustData = (LPARAM) NULL;
- pd->lpfnPrintHook = NULL;
- pd->lpfnSetupHook = NULL;
- pd->lpPrintTemplateName = NULL;
- pd->lpSetupTemplateName = NULL;
- pd->hPrintTemplate = (HGLOBAL) NULL;
- pd->hSetupTemplate = (HGLOBAL) NULL;
-
- if ( m_printAllPages )
- pd->Flags |= PD_ALLPAGES;
- if ( m_printAllPages )
- pd->Flags |= PD_SELECTION;
- if ( m_printCollate )
- pd->Flags |= PD_COLLATE;
- if ( m_printToFile )
- pd->Flags |= PD_PRINTTOFILE;
- if ( !m_printEnablePrintToFile )
- pd->Flags |= PD_DISABLEPRINTTOFILE;
- if ( !m_printEnableSelection )
- pd->Flags |= PD_NOSELECTION;
- if ( !m_printEnablePageNumbers )
- pd->Flags |= PD_NOPAGENUMS;
- if ( m_printEnableHelp )
- pd->Flags |= PD_SHOWHELP;
- if ( m_printSetupDialog )
- pd->Flags |= PD_PRINTSETUP;
-}
-
-void wxPrintDialogData::ConvertFromNative()
-{
- PRINTDLG *pd = (PRINTDLG*) m_printDlgData;
- if ( pd == NULL )
- return;
-
- // Pass the devmode data back to the wxPrintData structure where it really belongs.
- if (pd->hDevMode)
- {
- if (m_printData.GetNativeData())
- {
- // Make sure we don't leak memory
- GlobalFree((HGLOBAL)(DWORD) m_printData.GetNativeData());
- }
- m_printData.SetNativeData((void*)(long) pd->hDevMode);
- pd->hDevMode = NULL;
- }
-
- // Pass the devnames data back to the wxPrintData structure where it really belongs.
- if (pd->hDevNames)
- {
- if (m_printData.GetNativeDataDevNames())
- {
- // Make sure we don't leak memory
- GlobalFree((HGLOBAL)(DWORD) m_printData.GetNativeDataDevNames());
- }
- m_printData.SetNativeDataDevNames((void*)(long) pd->hDevNames);
- pd->hDevNames = NULL;
- }
-
- // Now convert the DEVMODE object, passed down from the PRINTDLG object,
- // into wxWindows form.
- m_printData.ConvertFromNative();
-
- m_printFromPage = pd->nFromPage ;
- m_printToPage = pd->nToPage ;
- m_printMinPage = pd->nMinPage ;
- m_printMaxPage = pd->nMaxPage ;
- m_printNoCopies = pd->nCopies ;
-
- m_printAllPages = ((pd->Flags & PD_ALLPAGES) == PD_ALLPAGES);
- m_printSelection = ((pd->Flags & PD_SELECTION) == PD_SELECTION);
- m_printCollate = ((pd->Flags & PD_COLLATE) == PD_COLLATE);
- m_printToFile = ((pd->Flags & PD_PRINTTOFILE) == PD_PRINTTOFILE);
- m_printEnablePrintToFile = ((pd->Flags & PD_DISABLEPRINTTOFILE) != PD_DISABLEPRINTTOFILE);
- m_printEnableSelection = ((pd->Flags & PD_NOSELECTION) != PD_NOSELECTION);
- m_printEnablePageNumbers = ((pd->Flags & PD_NOPAGENUMS) != PD_NOPAGENUMS);
- m_printEnableHelp = ((pd->Flags & PD_SHOWHELP) == PD_SHOWHELP);
- m_printSetupDialog = ((pd->Flags & PD_PRINTSETUP) == PD_PRINTSETUP);
-
-/* port is obsolete in WIN32
- // Get the port name
- if (pd->hDevNames)
- {
- LPDEVNAMES lpDevNames = (LPDEVNAMES)GlobalLock(pd->hDevNames);
- if (lpDevNames) {
- m_printData.SetPortName((LPSTR)lpDevNames + lpDevNames->wDriverOffset);
- wxString devName = (LPSTR)lpDevNames + lpDevNames->wDeviceOffset;
- GlobalUnlock(pd->hDevNames);
-
-// wxASSERT_MSG( (m_printerName == "" || (devName == m_printerName)), "Printer name obtained from DEVMODE and DEVNAMES were different!");
- }
- }
-*/
-}
-
-void wxPrintDialogData::SetOwnerWindow(wxWindow* win)
-{
- if ( m_printDlgData == NULL )
- ConvertToNative();
-
- if ( m_printDlgData != NULL && win != NULL)
- {
- PRINTDLG *pd = (PRINTDLG *) m_printDlgData ;
- pd->hwndOwner=(HWND) win->GetHWND();
- }
-}
-#endif // MSW
-
-#ifdef __WXMAC__
-void wxPrintDialogData::ConvertToNative()
-{
- (**m_printData.m_macPrintInfo).prJob.iFstPage = m_printFromPage ;
- (**m_printData.m_macPrintInfo).prJob.iLstPage = m_printToPage ;
- m_printData.ConvertToNative() ;