InputDate.cpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // InputDate.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "InputDate.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // InputDate dialog
  13. InputDate::InputDate(CWnd* pParent /*=NULL*/)
  14. : CDialog(InputDate::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(InputDate)
  17. m_name = _T("");
  18. m_date = _T("");
  19. m_mode=0;
  20. //}}AFX_DATA_INIT
  21. }
  22. void InputDate::DoDataExchange(CDataExchange* pDX)
  23. {
  24. CDialog::DoDataExchange(pDX);
  25. //{{AFX_DATA_MAP(InputDate)
  26. DDX_Control(pDX, IDC_EDIT2, m_ctrldate);
  27. DDX_Text(pDX, IDC_EDIT1, m_name);
  28. DDX_Text(pDX, IDC_EDIT2, m_date);
  29. //}}AFX_DATA_MAP
  30. }
  31. BEGIN_MESSAGE_MAP(InputDate, CDialog)
  32. //{{AFX_MSG_MAP(InputDate)
  33. //}}AFX_MSG_MAP
  34. END_MESSAGE_MAP()
  35. /////////////////////////////////////////////////////////////////////////////
  36. // InputDate message handlers
  37. void InputDate::OnOK()
  38. {
  39. // TODO: Add extra validation here
  40. UpdateData();
  41. if(!CheckDateOK(m_date))return;
  42. if(m_date.IsEmpty ())return;
  43. CDialog::OnOK();
  44. }
  45. BOOL InputDate::OnInitDialog()
  46. {
  47. CDialog::OnInitDialog();
  48. // TODO: Add extra initialization here
  49. if(m_mode)
  50. {
  51. SetWindowText("°²ÅÅÈÕÆÚ");
  52. GetDlgItem(IDC_EDIT1)->ShowWindow(0);
  53. GetDlgItem(IDC_STATIC1)->ShowWindow(0);
  54. }
  55. return TRUE; // return TRUE unless you set the focus to a control
  56. // EXCEPTION: OCX Property Pages should return FALSE
  57. }