home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 5 / MasteringVisualBasic5.iso / protview / demowinx / data.1 / DATAINPT.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-29  |  2.5 KB  |  101 lines

  1. // DataEntry.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "allctls.h"
  6. #include "Datainpt.h"
  7. #include "CalTypes.h"
  8.  
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CDataEntry dialog
  17.  
  18.  
  19. CDataEntry::CDataEntry(CWnd* pParent /*=NULL*/)
  20.     : CDialog(CDataEntry::IDD, pParent)
  21. {
  22.     //{{AFX_DATA_INIT(CDataEntry)
  23.     //}}AFX_DATA_INIT
  24. }
  25.  
  26.  
  27. void CDataEntry::DoDataExchange(CDataExchange* pDX)
  28. {
  29.     CDialog::DoDataExchange(pDX);
  30.     //{{AFX_DATA_MAP(CDataEntry)
  31.     DDX_Control(pDX, IDC_TIME32CTRL1, m_time);
  32.     DDX_Control(pDX, IDC_DATEEDIT2, m_getdate);
  33.     DDX_Control(pDX, IDC_DATEEDIT3, m_setdate);
  34.     //}}AFX_DATA_MAP
  35. }
  36.  
  37.  
  38. BEGIN_MESSAGE_MAP(CDataEntry, CDialog)
  39.     //{{AFX_MSG_MAP(CDataEntry)
  40.         // NOTE: the ClassWizard will add message map macros here
  41.     //}}AFX_MSG_MAP
  42. END_MESSAGE_MAP()
  43.  
  44. /////////////////////////////////////////////////////////////////////////////
  45. // CDataEntry message handlers
  46.  
  47. BEGIN_EVENTSINK_MAP(CDataEntry, CDialog)
  48.     //{{AFX_EVENTSINK_MAP(CDataEntry)
  49.     ON_EVENT(CDataEntry, IDC_DISPLAYCAL, -600 /* Click */, OnClickDisplaycal, VTS_NONE)
  50.     ON_EVENT(CDataEntry, IDC_STARTCLOCK, -600 /* Click */, OnClickStartclock, VTS_NONE)
  51.     ON_EVENT(CDataEntry, IDC_STOPCLOCK, -600 /* Click */, OnClickStopclock, VTS_NONE)
  52.     ON_EVENT(CDataEntry, IDC_CLEARCLOCK, -600 /* Click */, OnClickClearclock, VTS_NONE)
  53.     ON_EVENT(CDataEntry, IDC_CONTROLDATE, -600 /* Click */, OnClickControldate, VTS_NONE)
  54.     //}}AFX_EVENTSINK_MAP
  55. END_EVENTSINK_MAP()
  56.  
  57. void CDataEntry::OnClickDisplaycal() 
  58. {
  59.     // TODO: Add your control notification handler code here
  60.     CCalTypes dlg;
  61.  
  62.     dlg.DoModal();
  63. }
  64.  
  65. void CDataEntry::OnClickStartclock() 
  66. {
  67.     // TODO: Add your control notification handler code here
  68.     m_time.StartClock();
  69. }
  70.  
  71. void CDataEntry::OnClickStopclock() 
  72. {
  73.     // TODO: Add your control notification handler code here
  74.     m_time.StopClock();
  75. }
  76.  
  77. void CDataEntry::OnClickClearclock() 
  78. {
  79.     // TODO: Add your control notification handler code here
  80.     m_time.SetTime("12:00:00 AM");
  81. }
  82.  
  83. void CDataEntry::OnClickControldate() 
  84. {
  85.     // TODO: Add your control notification handler code here
  86.     COleDateTime date;
  87.     DATE value;
  88.     int Day, Month, Year;
  89.  
  90.     value = m_getdate.GetValue();
  91.     date = value;
  92.  
  93.     Day = date.GetDay();
  94.     Month = date.GetMonth();
  95.     Year = date.GetYear();
  96.  
  97.     date.SetDate(1971, 10, 7);
  98.     value = date;
  99.     m_setdate.SetValue(value);
  100. }
  101.