view src/win32/Throttle.cpp @ 2:3549bbe597ed

adding makefile.am
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Mar 2012 10:31:47 -0600
parents f9f4f1b99eed
children
line wrap: on
line source
1 // Throttle.cpp : implementation file
2 //
4 #include "stdafx.h"
5 #include "resource.h"
6 #include "Throttle.h"
7 #include "../common/System.h" // for system messages
9 /////////////////////////////////////////////////////////////////////////////
10 // Throttle dialog
12 Throttle::Throttle(CWnd*pParent /*=NULL*/)
13 : CDialog(Throttle::IDD, pParent)
14 {
15 //{{AFX_DATA_INIT(Throttle)
16 m_throttle = 100;
17 //}}AFX_DATA_INIT
18 }
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_MAP
26 }
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_MAP
33 END_MESSAGE_MAP()
35 /////////////////////////////////////////////////////////////////////////////
36 // Throttle message handlers
38 BOOL Throttle::OnInitDialog()
39 {
40 CDialog::OnInitDialog();
42 CenterWindow();
44 return TRUE; // return TRUE unless you set the focus to a control
45 // EXCEPTION: OCX Property Pages should return FALSE
46 }
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 else
60 EndDialog(m_throttle);
61 }