mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-12 18:11:35 -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;
|
CPanel *m_Panel;
|
||||||
bool m_IsAppTarget; // true, if we want to drop to app window (not to panel).
|
bool m_IsAppTarget; // true, if we want to drop to app window (not to panel).
|
||||||
|
bool m_IsPanelAddressComboBoxOrBar;
|
||||||
|
|
||||||
bool m_SetPathIsOK;
|
bool m_SetPathIsOK;
|
||||||
|
|
||||||
@@ -96,6 +97,7 @@ public:
|
|||||||
m_SubFolderIndex(-1),
|
m_SubFolderIndex(-1),
|
||||||
m_Panel(NULL),
|
m_Panel(NULL),
|
||||||
m_IsAppTarget(false),
|
m_IsAppTarget(false),
|
||||||
|
m_IsPanelAddressComboBoxOrBar(false),
|
||||||
m_SetPathIsOK(false),
|
m_SetPathIsOK(false),
|
||||||
App(NULL),
|
App(NULL),
|
||||||
SrcPanelIndex(-1),
|
SrcPanelIndex(-1),
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include <WindowsX.h>
|
#include <WindowsX.h>
|
||||||
// #include <stdio.h>
|
// #include <stdio.h>
|
||||||
|
#include <winuser.h>
|
||||||
|
|
||||||
#include "../../../Common/IntToString.h"
|
#include "../../../Common/IntToString.h"
|
||||||
#include "../../../Common/StringConvert.h"
|
#include "../../../Common/StringConvert.h"
|
||||||
@@ -190,6 +191,23 @@ LRESULT CMyListView::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
// return 0;
|
// 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)
|
else if (message == WM_KEYDOWN)
|
||||||
{
|
{
|
||||||
bool alt = IsKeyDown(VK_MENU);
|
bool alt = IsKeyDown(VK_MENU);
|
||||||
|
|||||||
@@ -295,8 +295,10 @@ class CPanel: public NWindows::NControl::CWindow2
|
|||||||
int _comboBoxID;
|
int _comboBoxID;
|
||||||
UINT _statusBarID;
|
UINT _statusBarID;
|
||||||
|
|
||||||
|
public:
|
||||||
CAppState *_appState;
|
CAppState *_appState;
|
||||||
|
|
||||||
|
private:
|
||||||
bool OnCommand(int code, int itemID, LPARAM lParam, LRESULT &result);
|
bool OnCommand(int code, int itemID, LPARAM lParam, LRESULT &result);
|
||||||
LRESULT OnMessage(UINT message, WPARAM wParam, LPARAM lParam);
|
LRESULT OnMessage(UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
virtual bool OnCreate(CREATESTRUCT *createStruct);
|
virtual bool OnCreate(CREATESTRUCT *createStruct);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// PanelDrag.cpp
|
// PanelDrag.cpp
|
||||||
|
|
||||||
#include "StdAfx.h"
|
#include "StdAfx.h"
|
||||||
|
#include <windef.h>
|
||||||
|
|
||||||
#ifdef UNDER_CE
|
#ifdef UNDER_CE
|
||||||
#include <winuserm.h>
|
#include <winuserm.h>
|
||||||
@@ -31,6 +32,25 @@ using namespace NDir;
|
|||||||
extern bool g_IsNT;
|
extern bool g_IsNT;
|
||||||
#endif
|
#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")
|
#define kTempDirPrefix FTEXT("7zE")
|
||||||
|
|
||||||
static LPCTSTR const kSvenZipSetFolderFormat = TEXT("7-Zip::SetTargetFolder");
|
static LPCTSTR const kSvenZipSetFolderFormat = TEXT("7-Zip::SetTargetFolder");
|
||||||
@@ -569,6 +589,7 @@ void CDropTarget::PositionCursor(POINTL ptl)
|
|||||||
|
|
||||||
RemoveSelection();
|
RemoveSelection();
|
||||||
m_IsAppTarget = true;
|
m_IsAppTarget = true;
|
||||||
|
m_IsPanelAddressComboBoxOrBar = false;
|
||||||
m_Panel = NULL;
|
m_Panel = NULL;
|
||||||
|
|
||||||
m_PanelDropIsAllowed = true;
|
m_PanelDropIsAllowed = true;
|
||||||
@@ -590,6 +611,19 @@ void CDropTarget::PositionCursor(POINTL ptl)
|
|||||||
m_PanelDropIsAllowed = false;
|
m_PanelDropIsAllowed = false;
|
||||||
return;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
if (m_IsAppTarget)
|
if (m_IsAppTarget)
|
||||||
@@ -873,7 +907,13 @@ STDMETHODIMP CDropTarget::Drop(IDataObject *dataObject, DWORD keyState,
|
|||||||
*effect = GetEffect(keyState, pt, *effect);
|
*effect = GetEffect(keyState, pt, *effect);
|
||||||
if (m_DropIsAllowed && m_PanelDropIsAllowed)
|
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();
|
UString path = GetTargetPath();
|
||||||
if (m_IsAppTarget && m_Panel)
|
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/glachancecmaisonneuve/Easy7-Zip
|
||||||
- https://github.com/mcmilk/7-Zip-zstd
|
- https://github.com/mcmilk/7-Zip-zstd
|
||||||
- https://github.com/treysis/Easy-7-Zip-ZS (Unused)
|
- 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
|
popd
|
||||||
|
|
||||||
powershell -Command Copy-Item .\out\*\*.exe,.\out\*\*.dll,.\out\*\*.pdb,.\out\*\*.sfx -Destination .\out\ -Verbose -Force
|
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
|
rem clear errorlevel
|
||||||
type nul
|
type nul
|
||||||
|
|||||||
Reference in New Issue
Block a user