https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ee6bc66318a3da67b57f2f...
commit ee6bc66318a3da67b57f2f42efd921aa9d938cdd Author: Bișoc George fraizeraust99@gmail.com AuthorDate: Tue Aug 21 15:49:54 2018 +0200 Commit: Hermès BÉLUSCA - MAÏTO hermes.belusca-maito@reactos.org CommitDate: Tue Aug 21 15:49:54 2018 +0200
[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. --- base/setup/usetup/progress.c | 25 +++++++++++++++++++++++-- base/setup/usetup/progress.h | 13 +++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/base/setup/usetup/progress.c b/base/setup/usetup/progress.c index 3aa9e2a99e..71f9ae99df 100644 --- a/base/setup/usetup/progress.c +++ b/base/setup/usetup/progress.c @@ -219,7 +219,7 @@ DrawProgressBar( for (coPos.Y = Bar->Top + 2; coPos.Y <= Bar->Bottom - 1; coPos.Y++) { FillConsoleOutputAttribute(StdOutput, - FOREGROUND_YELLOW | BACKGROUND_BLUE, + Bar->ProgressColour, Bar->Width - 2, coPos, &Written); @@ -234,7 +234,7 @@ DrawProgressBar(
PPROGRESSBAR -CreateProgressBar( +CreateProgressBarEx( SHORT Left, SHORT Top, SHORT Right, @@ -242,6 +242,7 @@ CreateProgressBar( SHORT TextTop, SHORT TextRight, IN BOOLEAN DoubleEdge, + SHORT ProgressColour, CHAR *Text) { PPROGRESSBAR Bar; @@ -259,6 +260,7 @@ CreateProgressBar( Bar->TextTop = TextTop; Bar->TextRight = TextRight; Bar->Double = DoubleEdge; + Bar->ProgressColour = ProgressColour; Bar->Text = Text;
Bar->Width = Bar->Right - Bar->Left + 1; @@ -274,6 +276,25 @@ CreateProgressBar( 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 DestroyProgressBar( diff --git a/base/setup/usetup/progress.h b/base/setup/usetup/progress.h index 4799225e33..ee438e95c2 100644 --- a/base/setup/usetup/progress.h +++ b/base/setup/usetup/progress.h @@ -44,11 +44,24 @@ typedef struct _PROGRESS ULONG CurrentStep;
BOOLEAN Double; + SHORT ProgressColour; CHAR *Text; } PROGRESSBAR, *PPROGRESSBAR;
/* FUNCTIONS ****************************************************************/
+PPROGRESSBAR +CreateProgressBarEx( + SHORT Left, + SHORT Top, + SHORT Right, + SHORT Bottom, + SHORT TextTop, + SHORT TextRight, + IN BOOLEAN DoubleEdge, + SHORT ProgressColour, + CHAR *Text); + PPROGRESSBAR CreateProgressBar( SHORT Left,