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 | |
parent | c99f3ebdd639c2adb03d8b44001b10af18516504 (diff) |
9.07 beta
Diffstat (limited to 'CPP/7zip/UI/FileManager')
-rwxr-xr-x | CPP/7zip/UI/FileManager/App.h | 27 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/EditPage.cpp | 65 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/EditPage.h | 3 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/EditPage.rc | 22 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/EditPage2.rc | 9 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/EditPageRes.h | 14 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/FM.cpp | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/MyLoadMenu.cpp | 1 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/OptionsDialog.cpp | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/SettingsPage.cpp | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ViewSettings.cpp | 2 |
11 files changed, 108 insertions, 45 deletions
diff --git a/CPP/7zip/UI/FileManager/App.h b/CPP/7zip/UI/FileManager/App.h index d2ced9ba..8c573cfa 100755 --- a/CPP/7zip/UI/FileManager/App.h +++ b/CPP/7zip/UI/FileManager/App.h @@ -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; 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; diff --git a/CPP/7zip/UI/FileManager/EditPage.h b/CPP/7zip/UI/FileManager/EditPage.h index cfc50658..fbe3c23c 100755 --- a/CPP/7zip/UI/FileManager/EditPage.h +++ b/CPP/7zip/UI/FileManager/EditPage.h @@ -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(); diff --git a/CPP/7zip/UI/FileManager/EditPage.rc b/CPP/7zip/UI/FileManager/EditPage.rc index eb1e8599..f5618d04 100755 --- a/CPP/7zip/UI/FileManager/EditPage.rc +++ b/CPP/7zip/UI/FileManager/EditPage.rc @@ -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 diff --git a/CPP/7zip/UI/FileManager/EditPage2.rc b/CPP/7zip/UI/FileManager/EditPage2.rc new file mode 100755 index 00000000..6b500d27 --- /dev/null +++ b/CPP/7zip/UI/FileManager/EditPage2.rc @@ -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 +} diff --git a/CPP/7zip/UI/FileManager/EditPageRes.h b/CPP/7zip/UI/FileManager/EditPageRes.h index 33981ae0..3b958311 100755 --- a/CPP/7zip/UI/FileManager/EditPageRes.h +++ b/CPP/7zip/UI/FileManager/EditPageRes.h @@ -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 diff --git a/CPP/7zip/UI/FileManager/FM.cpp b/CPP/7zip/UI/FileManager/FM.cpp index 033e266d..43a8162f 100755 --- a/CPP/7zip/UI/FileManager/FM.cpp +++ b/CPP/7zip/UI/FileManager/FM.cpp @@ -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); diff --git a/CPP/7zip/UI/FileManager/MyLoadMenu.cpp b/CPP/7zip/UI/FileManager/MyLoadMenu.cpp index ebd41fd9..ccfd33cc 100755 --- a/CPP/7zip/UI/FileManager/MyLoadMenu.cpp +++ b/CPP/7zip/UI/FileManager/MyLoadMenu.cpp @@ -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 }, diff --git a/CPP/7zip/UI/FileManager/OptionsDialog.cpp b/CPP/7zip/UI/FileManager/OptionsDialog.cpp index 1b44461f..7a7e90fb 100755 --- a/CPP/7zip/UI/FileManager/OptionsDialog.cpp +++ b/CPP/7zip/UI/FileManager/OptionsDialog.cpp @@ -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 }; diff --git a/CPP/7zip/UI/FileManager/SettingsPage.cpp b/CPP/7zip/UI/FileManager/SettingsPage.cpp index f6694c56..10d063f7 100755 --- a/CPP/7zip/UI/FileManager/SettingsPage.cpp +++ b/CPP/7zip/UI/FileManager/SettingsPage.cpp @@ -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"; diff --git a/CPP/7zip/UI/FileManager/ViewSettings.cpp b/CPP/7zip/UI/FileManager/ViewSettings.cpp index 6ec53787..f11f68d6 100755 --- a/CPP/7zip/UI/FileManager/ViewSettings.cpp +++ b/CPP/7zip/UI/FileManager/ViewSettings.cpp @@ -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() { |