diff --git a/CPP/7zip/UI/FileManager/App.h b/CPP/7zip/UI/FileManager/App.h index 3c3c5ef2..ddf92c10 100644 --- a/CPP/7zip/UI/FileManager/App.h +++ b/CPP/7zip/UI/FileManager/App.h @@ -68,6 +68,7 @@ class CDropTarget: CPanel *m_Panel; bool m_IsAppTarget; // true, if we want to drop to app window (not to panel). + bool m_IsPanelAddressComboBoxOrBar; bool m_SetPathIsOK; @@ -96,6 +97,7 @@ public: m_SubFolderIndex(-1), m_Panel(NULL), m_IsAppTarget(false), + m_IsPanelAddressComboBoxOrBar(false), m_SetPathIsOK(false), App(NULL), SrcPanelIndex(-1), diff --git a/CPP/7zip/UI/FileManager/Panel.cpp b/CPP/7zip/UI/FileManager/Panel.cpp index f7cdb5b9..c67299f1 100644 --- a/CPP/7zip/UI/FileManager/Panel.cpp +++ b/CPP/7zip/UI/FileManager/Panel.cpp @@ -4,6 +4,7 @@ #include // #include +#include #include "../../../Common/IntToString.h" #include "../../../Common/StringConvert.h" @@ -190,6 +191,23 @@ LRESULT CMyListView::OnMessage(UINT message, WPARAM wParam, LPARAM lParam) // return 0; } */ + else if (message == WM_APPCOMMAND) + { + short p = GET_APPCOMMAND_LPARAM(lParam); + if (p == APPCOMMAND_BROWSER_BACKWARD) { + _panel->OpenParentFolder(); + return 0; + } + if (p == APPCOMMAND_BROWSER_FORWARD) { + UStringVector folderHistory; + _panel->_appState->FolderHistory.GetList(folderHistory); + if (folderHistory.Size() >= 2) { + const UString x = folderHistory[1]; + _panel->BindToPathAndRefresh(x); + } + return 0; + } + } else if (message == WM_KEYDOWN) { bool alt = IsKeyDown(VK_MENU); diff --git a/CPP/7zip/UI/FileManager/Panel.h b/CPP/7zip/UI/FileManager/Panel.h index 70529ba8..e9722f97 100644 --- a/CPP/7zip/UI/FileManager/Panel.h +++ b/CPP/7zip/UI/FileManager/Panel.h @@ -295,8 +295,10 @@ class CPanel: public NWindows::NControl::CWindow2 int _comboBoxID; UINT _statusBarID; + public: CAppState *_appState; + private: bool OnCommand(int code, int itemID, LPARAM lParam, LRESULT &result); LRESULT OnMessage(UINT message, WPARAM wParam, LPARAM lParam); virtual bool OnCreate(CREATESTRUCT *createStruct); diff --git a/CPP/7zip/UI/FileManager/PanelDrag.cpp b/CPP/7zip/UI/FileManager/PanelDrag.cpp index 9c4080eb..578b8f9f 100644 --- a/CPP/7zip/UI/FileManager/PanelDrag.cpp +++ b/CPP/7zip/UI/FileManager/PanelDrag.cpp @@ -1,6 +1,7 @@ // PanelDrag.cpp #include "StdAfx.h" +#include #ifdef UNDER_CE #include @@ -31,6 +32,25 @@ using namespace NDir; extern bool g_IsNT; #endif +/** +* +Unmerged: + +enum Enum_CmdId +{ + k_OpenArc = 8, +} + +static const CCmdLangPair g_Pairs[] = +{ + { k_OpenArc, IDS_CONTEXT_OPEN }, +} + +ClearState() +m_IsPanelAddressComboBoxOrBar = false; + +*/ + #define kTempDirPrefix FTEXT("7zE") static LPCTSTR const kSvenZipSetFolderFormat = TEXT("7-Zip::SetTargetFolder"); @@ -569,6 +589,7 @@ void CDropTarget::PositionCursor(POINTL ptl) RemoveSelection(); m_IsAppTarget = true; + m_IsPanelAddressComboBoxOrBar = false; m_Panel = NULL; m_PanelDropIsAllowed = true; @@ -590,6 +611,19 @@ void CDropTarget::PositionCursor(POINTL ptl) m_PanelDropIsAllowed = false; return; } + + POINT pt3 = pt; + if (panel->ScreenToClient(&pt3)) { + HWND x = ::ChildWindowFromPointEx((HWND)*panel, pt3, + CWP_SKIPINVISIBLE | CWP_SKIPDISABLED); + if (x == (HWND)(panel->_headerToolBar) + || x == (HWND)(panel->_headerReBar) + || x == (HWND)(panel->_headerComboBox) + ) { + m_IsPanelAddressComboBoxOrBar = true; + } + } + break; } if (m_IsAppTarget) @@ -873,7 +907,13 @@ STDMETHODIMP CDropTarget::Drop(IDataObject *dataObject, DWORD keyState, *effect = GetEffect(keyState, pt, *effect); if (m_DropIsAllowed && m_PanelDropIsAllowed) { - if (needDrop) + if (m_Panel && m_IsPanelAddressComboBoxOrBar) + { + if (m_SourcePaths.Size() > 0) { + m_Panel->BindToPathAndRefresh(m_SourcePaths.Front()); + } + } + else if (needDrop) { UString path = GetTargetPath(); if (m_IsAppTarget && m_Panel) diff --git a/README.md b/README.md index 93329def..41c12263 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,16 @@ If the artifact gets expired, you may need to manually trigger it again somehow. - https://github.com/glachancecmaisonneuve/Easy7-Zip - https://github.com/mcmilk/7-Zip-zstd - https://github.com/treysis/Easy-7-Zip-ZS (Unused) + +### DevNote + +print message in a dialog + +``` +#include +#include + +char a[100] {}; +StringCbPrintfA(a, 100, "index=%u SoleFolderIndex=%ull", _index, SoleFolderIndex); +MessageBoxA(0, a, "AAA", MB_ICONERROR); +``` diff --git a/build.cmd b/build.cmd index aa9a137c..8f42eb78 100644 --- a/build.cmd +++ b/build.cmd @@ -128,7 +128,7 @@ IF %errorlevel% NEQ 0 echo "Error x64 @ 7z.dll" >> errorfile.txt popd powershell -Command Copy-Item .\out\*\*.exe,.\out\*\*.dll,.\out\*\*.pdb,.\out\*\*.sfx -Destination .\out\ -Verbose -Force -explorer.exe %~dp0out +rem explorer.exe %~dp0out rem clear errorlevel type nul