diff 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
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/win32/ModeConfirm.cpp	Sat Mar 03 10:31:27 2012 -0600
     1.3 @@ -0,0 +1,90 @@
     1.4 +// ModeConfirm.cpp : implementation file
     1.5 +//
     1.6 +
     1.7 +#include "stdafx.h"
     1.8 +#include "resource.h"
     1.9 +#include "ModeConfirm.h"
    1.10 +#include "VBA.h"
    1.11 +
    1.12 +/////////////////////////////////////////////////////////////////////////////
    1.13 +// ModeConfirm dialog
    1.14 +
    1.15 +
    1.16 +ModeConfirm::ModeConfirm(CWnd* pParent /*=NULL*/)
    1.17 +  : CDialog(ModeConfirm::IDD, pParent)
    1.18 +{
    1.19 +  //{{AFX_DATA_INIT(ModeConfirm)
    1.20 +  // NOTE: the ClassWizard will add member initialization here
    1.21 +  //}}AFX_DATA_INIT
    1.22 +}
    1.23 +
    1.24 +
    1.25 +void ModeConfirm::DoDataExchange(CDataExchange* pDX)
    1.26 +{
    1.27 +  CDialog::DoDataExchange(pDX);
    1.28 +  //{{AFX_DATA_MAP(ModeConfirm)
    1.29 +  // NOTE: the ClassWizard will add DDX and DDV calls here
    1.30 +  //}}AFX_DATA_MAP
    1.31 +}
    1.32 +
    1.33 +
    1.34 +BEGIN_MESSAGE_MAP(ModeConfirm, CDialog)
    1.35 +  //{{AFX_MSG_MAP(ModeConfirm)
    1.36 +  ON_BN_CLICKED(ID_CANCEL, OnCancel)
    1.37 +  ON_BN_CLICKED(ID_OK, OnOk)
    1.38 +  ON_WM_DESTROY()
    1.39 +  ON_WM_TIMER()
    1.40 +  //}}AFX_MSG_MAP
    1.41 +  END_MESSAGE_MAP()
    1.42 +
    1.43 +  /////////////////////////////////////////////////////////////////////////////
    1.44 +// ModeConfirm message handlers
    1.45 +
    1.46 +void ModeConfirm::OnCancel() 
    1.47 +{
    1.48 +  EndDialog(FALSE);
    1.49 +}
    1.50 +
    1.51 +void ModeConfirm::OnOk() 
    1.52 +{
    1.53 +  EndDialog(TRUE);
    1.54 +}
    1.55 +
    1.56 +void ModeConfirm::OnDestroy() 
    1.57 +{
    1.58 +  CDialog::OnDestroy();
    1.59 +  
    1.60 +  KillTimer(timer);
    1.61 +  timer = 0;
    1.62 +}
    1.63 +
    1.64 +BOOL ModeConfirm::OnInitDialog() 
    1.65 +{
    1.66 +  CDialog::OnInitDialog();
    1.67 +  
    1.68 +  timer = SetTimer(0, 1000, NULL);
    1.69 +
    1.70 +  count = 10;
    1.71 +
    1.72 +  CString buffer;
    1.73 +  buffer.Format("%d", count);
    1.74 +
    1.75 +  GetDlgItem(IDC_TIMER)->SetWindowText(buffer);
    1.76 +
    1.77 +  CenterWindow(theApp.m_pMainWnd);
    1.78 +  
    1.79 +  return TRUE;  // return TRUE unless you set the focus to a control
    1.80 +                // EXCEPTION: OCX Property Pages should return FALSE
    1.81 +}
    1.82 +
    1.83 +void ModeConfirm::OnTimer(UINT nIDEvent) 
    1.84 +{
    1.85 +  CString buffer;  
    1.86 +  count--;
    1.87 +  if(count == 0)
    1.88 +    EndDialog(FALSE);
    1.89 +  buffer.Format("%d", count);
    1.90 +  GetDlgItem(IDC_TIMER)->SetWindowText(buffer);
    1.91 +  
    1.92 +  CDialog::OnTimer(nIDEvent);
    1.93 +}