rlm@1: // ModeConfirm.cpp : implementation file rlm@1: // rlm@1: rlm@1: #include "stdafx.h" rlm@1: #include "resource.h" rlm@1: #include "ModeConfirm.h" rlm@1: #include "VBA.h" rlm@1: rlm@1: ///////////////////////////////////////////////////////////////////////////// rlm@1: // ModeConfirm dialog rlm@1: rlm@1: rlm@1: ModeConfirm::ModeConfirm(CWnd* pParent /*=NULL*/) rlm@1: : CDialog(ModeConfirm::IDD, pParent) rlm@1: { rlm@1: //{{AFX_DATA_INIT(ModeConfirm) rlm@1: // NOTE: the ClassWizard will add member initialization here rlm@1: //}}AFX_DATA_INIT rlm@1: } rlm@1: rlm@1: rlm@1: void ModeConfirm::DoDataExchange(CDataExchange* pDX) rlm@1: { rlm@1: CDialog::DoDataExchange(pDX); rlm@1: //{{AFX_DATA_MAP(ModeConfirm) rlm@1: // NOTE: the ClassWizard will add DDX and DDV calls here rlm@1: //}}AFX_DATA_MAP rlm@1: } rlm@1: rlm@1: rlm@1: BEGIN_MESSAGE_MAP(ModeConfirm, CDialog) rlm@1: //{{AFX_MSG_MAP(ModeConfirm) rlm@1: ON_BN_CLICKED(ID_CANCEL, OnCancel) rlm@1: ON_BN_CLICKED(ID_OK, OnOk) rlm@1: ON_WM_DESTROY() rlm@1: ON_WM_TIMER() rlm@1: //}}AFX_MSG_MAP rlm@1: END_MESSAGE_MAP() rlm@1: rlm@1: ///////////////////////////////////////////////////////////////////////////// rlm@1: // ModeConfirm message handlers rlm@1: rlm@1: void ModeConfirm::OnCancel() rlm@1: { rlm@1: EndDialog(FALSE); rlm@1: } rlm@1: rlm@1: void ModeConfirm::OnOk() rlm@1: { rlm@1: EndDialog(TRUE); rlm@1: } rlm@1: rlm@1: void ModeConfirm::OnDestroy() rlm@1: { rlm@1: CDialog::OnDestroy(); rlm@1: rlm@1: KillTimer(timer); rlm@1: timer = 0; rlm@1: } rlm@1: rlm@1: BOOL ModeConfirm::OnInitDialog() rlm@1: { rlm@1: CDialog::OnInitDialog(); rlm@1: rlm@1: timer = SetTimer(0, 1000, NULL); rlm@1: rlm@1: count = 10; rlm@1: rlm@1: CString buffer; rlm@1: buffer.Format("%d", count); rlm@1: rlm@1: GetDlgItem(IDC_TIMER)->SetWindowText(buffer); rlm@1: rlm@1: CenterWindow(theApp.m_pMainWnd); rlm@1: rlm@1: return TRUE; // return TRUE unless you set the focus to a control rlm@1: // EXCEPTION: OCX Property Pages should return FALSE rlm@1: } rlm@1: rlm@1: void ModeConfirm::OnTimer(UINT nIDEvent) rlm@1: { rlm@1: CString buffer; rlm@1: count--; rlm@1: if(count == 0) rlm@1: EndDialog(FALSE); rlm@1: buffer.Format("%d", count); rlm@1: GetDlgItem(IDC_TIMER)->SetWindowText(buffer); rlm@1: rlm@1: CDialog::OnTimer(nIDEvent); rlm@1: }