mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-18 02:11:50 -06:00
4.44 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
804edc5756
commit
d9666cf046
91
CPP/7zip/FileManager/Resource/EditPage/EditPage.cpp
Executable file
91
CPP/7zip/FileManager/Resource/EditPage/EditPage.cpp
Executable file
@@ -0,0 +1,91 @@
|
||||
// EditPage.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
#include "resource.h"
|
||||
#include "EditPage.h"
|
||||
|
||||
#include "Common/StringConvert.h"
|
||||
|
||||
#include "Windows/Defs.h"
|
||||
#include "Windows/CommonDialog.h"
|
||||
// #include "Windows/FileFind.h"
|
||||
// #include "Windows/FileDir.h"
|
||||
|
||||
#include "../../RegistryUtils.h"
|
||||
#include "../../HelpUtils.h"
|
||||
#include "../../LangUtils.h"
|
||||
#include "../../ProgramLocation.h"
|
||||
|
||||
using namespace NWindows;
|
||||
|
||||
static CIDLangPair kIDLangPairs[] =
|
||||
{
|
||||
{ IDC_EDIT_STATIC_EDITOR, 0x03010201}
|
||||
};
|
||||
|
||||
static LPCWSTR kEditTopic = L"FM/options.htm#editor";
|
||||
|
||||
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);
|
||||
return CPropertyPage::OnInit();
|
||||
}
|
||||
|
||||
LONG CEditPage::OnApply()
|
||||
{
|
||||
// int selectedIndex = _langCombo.GetCurSel();
|
||||
// int pathIndex = _langCombo.GetItemData(selectedIndex);
|
||||
// ReloadLang();
|
||||
UString editorPath;
|
||||
_editorEdit.GetText(editorPath);
|
||||
SaveRegEditor(editorPath);
|
||||
return PSNRET_NOERROR;
|
||||
}
|
||||
|
||||
void CEditPage::OnNotifyHelp()
|
||||
{
|
||||
ShowHelpWindow(NULL, kEditTopic); // change it
|
||||
}
|
||||
|
||||
bool CEditPage::OnButtonClicked(int aButtonID, HWND aButtonHWND)
|
||||
{
|
||||
switch(aButtonID)
|
||||
{
|
||||
case IDC_EDIT_BUTTON_SET:
|
||||
{
|
||||
OnSetEditorButton();
|
||||
// if (!NShell::BrowseForFolder(HWND(*this), title, currentPath, aResultPath))
|
||||
// return;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return CPropertyPage::OnButtonClicked(aButtonID, aButtonHWND);
|
||||
}
|
||||
|
||||
void CEditPage::OnSetEditorButton()
|
||||
{
|
||||
UString editorPath;
|
||||
_editorEdit.GetText(editorPath);
|
||||
UString resPath;
|
||||
if(!MyGetOpenFileName(HWND(*this), 0, editorPath, L"*.exe", resPath))
|
||||
return;
|
||||
_editorEdit.SetText(resPath);
|
||||
// Changed();
|
||||
}
|
||||
|
||||
bool CEditPage::OnCommand(int code, int itemID, LPARAM param)
|
||||
{
|
||||
if (code == EN_CHANGE && itemID == IDC_EDIT_EDIT_EDITOR)
|
||||
{
|
||||
Changed();
|
||||
return true;
|
||||
}
|
||||
return CPropertyPage::OnCommand(code, itemID, param);
|
||||
}
|
||||
|
||||
|
||||
21
CPP/7zip/FileManager/Resource/EditPage/EditPage.h
Executable file
21
CPP/7zip/FileManager/Resource/EditPage/EditPage.h
Executable file
@@ -0,0 +1,21 @@
|
||||
// EditPage.h
|
||||
|
||||
#ifndef __EDITPAGE_H
|
||||
#define __EDITPAGE_H
|
||||
|
||||
#include "Windows/Control/PropertyPage.h"
|
||||
#include "Windows/Control/Edit.h"
|
||||
|
||||
class CEditPage: public NWindows::NControl::CPropertyPage
|
||||
{
|
||||
NWindows::NControl::CEdit _editorEdit;
|
||||
void OnSetEditorButton();
|
||||
public:
|
||||
virtual bool OnInit();
|
||||
virtual void OnNotifyHelp();
|
||||
virtual bool OnCommand(int code, int itemID, LPARAM param);
|
||||
virtual LONG OnApply();
|
||||
virtual bool OnButtonClicked(int aButtonID, HWND aButtonHWND);
|
||||
};
|
||||
|
||||
#endif
|
||||
16
CPP/7zip/FileManager/Resource/EditPage/StdAfx.h
Executable file
16
CPP/7zip/FileManager/Resource/EditPage/StdAfx.h
Executable file
@@ -0,0 +1,16 @@
|
||||
// stdafx.h
|
||||
|
||||
#ifndef __STDAFX_H
|
||||
#define __STDAFX_H
|
||||
|
||||
#define _WIN32_WINNT 0x0400
|
||||
|
||||
// it's for Windows NT supporting (MENUITEMINFOW)
|
||||
#define WINVER 0x0400
|
||||
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
|
||||
#include "Common/NewHandler.h"
|
||||
|
||||
#endif
|
||||
4
CPP/7zip/FileManager/Resource/EditPage/resource.h
Executable file
4
CPP/7zip/FileManager/Resource/EditPage/resource.h
Executable file
@@ -0,0 +1,4 @@
|
||||
#define IDD_EDIT 903
|
||||
#define IDC_EDIT_STATIC_EDITOR 1000
|
||||
#define IDC_EDIT_EDIT_EDITOR 1002
|
||||
#define IDC_EDIT_BUTTON_SET 1003
|
||||
16
CPP/7zip/FileManager/Resource/EditPage/resource.rc
Executable file
16
CPP/7zip/FileManager/Resource/EditPage/resource.rc
Executable file
@@ -0,0 +1,16 @@
|
||||
#include "resource.h"
|
||||
#include "../../../GuiCommon.rc"
|
||||
|
||||
#define xSize2 196
|
||||
#define ySize2 140
|
||||
#define xSize (xSize2 + marg + marg)
|
||||
#define ySize (ySize2 + marg + marg)
|
||||
|
||||
IDD_EDIT DIALOG 0, 0, xSize, ySize MY_PAGE_STYLE
|
||||
CAPTION "Editor"
|
||||
MY_FONT
|
||||
BEGIN
|
||||
LTEXT "&Editor:", IDC_EDIT_STATIC_EDITOR, marg, marg, xSize2, 8
|
||||
EDITTEXT IDC_EDIT_EDIT_EDITOR, marg, 20, xSize2 - 12 - bDotsSize, 14, ES_AUTOHSCROLL
|
||||
PUSHBUTTON "...", IDC_EDIT_BUTTON_SET, (xSize - marg - bDotsSize), 20, bDotsSize, bYSize
|
||||
END
|
||||
Reference in New Issue
Block a user