summaryrefslogtreecommitdiffabout
path: root/CalleeDlg.cpp
blob: 971781e3271483a60c4fc9803369794a83067e26 (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
// CalleeDlg.cpp : implementation file
//

#include "stdafx.h"
#include "T42.h"
#include "CalleeDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCalleeDlg dialog


CCalleeDlg::CCalleeDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CCalleeDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CCalleeDlg)
	m_Callee = _T("");
	m_Caller = _T("");
	m_TTY = _T("");
	//}}AFX_DATA_INIT
}


void CCalleeDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCalleeDlg)
	DDX_Control(pDX, IDC_CALLER, m_CallerCtl);
	DDX_Control(pDX, IDC_CALLEE, m_CalleeCtl);
	DDX_Text(pDX, IDC_CALLEE, m_Callee);
	DDX_CBString(pDX, IDC_CALLER, m_Caller);
	DDV_MaxChars(pDX, m_Caller, 11);
	DDX_CBString(pDX, IDC_TTY, m_TTY);
	DDV_MaxChars(pDX, m_TTY, 15);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CCalleeDlg, CDialog)
	//{{AFX_MSG_MAP(CCalleeDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCalleeDlg message handlers

BOOL CCalleeDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();

CT42App* app = (CT42App*)AfxGetApp();
	ASSERT(app);
POSITION p = app->m_t42Callees.GetHeadPosition();
	m_CalleeCtl.ResetContent();
	while(p){
	CString callee = app->m_t42Callees.GetNext(p);
		m_CalleeCtl.AddString(callee);
		if(m_Callee.IsEmpty())
			m_Callee = callee;
	}
	m_CallerCtl.ResetContent();
	p = app->m_t42Callers.GetHeadPosition();
	while(p){
	CString caller = app->m_t42Callers.GetNext(p);
		m_CallerCtl.AddString(caller);
		if(m_Caller.IsEmpty())
			m_Caller = caller;
	}
	UpdateData(FALSE);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CCalleeDlg::OnOK() 
{
	UpdateData(TRUE);
	if(m_Caller.IsEmpty())
		VERIFY(m_Caller.LoadString(IDS_DEFAULTCALLER));
CT42App* app = (CT42App*)AfxGetApp();
	ASSERT(app);
	app->LastCaller(m_Caller);
	CDialog::OnOK();
}