109 lines
2.7 KiB
C++
109 lines
2.7 KiB
C++
// InputPasswordDial.cpp : implementation file
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "geomative.h"
|
|
#include "InputPasswordDial.h"
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
extern int g_iUILanguage;
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CInputPasswordDial dialog
|
|
|
|
|
|
CInputPasswordDial::CInputPasswordDial(CWnd* pParent /*=NULL*/)
|
|
: CDialog(CInputPasswordDial::IDD, pParent)
|
|
{
|
|
//{{AFX_DATA_INIT(CInputPasswordDial)
|
|
m_edPassword = _T("");
|
|
//}}AFX_DATA_INIT
|
|
m_bIsDirectVerify = true;
|
|
m_strGeoPassword = _T("");
|
|
}
|
|
|
|
|
|
void CInputPasswordDial::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CDialog::DoDataExchange(pDX);
|
|
//{{AFX_DATA_MAP(CInputPasswordDial)
|
|
DDX_Text(pDX, IDC_EDIT_INPUT_PASSWORD, m_edPassword);
|
|
DDV_MaxChars(pDX, m_edPassword, 50);
|
|
//}}AFX_DATA_MAP
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CInputPasswordDial, CDialog)
|
|
//{{AFX_MSG_MAP(CInputPasswordDial)
|
|
//}}AFX_MSG_MAP
|
|
END_MESSAGE_MAP()
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CInputPasswordDial message handlers
|
|
|
|
void CInputPasswordDial::OnOK()
|
|
{
|
|
// TODO: Add extra validation here
|
|
if (!UpdateData(TRUE))
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("输入密码错误!"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Input Password Error!"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
|
|
if (m_bIsDirectVerify)
|
|
{
|
|
if (m_edPassword != m_strGeoPassword)
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("密码错误!"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Password Error!"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
CDialog::OnOK();
|
|
}
|
|
|
|
BOOL CInputPasswordDial::OnInitDialog()
|
|
{
|
|
CDialog::OnInitDialog();
|
|
|
|
// TODO: Add extra initialization here
|
|
if (m_bIsDirectVerify)
|
|
{
|
|
if (m_strGeoPassword.IsEmpty())
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("获取Geomative 初始化密码失败!!!"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Get Geomative Initial Password Failed!!!"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return FALSE;
|
|
}
|
|
}
|
|
GetDlgItem(IDC_EDIT_INPUT_PASSWORD)->SetFocus();
|
|
return FALSE; // return TRUE unless you set the focus to a control
|
|
// EXCEPTION: OCX Property Pages should return FALSE
|
|
}
|
|
|
|
void CInputPasswordDial::OnCancel()
|
|
{
|
|
// TODO: Add extra cleanup here
|
|
int nRet = 0;
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
nRet = AfxMessageBox(_T("您要放弃输入密码吗?"), MB_YESNO);
|
|
else
|
|
nRet = MessageBoxEx(NULL, _T("Do you want to give up input password?"), STRING_MESSAGEBOXEX_TITLE, MB_YESNO, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
if (IDYES != nRet)
|
|
return;
|
|
CDialog::OnCancel();
|
|
}
|