diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2007-08-27 04:00:00 +0400 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:15:54 +0300 |
commit | 051769bbc577aeede90558b6ab5c9be187940ca0 (patch) | |
tree | e6330cb80f2d4a526d8aa27812528e053b0cda90 /CPP/7zip/UI/FileManager/PasswordDialog.cpp | |
parent | 33ccab7e728a996800e166d849fe1e92a17e1afe (diff) |
4.53 beta
Diffstat (limited to 'CPP/7zip/UI/FileManager/PasswordDialog.cpp')
-rwxr-xr-x | CPP/7zip/UI/FileManager/PasswordDialog.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/CPP/7zip/UI/FileManager/PasswordDialog.cpp b/CPP/7zip/UI/FileManager/PasswordDialog.cpp new file mode 100755 index 00000000..a366a61e --- /dev/null +++ b/CPP/7zip/UI/FileManager/PasswordDialog.cpp @@ -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('*')); + UString password; + _passwordControl.GetText(password); + _passwordControl.SetText(password); + return true; + } + return CDialog::OnButtonClicked(buttonID, buttonHWND); +} + +void CPasswordDialog::OnOK() +{ + _passwordControl.GetText(Password); + CModalDialog::OnOK(); +} |