mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-06 13:14:59 -06:00
9.07 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
c99f3ebdd6
commit
2fed872194
@@ -16,6 +16,8 @@ extern HWND g_HWND;
|
||||
|
||||
const int kNumPanelsMax = 2;
|
||||
|
||||
extern bool g_IsSmallScreen;
|
||||
|
||||
enum
|
||||
{
|
||||
kAddCommand = kToolbarStartID,
|
||||
@@ -202,8 +204,8 @@ public:
|
||||
|
||||
void RefreshStatusBar() { GetFocusedPanel().RefreshStatusBar(); }
|
||||
|
||||
void SetListViewMode(UINT32 index) { GetFocusedPanel().SetListViewMode(index); }
|
||||
UINT32 GetListViewMode() { return GetFocusedPanel().GetListViewMode(); }
|
||||
void SetListViewMode(UInt32 index) { GetFocusedPanel().SetListViewMode(index); }
|
||||
UInt32 GetListViewMode() { return GetFocusedPanel().GetListViewMode(); }
|
||||
PROPID GetSortID() { return GetFocusedPanel().GetSortID(); }
|
||||
|
||||
void SortItemsWithPropID(PROPID propID) { GetFocusedPanel().SortItemsWithPropID(propID); }
|
||||
@@ -248,15 +250,24 @@ public:
|
||||
void ReloadToolbars();
|
||||
void ReadToolbar()
|
||||
{
|
||||
UINT32 mask = ReadToolbarsMask();
|
||||
ShowButtonsLables = ((mask & 1) != 0);
|
||||
LargeButtons = ((mask & 2) != 0);
|
||||
ShowStandardToolbar = ((mask & 4) != 0);
|
||||
ShowArchiveToolbar = ((mask & 8) != 0);
|
||||
UInt32 mask = ReadToolbarsMask();
|
||||
if (mask & ((UInt32)1 << 31))
|
||||
{
|
||||
ShowButtonsLables = !g_IsSmallScreen;
|
||||
LargeButtons = false;
|
||||
ShowStandardToolbar = ShowArchiveToolbar = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowButtonsLables = ((mask & 1) != 0);
|
||||
LargeButtons = ((mask & 2) != 0);
|
||||
ShowStandardToolbar = ((mask & 4) != 0);
|
||||
ShowArchiveToolbar = ((mask & 8) != 0);
|
||||
}
|
||||
}
|
||||
void SaveToolbar()
|
||||
{
|
||||
UINT32 mask = 0;
|
||||
UInt32 mask = 0;
|
||||
if (ShowButtonsLables) mask |= 1;
|
||||
if (LargeButtons) mask |= 2;
|
||||
if (ShowStandardToolbar) mask |= 4;
|
||||
|
||||
@@ -14,7 +14,8 @@ using namespace NWindows;
|
||||
|
||||
static CIDLangPair kIDLangPairs[] =
|
||||
{
|
||||
{ IDC_EDIT_STATIC_EDITOR, 0x03010201}
|
||||
{ IDC_EDIT_STATIC_EDITOR, 0x03010201},
|
||||
{ IDC_EDIT_STATIC_DIFF, 0x03010202}
|
||||
};
|
||||
|
||||
static LPCWSTR kEditTopic = L"FM/options.htm#editor";
|
||||
@@ -23,18 +24,34 @@ bool CEditPage::OnInit()
|
||||
{
|
||||
LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
|
||||
|
||||
_editorEdit.Attach(GetItem(IDC_EDIT_EDIT_EDITOR));
|
||||
UString editorPath;
|
||||
ReadRegEditor(editorPath);
|
||||
_editorEdit.SetText(editorPath);
|
||||
_editor.Attach(GetItem(IDC_EDIT_EDIT_EDITOR));
|
||||
_diff.Attach(GetItem(IDC_EDIT_EDIT_DIFF));
|
||||
|
||||
{
|
||||
UString path;
|
||||
ReadRegEditor(path);
|
||||
_editor.SetText(path);
|
||||
}
|
||||
{
|
||||
UString path;
|
||||
ReadRegDiff(path);
|
||||
_diff.SetText(path);
|
||||
}
|
||||
return CPropertyPage::OnInit();
|
||||
}
|
||||
|
||||
LONG CEditPage::OnApply()
|
||||
{
|
||||
UString editorPath;
|
||||
_editorEdit.GetText(editorPath);
|
||||
SaveRegEditor(editorPath);
|
||||
{
|
||||
UString path;
|
||||
_editor.GetText(path);
|
||||
SaveRegEditor(path);
|
||||
}
|
||||
{
|
||||
UString path;
|
||||
_diff.GetText(path);
|
||||
SaveRegDiff(path);
|
||||
}
|
||||
return PSNRET_NOERROR;
|
||||
}
|
||||
|
||||
@@ -43,29 +60,37 @@ void CEditPage::OnNotifyHelp()
|
||||
ShowHelpWindow(NULL, kEditTopic);
|
||||
}
|
||||
|
||||
static void Edit_BrowseForFile(NWindows::NControl::CEdit &edit, HWND hwnd)
|
||||
{
|
||||
UString path;
|
||||
edit.GetText(path);
|
||||
UString resPath;
|
||||
if (MyBrowseForFile(hwnd, 0, path, L"*.exe", resPath))
|
||||
{
|
||||
edit.SetText(resPath);
|
||||
// Changed();
|
||||
}
|
||||
}
|
||||
|
||||
bool CEditPage::OnButtonClicked(int buttonID, HWND buttonHWND)
|
||||
{
|
||||
switch (buttonID)
|
||||
{
|
||||
case IDC_EDIT_BUTTON_SET:
|
||||
{
|
||||
UString editorPath;
|
||||
_editorEdit.GetText(editorPath);
|
||||
UString resPath;
|
||||
if (MyBrowseForFile(HWND(*this), 0, editorPath, L"*.exe", resPath))
|
||||
{
|
||||
_editorEdit.SetText(resPath);
|
||||
// Changed();
|
||||
}
|
||||
case IDC_EDIT_BUTTON_EDITOR:
|
||||
Edit_BrowseForFile(_editor, *this);
|
||||
return true;
|
||||
case IDC_EDIT_BUTTON_DIFF:
|
||||
Edit_BrowseForFile(_diff, *this);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return CPropertyPage::OnButtonClicked(buttonID, buttonHWND);
|
||||
}
|
||||
|
||||
bool CEditPage::OnCommand(int code, int itemID, LPARAM param)
|
||||
{
|
||||
if (code == EN_CHANGE && itemID == IDC_EDIT_EDIT_EDITOR)
|
||||
if (code == EN_CHANGE &&
|
||||
(itemID == IDC_EDIT_EDIT_EDITOR ||
|
||||
itemID == IDC_EDIT_EDIT_DIFF))
|
||||
{
|
||||
Changed();
|
||||
return true;
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
|
||||
class CEditPage: public NWindows::NControl::CPropertyPage
|
||||
{
|
||||
NWindows::NControl::CEdit _editorEdit;
|
||||
NWindows::NControl::CEdit _editor;
|
||||
NWindows::NControl::CEdit _diff;
|
||||
public:
|
||||
virtual bool OnInit();
|
||||
virtual void OnNotifyHelp();
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
#include "EditPageRes.h"
|
||||
#include "../../GuiCommon.rc"
|
||||
|
||||
#define xc SMALL_PAGE_SIZE_X
|
||||
#define yc 60
|
||||
#define xc 200
|
||||
#define yc 80
|
||||
|
||||
IDD_EDIT MY_PAGE
|
||||
CAPTION "Editor"
|
||||
{
|
||||
LTEXT "&Editor:", IDC_EDIT_STATIC_EDITOR, m, m, xc, 8
|
||||
EDITTEXT IDC_EDIT_EDIT_EDITOR, m, 20, xc - m - bxsDots, 14, ES_AUTOHSCROLL
|
||||
PUSHBUTTON "...", IDC_EDIT_BUTTON_SET, xs - m - bxsDots, 19, bxsDots, bys
|
||||
}
|
||||
#include "EditPage2.rc"
|
||||
|
||||
#ifdef UNDER_CE
|
||||
|
||||
#undef xc
|
||||
|
||||
#define xc SMALL_PAGE_SIZE_X
|
||||
|
||||
IDD_EDIT_2 MY_PAGE
|
||||
#include "EditPage2.rc"
|
||||
|
||||
#endif
|
||||
|
||||
9
CPP/7zip/UI/FileManager/EditPage2.rc
Executable file
9
CPP/7zip/UI/FileManager/EditPage2.rc
Executable file
@@ -0,0 +1,9 @@
|
||||
CAPTION "Editor"
|
||||
{
|
||||
LTEXT "&Editor:", IDC_EDIT_STATIC_EDITOR, m, m, xc, 8
|
||||
EDITTEXT IDC_EDIT_EDIT_EDITOR, m, 20, xc - m - bxsDots, 14, ES_AUTOHSCROLL
|
||||
PUSHBUTTON "...", IDC_EDIT_BUTTON_EDITOR, xs - m - bxsDots, 19, bxsDots, bys
|
||||
LTEXT "&Diff:", IDC_EDIT_STATIC_DIFF, m, 40, xc, 8
|
||||
EDITTEXT IDC_EDIT_EDIT_DIFF, m, 52, xc - m - bxsDots, 14, ES_AUTOHSCROLL
|
||||
PUSHBUTTON "...", IDC_EDIT_BUTTON_DIFF, xs - m - bxsDots, 51, bxsDots, bys
|
||||
}
|
||||
@@ -1,4 +1,10 @@
|
||||
#define IDD_EDIT 542
|
||||
#define IDC_EDIT_STATIC_EDITOR 1000
|
||||
#define IDC_EDIT_EDIT_EDITOR 1002
|
||||
#define IDC_EDIT_BUTTON_SET 1003
|
||||
#define IDD_EDIT 542
|
||||
#define IDD_EDIT_2 642
|
||||
|
||||
#define IDC_EDIT_STATIC_EDITOR 1000
|
||||
#define IDC_EDIT_EDIT_EDITOR 1001
|
||||
#define IDC_EDIT_BUTTON_EDITOR 1002
|
||||
|
||||
#define IDC_EDIT_STATIC_DIFF 1010
|
||||
#define IDC_EDIT_EDIT_DIFF 1011
|
||||
#define IDC_EDIT_BUTTON_DIFF 1012
|
||||
|
||||
@@ -43,6 +43,8 @@ static bool g_Maximized = false;
|
||||
DWORD g_ComCtl32Version;
|
||||
#endif
|
||||
|
||||
bool g_IsSmallScreen = false;
|
||||
|
||||
bool g_LVN_ITEMACTIVATE_Support = true;
|
||||
// LVN_ITEMACTIVATE replaces both NM_DBLCLK & NM_RETURN
|
||||
// Windows 2000
|
||||
@@ -418,6 +420,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
|
||||
g_LVN_ITEMACTIVATE_Support = (g_ComCtl32Version >= MAKELONG(71, 4));
|
||||
#endif
|
||||
|
||||
g_IsSmallScreen = !NWindows::NControl::IsDialogSizeOK(200, 200);
|
||||
|
||||
// OleInitialize is required for drag and drop.
|
||||
#ifndef UNDER_CE
|
||||
OleInitialize(NULL);
|
||||
|
||||
@@ -64,6 +64,7 @@ static const CIDLangPair kIDLangPairs[] =
|
||||
{ IDM_FILE_PROPERTIES, 0x03000240 },
|
||||
{ IDM_FILE_COMMENT, 0x03000241 },
|
||||
{ IDM_FILE_CRC, 0x03000242 },
|
||||
{ IDM_FILE_DIFF, 0x03000243 },
|
||||
{ IDM_FILE_SPLIT, 0x03000270 },
|
||||
{ IDM_FILE_COMBINE, 0x03000271 },
|
||||
{ IDM_CREATE_FOLDER, 0x03000250 },
|
||||
|
||||
@@ -106,7 +106,7 @@ void OptionsDialog(HWND hwndOwner, HINSTANCE /* hInstance */)
|
||||
// IDD_PLUGINS,
|
||||
SIZED_DIALOG(IDD_MENU),
|
||||
SIZED_DIALOG(IDD_FOLDERS),
|
||||
IDD_EDIT,
|
||||
SIZED_DIALOG(IDD_EDIT),
|
||||
SIZED_DIALOG(IDD_SETTINGS),
|
||||
SIZED_DIALOG(IDD_LANG) };
|
||||
NControl::CPropertyPage *pagePinters[] = { &systemPage, &menuPage, &foldersPage, &editPage, &settingsPage, &langPage };
|
||||
|
||||
@@ -25,10 +25,10 @@ static CIDLangPair kIDLangPairs[] =
|
||||
{ IDC_SETTINGS_SHOW_SYSTEM_MENU, 0x03010410},
|
||||
{ IDC_SETTINGS_FULL_ROW, 0x03010420},
|
||||
{ IDC_SETTINGS_SHOW_GRID, 0x03010421},
|
||||
{ IDC_SETTINGS_SINGLE_CLICK, 0x03010422},
|
||||
// { IDC_SETTINGS_UNDERLINE, 0x03010423}
|
||||
{ IDC_SETTINGS_ALTERNATIVE_SELECTION, 0x03010430},
|
||||
{ IDC_SETTINGS_LARGE_PAGES, 0x03010440}
|
||||
// { IDC_SETTINGS_SINGLE_CLICK, 0x03010422},
|
||||
// { IDC_SETTINGS_UNDERLINE, 0x03010423}
|
||||
};
|
||||
|
||||
static LPCWSTR kEditTopic = L"FM/options.htm#settings";
|
||||
|
||||
@@ -281,7 +281,7 @@ void SaveToolbarsMask(UInt32 toolbarMask)
|
||||
key.SetValue(kToolbars, toolbarMask);
|
||||
}
|
||||
|
||||
static const UInt32 kDefaultToolbarMask = 8 | 4 | 1;
|
||||
static const UInt32 kDefaultToolbarMask = ((UInt32)1 << 31) | 8 | 4 | 1;
|
||||
|
||||
UInt32 ReadToolbarsMask()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user