2 * COPYRIGHT: See COPYING in the top level directory
4 * FILE: freeldr/ui/minitui.c
5 * PURPOSE: Mini Text UI interface
6 * PROGRAMMERS: Brian Palmer <brianp@sginet.com>
12 VOID
MiniTuiDrawBackdrop(VOID
)
15 // Fill in a black background
25 // Update the screen buffer
27 VideoCopyOffScreenBufferToVRAM();
30 VOID
MiniTuiDrawStatusText(PCSTR StatusText
)
33 // Minimal UI doesn't have a status bar
37 VOID
MiniTuiDrawProgressBarCenter(ULONG Position
, ULONG Range
, PCHAR ProgressText
)
39 ULONG Left
, Top
, Right
, Bottom
;
40 ULONG Width
= 50; // Allow for 50 "bars"
46 Top
= UiScreenHeight
- Height
- 4;
47 Bottom
= Top
+ Height
+ 1;
49 MiniTuiDrawProgressBar(Left
, Top
, Right
, Bottom
, Position
, Range
, ProgressText
);
52 VOID
MiniTuiDrawProgressBar(ULONG Left
, ULONG Top
, ULONG Right
, ULONG Bottom
, ULONG Position
, ULONG Range
, PCHAR ProgressText
)
55 ULONG ProgressBarWidth
= (Right
- Left
) - 3;
57 // First make sure the progress bar text fits
58 UiTruncateStringEllipsis(ProgressText
, ProgressBarWidth
- 4);
66 // Draw the "Loading..." text
68 TuiDrawCenteredText(Left
+ 2, Top
+ 1, Right
- 2, Top
+ 1, ProgressText
, ATTR(7, 0));
70 // Draw the percent complete
71 for (i
=0; i
<(Position
*ProgressBarWidth
)/Range
; i
++)
73 TuiDrawText(Left
+2+i
, Top
+2, "\xDB", ATTR(UiTextColor
, UiMenuBgColor
));
77 VideoCopyOffScreenBufferToVRAM();
81 MiniTuiDrawMenu(PUI_MENU_INFO MenuInfo
)
91 // No GUI status bar text, just minimal text. first to tell the user to
96 "Please select the operating system to start:",
97 ATTR(UiMenuFgColor
, UiMenuBgColor
));
100 // Now tell him how to choose
103 MenuInfo
->Bottom
+ 1,
104 "Use the up and down arrow keys to move the highlight to "
106 ATTR(UiMenuFgColor
, UiMenuBgColor
));
108 MenuInfo
->Bottom
+ 2,
109 "Press ENTER to choose.",
110 ATTR(UiMenuFgColor
, UiMenuBgColor
));
113 // And offer F8 options
117 "For troubleshooting and advanced startup options for "
118 "ReactOS, press F8.",
119 ATTR(UiMenuFgColor
, UiMenuBgColor
));
124 TuiDrawMenuBox(MenuInfo
);
127 // Draw each line of the menu
129 for (i
= 0; i
< MenuInfo
->MenuItemCount
; i
++) TuiDrawMenuItem(MenuInfo
, i
);
130 VideoCopyOffScreenBufferToVRAM();
133 const UIVTBL MiniTuiVtbl
=
143 MiniTuiDrawStatusText
,
146 TuiMessageBoxCritical
,
147 MiniTuiDrawProgressBarCenter
,
148 MiniTuiDrawProgressBar
,
152 MiniTuiDrawBackdrop
, /* no FadeIn */