https://git.reactos.org/?p=reactos.git;a=commitdiff;h=61fed540642f81be00c2b…
commit 61fed540642f81be00c2bce6449114b50b994811
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Wed Jan 16 03:39:27 2019 +0100
Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed Jan 16 03:39:27 2019 +0100
[CTM] Add a visual indication to show there are more processes (#1222)
---
modules/rosapps/applications/sysutils/ctm/ctm.c | 27 ++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/modules/rosapps/applications/sysutils/ctm/ctm.c
b/modules/rosapps/applications/sysutils/ctm/ctm.c
index f168c54dff..dd45ff0a6f 100644
--- a/modules/rosapps/applications/sysutils/ctm/ctm.c
+++ b/modules/rosapps/applications/sysutils/ctm/ctm.c
@@ -61,6 +61,8 @@ DWORD outConMode;
DWORD columnRightPositions[6];
TCHAR lpSeparator[80];
+TCHAR lpSeparatorUp[80];
+TCHAR lpSeparatorDown[80];
TCHAR lpHeader[80];
TCHAR lpMemUnit[3];
TCHAR lpIdleProcess[80];
@@ -161,11 +163,17 @@ void DisplayScreen()
WriteConsoleOutputCharacter(hStdout, lpHeader, _tcslen(lpHeader), pos, &numChars);
pos.X = 1; pos.Y = 4;
- WriteConsoleOutputCharacter(hStdout, lpSeparator, _tcslen(lpSeparator), pos,
&numChars);
+ if (scrolled)
+ WriteConsoleOutputCharacter(hStdout, lpSeparatorUp, _tcslen(lpSeparatorUp), pos,
&numChars);
+ else
+ WriteConsoleOutputCharacter(hStdout, lpSeparator, _tcslen(lpSeparator), pos,
&numChars);
// Footer
pos.X = 1; pos.Y = ScreenLines-2;
- WriteConsoleOutputCharacter(hStdout, lpSeparator, _tcslen(lpSeparator), pos,
&numChars);
+ if ((ProcPerScreen+scrolled < ProcessCount))
+ WriteConsoleOutputCharacter(hStdout, lpSeparatorDown, _tcslen(lpSeparatorDown), pos,
&numChars);
+ else
+ WriteConsoleOutputCharacter(hStdout, lpSeparator, _tcslen(lpSeparator), pos,
&numChars);
// Menu
pos.X = 1; pos.Y = ScreenLines-1;
@@ -579,6 +587,8 @@ void PerfDataRefresh()
PsaFreeCapture(pBuffer);
free(SysProcessorTimeInfo);
+ if (ProcessCount != ProcessCountOld)
+ first = 0;
}
// Code partly taken from slw32tty.c from mc/slang
@@ -647,16 +657,26 @@ int _tmain(int argc, char **argv)
}
for (i = 0; i < columnRightPositions[5]; i++)
+ {
lpSeparator[i] = _T('-');
+ lpSeparatorUp[i] = _T('^');
+ lpSeparatorDown[i] = _T('v');
+ }
lpHeader[0] = _T('|');
lpSeparator[0] = _T('+');
+ lpSeparatorUp[0] = _T('^');
+ lpSeparatorDown[0] = _T('v');
for (i = 0; i < 6; i++)
{
lpHeader[columnRightPositions[i]] = _T('|');
lpSeparator[columnRightPositions[i]] = _T('+');
+ lpSeparatorUp[columnRightPositions[i]] = _T('^');
+ lpSeparatorDown[columnRightPositions[i]] = _T('v');
}
- lpSeparator[columnRightPositions[5] + 1] = _T('\0');
lpHeader[columnRightPositions[5] + 1] = _T('\0');
+ lpSeparator[columnRightPositions[5] + 1] = _T('\0');
+ lpSeparatorUp[columnRightPositions[5] + 1] = _T('\0');
+ lpSeparatorDown[columnRightPositions[5] + 1] = _T('\0');
if (!LoadString(hInst, IDS_APP_TITLE, lpTitle, 80))
@@ -720,6 +740,7 @@ int _tmain(int argc, char **argv)
{
if (ProcessKeys(numEvents) == TRUE)
break;
+ first = 0;
}
}