mirror of
https://github.com/Xevion/easy7zip.git
synced 2026-02-01 00:24:14 -06:00
4.59 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
3901bf0ab8
commit
173c07e166
@@ -11,17 +11,30 @@ using namespace NWindows;
|
||||
static const UINT_PTR kTimerID = 3;
|
||||
static const UINT kTimerElapse = 50;
|
||||
|
||||
#ifdef LANG
|
||||
#ifdef LANG
|
||||
#include "LangUtils.h"
|
||||
#endif
|
||||
|
||||
#ifdef LANG
|
||||
static CIDLangPair kIDLangPairs[] =
|
||||
#ifdef LANG
|
||||
static CIDLangPair kIDLangPairs[] =
|
||||
{
|
||||
{ IDCANCEL, 0x02000711 }
|
||||
};
|
||||
#endif
|
||||
|
||||
HRESULT CProgressSynch::ProcessStopAndPause()
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
if (GetStopped())
|
||||
return E_ABORT;
|
||||
if (!GetPaused())
|
||||
break;
|
||||
::Sleep(100);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#ifndef _SFX
|
||||
CProgressDialog::~CProgressDialog()
|
||||
{
|
||||
@@ -36,12 +49,12 @@ void CProgressDialog::AddToTitle(LPCWSTR s)
|
||||
|
||||
|
||||
|
||||
bool CProgressDialog::OnInit()
|
||||
bool CProgressDialog::OnInit()
|
||||
{
|
||||
_range = UINT64(-1);
|
||||
_prevPercentValue = -1;
|
||||
|
||||
#ifdef LANG
|
||||
#ifdef LANG
|
||||
// LangSetWindowText(HWND(*this), 0x02000C00);
|
||||
LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
|
||||
#endif
|
||||
@@ -53,7 +66,7 @@ bool CProgressDialog::OnInit()
|
||||
return CModalDialog::OnInit();
|
||||
}
|
||||
|
||||
void CProgressDialog::OnCancel()
|
||||
void CProgressDialog::OnCancel()
|
||||
{
|
||||
ProgressSynch.SetStopped(true);
|
||||
}
|
||||
@@ -96,7 +109,7 @@ bool CProgressDialog::OnTimer(WPARAM /* timerID */, LPARAM /* callback */)
|
||||
total = 1;
|
||||
|
||||
int percentValue = (int)(completed * 100 / total);
|
||||
if (percentValue != _prevPercentValue)
|
||||
if (percentValue != _prevPercentValue)
|
||||
{
|
||||
wchar_t s[64];
|
||||
ConvertUInt64ToString(percentValue, s);
|
||||
@@ -154,16 +167,16 @@ bool CProgressDialog::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
return CModalDialog::OnMessage(message, wParam, lParam);
|
||||
}
|
||||
|
||||
bool CProgressDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
|
||||
{
|
||||
bool CProgressDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
|
||||
{
|
||||
switch(buttonID)
|
||||
{
|
||||
case IDCANCEL:
|
||||
{
|
||||
bool paused = ProgressSynch.GetPaused();;
|
||||
ProgressSynch.SetPaused(true);
|
||||
int res = ::MessageBoxW(HWND(*this),
|
||||
L"Are you sure you want to cancel?",
|
||||
int res = ::MessageBoxW(HWND(*this),
|
||||
L"Are you sure you want to cancel?",
|
||||
_title, MB_YESNOCANCEL);
|
||||
ProgressSynch.SetPaused(paused);
|
||||
if (res == IDCANCEL || res == IDNO)
|
||||
|
||||
Reference in New Issue
Block a user