Source code of Windows XP (NT5)
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.

96 lines
2.3 KiB

  1. /*************************************************
  2. * statis.cpp *
  3. * *
  4. * Copyright (C) 1995-1999 Microsoft Inc. *
  5. * *
  6. *************************************************/
  7. // statis.cpp : implementation file
  8. //
  9. #include "stdafx.h"
  10. #include "cblocks.h"
  11. #include "dib.h"
  12. #include "dibpal.h"
  13. #include "spriteno.h"
  14. #include "sprite.h"
  15. #include "phsprite.h"
  16. #include "myblock.h"
  17. #include "splstno.h"
  18. #include "spritlst.h"
  19. #include "osbview.h"
  20. #include "blockvw.h"
  21. #include "slot.h"
  22. #include "mainfrm.h"
  23. #include "blockdoc.h"
  24. #include "statis.h"
  25. #ifdef _DEBUG
  26. #undef THIS_FILE
  27. static char BASED_CODE THIS_FILE[] = __FILE__;
  28. #endif
  29. /////////////////////////////////////////////////////////////////////////////
  30. // CStatisticDlg dialog
  31. CStatisticDlg::CStatisticDlg(CBlockDoc* pDoc,CWnd* pParent /*=NULL*/)
  32. : CDialog(CStatisticDlg::IDD, pParent)
  33. {
  34. //{{AFX_DATA_INIT(CStatisticDlg)
  35. m_nHitWordInAir = _T("");
  36. m_nHitWordInGround = _T("");
  37. m_nMissHit = _T("");
  38. m_nTotalHitWord = _T("");
  39. m_nTotalWord = _T("");
  40. //}}AFX_DATA_INIT
  41. m_pDoc = pDoc;
  42. }
  43. void CStatisticDlg::DoDataExchange(CDataExchange* pDX)
  44. {
  45. CDialog::DoDataExchange(pDX);
  46. //{{AFX_DATA_MAP(CStatisticDlg)
  47. DDX_Text(pDX, IDC_HITWORDINAIR, m_nHitWordInAir);
  48. DDX_Text(pDX, IDC_HITWORDINGROUND, m_nHitWordInGround);
  49. DDX_Text(pDX, IDC_MISSHIT, m_nMissHit);
  50. DDX_Text(pDX, IDC_TOTALHITWORD, m_nTotalHitWord);
  51. DDX_Text(pDX, IDC_TOTALWORD, m_nTotalWord);
  52. //}}AFX_DATA_MAP
  53. }
  54. BEGIN_MESSAGE_MAP(CStatisticDlg, CDialog)
  55. //{{AFX_MSG_MAP(CStatisticDlg)
  56. //}}AFX_MSG_MAP
  57. END_MESSAGE_MAP()
  58. /////////////////////////////////////////////////////////////////////////////
  59. // CStatisticDlg message handlers
  60. BOOL CStatisticDlg::OnInitDialog()
  61. {
  62. char szBuf[100];
  63. wsprintf(szBuf,"%d",m_pDoc->GetTotalWords());
  64. m_nTotalWord = szBuf;
  65. wsprintf(szBuf,"%d",m_pDoc->GetTotalHitWords());
  66. m_nTotalHitWord = szBuf;
  67. wsprintf(szBuf,"%d",m_pDoc->GetWordHitInAir());
  68. m_nHitWordInAir = szBuf;
  69. wsprintf(szBuf,"%d",m_pDoc->GetWordHitInGround());
  70. m_nHitWordInGround = szBuf;
  71. wsprintf(szBuf,"%d",m_pDoc->GetMissedHit());
  72. m_nMissHit = szBuf;
  73. CDialog::OnInitDialog();
  74. return TRUE; // return TRUE unless you set the focus to a control
  75. // EXCEPTION: OCX Property Pages should return FALSE
  76. }