mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-10 02:07:07 -06:00
feat: 1. drag to panel address combobox opens the archive/dir; 2. mouse forward/backward key nav
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <WindowsX.h>
|
||||
// #include <stdio.h>
|
||||
#include <winuser.h>
|
||||
|
||||
#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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// PanelDrag.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
#include <windef.h>
|
||||
|
||||
#ifdef UNDER_CE
|
||||
#include <winuserm.h>
|
||||
@@ -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)
|
||||
|
||||
13
README.md
13
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 <winuser.h>
|
||||
#include <strsafe.h>
|
||||
|
||||
char a[100] {};
|
||||
StringCbPrintfA(a, 100, "index=%u SoleFolderIndex=%ull", _index, SoleFolderIndex);
|
||||
MessageBoxA(0, a, "AAA", MB_ICONERROR);
|
||||
```
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user