[6a7162]: SampleTextDlg.cpp  Maximize  Restore  History

Download this file

52 lines (41 with data), 1.1 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
// SampleTextDlg.cpp : implementation file
//
#include "stdafx.h"
#include "SampleTextDlg.h"
#include "resource.h"
#include "resource3.h"
#include "ControlExtns.h"
// SampleTextDlg dialog
IMPLEMENT_DYNAMIC(CSampleTextDlg, CDialog)
CSampleTextDlg::CSampleTextDlg(CWnd* pParent, CString sampletext)
: CDialog(CSampleTextDlg::IDD, pParent), m_sampletext(sampletext)
{
}
CSampleTextDlg::~CSampleTextDlg()
{
}
BOOL CSampleTextDlg::OnInitDialog()
{
CDialog::OnInitDialog();
((CEdit*)GetDlgItem(IDC_SAMPLETEXT))->SetFocus();
return FALSE;
}
void CSampleTextDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Text(pDX, IDC_SAMPLETEXT, m_sampletext);
DDX_Control(pDX, IDC_SAMPLETEXT, m_ex_sampletext);
}
BEGIN_MESSAGE_MAP(CSampleTextDlg, CDialog)
ON_BN_CLICKED(IDOK, OnOK)
END_MESSAGE_MAP()
void CSampleTextDlg::OnOK()
{
UpdateData(TRUE);
if (m_sampletext.IsEmpty()) {
AfxMessageBox(IDS_EMPTYSAMPLETEXT);
((CEdit*)GetDlgItem(IDC_SAMPLETEXT))->SetFocus();
return;
}
CDialog::OnOK();
}