summaryrefslogtreecommitdiffabout
path: root/SecretaryPage.cpp
Unidiff
Diffstat (limited to 'SecretaryPage.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--SecretaryPage.cpp116
1 files changed, 116 insertions, 0 deletions
diff --git a/SecretaryPage.cpp b/SecretaryPage.cpp
new file mode 100644
index 0000000..affac08
--- a/dev/null
+++ b/SecretaryPage.cpp
@@ -0,0 +1,116 @@
1// SecretaryPage.cpp : implementation file
2//
3
4#include "stdafx.h"
5#include "T42.h"
6#include "SecretaryPage.h"
7
8#ifdef _DEBUG
9#define new DEBUG_NEW
10#undef THIS_FILE
11static char THIS_FILE[] = __FILE__;
12#endif
13
14/////////////////////////////////////////////////////////////////////////////
15// CSecretaryPage property page
16
17IMPLEMENT_DYNCREATE(CSecretaryPage, CPropertyPage)
18
19CSecretaryPage::CSecretaryPage() : CPropertyPage(CSecretaryPage::IDD)
20{
21 //{{AFX_DATA_INIT(CSecretaryPage)
22 m_limitBytes = 0;
23 m_bLimitBytes = FALSE;
24 m_bLimitTime = FALSE;
25 m_Greeting = _T("");
26 m_limitTime = 0;
27 m_bLimitWin = FALSE;
28 m_limitWin = 0;
29 //}}AFX_DATA_INIT
30}
31
32CSecretaryPage::~CSecretaryPage()
33{
34}
35
36void CSecretaryPage::DoDataExchange(CDataExchange* pDX)
37{
38 CPropertyPage::DoDataExchange(pDX);
39 //{{AFX_DATA_MAP(CSecretaryPage)
40 DDX_Control(pDX, IDC_DOWINLIMIT, m_bLimitWinCtl);
41 DDX_Control(pDX, IDC_WINSPIN, m_WinSpinCtl);
42 DDX_Control(pDX, IDC_TIMESPIN, m_TimeSpinCtl);
43 DDX_Control(pDX, IDC_WINLIMIT, m_limitWinCtl);
44 DDX_Control(pDX, IDC_CHARSPIN, m_CharSpinCtl);
45 DDX_Control(pDX, IDC_TIMELIMIT, m_limitTimeCtl);
46 DDX_Control(pDX, IDC_DOTIMELIMIT, m_bLimitTimeCtl);
47 DDX_Control(pDX, IDC_DOBYTELIMIT, m_bLimitBytesCtl);
48 DDX_Control(pDX, IDC_BYTELIMIT, m_limitBytesCtl);
49 DDX_Text(pDX, IDC_BYTELIMIT, m_limitBytes);
50 DDX_Check(pDX, IDC_DOBYTELIMIT, m_bLimitBytes);
51 DDX_Check(pDX, IDC_DOTIMELIMIT, m_bLimitTime);
52 DDX_Text(pDX, IDC_GREETING, m_Greeting);
53 DDX_Text(pDX, IDC_TIMELIMIT, m_limitTime);
54 DDX_Check(pDX, IDC_DOWINLIMIT, m_bLimitWin);
55 DDX_Text(pDX, IDC_WINLIMIT, m_limitWin);
56 //}}AFX_DATA_MAP
57}
58
59
60BEGIN_MESSAGE_MAP(CSecretaryPage, CPropertyPage)
61 //{{AFX_MSG_MAP(CSecretaryPage)
62 ON_BN_CLICKED(IDC_DOBYTELIMIT, OnDobytelimit)
63 ON_BN_CLICKED(IDC_DOTIMELIMIT, OnDotimelimit)
64 ON_BN_CLICKED(IDC_DOWINLIMIT, OnDowinlimit)
65 //}}AFX_MSG_MAP
66END_MESSAGE_MAP()
67
68/////////////////////////////////////////////////////////////////////////////
69// CSecretaryPage message handlers
70
71BOOL CSecretaryPage::OnInitDialog()
72{
73 CPropertyPage::OnInitDialog();
74
75 SetTimeLimit();
76 SetBytesLimit();
77 SetWinLimit();
78 m_TimeSpinCtl.SetRange(0,60);
79 m_WinSpinCtl.SetRange(0,100);
80 m_CharSpinCtl.SetRange(0,UD_MAXVAL);
81UDACCEL uda = {0,512};
82 m_CharSpinCtl.SetAccel(1,&uda);
83 return TRUE; // return TRUE unless you set the focus to a control
84 // EXCEPTION: OCX Property Pages should return FALSE
85}
86
87void CSecretaryPage::SetTimeLimit()
88{
89 m_limitTimeCtl.EnableWindow(m_bLimitTimeCtl.GetCheck());
90}
91
92void CSecretaryPage::SetBytesLimit()
93{
94 m_limitBytesCtl.EnableWindow(m_bLimitBytesCtl.GetCheck());
95}
96
97void CSecretaryPage::SetWinLimit()
98{
99 m_limitWinCtl.EnableWindow(m_bLimitWinCtl.GetCheck());
100}
101
102void CSecretaryPage::OnDobytelimit()
103{
104 SetBytesLimit();
105}
106
107void CSecretaryPage::OnDotimelimit()
108{
109 SetTimeLimit();
110}
111
112void CSecretaryPage::OnDowinlimit()
113{
114 SetWinLimit();
115}
116