////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2008-2016 HiTi Digital, Inc.  All Rights Reserved.
//
// Revision: 1.7.11.1100
// Date    : 2016.02.03
//
////////////////////////////////////////////////////////////////////////////////
// DlgSecurityMode.cpp : implementation file
//

#include "stdafx.h"
#include "demo1.h"
#include "DlgSecurityMode.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDlgSecurityMode dialog


CDlgSecurityMode::CDlgSecurityMode(LPTSTR szPasswdOld, int* lpnSecurityMode, CWnd* pParent /*=NULL*/)
	: CDialog(CDlgSecurityMode::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgSecurityMode)
	m_PasswdOld = _T("");
	m_nSecurityMode = 0;
	//}}AFX_DATA_INIT

	m_lpPasswdOld = szPasswdOld;
	m_lpnSecurityMode = lpnSecurityMode;
}


void CDlgSecurityMode::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgSecurityMode)
	DDX_Text(pDX, IDC_EDIT_PASSWD_OLD, m_PasswdOld);
	DDV_MaxChars(pDX, m_PasswdOld, 4);
	DDX_Radio(pDX, IDC_RADIO1, m_nSecurityMode);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CDlgSecurityMode message handlers

void CDlgSecurityMode::OnOK()
{
	// TODO: Add extra validation here
	UpdateData(TRUE);

	if ( m_lpPasswdOld )
		lstrcpy(m_lpPasswdOld, (LPCTSTR)m_PasswdOld);

	if ( m_lpnSecurityMode )
		*m_lpnSecurityMode = m_nSecurityMode;

	CDialog::OnOK();
}
