Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

141 lines
3.0 KiB

  1. // PrtDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "minidev.h"
  5. #include "PrtDlg.h"
  6. #include "Windows.h"
  7. #include "commdlg.h"
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CPrtDlg dialog
  15. CPrtDlg::CPrtDlg(CWnd* pParent /*=NULL*/)
  16. : CDialog(CPrtDlg::IDD, pParent)
  17. {
  18. //{{AFX_DATA_INIT(CPrtDlg)
  19. // NOTE: the ClassWizard will add member initialization here
  20. //}}AFX_DATA_INIT
  21. }
  22. void CPrtDlg::DoDataExchange(CDataExchange* pDX)
  23. {
  24. CDialog::DoDataExchange(pDX);
  25. //{{AFX_DATA_MAP(CPrtDlg)
  26. DDX_Control(pDX, IDC_PRINT_COMBO, m_ccbPrtList);
  27. //}}AFX_DATA_MAP
  28. }
  29. BEGIN_MESSAGE_MAP(CPrtDlg, CDialog)
  30. //{{AFX_MSG_MAP(CPrtDlg)
  31. ON_BN_CLICKED(IDC_PRINT_SETUP, OnPrintSetup)
  32. //}}AFX_MSG_MAP
  33. END_MESSAGE_MAP()
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CPrtDlg message handlers
  36. /*
  37. show print standard sheet dialog box and set up
  38. */
  39. void CPrtDlg::OnPrintSetup()
  40. {
  41. /*
  42. HRESULT hResult;
  43. LPPRINTDLGEX pPDX = NULL;
  44. LPPRINTPAGERANGE pPageRanges = NULL;
  45. // Allocate the PRINTDLGEX structure.
  46. pPDX = (LPPRINTDLGEX)GlobalAlloc(GPTR, sizeof(PRINTDLGEX));
  47. if (!pPDX)
  48. return E_OUTOFMEMORY;
  49. // Allocate an array of PRINTPAGERANGE structures.
  50. pPageRanges = (LPPRINTPAGERANGE) GlobalAlloc(GPTR,
  51. 10 * sizeof(PRINTPAGERANGE));
  52. if (!pPageRanges)
  53. return E_OUTOFMEMORY;
  54. // Initialize the PRINTDLGEX structure.
  55. pPDX->lStructSize = sizeof(PRINTDLGEX);
  56. pPDX->hwndOwner = hWnd;
  57. pPDX->hDevMode = NULL;
  58. pPDX->hDevNames = NULL;
  59. pPDX->hDC = NULL;
  60. pPDX->Flags = PD_RETURNDC | PD_COLLATE;
  61. pPDX->Flags2 = 0;
  62. pPDX->ExclusionFlags = 0;
  63. pPDX->nPageRanges = 0;
  64. pPDX->nMaxPageRanges = 10;
  65. pPDX->lpPageRanges = pPageRanges;
  66. pPDX->nMinPage = 1;
  67. pPDX->nMaxPage = 1000;
  68. pPDX->nCopies = 1;
  69. pPDX->hInstance = 0;
  70. pPDX->lpPrintTemplateName = NULL;
  71. pPDX->lpCallback = NULL;
  72. pPDX->nPropertyPages = 0;
  73. pPDX->lphPropertyPages = NULL;
  74. pPDX->nStartPage = START_PAGE_GENERAL;
  75. pPDX->dwResultAction = 0;
  76. // Invoke the Print property sheet.
  77. hResult = PrintDlgEx(pPDX);
  78. if ( (hResult == S_OK) &&
  79. pPDX->dwResultAction == PD_RESULT_PRINT) {
  80. // User clicked the Print button, so
  81. // use the DC and other information returned in the
  82. // PRINTDLGEX structure to print the document
  83. */
  84. }
  85. /*void CPrtDlg::OnOK()
  86. Print out Gpd view
  87. Get DOCINFO
  88. Get PrintDC,
  89. 1. StartDoc(), StartPage(), EndPage(),
  90. 2. Things to consider
  91. 2.1 line number of printable area
  92. 2.2 character height for 2.1
  93. 2.3 Clipping area -->
  94. 2.3.1 selection part -> capture string(avoid disrupting its format)
  95. 2.3.2 All -> GPDDOC();
  96. */
  97. void CPrtDlg::OnOK()
  98. {
  99. // CGPDViewer* pcgv = (CGPDViewer *)GetParent();
  100. // get View, Doc class
  101. CWnd *pcw = GetParent();
  102. // CDocument *pcd = pcw ->GetDocument();
  103. // Get PrintDC
  104. CDialog::OnOK();
  105. }