-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFindDlg.cpp
81 lines (71 loc) · 1.62 KB
/
FindDlg.cpp
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
/******************************************************************************
** (C) Chris Oldwood
**
** MODULE: FINDDLG.CPP
** COMPONENT: The Application
** DESCRIPTION: CFindDlg class definition.
**
*******************************************************************************
*/
#include "Common.hpp"
#include "FindDlg.hpp"
/******************************************************************************
** Method: Default constructor.
**
** Description: .
**
** Parameters: None.
**
** Returns: Nothing.
**
*******************************************************************************
*/
CFindDlg::CFindDlg()
: CDialog(IDD_FIND)
{
DEFINE_CTRL_TABLE
CTRL(IDC_TEXT, &m_ebText)
END_CTRL_TABLE
// DEFINE_CTRLMSG_TABLE
// END_CTRLMSG_TABLE
}
/******************************************************************************
** Method: OnInitDialog()
**
** Description: Initialise the dialog.
**
** Parameters: None.
**
** Returns: Nothing.
**
*******************************************************************************
*/
void CFindDlg::OnInitDialog()
{
// Initialise controls.
m_ebText.Text(m_strText);
}
/******************************************************************************
** Method: OnOk()
**
** Description: The OK button was pressed.
**
** Parameters: None.
**
** Returns: true or false.
**
*******************************************************************************
*/
bool CFindDlg::OnOk()
{
// Validate settings.
if (m_ebText.TextLength() == 0)
{
AlertMsg(TXT("Please enter the text to find."));
m_ebText.Focus();
return false;
}
// Get new settings.
m_strText = m_ebText.Text();
return true;
}