mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:23:07 +00:00
[USETUP] DrawProgressBar(): Draw the progress bar borders first, then draw its contents.
This commit is contained in:
parent
8f63c209bc
commit
914769a14a
1 changed files with 17 additions and 22 deletions
|
@ -8,7 +8,6 @@
|
||||||
|
|
||||||
/* FUNCTIONS ****************************************************************/
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
|
||||||
|
|
||||||
static
|
static
|
||||||
VOID
|
VOID
|
||||||
DrawBorder(
|
DrawBorder(
|
||||||
|
@ -92,7 +91,6 @@ DrawBorder(
|
||||||
&Written);
|
&Written);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static
|
static
|
||||||
VOID
|
VOID
|
||||||
DrawThickBorder(
|
DrawThickBorder(
|
||||||
|
@ -176,7 +174,6 @@ DrawThickBorder(
|
||||||
&Written);
|
&Written);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static
|
static
|
||||||
VOID
|
VOID
|
||||||
DrawProgressBar(
|
DrawProgressBar(
|
||||||
|
@ -187,6 +184,22 @@ DrawProgressBar(
|
||||||
DWORD Written;
|
DWORD Written;
|
||||||
PROGRESSBAR BarBorder = *Bar;
|
PROGRESSBAR BarBorder = *Bar;
|
||||||
|
|
||||||
|
/* Draw the progress bar "border" border */
|
||||||
|
if (Bar->Double)
|
||||||
|
{
|
||||||
|
BarBorder.Top -= 5;
|
||||||
|
BarBorder.Bottom += 2;
|
||||||
|
BarBorder.Right += 5;
|
||||||
|
BarBorder.Left -= 5;
|
||||||
|
DrawThickBorder(&BarBorder);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Draw the progress bar border */
|
||||||
|
DrawBorder(Bar);
|
||||||
|
|
||||||
|
/* Write the text associated with the bar */
|
||||||
|
CONSOLE_SetTextXY(Bar->TextTop, Bar->TextRight, Bar->Text);
|
||||||
|
|
||||||
/* Print percentage */
|
/* Print percentage */
|
||||||
sprintf(TextBuffer, "%-3lu%%", Bar->Percent);
|
sprintf(TextBuffer, "%-3lu%%", Bar->Percent);
|
||||||
|
|
||||||
|
@ -198,23 +211,7 @@ DrawProgressBar(
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
|
||||||
/* Draw the progress bar border */
|
/* Draw the empty bar */
|
||||||
DrawBorder(Bar);
|
|
||||||
|
|
||||||
/* Write Text Associated with Bar */
|
|
||||||
CONSOLE_SetTextXY(Bar->TextTop, Bar->TextRight, Bar->Text);
|
|
||||||
|
|
||||||
/* Draw the progress bar "border" border */
|
|
||||||
if (Bar->Double)
|
|
||||||
{
|
|
||||||
BarBorder.Top -= 5;
|
|
||||||
BarBorder.Bottom += 2;
|
|
||||||
BarBorder.Right += 5;
|
|
||||||
BarBorder.Left -= 5;
|
|
||||||
DrawThickBorder(&BarBorder);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Draw the 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++)
|
||||||
{
|
{
|
||||||
|
@ -315,7 +312,6 @@ ProgressSetStepCount(
|
||||||
DrawProgressBar(Bar);
|
DrawProgressBar(Bar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
ProgressNextStep(
|
ProgressNextStep(
|
||||||
PPROGRESSBAR Bar)
|
PPROGRESSBAR Bar)
|
||||||
|
@ -323,7 +319,6 @@ ProgressNextStep(
|
||||||
ProgressSetStep(Bar, Bar->CurrentStep + 1);
|
ProgressSetStep(Bar, Bar->CurrentStep + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
ProgressSetStep(
|
ProgressSetStep(
|
||||||
PPROGRESSBAR Bar,
|
PPROGRESSBAR Bar,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue