mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-14 16:11:38 -06:00
3.13
This commit is contained in:
50
7zip/FileManager/Resource/PasswordDialog/PasswordDialog.cpp
Executable file
50
7zip/FileManager/Resource/PasswordDialog/PasswordDialog.cpp
Executable file
@@ -0,0 +1,50 @@
|
||||
// PasswordDialog.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
#include "PasswordDialog.h"
|
||||
|
||||
#ifdef LANG
|
||||
#include "../../LangUtils.h"
|
||||
#endif
|
||||
|
||||
#ifdef LANG
|
||||
static CIDLangPair kIDLangPairs[] =
|
||||
{
|
||||
{ IDC_STATIC_PASSWORD_HEADER, 0x02000B01 },
|
||||
{ IDC_CHECK_PASSWORD_SHOW, 0x02000B02 },
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
bool CPasswordDialog::OnInit()
|
||||
{
|
||||
#ifdef LANG
|
||||
LangSetWindowText(HWND(*this), 0x02000B00);
|
||||
LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
|
||||
#endif
|
||||
_passwordControl.Attach(GetItem(IDC_EDIT_PASSWORD));
|
||||
_passwordControl.SetText(_password);
|
||||
_passwordControl.SetPasswordChar(TEXT('*'));
|
||||
return CModalDialog::OnInit();
|
||||
}
|
||||
|
||||
bool CPasswordDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
|
||||
{
|
||||
if (buttonID == IDC_CHECK_PASSWORD_SHOW)
|
||||
{
|
||||
_passwordControl.SetPasswordChar((IsButtonChecked(
|
||||
IDC_CHECK_PASSWORD_SHOW) == BST_CHECKED) ? 0: TEXT('*'));
|
||||
CSysString password;
|
||||
_passwordControl.GetText(password);
|
||||
_passwordControl.SetText(password);
|
||||
return true;
|
||||
}
|
||||
return CDialog::OnButtonClicked(buttonID, buttonHWND);
|
||||
}
|
||||
|
||||
void CPasswordDialog::OnOK()
|
||||
{
|
||||
_passwordControl.GetText(_password);
|
||||
CModalDialog::OnOK();
|
||||
}
|
||||
Reference in New Issue
Block a user