Mercurial > vba-clojure
view src/win32/Throttle.cpp @ 8:08a8e09ca414
add files required by automake
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Mar 2012 10:54:39 -0600 |
parents | f9f4f1b99eed |
children |
line wrap: on
line source
1 // Throttle.cpp : implementation file2 //4 #include "stdafx.h"5 #include "resource.h"6 #include "Throttle.h"7 #include "../common/System.h" // for system messages9 /////////////////////////////////////////////////////////////////////////////10 // Throttle dialog12 Throttle::Throttle(CWnd*pParent /*=NULL*/)13 : CDialog(Throttle::IDD, pParent)14 {15 //{{AFX_DATA_INIT(Throttle)16 m_throttle = 100;17 //}}AFX_DATA_INIT18 }20 void Throttle::DoDataExchange(CDataExchange*pDX)21 {22 CDialog::DoDataExchange(pDX);23 //{{AFX_DATA_MAP(Throttle)24 DDX_Text(pDX, IDC_THROTTLE, m_throttle);25 //}}AFX_DATA_MAP26 }28 BEGIN_MESSAGE_MAP(Throttle, CDialog)29 //{{AFX_MSG_MAP(Throttle)30 ON_BN_CLICKED(ID_CANCEL, OnCancel)31 ON_BN_CLICKED(ID_OK, OnOk)32 //}}AFX_MSG_MAP33 END_MESSAGE_MAP()35 /////////////////////////////////////////////////////////////////////////////36 // Throttle message handlers38 BOOL Throttle::OnInitDialog()39 {40 CDialog::OnInitDialog();42 CenterWindow();44 return TRUE; // return TRUE unless you set the focus to a control45 // EXCEPTION: OCX Property Pages should return FALSE46 }48 void Throttle::OnCancel()49 {50 EndDialog(false);51 }53 void Throttle::OnOk()54 {55 UpdateData();57 if (m_throttle < 1 || m_throttle > 1000)58 systemMessage(IDS_INVALID_THROTTLE_VALUE, "Invalid throttle value. Please enter a number between 1 and 1000");59 else60 EndDialog(m_throttle);61 }