Mercurial > vba-clojure
comparison src/win32/ModeConfirm.cpp @ 1:f9f4f1b99eed
importing src directory
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Mar 2012 10:31:27 -0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:8ced16adf2e1 | 1:f9f4f1b99eed |
---|---|
1 // ModeConfirm.cpp : implementation file | |
2 // | |
3 | |
4 #include "stdafx.h" | |
5 #include "resource.h" | |
6 #include "ModeConfirm.h" | |
7 #include "VBA.h" | |
8 | |
9 ///////////////////////////////////////////////////////////////////////////// | |
10 // ModeConfirm dialog | |
11 | |
12 | |
13 ModeConfirm::ModeConfirm(CWnd* pParent /*=NULL*/) | |
14 : CDialog(ModeConfirm::IDD, pParent) | |
15 { | |
16 //{{AFX_DATA_INIT(ModeConfirm) | |
17 // NOTE: the ClassWizard will add member initialization here | |
18 //}}AFX_DATA_INIT | |
19 } | |
20 | |
21 | |
22 void ModeConfirm::DoDataExchange(CDataExchange* pDX) | |
23 { | |
24 CDialog::DoDataExchange(pDX); | |
25 //{{AFX_DATA_MAP(ModeConfirm) | |
26 // NOTE: the ClassWizard will add DDX and DDV calls here | |
27 //}}AFX_DATA_MAP | |
28 } | |
29 | |
30 | |
31 BEGIN_MESSAGE_MAP(ModeConfirm, CDialog) | |
32 //{{AFX_MSG_MAP(ModeConfirm) | |
33 ON_BN_CLICKED(ID_CANCEL, OnCancel) | |
34 ON_BN_CLICKED(ID_OK, OnOk) | |
35 ON_WM_DESTROY() | |
36 ON_WM_TIMER() | |
37 //}}AFX_MSG_MAP | |
38 END_MESSAGE_MAP() | |
39 | |
40 ///////////////////////////////////////////////////////////////////////////// | |
41 // ModeConfirm message handlers | |
42 | |
43 void ModeConfirm::OnCancel() | |
44 { | |
45 EndDialog(FALSE); | |
46 } | |
47 | |
48 void ModeConfirm::OnOk() | |
49 { | |
50 EndDialog(TRUE); | |
51 } | |
52 | |
53 void ModeConfirm::OnDestroy() | |
54 { | |
55 CDialog::OnDestroy(); | |
56 | |
57 KillTimer(timer); | |
58 timer = 0; | |
59 } | |
60 | |
61 BOOL ModeConfirm::OnInitDialog() | |
62 { | |
63 CDialog::OnInitDialog(); | |
64 | |
65 timer = SetTimer(0, 1000, NULL); | |
66 | |
67 count = 10; | |
68 | |
69 CString buffer; | |
70 buffer.Format("%d", count); | |
71 | |
72 GetDlgItem(IDC_TIMER)->SetWindowText(buffer); | |
73 | |
74 CenterWindow(theApp.m_pMainWnd); | |
75 | |
76 return TRUE; // return TRUE unless you set the focus to a control | |
77 // EXCEPTION: OCX Property Pages should return FALSE | |
78 } | |
79 | |
80 void ModeConfirm::OnTimer(UINT nIDEvent) | |
81 { | |
82 CString buffer; | |
83 count--; | |
84 if(count == 0) | |
85 EndDialog(FALSE); | |
86 buffer.Format("%d", count); | |
87 GetDlgItem(IDC_TIMER)->SetWindowText(buffer); | |
88 | |
89 CDialog::OnTimer(nIDEvent); | |
90 } |