mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-14 20:11:38 -06:00
3.13
This commit is contained in:
87
7zip/FileManager/Resource/MessagesDialog/MessagesDialog.cpp
Executable file
87
7zip/FileManager/Resource/MessagesDialog/MessagesDialog.cpp
Executable file
@@ -0,0 +1,87 @@
|
||||
// MessagesDialog.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
#include "MessagesDialog.h"
|
||||
#include "Windows/ResourceString.h"
|
||||
|
||||
// #include "../resource.h"
|
||||
|
||||
#ifdef LANG
|
||||
#include "../../LangUtils.h"
|
||||
#endif
|
||||
|
||||
using namespace NWindows;
|
||||
|
||||
#ifdef LANG
|
||||
static CIDLangPair kIDLangPairs[] =
|
||||
{
|
||||
{ IDOK, 0x02000713 }
|
||||
};
|
||||
#endif
|
||||
|
||||
void CMessagesDialog::AddMessage(LPCTSTR aMessage)
|
||||
{
|
||||
int itemIndex = _messageList.GetItemCount();
|
||||
LVITEM item;
|
||||
item.mask = LVIF_TEXT;
|
||||
item.iItem = itemIndex;
|
||||
|
||||
CSysString stringNumber;
|
||||
TCHAR sz[32];
|
||||
wsprintf(sz, TEXT("%d"), itemIndex);
|
||||
stringNumber = sz;
|
||||
|
||||
item.pszText = (LPTSTR)(LPCTSTR)stringNumber;
|
||||
item.iSubItem = 0;
|
||||
_messageList.InsertItem(&item);
|
||||
|
||||
item.mask = LVIF_TEXT;
|
||||
item.pszText = (LPTSTR)aMessage;
|
||||
item.iSubItem = 1;
|
||||
_messageList.SetItem(&item);
|
||||
}
|
||||
|
||||
bool CMessagesDialog::OnInit()
|
||||
{
|
||||
#ifdef LANG
|
||||
LangSetWindowText(HWND(*this), 0x02000A00);
|
||||
LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
|
||||
#endif
|
||||
_messageList.Attach(GetItem(IDC_MESSAGE_LIST));
|
||||
|
||||
LVCOLUMN columnInfo;
|
||||
columnInfo.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;
|
||||
columnInfo.fmt = LVCFMT_LEFT;
|
||||
columnInfo.pszText = TEXT("#");
|
||||
columnInfo.iSubItem = 0;
|
||||
columnInfo.cx = 30;
|
||||
|
||||
_messageList.InsertColumn(0, &columnInfo);
|
||||
|
||||
|
||||
columnInfo.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;
|
||||
columnInfo.fmt = LVCFMT_LEFT;
|
||||
#ifdef LANG
|
||||
CSysString s = LangLoadString(IDS_MESSAGES_DIALOG_MESSAGE_COLUMN, 0x02000A80);
|
||||
#else
|
||||
CSysString s = MyLoadString(IDS_MESSAGES_DIALOG_MESSAGE_COLUMN);
|
||||
#endif
|
||||
|
||||
columnInfo.pszText = (LPTSTR)(LPCTSTR)s;
|
||||
columnInfo.iSubItem = 1;
|
||||
columnInfo.cx = 450;
|
||||
|
||||
_messageList.InsertColumn(1, &columnInfo);
|
||||
|
||||
for(int i = 0; i < _messages->Size(); i++)
|
||||
AddMessage((*_messages)[i]);
|
||||
|
||||
/*
|
||||
if(_messageList.GetItemCount() > 0)
|
||||
{
|
||||
UINT aState = LVIS_SELECTED | LVIS_FOCUSED;
|
||||
_messageList.SetItemState(0, aState, aState);
|
||||
}
|
||||
*/
|
||||
return CModalDialog::OnInit();
|
||||
}
|
||||
24
7zip/FileManager/Resource/MessagesDialog/MessagesDialog.h
Executable file
24
7zip/FileManager/Resource/MessagesDialog/MessagesDialog.h
Executable file
@@ -0,0 +1,24 @@
|
||||
// MessagesDialog.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __MESSAGESDIALOG_H
|
||||
#define __MESSAGESDIALOG_H
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
#include "Windows/Control/Dialog.h"
|
||||
#include "Windows/Control/ListView.h"
|
||||
|
||||
class CMessagesDialog: public NWindows::NControl::CModalDialog
|
||||
{
|
||||
NWindows::NControl::CListView _messageList;
|
||||
void AddMessage(LPCTSTR string);
|
||||
virtual bool OnInit();
|
||||
public:
|
||||
const CSysStringVector *_messages;
|
||||
INT_PTR Create(HWND parentWindow = 0)
|
||||
{ return CModalDialog::Create(MAKEINTRESOURCE(IDD_DIALOG_MESSAGES), parentWindow); }
|
||||
};
|
||||
|
||||
#endif
|
||||
22
7zip/FileManager/Resource/MessagesDialog/resource.h
Executable file
22
7zip/FileManager/Resource/MessagesDialog/resource.h
Executable file
@@ -0,0 +1,22 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by resource.rc
|
||||
//
|
||||
|
||||
#define IDS_MESSAGES_DIALOG_MESSAGE_COLUMN 11
|
||||
|
||||
#define IDD_DIALOG_MESSAGES 503
|
||||
|
||||
#define IDC_MESSAGE_LIST 1000
|
||||
|
||||
|
||||
// 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 1002
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
114
7zip/FileManager/Resource/MessagesDialog/resource.rc
Executable file
114
7zip/FileManager/Resource/MessagesDialog/resource.rc
Executable file
@@ -0,0 +1,114 @@
|
||||
//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_MESSAGES DIALOG DISCARDABLE 0, 0, 349, 135
|
||||
STYLE DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CAPTION "7-Zip: Diagnostic messages"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "&Close",IDOK,143,114,64,14
|
||||
CONTROL "List1",IDC_MESSAGE_LIST,"SysListView32",LVS_REPORT |
|
||||
LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER |
|
||||
WS_TABSTOP,7,7,335,101
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
|
||||
IDD_DIALOG_MESSAGES, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 342
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 128
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_MESSAGES_DIALOG_MESSAGE_COLUMN "Message"
|
||||
END
|
||||
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
Reference in New Issue
Block a user