summaryrefslogtreecommitdiffabout
path: root/SecretaryPage.cpp
blob: affac08be33edb0bd97c25f55658a498b4713425 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// SecretaryPage.cpp : implementation file
//

#include "stdafx.h"
#include "T42.h"
#include "SecretaryPage.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSecretaryPage property page

IMPLEMENT_DYNCREATE(CSecretaryPage, CPropertyPage)

CSecretaryPage::CSecretaryPage() : CPropertyPage(CSecretaryPage::IDD)
{
	//{{AFX_DATA_INIT(CSecretaryPage)
	m_limitBytes = 0;
	m_bLimitBytes = FALSE;
	m_bLimitTime = FALSE;
	m_Greeting = _T("");
	m_limitTime = 0;
	m_bLimitWin = FALSE;
	m_limitWin = 0;
	//}}AFX_DATA_INIT
}

CSecretaryPage::~CSecretaryPage()
{
}

void CSecretaryPage::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSecretaryPage)
	DDX_Control(pDX, IDC_DOWINLIMIT, m_bLimitWinCtl);
	DDX_Control(pDX, IDC_WINSPIN, m_WinSpinCtl);
	DDX_Control(pDX, IDC_TIMESPIN, m_TimeSpinCtl);
	DDX_Control(pDX, IDC_WINLIMIT, m_limitWinCtl);
	DDX_Control(pDX, IDC_CHARSPIN, m_CharSpinCtl);
	DDX_Control(pDX, IDC_TIMELIMIT, m_limitTimeCtl);
	DDX_Control(pDX, IDC_DOTIMELIMIT, m_bLimitTimeCtl);
	DDX_Control(pDX, IDC_DOBYTELIMIT, m_bLimitBytesCtl);
	DDX_Control(pDX, IDC_BYTELIMIT, m_limitBytesCtl);
	DDX_Text(pDX, IDC_BYTELIMIT, m_limitBytes);
	DDX_Check(pDX, IDC_DOBYTELIMIT, m_bLimitBytes);
	DDX_Check(pDX, IDC_DOTIMELIMIT, m_bLimitTime);
	DDX_Text(pDX, IDC_GREETING, m_Greeting);
	DDX_Text(pDX, IDC_TIMELIMIT, m_limitTime);
	DDX_Check(pDX, IDC_DOWINLIMIT, m_bLimitWin);
	DDX_Text(pDX, IDC_WINLIMIT, m_limitWin);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSecretaryPage, CPropertyPage)
	//{{AFX_MSG_MAP(CSecretaryPage)
	ON_BN_CLICKED(IDC_DOBYTELIMIT, OnDobytelimit)
	ON_BN_CLICKED(IDC_DOTIMELIMIT, OnDotimelimit)
	ON_BN_CLICKED(IDC_DOWINLIMIT, OnDowinlimit)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSecretaryPage message handlers

BOOL CSecretaryPage::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
	
	SetTimeLimit();
	SetBytesLimit();
	SetWinLimit();
	m_TimeSpinCtl.SetRange(0,60);
	m_WinSpinCtl.SetRange(0,100);
	m_CharSpinCtl.SetRange(0,UD_MAXVAL);
UDACCEL uda = {0,512};                  
	m_CharSpinCtl.SetAccel(1,&uda);	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CSecretaryPage::SetTimeLimit()
{
	m_limitTimeCtl.EnableWindow(m_bLimitTimeCtl.GetCheck());
}

void CSecretaryPage::SetBytesLimit()
{
	m_limitBytesCtl.EnableWindow(m_bLimitBytesCtl.GetCheck());
}

void CSecretaryPage::SetWinLimit()
{
	m_limitWinCtl.EnableWindow(m_bLimitWinCtl.GetCheck());
}

void CSecretaryPage::OnDobytelimit() 
{
	SetBytesLimit();
}

void CSecretaryPage::OnDotimelimit() 
{
	SetTimeLimit();
}

void CSecretaryPage::OnDowinlimit() 
{
	SetWinLimit();
}