fix: EDITCHANGE should not append; SELCHANGE should delay

This commit is contained in:
shunf4
2024-09-03 01:09:17 +08:00
parent abb4a992d9
commit e2770ed02a
2 changed files with 15 additions and 2 deletions

View File

@@ -8,7 +8,9 @@
#include "BrowseDialog.h"
#include "CopyDialog.h"
#include <cstdlib>
#include <wchar.h>
#include <winuser.h>
#include "Panel.h"
#include "ViewSettings.h"
#include "LangUtils.h"
@@ -287,6 +289,15 @@ bool CCopyDialog::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
{
return OnGetMinMaxInfo((PMINMAXINFO)lParam);
}
case WM_TIMER:
{
if (wParam == 1679) {
KillTimer(1679);
OnButtonAddFileName();
}
return 0;
}
}
return CModalDialog::OnMessage(message, wParam, lParam);
}
@@ -387,8 +398,9 @@ bool CCopyDialog::OnCommand(unsigned code, unsigned itemID, LPARAM lParam)
{
UString strPath;
_path.GetText(strPath);
if (isActuallyAppendingFilename) {
OnButtonAddFileName();
isActuallyAppendingFilename = false;
}
ShowPathFreeSpace(strPath);
@@ -402,7 +414,7 @@ bool CCopyDialog::OnCommand(unsigned code, unsigned itemID, LPARAM lParam)
UString strPath;
_path.GetLBText(nSel, strPath);
if (isActuallyAppendingFilename) {
OnButtonAddFileName();
this->SetTimer(1679, 0);
}
ShowPathFreeSpace(strPath);
}

View File

@@ -22,6 +22,7 @@ class CCopyDialog: public NWindows::NControl::CModalDialog
void OnButtonOpenPath();
void OnButtonAddFileName();
bool OnCommand(unsigned code, unsigned itemID, LPARAM lParam) Z7_override;
bool OnTimer(WPARAM /* timerID */, LPARAM /* callback */) Z7_override;
bool OnGetMinMaxInfo(PMINMAXINFO pMMI);
void ShowPathFreeSpace(UString & strPath);