mirror of
https://github.com/reactos/reactos.git
synced 2025-05-08 11:24:14 +00:00
[USETUP] Implement CreateProgressBarEx() (#791)
Improve the progress bar functions: - Add a member in the struct, which will be used as a bar colour parameter for the new CreateProgressBarEx(). - CreateProgressBar() which will now invoke the Ex variant without the additional parameter.
This commit is contained in:
parent
afe5ecb6b7
commit
ee6bc66318
2 changed files with 36 additions and 2 deletions
|
@ -219,7 +219,7 @@ DrawProgressBar(
|
||||||
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(StdOutput,
|
FillConsoleOutputAttribute(StdOutput,
|
||||||
FOREGROUND_YELLOW | BACKGROUND_BLUE,
|
Bar->ProgressColour,
|
||||||
Bar->Width - 2,
|
Bar->Width - 2,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
@ -234,7 +234,7 @@ DrawProgressBar(
|
||||||
|
|
||||||
|
|
||||||
PPROGRESSBAR
|
PPROGRESSBAR
|
||||||
CreateProgressBar(
|
CreateProgressBarEx(
|
||||||
SHORT Left,
|
SHORT Left,
|
||||||
SHORT Top,
|
SHORT Top,
|
||||||
SHORT Right,
|
SHORT Right,
|
||||||
|
@ -242,6 +242,7 @@ CreateProgressBar(
|
||||||
SHORT TextTop,
|
SHORT TextTop,
|
||||||
SHORT TextRight,
|
SHORT TextRight,
|
||||||
IN BOOLEAN DoubleEdge,
|
IN BOOLEAN DoubleEdge,
|
||||||
|
SHORT ProgressColour,
|
||||||
CHAR *Text)
|
CHAR *Text)
|
||||||
{
|
{
|
||||||
PPROGRESSBAR Bar;
|
PPROGRESSBAR Bar;
|
||||||
|
@ -259,6 +260,7 @@ CreateProgressBar(
|
||||||
Bar->TextTop = TextTop;
|
Bar->TextTop = TextTop;
|
||||||
Bar->TextRight = TextRight;
|
Bar->TextRight = TextRight;
|
||||||
Bar->Double = DoubleEdge;
|
Bar->Double = DoubleEdge;
|
||||||
|
Bar->ProgressColour = ProgressColour;
|
||||||
Bar->Text = Text;
|
Bar->Text = Text;
|
||||||
|
|
||||||
Bar->Width = Bar->Right - Bar->Left + 1;
|
Bar->Width = Bar->Right - Bar->Left + 1;
|
||||||
|
@ -274,6 +276,25 @@ CreateProgressBar(
|
||||||
return Bar;
|
return Bar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PPROGRESSBAR
|
||||||
|
CreateProgressBar(
|
||||||
|
SHORT Left,
|
||||||
|
SHORT Top,
|
||||||
|
SHORT Right,
|
||||||
|
SHORT Bottom,
|
||||||
|
SHORT TextTop,
|
||||||
|
SHORT TextRight,
|
||||||
|
IN BOOLEAN DoubleEdge,
|
||||||
|
CHAR *Text)
|
||||||
|
{
|
||||||
|
|
||||||
|
/* Call the Ex variant of the function */
|
||||||
|
return CreateProgressBarEx(Left, Top, Right, Bottom,
|
||||||
|
TextTop, TextRight,
|
||||||
|
DoubleEdge,
|
||||||
|
FOREGROUND_YELLOW | BACKGROUND_BLUE,
|
||||||
|
Text);
|
||||||
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
DestroyProgressBar(
|
DestroyProgressBar(
|
||||||
|
|
|
@ -44,11 +44,24 @@ typedef struct _PROGRESS
|
||||||
ULONG CurrentStep;
|
ULONG CurrentStep;
|
||||||
|
|
||||||
BOOLEAN Double;
|
BOOLEAN Double;
|
||||||
|
SHORT ProgressColour;
|
||||||
CHAR *Text;
|
CHAR *Text;
|
||||||
} PROGRESSBAR, *PPROGRESSBAR;
|
} PROGRESSBAR, *PPROGRESSBAR;
|
||||||
|
|
||||||
/* FUNCTIONS ****************************************************************/
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
|
||||||
|
PPROGRESSBAR
|
||||||
|
CreateProgressBarEx(
|
||||||
|
SHORT Left,
|
||||||
|
SHORT Top,
|
||||||
|
SHORT Right,
|
||||||
|
SHORT Bottom,
|
||||||
|
SHORT TextTop,
|
||||||
|
SHORT TextRight,
|
||||||
|
IN BOOLEAN DoubleEdge,
|
||||||
|
SHORT ProgressColour,
|
||||||
|
CHAR *Text);
|
||||||
|
|
||||||
PPROGRESSBAR
|
PPROGRESSBAR
|
||||||
CreateProgressBar(
|
CreateProgressBar(
|
||||||
SHORT Left,
|
SHORT Left,
|
||||||
|
|
Loading…
Reference in a new issue