annotate src/win32/ModeConfirm.cpp @ 7:c0a590a394c3

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