diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2009-08-29 04:00:00 +0400 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:16:01 +0300 |
commit | 2fed8721946901375d21d4a506fe8b114045b397 (patch) | |
tree | 30c688bd7e1c59c31081a4fe4bb5fc3a6497f066 /CPP/7zip/UI/FileManager/EditPage.cpp | |
parent | c99f3ebdd639c2adb03d8b44001b10af18516504 (diff) |
9.07 beta
Diffstat (limited to 'CPP/7zip/UI/FileManager/EditPage.cpp')
-rwxr-xr-x | CPP/7zip/UI/FileManager/EditPage.cpp | 65 |
1 files changed, 45 insertions, 20 deletions
diff --git a/CPP/7zip/UI/FileManager/EditPage.cpp b/CPP/7zip/UI/FileManager/EditPage.cpp index dbc580ff..3b38a3a5 100755 --- a/CPP/7zip/UI/FileManager/EditPage.cpp +++ b/CPP/7zip/UI/FileManager/EditPage.cpp @@ -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; |