home *** CD-ROM | disk | FTP | other *** search
- // TInABox.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include "ch3_menu.h"
- #include "TInABox.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // TimeInABox dialog
-
-
- TimeInABox::TimeInABox(CWnd* pParent /*=NULL*/)
- : CDialog(TimeInABox::IDD, pParent)
- {
- //{{AFX_DATA_INIT(TimeInABox)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- }
-
-
- void TimeInABox::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(TimeInABox)
- // NOTE: the ClassWizard will add DDX and DDV calls here
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(TimeInABox, CDialog)
- //{{AFX_MSG_MAP(TimeInABox)
- ON_WM_TIMER()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // TimeInABox message handlers
-
- BOOL TimeInABox::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- // Set the initial time
- SetDlgItemText(
- IDC_TIMEBOX_TIME,
- CTime::GetCurrentTime().Format("%#c"));
- // trigger a timer every second, to update the time
- SetTimer(1, 1000, NULL);
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
-
- void TimeInABox::OnTimer(UINT nIDEvent)
- {
- // display current date/time in long format
- if (nIDEvent == 1) {
- SetDlgItemText(
- IDC_TIMEBOX_TIME,
- CTime::GetCurrentTime().Format("%#c"));
- }
- CDialog::OnTimer(nIDEvent);
- }
-
- void TimeInABox::OnOK()
- {
- // TODO: Add extra validation here
-
- CDialog::OnOK();
- }
-
- void TimeInABox::OnCancel()
- {
- // TODO: Add extra cleanup here
-
- CDialog::OnCancel();
- }
-