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

View File

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