/
PasswordDialog.cpp
103 lines (78 loc) · 2.62 KB
/
PasswordDialog.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/****************************************************************************
* Operator Console - an extensible user interface for the Imatest IT *
* library *
* Copyright (C) 2013 Imatest LLC. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
****************************************************************************/
// PasswordDialog.cpp : implementation file
//
#include "stdafx.h"
#include "OperatorConsole.h"
#include "PasswordDialog.h"
#include "afxdialogex.h"
// CPasswordDialog dialog
IMPLEMENT_DYNAMIC(CPasswordDialog, CDialogEx)
CPasswordDialog::CPasswordDialog(CWnd* pParent /*=NULL*/)
: CDialogEx(CPasswordDialog::IDD, pParent)
{
m_password.SetString(_T(""));
m_unlock = false;
}
CPasswordDialog::~CPasswordDialog()
{
}
void CPasswordDialog::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_EDIT_PWD, c_edit_password);
DDX_Control(pDX, IDC_CHECK_RETAIN_ACCESS, c_unlock);
}
BEGIN_MESSAGE_MAP(CPasswordDialog, CDialogEx)
ON_BN_CLICKED(IDOK, &CPasswordDialog::OnBnClickedOk)
ON_BN_CLICKED(IDC_CHECK_RETAIN_ACCESS, &CPasswordDialog::OnClickedCheckRetainAccess)
END_MESSAGE_MAP()
// CPasswordDialog message handlers
const CString CPasswordDialog::getResponse(void)
{
return m_password;
}
void CPasswordDialog::OnBnClickedOk()
{
// TODO: Add your control notification handler code here
CDialogEx::OnOK();
c_edit_password.GetWindowTextA(m_password); // copy the entered password to the private variable;
}
void CPasswordDialog::OnClickedCheckRetainAccess()
{
m_unlock = (BST_CHECKED==c_unlock.GetCheck());
}
const bool CPasswordDialog::getUnlockStatus(void)
{
return m_unlock;
}
BOOL CPasswordDialog::OnInitDialog()
{
CDialogEx::OnInitDialog();
if (m_unlock)
{
c_unlock.SetCheck(BST_CHECKED);
}
else
{
c_unlock.SetCheck(BST_UNCHECKED);
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}