home *** CD-ROM | disk | FTP | other *** search
- // DataEntry.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include "allctls.h"
- #include "Datainpt.h"
- #include "CalTypes.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CDataEntry dialog
-
-
- CDataEntry::CDataEntry(CWnd* pParent /*=NULL*/)
- : CDialog(CDataEntry::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CDataEntry)
- //}}AFX_DATA_INIT
- }
-
-
- void CDataEntry::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CDataEntry)
- DDX_Control(pDX, IDC_TIME32CTRL1, m_time);
- DDX_Control(pDX, IDC_DATEEDIT2, m_getdate);
- DDX_Control(pDX, IDC_DATEEDIT3, m_setdate);
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(CDataEntry, CDialog)
- //{{AFX_MSG_MAP(CDataEntry)
- // NOTE: the ClassWizard will add message map macros here
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CDataEntry message handlers
-
- BEGIN_EVENTSINK_MAP(CDataEntry, CDialog)
- //{{AFX_EVENTSINK_MAP(CDataEntry)
- ON_EVENT(CDataEntry, IDC_DISPLAYCAL, -600 /* Click */, OnClickDisplaycal, VTS_NONE)
- ON_EVENT(CDataEntry, IDC_STARTCLOCK, -600 /* Click */, OnClickStartclock, VTS_NONE)
- ON_EVENT(CDataEntry, IDC_STOPCLOCK, -600 /* Click */, OnClickStopclock, VTS_NONE)
- ON_EVENT(CDataEntry, IDC_CLEARCLOCK, -600 /* Click */, OnClickClearclock, VTS_NONE)
- ON_EVENT(CDataEntry, IDC_CONTROLDATE, -600 /* Click */, OnClickControldate, VTS_NONE)
- //}}AFX_EVENTSINK_MAP
- END_EVENTSINK_MAP()
-
- void CDataEntry::OnClickDisplaycal()
- {
- // TODO: Add your control notification handler code here
- CCalTypes dlg;
-
- dlg.DoModal();
- }
-
- void CDataEntry::OnClickStartclock()
- {
- // TODO: Add your control notification handler code here
- m_time.StartClock();
- }
-
- void CDataEntry::OnClickStopclock()
- {
- // TODO: Add your control notification handler code here
- m_time.StopClock();
- }
-
- void CDataEntry::OnClickClearclock()
- {
- // TODO: Add your control notification handler code here
- m_time.SetTime("12:00:00 AM");
- }
-
- void CDataEntry::OnClickControldate()
- {
- // TODO: Add your control notification handler code here
- COleDateTime date;
- DATE value;
- int Day, Month, Year;
-
- value = m_getdate.GetValue();
- date = value;
-
- Day = date.GetDay();
- Month = date.GetMonth();
- Year = date.GetYear();
-
- date.SetDate(1971, 10, 7);
- value = date;
- m_setdate.SetValue(value);
- }
-