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