-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDMInputDialog.cpp
More file actions
73 lines (50 loc) · 1.38 KB
/
Copy pathDMInputDialog.cpp
File metadata and controls
73 lines (50 loc) · 1.38 KB
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
// DMInputDialog.cpp : implementation file
//
#include "stdafx.h"
#include "DM Helper.h"
#include "DMInputDialog.h"
// CDMInputDialog dialog
IMPLEMENT_DYNAMIC(CDMInputDialog, CDialog)
CDMInputDialog::CDMInputDialog(char *pszPrompt, CString *pszRetVal, CWnd* pParent /*=NULL*/)
: CDialog(CDMInputDialog::IDD, pParent)
, m_szInputEdit(_T(""))
, m_szPrompt(_T(""))
{
m_szPrompt = pszPrompt;
m_pszRetVal = pszRetVal;
}
CDMInputDialog::~CDMInputDialog()
{
}
void CDMInputDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Text(pDX, IDC_INPUT_EDIT, m_szInputEdit);
DDV_MaxChars(pDX, m_szInputEdit, 64);
DDX_Text(pDX, IDC_PROMPT_STATIC, m_szPrompt);
DDX_Control(pDX, IDC_INPUT_EDIT, m_cInputEdit);
}
BEGIN_MESSAGE_MAP(CDMInputDialog, CDialog)
ON_BN_CLICKED(IDOK, &CDMInputDialog::OnBnClickedOk)
ON_BN_CLICKED(IDCANCEL, &CDMInputDialog::OnBnClickedCancel)
END_MESSAGE_MAP()
// CDMInputDialog message handlers
BOOL CDMInputDialog::OnInitDialog()
{
CDialog::OnInitDialog();
m_szInputEdit = *m_pszRetVal;
m_cInputEdit.SetFocus();
UpdateData(FALSE);
return FALSE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDMInputDialog::OnBnClickedOk()
{
UpdateData(TRUE);
m_pszRetVal->Format("%s", m_szInputEdit.GetBuffer(0));
OnOK();
}
void CDMInputDialog::OnBnClickedCancel()
{
OnCancel();
}