mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-10 02:07:07 -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();
|
||||
}
|
||||
24
7zip/FileManager/Resource/PasswordDialog/PasswordDialog.h
Executable file
24
7zip/FileManager/Resource/PasswordDialog/PasswordDialog.h
Executable file
@@ -0,0 +1,24 @@
|
||||
// PasswordDialog.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __PASSWORDDIALOG_H
|
||||
#define __PASSWORDDIALOG_H
|
||||
|
||||
#include "Windows/Control/Dialog.h"
|
||||
#include "Windows/Control/Edit.h"
|
||||
#include "resource.h"
|
||||
|
||||
class CPasswordDialog: public NWindows::NControl::CModalDialog
|
||||
{
|
||||
NWindows::NControl::CEdit _passwordControl;
|
||||
virtual void OnOK();
|
||||
virtual bool OnInit();
|
||||
virtual bool OnButtonClicked(int buttonID, HWND buttonHWND);
|
||||
public:
|
||||
CSysString _password;
|
||||
INT_PTR Create(HWND parentWindow = 0)
|
||||
{ return CModalDialog::Create(MAKEINTRESOURCE(IDD_DIALOG_PASSWORD), parentWindow); }
|
||||
};
|
||||
|
||||
#endif
|
||||
19
7zip/FileManager/Resource/PasswordDialog/resource.h
Executable file
19
7zip/FileManager/Resource/PasswordDialog/resource.h
Executable file
@@ -0,0 +1,19 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by resource.rc
|
||||
//
|
||||
#define IDD_DIALOG_PASSWORD 501
|
||||
#define IDC_STATIC_PASSWORD_HEADER 1000
|
||||
#define IDC_EDIT_PASSWORD 1001
|
||||
#define IDC_CHECK_PASSWORD_SHOW 1002
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 157
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1003
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
103
7zip/FileManager/Resource/PasswordDialog/resource.rc
Executable file
103
7zip/FileManager/Resource/PasswordDialog/resource.rc
Executable file
@@ -0,0 +1,103 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Russian resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
|
||||
#pragma code_page(1251)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // Russian resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_DIALOG_PASSWORD DIALOG DISCARDABLE 0, 0, 186, 82
|
||||
STYLE DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CAPTION "Enter password"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "&Enter password:",IDC_STATIC_PASSWORD_HEADER,7,7,172,8
|
||||
EDITTEXT IDC_EDIT_PASSWORD,7,19,172,14,ES_PASSWORD |
|
||||
ES_AUTOHSCROLL
|
||||
CONTROL "&Show password",IDC_CHECK_PASSWORD_SHOW,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,41,172,10
|
||||
DEFPUSHBUTTON "OK",IDOK,41,61,64,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,115,61,64,14
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_DIALOG_PASSWORD, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 179
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 75
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
Reference in New Issue
Block a user