mirror of
https://github.com/reactos/reactos.git
synced 2025-07-28 07:12:28 +00:00
Clean up console functions in usetup. We now have 2 categories:
- The same functions as in Win32 Console API, prefixed with Con - The helpers (which call Con* functions) prefixed with CONSOLE_ Do according changes in other files svn path=/trunk/; revision=23834
This commit is contained in:
parent
e870b20916
commit
f52bca045b
8 changed files with 1036 additions and 1054 deletions
File diff suppressed because it is too large
Load diff
|
@ -27,127 +27,165 @@
|
||||||
#ifndef __CONSOLE_H__
|
#ifndef __CONSOLE_H__
|
||||||
#define __CONSOLE_H__
|
#define __CONSOLE_H__
|
||||||
|
|
||||||
#define AllocConsole ConAllocConsole
|
#undef WriteConsole
|
||||||
#define FreeConsole ConFreeConsole
|
#undef ReadConsoleInput
|
||||||
#define ReadConsoleOutputCharacters ConReadConsoleOutputCharacters
|
|
||||||
#define ReadConsoleOutputAttributes ConReadConsoleOutputAttributes
|
|
||||||
#define WriteConsoleOutputCharacters ConWriteConsoleOutputCharacters
|
|
||||||
#define WriteConsoleOutputAttributes ConWriteConsoleOutputAttributes
|
|
||||||
#define FillConsoleOutputAttribute ConFillConsoleOutputAttribute
|
|
||||||
#undef FillConsoleOutputCharacter
|
#undef FillConsoleOutputCharacter
|
||||||
#define FillConsoleOutputCharacter ConFillConsoleOutputCharacter
|
|
||||||
|
|
||||||
NTSTATUS
|
#define AllocConsole ConAllocConsole
|
||||||
ConAllocConsole(VOID);
|
#define FillConsoleOutputAttribute ConFillConsoleOutputAttribute
|
||||||
|
#define FillConsoleOutputCharacterA ConFillConsoleOutputCharacterA
|
||||||
|
#define FreeConsole ConFreeConsole
|
||||||
|
#define GetConsoleScreenBufferInfo ConGetConsoleScreenBufferInfo
|
||||||
|
#define ReadConsoleInput ConReadConsoleInput
|
||||||
|
#define SetConsoleCursorInfo ConSetConsoleCursorInfo
|
||||||
|
#define SetConsoleCursorPosition ConSetConsoleCursorPosition
|
||||||
|
#define SetConsoleTextAttribute ConSetConsoleTextAttribute
|
||||||
|
#define WriteConsole ConWriteConsole
|
||||||
|
#define WriteConsoleOutputCharacterA ConWriteConsoleOutputCharacterA
|
||||||
|
#define WriteConsoleOutputCharacterW ConWriteConsoleOutputCharacterW
|
||||||
|
|
||||||
VOID
|
#define FOREGROUND_WHITE (FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE)
|
||||||
|
#define FOREGROUND_YELLOW (FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN)
|
||||||
|
#define BACKGROUND_WHITE (BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE)
|
||||||
|
|
||||||
|
BOOL WINAPI
|
||||||
|
ConAllocConsole(
|
||||||
|
IN DWORD dwProcessId);
|
||||||
|
|
||||||
|
BOOL WINAPI
|
||||||
|
ConFillConsoleOutputAttribute(
|
||||||
|
IN HANDLE hConsoleOutput,
|
||||||
|
IN WORD wAttribute,
|
||||||
|
IN DWORD nLength,
|
||||||
|
IN COORD dwWriteCoord,
|
||||||
|
OUT LPDWORD lpNumberOfAttrsWritten);
|
||||||
|
|
||||||
|
BOOL WINAPI
|
||||||
|
ConFillConsoleOutputCharacterA(
|
||||||
|
IN HANDLE hConsoleOutput,
|
||||||
|
IN CHAR cCharacter,
|
||||||
|
IN DWORD nLength,
|
||||||
|
IN COORD dwWriteCoord,
|
||||||
|
OUT LPDWORD lpNumberOfCharsWritten);
|
||||||
|
|
||||||
|
BOOL WINAPI
|
||||||
ConFreeConsole(VOID);
|
ConFreeConsole(VOID);
|
||||||
|
|
||||||
|
BOOL WINAPI
|
||||||
|
ConGetConsoleScreenBufferInfo(
|
||||||
|
IN HANDLE hConsoleOutput,
|
||||||
|
OUT PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo);
|
||||||
|
|
||||||
NTSTATUS
|
BOOL WINAPI
|
||||||
ConReadConsoleOutputCharacters(LPSTR lpCharacter,
|
ConReadConsoleInput(
|
||||||
ULONG nLength,
|
IN HANDLE hConsoleInput,
|
||||||
COORD dwReadCoord,
|
OUT PINPUT_RECORD lpBuffer,
|
||||||
PULONG lpNumberOfCharsRead);
|
IN DWORD nLength,
|
||||||
|
OUT LPDWORD lpNumberOfEventsRead);
|
||||||
|
|
||||||
NTSTATUS
|
BOOL WINAPI
|
||||||
ConReadConsoleOutputAttributes(PUSHORT lpAttribute,
|
ConSetConsoleCursorInfo(
|
||||||
ULONG nLength,
|
IN HANDLE hConsoleOutput,
|
||||||
COORD dwReadCoord,
|
IN const CONSOLE_CURSOR_INFO* lpConsoleCursorInfo);
|
||||||
PULONG lpNumberOfAttrsRead);
|
|
||||||
|
|
||||||
NTSTATUS
|
BOOL WINAPI
|
||||||
ConWriteConsoleOutputCharacters(LPCSTR lpCharacter,
|
ConSetConsoleCursorPosition(
|
||||||
ULONG nLength,
|
IN HANDLE hConsoleOutput,
|
||||||
COORD dwWriteCoord);
|
IN COORD dwCursorPosition);
|
||||||
|
|
||||||
NTSTATUS
|
BOOL WINAPI
|
||||||
ConWriteConsoleOutputAttributes(CONST USHORT *lpAttribute,
|
ConSetConsoleTextAttribute(
|
||||||
ULONG nLength,
|
IN HANDLE hConsoleOutput,
|
||||||
COORD dwWriteCoord,
|
IN WORD wAttributes);
|
||||||
PULONG lpNumberOfAttrsWritten);
|
|
||||||
|
BOOL WINAPI
|
||||||
|
ConWriteConsole(
|
||||||
|
IN HANDLE hConsoleOutput,
|
||||||
|
IN const VOID* lpBuffer,
|
||||||
|
IN DWORD nNumberOfCharsToWrite,
|
||||||
|
OUT LPDWORD lpNumberOfCharsWritten,
|
||||||
|
IN LPVOID lpReserved);
|
||||||
|
|
||||||
|
BOOL WINAPI
|
||||||
|
ConWriteConsoleOutputCharacterA(
|
||||||
|
HANDLE hConsoleOutput,
|
||||||
|
IN LPCSTR lpCharacter,
|
||||||
|
IN DWORD nLength,
|
||||||
|
IN COORD dwWriteCoord,
|
||||||
|
OUT LPDWORD lpNumberOfCharsWritten);
|
||||||
|
|
||||||
|
BOOL WINAPI
|
||||||
|
ConWriteConsoleOutputCharacterA(
|
||||||
|
HANDLE hConsoleOutput,
|
||||||
|
IN LPCSTR lpCharacter,
|
||||||
|
IN DWORD nLength,
|
||||||
|
IN COORD dwWriteCoord,
|
||||||
|
OUT LPDWORD lpNumberOfCharsWritten);
|
||||||
|
|
||||||
NTSTATUS
|
|
||||||
ConFillConsoleOutputAttribute(USHORT wAttribute,
|
|
||||||
ULONG nLength,
|
|
||||||
COORD dwWriteCoord,
|
|
||||||
PULONG lpNumberOfAttrsWritten);
|
|
||||||
NTSTATUS
|
|
||||||
ConFillConsoleOutputCharacter(CHAR Character,
|
|
||||||
ULONG Length,
|
|
||||||
COORD WriteCoord,
|
|
||||||
PULONG NumberOfCharsWritten);
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
NTSTATUS
|
|
||||||
SetConsoleMode(HANDLE hConsoleHandle,
|
|
||||||
ULONG dwMode);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
ConInKey(PINPUT_RECORD Buffer);
|
CONSOLE_ConInKey(PINPUT_RECORD Buffer);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
ConOutChar(CHAR c);
|
CONSOLE_ConOutChar(CHAR c);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
ConOutPuts(LPSTR szText);
|
CONSOLE_ConOutPuts(LPSTR szText);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
ConOutPrintf(LPSTR szFormat, ...);
|
CONSOLE_ConOutPrintf(LPSTR szFormat, ...);
|
||||||
|
|
||||||
SHORT
|
SHORT
|
||||||
GetCursorX(VOID);
|
CONSOLE_GetCursorX(VOID);
|
||||||
|
|
||||||
SHORT
|
SHORT
|
||||||
GetCursorY(VOID);
|
CONSOLE_GetCursorY(VOID);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
GetScreenSize(SHORT *maxx,
|
CONSOLE_GetScreenSize(SHORT *maxx,
|
||||||
SHORT *maxy);
|
SHORT *maxy);
|
||||||
|
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
SetCursorType(BOOL bInsert,
|
CONSOLE_SetCursorType(BOOL bInsert,
|
||||||
BOOL bVisible);
|
BOOL bVisible);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
SetCursorXY(SHORT x,
|
CONSOLE_SetCursorXY(SHORT x,
|
||||||
SHORT y);
|
SHORT y);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
CONSOLE_ClearScreen(VOID);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
ClearScreen(VOID);
|
CONSOLE_SetStatusText(char* fmt, ...);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
SetStatusText(char* fmt, ...);
|
CONSOLE_InvertTextXY(SHORT x, SHORT y, SHORT col, SHORT row);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
InvertTextXY(SHORT x, SHORT y, SHORT col, SHORT row);
|
CONSOLE_NormalTextXY(SHORT x, SHORT y, SHORT col, SHORT row);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NormalTextXY(SHORT x, SHORT y, SHORT col, SHORT row);
|
CONSOLE_SetTextXY(SHORT x, SHORT y, PCHAR Text);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
SetTextXY(SHORT x, SHORT y, PCHAR Text);
|
CONSOLE_SetInputTextXY(SHORT x, SHORT y, SHORT len, PWCHAR Text);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
SetInputTextXY(SHORT x, SHORT y, SHORT len, PWCHAR Text);
|
CONSOLE_SetUnderlinedTextXY(SHORT x, SHORT y, PCHAR Text);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
SetUnderlinedTextXY(SHORT x, SHORT y, PCHAR Text);
|
CONSOLE_SetInvertedTextXY(SHORT x, SHORT y, PCHAR Text);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
SetInvertedTextXY(SHORT x, SHORT y, PCHAR Text);
|
CONSOLE_SetHighlightedTextXY(SHORT x, SHORT y, PCHAR Text);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
SetHighlightedTextXY(SHORT x, SHORT y, PCHAR Text);
|
CONSOLE_PrintTextXY(SHORT x, SHORT y, char* fmt, ...);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
PrintTextXY(SHORT x, SHORT y, char* fmt, ...);
|
CONSOLE_PrintTextXYN(SHORT x, SHORT y, SHORT len, char* fmt, ...);
|
||||||
|
|
||||||
VOID
|
|
||||||
PrintTextXYN(SHORT x, SHORT y, SHORT len, char* fmt, ...);
|
|
||||||
|
|
||||||
#endif /* __CONSOLE_H__*/
|
#endif /* __CONSOLE_H__*/
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ FormatPartition (PUNICODE_STRING DriveRoot)
|
||||||
SHORT xScreen;
|
SHORT xScreen;
|
||||||
SHORT yScreen;
|
SHORT yScreen;
|
||||||
|
|
||||||
GetScreenSize(&xScreen, &yScreen);
|
CONSOLE_GetScreenSize(&xScreen, &yScreen);
|
||||||
|
|
||||||
ProgressBar = CreateProgressBar (6,
|
ProgressBar = CreateProgressBar (6,
|
||||||
yScreen - 14,
|
yScreen - 14,
|
||||||
|
|
|
@ -81,24 +81,26 @@ DrawFileSystemList (PFILE_SYSTEM_LIST List)
|
||||||
|
|
||||||
coPos.X = List->Left;
|
coPos.X = List->Left;
|
||||||
coPos.Y = List->Top + Index;
|
coPos.Y = List->Top + Index;
|
||||||
FillConsoleOutputAttribute (0x17,
|
FillConsoleOutputAttribute (StdOutput,
|
||||||
|
FOREGROUND_WHITE | BACKGROUND_BLUE,
|
||||||
50,
|
50,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
FillConsoleOutputCharacter (' ',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
' ',
|
||||||
50,
|
50,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
|
||||||
if (List->CurrentFileSystem == FsFat)
|
if (List->CurrentFileSystem == FsFat)
|
||||||
{
|
{
|
||||||
SetInvertedTextXY (List->Left,
|
CONSOLE_SetInvertedTextXY (List->Left,
|
||||||
List->Top + Index,
|
List->Top + Index,
|
||||||
" Format partition as FAT file system ");
|
" Format partition as FAT file system ");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetTextXY (List->Left,
|
CONSOLE_SetTextXY (List->Left,
|
||||||
List->Top + Index,
|
List->Top + Index,
|
||||||
" Format partition as FAT file system ");
|
" Format partition as FAT file system ");
|
||||||
}
|
}
|
||||||
|
@ -108,24 +110,26 @@ DrawFileSystemList (PFILE_SYSTEM_LIST List)
|
||||||
{
|
{
|
||||||
coPos.X = List->Left;
|
coPos.X = List->Left;
|
||||||
coPos.Y = List->Top + Index;
|
coPos.Y = List->Top + Index;
|
||||||
FillConsoleOutputAttribute (0x17,
|
FillConsoleOutputAttribute (StdOutput,
|
||||||
|
FOREGROUND_WHITE | BACKGROUND_BLUE,
|
||||||
50,
|
50,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
FillConsoleOutputCharacter (' ',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
' ',
|
||||||
50,
|
50,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
|
||||||
if (List->CurrentFileSystem == FsKeep)
|
if (List->CurrentFileSystem == FsKeep)
|
||||||
{
|
{
|
||||||
SetInvertedTextXY (List->Left,
|
CONSOLE_SetInvertedTextXY (List->Left,
|
||||||
List->Top + Index,
|
List->Top + Index,
|
||||||
" Keep current file system (no changes) ");
|
" Keep current file system (no changes) ");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetTextXY (List->Left,
|
CONSOLE_SetTextXY (List->Left,
|
||||||
List->Top + Index,
|
List->Top + Index,
|
||||||
" Keep current file system (no changes) ");
|
" Keep current file system (no changes) ");
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,7 +122,8 @@ DrawListFrame(PGENERIC_LIST GenericList)
|
||||||
/* Draw upper left corner */
|
/* Draw upper left corner */
|
||||||
coPos.X = GenericList->Left;
|
coPos.X = GenericList->Left;
|
||||||
coPos.Y = GenericList->Top;
|
coPos.Y = GenericList->Top;
|
||||||
FillConsoleOutputCharacter (0xDA, // '+',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
0xDA, // '+',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -130,7 +131,8 @@ DrawListFrame(PGENERIC_LIST GenericList)
|
||||||
/* Draw upper edge */
|
/* Draw upper edge */
|
||||||
coPos.X = GenericList->Left + 1;
|
coPos.X = GenericList->Left + 1;
|
||||||
coPos.Y = GenericList->Top;
|
coPos.Y = GenericList->Top;
|
||||||
FillConsoleOutputCharacter (0xC4, // '-',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
0xC4, // '-',
|
||||||
GenericList->Right - GenericList->Left - 1,
|
GenericList->Right - GenericList->Left - 1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -138,7 +140,8 @@ DrawListFrame(PGENERIC_LIST GenericList)
|
||||||
/* Draw upper right corner */
|
/* Draw upper right corner */
|
||||||
coPos.X = GenericList->Right;
|
coPos.X = GenericList->Right;
|
||||||
coPos.Y = GenericList->Top;
|
coPos.Y = GenericList->Top;
|
||||||
FillConsoleOutputCharacter (0xBF, // '+',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
0xBF, // '+',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -148,13 +151,15 @@ DrawListFrame(PGENERIC_LIST GenericList)
|
||||||
{
|
{
|
||||||
coPos.X = GenericList->Left;
|
coPos.X = GenericList->Left;
|
||||||
coPos.Y = i;
|
coPos.Y = i;
|
||||||
FillConsoleOutputCharacter (0xB3, // '|',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
0xB3, // '|',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
|
||||||
coPos.X = GenericList->Right;
|
coPos.X = GenericList->Right;
|
||||||
FillConsoleOutputCharacter (0xB3, //'|',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
0xB3, //'|',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -163,7 +168,8 @@ DrawListFrame(PGENERIC_LIST GenericList)
|
||||||
/* Draw lower left corner */
|
/* Draw lower left corner */
|
||||||
coPos.X = GenericList->Left;
|
coPos.X = GenericList->Left;
|
||||||
coPos.Y = GenericList->Bottom;
|
coPos.Y = GenericList->Bottom;
|
||||||
FillConsoleOutputCharacter (0xC0, // '+',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
0xC0, // '+',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -171,7 +177,8 @@ DrawListFrame(PGENERIC_LIST GenericList)
|
||||||
/* Draw lower edge */
|
/* Draw lower edge */
|
||||||
coPos.X = GenericList->Left + 1;
|
coPos.X = GenericList->Left + 1;
|
||||||
coPos.Y = GenericList->Bottom;
|
coPos.Y = GenericList->Bottom;
|
||||||
FillConsoleOutputCharacter (0xC4, // '-',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
0xC4, // '-',
|
||||||
GenericList->Right - GenericList->Left - 1,
|
GenericList->Right - GenericList->Left - 1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -179,7 +186,8 @@ DrawListFrame(PGENERIC_LIST GenericList)
|
||||||
/* Draw lower right corner */
|
/* Draw lower right corner */
|
||||||
coPos.X = GenericList->Right;
|
coPos.X = GenericList->Right;
|
||||||
coPos.Y = GenericList->Bottom;
|
coPos.Y = GenericList->Bottom;
|
||||||
FillConsoleOutputCharacter (0xD9, // '+',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
0xD9, // '+',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -207,20 +215,26 @@ DrawListEntries(PGENERIC_LIST GenericList)
|
||||||
if (coPos.Y == GenericList->Bottom)
|
if (coPos.Y == GenericList->Bottom)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
FillConsoleOutputAttribute ((GenericList->CurrentEntry == ListEntry) ? 0x71 : 0x17,
|
FillConsoleOutputAttribute (StdOutput,
|
||||||
|
(GenericList->CurrentEntry == ListEntry) ?
|
||||||
|
FOREGROUND_BLUE | BACKGROUND_WHITE :
|
||||||
|
FOREGROUND_WHITE | BACKGROUND_BLUE,
|
||||||
Width,
|
Width,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
|
||||||
FillConsoleOutputCharacter (' ',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
' ',
|
||||||
Width,
|
Width,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
|
||||||
coPos.X++;
|
coPos.X++;
|
||||||
WriteConsoleOutputCharacters (ListEntry->Text,
|
WriteConsoleOutputCharacterA (StdOutput,
|
||||||
|
ListEntry->Text,
|
||||||
min (strlen(ListEntry->Text), (SIZE_T)Width - 2),
|
min (strlen(ListEntry->Text), (SIZE_T)Width - 2),
|
||||||
coPos);
|
coPos,
|
||||||
|
&Written);
|
||||||
coPos.X--;
|
coPos.X--;
|
||||||
|
|
||||||
coPos.Y++;
|
coPos.Y++;
|
||||||
|
@ -229,12 +243,14 @@ DrawListEntries(PGENERIC_LIST GenericList)
|
||||||
|
|
||||||
while (coPos.Y < GenericList->Bottom)
|
while (coPos.Y < GenericList->Bottom)
|
||||||
{
|
{
|
||||||
FillConsoleOutputAttribute (0x17,
|
FillConsoleOutputAttribute (StdOutput,
|
||||||
|
FOREGROUND_WHITE | BACKGROUND_BLUE,
|
||||||
Width,
|
Width,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
|
||||||
FillConsoleOutputCharacter (' ',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
' ',
|
||||||
Width,
|
Width,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
|
|
@ -1056,12 +1056,14 @@ PrintEmptyLine (PPARTLIST List)
|
||||||
|
|
||||||
if (List->Line >= 0 && List->Line <= Height)
|
if (List->Line >= 0 && List->Line <= Height)
|
||||||
{
|
{
|
||||||
FillConsoleOutputAttribute (0x17,
|
FillConsoleOutputAttribute (StdOutput,
|
||||||
|
FOREGROUND_WHITE | BACKGROUND_BLUE,
|
||||||
Width,
|
Width,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
|
||||||
FillConsoleOutputCharacter (' ',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
' ',
|
||||||
Width,
|
Width,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -1189,11 +1191,14 @@ PrintPartitionData (PPARTLIST List,
|
||||||
}
|
}
|
||||||
|
|
||||||
Attribute = (List->CurrentDisk == DiskEntry &&
|
Attribute = (List->CurrentDisk == DiskEntry &&
|
||||||
List->CurrentPartition == PartEntry) ? 0x71 : 0x17;
|
List->CurrentPartition == PartEntry) ?
|
||||||
|
FOREGROUND_BLUE | BACKGROUND_WHITE :
|
||||||
|
FOREGROUND_WHITE | BACKGROUND_BLUE;
|
||||||
|
|
||||||
if (List->Line >= 0 && List->Line <= Height)
|
if (List->Line >= 0 && List->Line <= Height)
|
||||||
{
|
{
|
||||||
FillConsoleOutputCharacter (' ',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
' ',
|
||||||
Width,
|
Width,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -1202,7 +1207,8 @@ PrintPartitionData (PPARTLIST List,
|
||||||
Width -= 8;
|
Width -= 8;
|
||||||
if (List->Line >= 0 && List->Line <= Height)
|
if (List->Line >= 0 && List->Line <= Height)
|
||||||
{
|
{
|
||||||
FillConsoleOutputAttribute (Attribute,
|
FillConsoleOutputAttribute (StdOutput,
|
||||||
|
Attribute,
|
||||||
Width,
|
Width,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -1211,9 +1217,11 @@ PrintPartitionData (PPARTLIST List,
|
||||||
Width -= 2;
|
Width -= 2;
|
||||||
if (List->Line >= 0 && List->Line <= Height)
|
if (List->Line >= 0 && List->Line <= Height)
|
||||||
{
|
{
|
||||||
WriteConsoleOutputCharacters (LineBuffer,
|
WriteConsoleOutputCharacterA (StdOutput,
|
||||||
|
LineBuffer,
|
||||||
min (strlen (LineBuffer), Width),
|
min (strlen (LineBuffer), Width),
|
||||||
coPos);
|
coPos,
|
||||||
|
&Written);
|
||||||
}
|
}
|
||||||
List->Line++;
|
List->Line++;
|
||||||
}
|
}
|
||||||
|
@ -1279,12 +1287,14 @@ PrintDiskData (PPARTLIST List,
|
||||||
}
|
}
|
||||||
if (List->Line >= 0 && List->Line <= Height)
|
if (List->Line >= 0 && List->Line <= Height)
|
||||||
{
|
{
|
||||||
FillConsoleOutputAttribute (0x17,
|
FillConsoleOutputAttribute (StdOutput,
|
||||||
|
FOREGROUND_WHITE | BACKGROUND_BLUE,
|
||||||
Width,
|
Width,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
|
||||||
FillConsoleOutputCharacter (' ',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
' ',
|
||||||
Width,
|
Width,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -1293,9 +1303,11 @@ PrintDiskData (PPARTLIST List,
|
||||||
coPos.X++;
|
coPos.X++;
|
||||||
if (List->Line >= 0 && List->Line <= Height)
|
if (List->Line >= 0 && List->Line <= Height)
|
||||||
{
|
{
|
||||||
WriteConsoleOutputCharacters (LineBuffer,
|
WriteConsoleOutputCharacterA (StdOutput,
|
||||||
|
LineBuffer,
|
||||||
min (strlen (LineBuffer), Width - 2),
|
min (strlen (LineBuffer), Width - 2),
|
||||||
coPos);
|
coPos,
|
||||||
|
&Written);
|
||||||
}
|
}
|
||||||
List->Line++;
|
List->Line++;
|
||||||
|
|
||||||
|
@ -1397,7 +1409,8 @@ DrawPartitionList (PPARTLIST List)
|
||||||
/* draw upper left corner */
|
/* draw upper left corner */
|
||||||
coPos.X = List->Left;
|
coPos.X = List->Left;
|
||||||
coPos.Y = List->Top;
|
coPos.Y = List->Top;
|
||||||
FillConsoleOutputCharacter (0xDA, // '+',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
0xDA, // '+',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -1407,23 +1420,28 @@ DrawPartitionList (PPARTLIST List)
|
||||||
coPos.Y = List->Top;
|
coPos.Y = List->Top;
|
||||||
if (List->Offset == 0)
|
if (List->Offset == 0)
|
||||||
{
|
{
|
||||||
FillConsoleOutputCharacter (0xC4, // '-',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
0xC4, // '-',
|
||||||
List->Right - List->Left - 1,
|
List->Right - List->Left - 1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FillConsoleOutputCharacter (0xC4, // '-',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
0xC4, // '-',
|
||||||
List->Right - List->Left - 5,
|
List->Right - List->Left - 5,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
coPos.X = List->Right - 5;
|
coPos.X = List->Right - 5;
|
||||||
WriteConsoleOutputCharacters ("(\x18)", // "(up)"
|
WriteConsoleOutputCharacterA (StdOutput,
|
||||||
|
"(\x18)", // "(up)"
|
||||||
3,
|
3,
|
||||||
coPos);
|
coPos,
|
||||||
|
&Written);
|
||||||
coPos.X = List->Right - 2;
|
coPos.X = List->Right - 2;
|
||||||
FillConsoleOutputCharacter (0xC4, // '-',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
0xC4, // '-',
|
||||||
2,
|
2,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -1432,7 +1450,8 @@ DrawPartitionList (PPARTLIST List)
|
||||||
/* draw upper right corner */
|
/* draw upper right corner */
|
||||||
coPos.X = List->Right;
|
coPos.X = List->Right;
|
||||||
coPos.Y = List->Top;
|
coPos.Y = List->Top;
|
||||||
FillConsoleOutputCharacter (0xBF, // '+',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
0xBF, // '+',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -1442,13 +1461,15 @@ DrawPartitionList (PPARTLIST List)
|
||||||
{
|
{
|
||||||
coPos.X = List->Left;
|
coPos.X = List->Left;
|
||||||
coPos.Y = i;
|
coPos.Y = i;
|
||||||
FillConsoleOutputCharacter (0xB3, // '|',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
0xB3, // '|',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
|
||||||
coPos.X = List->Right;
|
coPos.X = List->Right;
|
||||||
FillConsoleOutputCharacter (0xB3, //'|',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
0xB3, //'|',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -1457,7 +1478,8 @@ DrawPartitionList (PPARTLIST List)
|
||||||
/* draw lower left corner */
|
/* draw lower left corner */
|
||||||
coPos.X = List->Left;
|
coPos.X = List->Left;
|
||||||
coPos.Y = List->Bottom;
|
coPos.Y = List->Bottom;
|
||||||
FillConsoleOutputCharacter (0xC0, // '+',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
0xC0, // '+',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -1467,23 +1489,28 @@ DrawPartitionList (PPARTLIST List)
|
||||||
coPos.Y = List->Bottom;
|
coPos.Y = List->Bottom;
|
||||||
if (LastLine - List->Offset <= List->Bottom - List->Top - 2)
|
if (LastLine - List->Offset <= List->Bottom - List->Top - 2)
|
||||||
{
|
{
|
||||||
FillConsoleOutputCharacter (0xC4, // '-',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
0xC4, // '-',
|
||||||
List->Right - List->Left - 1,
|
List->Right - List->Left - 1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FillConsoleOutputCharacter (0xC4, // '-',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
0xC4, // '-',
|
||||||
List->Right - List->Left - 5,
|
List->Right - List->Left - 5,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
coPos.X = List->Right - 5;
|
coPos.X = List->Right - 5;
|
||||||
WriteConsoleOutputCharacters ("(\x19)", // "(down)"
|
WriteConsoleOutputCharacterA (StdOutput,
|
||||||
|
"(\x19)", // "(down)"
|
||||||
3,
|
3,
|
||||||
coPos);
|
coPos,
|
||||||
|
&Written);
|
||||||
coPos.X = List->Right - 2;
|
coPos.X = List->Right - 2;
|
||||||
FillConsoleOutputCharacter (0xC4, // '-',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
0xC4, // '-',
|
||||||
2,
|
2,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -1492,7 +1519,8 @@ DrawPartitionList (PPARTLIST List)
|
||||||
/* draw lower right corner */
|
/* draw lower right corner */
|
||||||
coPos.X = List->Right;
|
coPos.X = List->Right;
|
||||||
coPos.Y = List->Bottom;
|
coPos.Y = List->Bottom;
|
||||||
FillConsoleOutputCharacter (0xD9, // '+',
|
FillConsoleOutputCharacterA (StdOutput,
|
||||||
|
0xD9, // '+',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
|
|
@ -19,7 +19,8 @@ DrawBorder(PPROGRESSBAR Bar)
|
||||||
/* draw upper left corner */
|
/* draw upper left corner */
|
||||||
coPos.X = Bar->Left;
|
coPos.X = Bar->Left;
|
||||||
coPos.Y = Bar->Top + 1;
|
coPos.Y = Bar->Top + 1;
|
||||||
FillConsoleOutputCharacter(0xDA, // '+',
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
0xDA, // '+',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -27,7 +28,8 @@ DrawBorder(PPROGRESSBAR Bar)
|
||||||
/* draw upper edge */
|
/* draw upper edge */
|
||||||
coPos.X = Bar->Left + 1;
|
coPos.X = Bar->Left + 1;
|
||||||
coPos.Y = Bar->Top + 1;
|
coPos.Y = Bar->Top + 1;
|
||||||
FillConsoleOutputCharacter(0xC4, // '-',
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
0xC4, // '-',
|
||||||
Bar->Right - Bar->Left - 1,
|
Bar->Right - Bar->Left - 1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -35,7 +37,8 @@ DrawBorder(PPROGRESSBAR Bar)
|
||||||
/* draw upper right corner */
|
/* draw upper right corner */
|
||||||
coPos.X = Bar->Right;
|
coPos.X = Bar->Right;
|
||||||
coPos.Y = Bar->Top + 1;
|
coPos.Y = Bar->Top + 1;
|
||||||
FillConsoleOutputCharacter(0xBF, // '+',
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
0xBF, // '+',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -45,13 +48,15 @@ DrawBorder(PPROGRESSBAR Bar)
|
||||||
{
|
{
|
||||||
coPos.X = Bar->Left;
|
coPos.X = Bar->Left;
|
||||||
coPos.Y = i;
|
coPos.Y = i;
|
||||||
FillConsoleOutputCharacter(0xB3, // '|',
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
0xB3, // '|',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
|
||||||
coPos.X = Bar->Right;
|
coPos.X = Bar->Right;
|
||||||
FillConsoleOutputCharacter(0xB3, //'|',
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
0xB3, //'|',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -60,7 +65,8 @@ DrawBorder(PPROGRESSBAR Bar)
|
||||||
/* draw lower left corner */
|
/* draw lower left corner */
|
||||||
coPos.X = Bar->Left;
|
coPos.X = Bar->Left;
|
||||||
coPos.Y = Bar->Bottom;
|
coPos.Y = Bar->Bottom;
|
||||||
FillConsoleOutputCharacter(0xC0, // '+',
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
0xC0, // '+',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -68,7 +74,8 @@ DrawBorder(PPROGRESSBAR Bar)
|
||||||
/* draw lower edge */
|
/* draw lower edge */
|
||||||
coPos.X = Bar->Left + 1;
|
coPos.X = Bar->Left + 1;
|
||||||
coPos.Y = Bar->Bottom;
|
coPos.Y = Bar->Bottom;
|
||||||
FillConsoleOutputCharacter(0xC4, // '-',
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
0xC4, // '-',
|
||||||
Bar->Right - Bar->Left - 1,
|
Bar->Right - Bar->Left - 1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -76,7 +83,8 @@ DrawBorder(PPROGRESSBAR Bar)
|
||||||
/* draw lower right corner */
|
/* draw lower right corner */
|
||||||
coPos.X = Bar->Right;
|
coPos.X = Bar->Right;
|
||||||
coPos.Y = Bar->Bottom;
|
coPos.Y = Bar->Bottom;
|
||||||
FillConsoleOutputCharacter(0xD9, // '+',
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
0xD9, // '+',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -92,7 +100,8 @@ DrawThickBorder(PPROGRESSBAR Bar)
|
||||||
/* draw upper left corner */
|
/* draw upper left corner */
|
||||||
coPos.X = Bar->Left;
|
coPos.X = Bar->Left;
|
||||||
coPos.Y = Bar->Top + 1;
|
coPos.Y = Bar->Top + 1;
|
||||||
FillConsoleOutputCharacter(0xC9, // '+',
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
0xC9, // '+',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -100,7 +109,8 @@ DrawThickBorder(PPROGRESSBAR Bar)
|
||||||
/* draw upper edge */
|
/* draw upper edge */
|
||||||
coPos.X = Bar->Left + 1;
|
coPos.X = Bar->Left + 1;
|
||||||
coPos.Y = Bar->Top + 1;
|
coPos.Y = Bar->Top + 1;
|
||||||
FillConsoleOutputCharacter(0xCD, // '-',
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
0xCD, // '-',
|
||||||
Bar->Right - Bar->Left - 1,
|
Bar->Right - Bar->Left - 1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -108,7 +118,8 @@ DrawThickBorder(PPROGRESSBAR Bar)
|
||||||
/* draw upper right corner */
|
/* draw upper right corner */
|
||||||
coPos.X = Bar->Right;
|
coPos.X = Bar->Right;
|
||||||
coPos.Y = Bar->Top + 1;
|
coPos.Y = Bar->Top + 1;
|
||||||
FillConsoleOutputCharacter(0xBB, // '+',
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
0xBB, // '+',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -118,13 +129,15 @@ DrawThickBorder(PPROGRESSBAR Bar)
|
||||||
{
|
{
|
||||||
coPos.X = Bar->Left;
|
coPos.X = Bar->Left;
|
||||||
coPos.Y = i;
|
coPos.Y = i;
|
||||||
FillConsoleOutputCharacter(0xBA, // '|',
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
0xBA, // '|',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
|
||||||
coPos.X = Bar->Right;
|
coPos.X = Bar->Right;
|
||||||
FillConsoleOutputCharacter(0xBA, //'|',
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
0xBA, //'|',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -133,7 +146,8 @@ DrawThickBorder(PPROGRESSBAR Bar)
|
||||||
/* draw lower left corner */
|
/* draw lower left corner */
|
||||||
coPos.X = Bar->Left;
|
coPos.X = Bar->Left;
|
||||||
coPos.Y = Bar->Bottom;
|
coPos.Y = Bar->Bottom;
|
||||||
FillConsoleOutputCharacter(0xC8, // '+',
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
0xC8, // '+',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -141,7 +155,8 @@ DrawThickBorder(PPROGRESSBAR Bar)
|
||||||
/* draw lower edge */
|
/* draw lower edge */
|
||||||
coPos.X = Bar->Left + 1;
|
coPos.X = Bar->Left + 1;
|
||||||
coPos.Y = Bar->Bottom;
|
coPos.Y = Bar->Bottom;
|
||||||
FillConsoleOutputCharacter(0xCD, // '-',
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
0xCD, // '-',
|
||||||
Bar->Right - Bar->Left - 1,
|
Bar->Right - Bar->Left - 1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -149,7 +164,8 @@ DrawThickBorder(PPROGRESSBAR Bar)
|
||||||
/* draw lower right corner */
|
/* draw lower right corner */
|
||||||
coPos.X = Bar->Right;
|
coPos.X = Bar->Right;
|
||||||
coPos.Y = Bar->Bottom;
|
coPos.Y = Bar->Bottom;
|
||||||
FillConsoleOutputCharacter(0xBC, // '+',
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
0xBC, // '+',
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -168,15 +184,17 @@ DrawProgressBar(PPROGRESSBAR Bar)
|
||||||
|
|
||||||
coPos.X = Bar->Left + (Bar->Width - 2) / 2;
|
coPos.X = Bar->Left + (Bar->Width - 2) / 2;
|
||||||
coPos.Y = Bar->Top;
|
coPos.Y = Bar->Top;
|
||||||
WriteConsoleOutputCharacters(TextBuffer,
|
WriteConsoleOutputCharacterA(StdOutput,
|
||||||
|
TextBuffer,
|
||||||
4,
|
4,
|
||||||
coPos);
|
coPos,
|
||||||
|
&Written);
|
||||||
|
|
||||||
/* Draw the progress bar border */
|
/* Draw the progress bar border */
|
||||||
DrawBorder(Bar);
|
DrawBorder(Bar);
|
||||||
|
|
||||||
/* Write Text Associated with Bar */
|
/* Write Text Associated with Bar */
|
||||||
SetTextXY(10, 24, Bar->Text);
|
CONSOLE_SetTextXY(10, 24, Bar->Text);
|
||||||
|
|
||||||
/* Draw the progress bar "border" border */
|
/* Draw the progress bar "border" border */
|
||||||
BarBorder.Top -= 5;
|
BarBorder.Top -= 5;
|
||||||
|
@ -189,12 +207,14 @@ DrawProgressBar(PPROGRESSBAR Bar)
|
||||||
coPos.X = Bar->Left + 1;
|
coPos.X = Bar->Left + 1;
|
||||||
for (coPos.Y = Bar->Top + 2; coPos.Y <= Bar->Bottom - 1; coPos.Y++)
|
for (coPos.Y = Bar->Top + 2; coPos.Y <= Bar->Bottom - 1; coPos.Y++)
|
||||||
{
|
{
|
||||||
FillConsoleOutputAttribute(0x1E, /* Yellow on blue */
|
FillConsoleOutputAttribute(StdOutput,
|
||||||
|
FOREGROUND_YELLOW | BACKGROUND_BLUE,
|
||||||
Bar->Width - 2,
|
Bar->Width - 2,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
|
||||||
FillConsoleOutputCharacter(' ',
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
' ',
|
||||||
Bar->Width - 2,
|
Bar->Width - 2,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -285,9 +305,11 @@ ProgressNextStep(PPROGRESSBAR Bar)
|
||||||
|
|
||||||
coPos.X = Bar->Left + (Bar->Width - 2) / 2;
|
coPos.X = Bar->Left + (Bar->Width - 2) / 2;
|
||||||
coPos.Y = Bar->Top;
|
coPos.Y = Bar->Top;
|
||||||
WriteConsoleOutputCharacters(TextBuffer,
|
WriteConsoleOutputCharacterA(StdOutput,
|
||||||
|
TextBuffer,
|
||||||
4,
|
4,
|
||||||
coPos);
|
coPos,
|
||||||
|
&Written);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calculate bar position */
|
/* Calculate bar position */
|
||||||
|
@ -301,7 +323,8 @@ ProgressNextStep(PPROGRESSBAR Bar)
|
||||||
for (coPos.Y = Bar->Top + 2; coPos.Y <= Bar->Bottom - 1; coPos.Y++)
|
for (coPos.Y = Bar->Top + 2; coPos.Y <= Bar->Bottom - 1; coPos.Y++)
|
||||||
{
|
{
|
||||||
coPos.X = Bar->Left + 1;
|
coPos.X = Bar->Left + 1;
|
||||||
FillConsoleOutputCharacter(0xDB,
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
0xDB,
|
||||||
Bar->Pos / 2,
|
Bar->Pos / 2,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -309,7 +332,8 @@ ProgressNextStep(PPROGRESSBAR Bar)
|
||||||
|
|
||||||
if (NewPos & 1)
|
if (NewPos & 1)
|
||||||
{
|
{
|
||||||
FillConsoleOutputCharacter(0xDD,
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
0xDD,
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -318,7 +342,8 @@ ProgressNextStep(PPROGRESSBAR Bar)
|
||||||
|
|
||||||
if (coPos.X <= Bar->Right - 1)
|
if (coPos.X <= Bar->Right - 1)
|
||||||
{
|
{
|
||||||
FillConsoleOutputCharacter(' ',
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
' ',
|
||||||
Bar->Right - coPos.X,
|
Bar->Right - coPos.X,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -355,9 +380,11 @@ ProgressSetStep (PPROGRESSBAR Bar,
|
||||||
|
|
||||||
coPos.X = Bar->Left + (Bar->Width - 2) / 2;
|
coPos.X = Bar->Left + (Bar->Width - 2) / 2;
|
||||||
coPos.Y = Bar->Top;
|
coPos.Y = Bar->Top;
|
||||||
WriteConsoleOutputCharacters(TextBuffer,
|
WriteConsoleOutputCharacterA(StdOutput,
|
||||||
|
TextBuffer,
|
||||||
4,
|
4,
|
||||||
coPos);
|
coPos,
|
||||||
|
&Written);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calculate bar position */
|
/* Calculate bar position */
|
||||||
|
@ -371,7 +398,8 @@ ProgressSetStep (PPROGRESSBAR Bar,
|
||||||
for (coPos.Y = Bar->Top + 2; coPos.Y <= Bar->Bottom - 1; coPos.Y++)
|
for (coPos.Y = Bar->Top + 2; coPos.Y <= Bar->Bottom - 1; coPos.Y++)
|
||||||
{
|
{
|
||||||
coPos.X = Bar->Left + 1;
|
coPos.X = Bar->Left + 1;
|
||||||
FillConsoleOutputCharacter(0xDB,
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
0xDB,
|
||||||
Bar->Pos / 2,
|
Bar->Pos / 2,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -379,7 +407,8 @@ ProgressSetStep (PPROGRESSBAR Bar,
|
||||||
|
|
||||||
if (NewPos & 1)
|
if (NewPos & 1)
|
||||||
{
|
{
|
||||||
FillConsoleOutputCharacter(0xDD,
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
0xDD,
|
||||||
1,
|
1,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -388,7 +417,8 @@ ProgressSetStep (PPROGRESSBAR Bar,
|
||||||
|
|
||||||
if (coPos.X <= Bar->Right - 1)
|
if (coPos.X <= Bar->Right - 1)
|
||||||
{
|
{
|
||||||
FillConsoleOutputCharacter(' ',
|
FillConsoleOutputCharacterA(StdOutput,
|
||||||
|
' ',
|
||||||
Bar->Right - coPos.X,
|
Bar->Right - coPos.X,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue