Author: hbelusca
Date: Sun Dec 9 15:01:51 2012
New Revision: 57842
URL:
http://svn.reactos.org/svn/reactos?rev=57842&view=rev
Log:
[FREELDR]
Improve the overall look:
- Augment the timeout of the livecd from 3 seconds to 5 seconds.
- In "Mini"-UI (i.e. NTLDR-like UI), add a newline between "Press
ENTER" and the time counting.
- Have a real "Setup"-UI (i.e. make it really work).
- Add the possibility to change the title of menus.
Modified:
trunk/reactos/boot/bootdata/bootcd.ini
trunk/reactos/boot/bootdata/livecd.ini
trunk/reactos/boot/freeldr/freeldr/arch/i386/custom.c
trunk/reactos/boot/freeldr/freeldr/bootmgr.c
trunk/reactos/boot/freeldr/freeldr/include/ui.h
trunk/reactos/boot/freeldr/freeldr/include/ui/noui.h
trunk/reactos/boot/freeldr/freeldr/include/ui/tui.h
trunk/reactos/boot/freeldr/freeldr/options.c
trunk/reactos/boot/freeldr/freeldr/ui/directui.c
trunk/reactos/boot/freeldr/freeldr/ui/minitui.c
trunk/reactos/boot/freeldr/freeldr/ui/noui.c
trunk/reactos/boot/freeldr/freeldr/ui/tui.c
trunk/reactos/boot/freeldr/freeldr/ui/tuimenu.c
trunk/reactos/boot/freeldr/freeldr/ui/ui.c
trunk/reactos/boot/freeldr/freeldr/windows/setupldr.c
Modified: trunk/reactos/boot/bootdata/bootcd.ini
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/bootcd.ini?r…
==============================================================================
--- trunk/reactos/boot/bootdata/bootcd.ini [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/bootcd.ini [iso-8859-1] Sun Dec 9 15:01:51 2012
@@ -13,16 +13,11 @@
TitleBoxColor=Red
MessageBoxTextColor=White
MessageBoxColor=Blue
-MenuTextColor=Gray
-MenuColor=Black
-TextColor=Gray
+MenuTextColor=White
+MenuColor=Blue
+TextColor=Yellow
SelectedTextColor=Black
SelectedColor=Gray
-ShowTime=No
-MenuBox=No
-CenterMenu=No
-MinimalUI=Yes
-TimeText=Seconds until highlighted choice will be started automatically:
[Operating Systems]
Setup="Setup"
Modified: trunk/reactos/boot/bootdata/livecd.ini
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/livecd.ini?r…
==============================================================================
--- trunk/reactos/boot/bootdata/livecd.ini [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/livecd.ini [iso-8859-1] Sun Dec 9 15:01:51 2012
@@ -1,6 +1,6 @@
[FREELOADER]
DefaultOS=LiveCD_Debug
-TimeOut=3
+TimeOut=5
[Display]
TitleText=ReactOS LiveCD
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/custom.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/custom.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/custom.c [iso-8859-1] Sun Dec 9 15:01:51
2012
@@ -43,7 +43,13 @@
ULONG CustomBootMenuCount = sizeof(CustomBootMenuList) /
sizeof(CustomBootMenuList[0]);
ULONG SelectedMenuItem;
- if (!UiDisplayMenu(CustomBootMenuList, CustomBootMenuCount, 0, -1,
&SelectedMenuItem, TRUE, NULL))
+ if (!UiDisplayMenu("Please choose a boot method:",
+ CustomBootMenuList,
+ CustomBootMenuCount,
+ 0, -1,
+ &SelectedMenuItem,
+ TRUE,
+ NULL))
{
// The user pressed ESC
return;
Modified: trunk/reactos/boot/freeldr/freeldr/bootmgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/bootm…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/bootmgr.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/bootmgr.c [iso-8859-1] Sun Dec 9 15:01:51 2012
@@ -191,7 +191,14 @@
UiDrawBackdrop();
// Show the operating system list menu
- if (!UiDisplayMenu(OperatingSystemDisplayNames, OperatingSystemCount,
DefaultOperatingSystem, TimeOut, &SelectedOperatingSystem, FALSE,
MainBootMenuKeyPressFilter))
+ if (!UiDisplayMenu("Please select the operating system to start:",
+ OperatingSystemDisplayNames,
+ OperatingSystemCount,
+ DefaultOperatingSystem,
+ TimeOut,
+ &SelectedOperatingSystem,
+ FALSE,
+ MainBootMenuKeyPressFilter))
{
UiMessageBox("Press ENTER to reboot.");
goto reboot;
Modified: trunk/reactos/boot/freeldr/freeldr/include/ui.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/ui.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/ui.h [iso-8859-1] Sun Dec 9 15:01:51 2012
@@ -19,8 +19,8 @@
#pragma once
-extern ULONG UiScreenWidth; // Screen Width
-extern ULONG UiScreenHeight; // Screen Height
+extern ULONG UiScreenWidth; // Screen Width
+extern ULONG UiScreenHeight; // Screen Height
extern UCHAR UiStatusBarFgColor; // Status bar foreground color
extern UCHAR UiStatusBarBgColor; // Status bar background color
@@ -42,10 +42,10 @@
extern CHAR UiTitleBoxTitleText[260]; // Title box's title text
extern BOOLEAN UiUseSpecialEffects; // Tells us if we should use fade effects
-extern BOOLEAN UiCenterMenu;
-extern BOOLEAN UiMenuBox;
-extern CHAR UiTimeText[];
-extern BOOLEAN UiDrawTime;
+extern BOOLEAN UiCenterMenu;
+extern BOOLEAN UiMenuBox;
+extern CHAR UiTimeText[];
+extern BOOLEAN UiDrawTime;
extern const CHAR UiMonthNames[12][15];
@@ -55,7 +55,7 @@
//
///////////////////////////////////////////////////////////////////////////////////////
BOOLEAN UiInitialize(BOOLEAN ShowGui); // Initialize User-Interface
-BOOLEAN SetupUiInitialize(VOID); // Initialize User-Interface
+BOOLEAN SetupUiInitialize(VOID); // Initialize Setup User-Interface
VOID UiUnInitialize(PCSTR BootText); // Un-initialize User-Interface
VOID UiDrawBackdrop(VOID); // Fills the entire screen with a backdrop
VOID UiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR
Attr /* Color Attributes */); // Fills the area specified with FillChar and Attr
@@ -93,7 +93,7 @@
typedef BOOLEAN (*UiMenuKeyPressFilterCallback)(ULONG KeyPress);
-BOOLEAN UiDisplayMenu(PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem,
LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback
KeyPressFilter);
+BOOLEAN UiDisplayMenu(PCSTR MenuTitle, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG
DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape,
UiMenuKeyPressFilterCallback KeyPressFilter);
///////////////////////////////////////////////////////////////////////////////////////
//
@@ -123,7 +123,7 @@
VOID (*FadeInBackdrop)(VOID);
VOID (*FadeOut)(VOID);
- BOOLEAN (*DisplayMenu)(PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem,
LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback
KeyPressFilter);
+ BOOLEAN (*DisplayMenu)(PCSTR MenuTitle, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG
DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape,
UiMenuKeyPressFilterCallback KeyPressFilter);
VOID (*DrawMenu)(PUI_MENU_INFO MenuInfo);
} UIVTBL, *PUIVTBL;
Modified: trunk/reactos/boot/freeldr/freeldr/include/ui/noui.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/ui/noui.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/ui/noui.h [iso-8859-1] Sun Dec 9 15:01:51
2012
@@ -35,14 +35,11 @@
VOID NoUiFadeInBackdrop(VOID);
VOID NoUiFadeOut(VOID);
-BOOLEAN NoUiDisplayMenu(PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem,
LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback
KeyPressFilter);
-VOID NoUiDrawMenu(PUI_MENU_INFO MenuInfo);
-
///////////////////////////////////////////////////////////////////////////////////////
//
// Menu Functions
//
///////////////////////////////////////////////////////////////////////////////////////
-BOOLEAN NoUiDisplayMenu(PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem,
LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback
KeyPressFilter);
+BOOLEAN NoUiDisplayMenu(PCSTR MenuTitle, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG
DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape,
UiMenuKeyPressFilterCallback KeyPressFilter);
VOID NoUiDrawMenu(PUI_MENU_INFO MenuInfo);
Modified: trunk/reactos/boot/freeldr/freeldr/include/ui/tui.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/ui/tui.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/ui/tui.h [iso-8859-1] Sun Dec 9 15:01:51
2012
@@ -60,6 +60,8 @@
struct tagUI_MENU_INFO
{
+ PCSTR MenuTitle;
+
PCSTR *MenuItemList;
ULONG MenuItemCount;
LONG MenuTimeRemaining;
@@ -69,7 +71,6 @@
ULONG Top;
ULONG Right;
ULONG Bottom;
-
};
VOID NTAPI TuiCalcMenuBoxSize(PUI_MENU_INFO MenuInfo);
@@ -77,7 +78,7 @@
VOID NTAPI TuiDrawMenuBox(PUI_MENU_INFO MenuInfo);
VOID NTAPI TuiDrawMenuItem(PUI_MENU_INFO MenuInfo, ULONG MenuItemNumber);
ULONG NTAPI TuiProcessMenuKeyboardEvent(PUI_MENU_INFO MenuInfo,
UiMenuKeyPressFilterCallback KeyPressFilter);
-BOOLEAN TuiDisplayMenu(PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem,
LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback
KeyPressFilter);
+BOOLEAN TuiDisplayMenu(PCSTR MenuTitle, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG
DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape,
UiMenuKeyPressFilterCallback KeyPressFilter);
/* Definitions for corners, depending on HORIZ and VERT */
#define UL (0xda)
Modified: trunk/reactos/boot/freeldr/freeldr/options.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/optio…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/options.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/options.c [iso-8859-1] Sun Dec 9 15:01:51 2012
@@ -101,7 +101,13 @@
ULONG SelectedMenuItem;
CHAR DebugChannelString[100];
- if (!UiDisplayMenu(OptionsMenuList, OptionsMenuItemCount, 0, -1, &SelectedMenuItem,
TRUE, NULL))
+ if (!UiDisplayMenu("Select an option:",
+ OptionsMenuList,
+ OptionsMenuItemCount,
+ 0, -1,
+ &SelectedMenuItem,
+ TRUE,
+ NULL))
{
// The user pressed ESC
return;
Modified: trunk/reactos/boot/freeldr/freeldr/ui/directui.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/di…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/ui/directui.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/ui/directui.c [iso-8859-1] Sun Dec 9 15:01:51
2012
@@ -52,11 +52,11 @@
UiInitialize(IN BOOLEAN ShowGui)
{
ULONG Depth;
-
- /* Nothing to do */
- if (!ShowGui) return TRUE;
-
- /* Set mode and query size */
+
+ /* Nothing to do */
+ if (!ShowGui) return TRUE;
+
+ /* Set mode and query size */
MachVideoSetDisplayMode(NULL, TRUE);
MachVideoGetDisplaySize(&UiScreenWidth, &UiScreenHeight, &Depth);
return TRUE;
@@ -245,7 +245,7 @@
IN ULONG MaxChars)
{
/* If it's too large, just add some ellipsis past the maximum */
- if (strlen(StringText) > MaxChars) strcpy(&StringText[MaxChars - 3],
"...");
+ if (strlen(StringText) > MaxChars) strcpy(&StringText[MaxChars - 3],
"...");
}
VOID
@@ -273,7 +273,7 @@
/* Display under the menu directly */
UiDrawText(0,
- MenuInfo->Bottom + 3,
+ MenuInfo->Bottom + 4,
MenuLineText,
ATTR(UiMenuFgColor, UiMenuBgColor));
}
@@ -288,7 +288,7 @@
/* Draw this "empty" string to erase */
UiDrawText(0,
- MenuInfo->Bottom + 3,
+ MenuInfo->Bottom + 4,
MenuLineText,
ATTR(UiMenuFgColor, UiMenuBgColor));
}
@@ -356,14 +356,13 @@
/* No GUI status bar text, just minimal text. first to tell the user to choose */
UiDrawText(0,
MenuInfo->Top - 2,
- "Please select the operating system to start:",
+ MenuInfo->MenuTitle,
ATTR(UiMenuFgColor, UiMenuBgColor));
/* Now tell him how to choose */
UiDrawText(0,
MenuInfo->Bottom + 1,
- "Use the up and down arrow keys to move the highlight to "
- "your choice.",
+ "Use \x18 and \x19 to move the highlight to your choice.",
ATTR(UiMenuFgColor, UiMenuBgColor));
UiDrawText(0,
MenuInfo->Bottom + 2,
@@ -381,7 +380,10 @@
UiDrawMenuBox(MenuInfo);
/* Draw each line of the menu */
- for (i = 0; i < MenuInfo->MenuItemCount; i++) UiDrawMenuItem(MenuInfo, i);
+ for (i = 0; i < MenuInfo->MenuItemCount; i++)
+ {
+ UiDrawMenuItem(MenuInfo, i);
+ }
}
ULONG
@@ -495,7 +497,8 @@
}
BOOLEAN
-UiDisplayMenu(IN PCSTR MenuItemList[],
+UiDisplayMenu(IN PCSTR MenuTitle,
+ IN PCSTR MenuItemList[],
IN ULONG MenuItemCount,
IN ULONG DefaultMenuItem,
IN LONG MenuTimeOut,
@@ -517,6 +520,7 @@
}
/* Setup the MENU_INFO structure */
+ MenuInformation.MenuTitle = MenuTitle;
MenuInformation.MenuItemList = MenuItemList;
MenuInformation.MenuItemCount = MenuItemCount;
MenuInformation.MenuTimeRemaining = MenuTimeOut;
Modified: trunk/reactos/boot/freeldr/freeldr/ui/minitui.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/mi…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/ui/minitui.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/ui/minitui.c [iso-8859-1] Sun Dec 9 15:01:51 2012
@@ -14,13 +14,8 @@
//
// Fill in a black background
//
- TuiFillArea(0,
- 0,
- UiScreenWidth - 1,
- UiScreenHeight - 1,
- 0,
- 0);
-
+ TuiFillArea(0, 0, UiScreenWidth - 1, UiScreenHeight - 1, 0, 0);
+
//
// Update the screen buffer
//
@@ -93,7 +88,7 @@
//
UiVtbl.DrawText(0,
MenuInfo->Top - 2,
- "Please select the operating system to start:",
+ MenuInfo->MenuTitle,
ATTR(UiMenuFgColor, UiMenuBgColor));
//
@@ -101,8 +96,7 @@
//
UiVtbl.DrawText(0,
MenuInfo->Bottom + 1,
- "Use the up and down arrow keys to move the highlight to "
- "your choice.",
+ "Use \x18 and \x19 to move the highlight to your choice.",
ATTR(UiMenuFgColor, UiMenuBgColor));
UiVtbl.DrawText(0,
MenuInfo->Bottom + 2,
@@ -126,7 +120,11 @@
//
// Draw each line of the menu
//
- for (i = 0; i < MenuInfo->MenuItemCount; i++) TuiDrawMenuItem(MenuInfo, i);
+ for (i = 0; i < MenuInfo->MenuItemCount; i++)
+ {
+ TuiDrawMenuItem(MenuInfo, i);
+ }
+
VideoCopyOffScreenBufferToVRAM();
}
Modified: trunk/reactos/boot/freeldr/freeldr/ui/noui.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/no…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/ui/noui.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/ui/noui.c [iso-8859-1] Sun Dec 9 15:01:51 2012
@@ -109,7 +109,7 @@
//
///////////////////////////////////////////////////////////////////////////////////////
-BOOLEAN NoUiDisplayMenu(PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem,
LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback
KeyPressFilter)
+BOOLEAN NoUiDisplayMenu(PCSTR MenuTitle, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG
DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape,
UiMenuKeyPressFilterCallback KeyPressFilter)
{
*SelectedMenuItem = DefaultMenuItem;
return TRUE;
Modified: trunk/reactos/boot/freeldr/freeldr/ui/tui.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/tu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/ui/tui.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/ui/tui.c [iso-8859-1] Sun Dec 9 15:01:51 2012
@@ -153,7 +153,7 @@
VOID TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR
Attr /* Color Attributes */)
{
PUCHAR ScreenMemory = (PUCHAR)TextVideoBuffer;
- ULONG i, j;
+ ULONG i, j;
// Clip the area to the screen
if ((Left >= UiScreenWidth) || (Top >= UiScreenHeight))
@@ -188,7 +188,7 @@
VOID TuiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom)
{
PUCHAR ScreenMemory = (PUCHAR)TextVideoBuffer;
- ULONG Idx;
+ ULONG Idx;
// Shade the bottom of the area
if (Bottom < (UiScreenHeight - 1))
@@ -320,7 +320,7 @@
VOID TuiDrawText(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr)
{
PUCHAR ScreenMemory = (PUCHAR)TextVideoBuffer;
- ULONG i, j;
+ ULONG i, j;
// Draw the text
for (i=X, j=0; Text[j] && i<UiScreenWidth; i++,j++)
@@ -332,16 +332,16 @@
VOID TuiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR
TextString, UCHAR Attr)
{
- SIZE_T TextLength;
- ULONG BoxWidth;
- ULONG BoxHeight;
- ULONG LineBreakCount;
- SIZE_T Index;
- SIZE_T LastIndex;
- ULONG RealLeft;
- ULONG RealTop;
- ULONG X;
- ULONG Y;
+ SIZE_T TextLength;
+ ULONG BoxWidth;
+ ULONG BoxHeight;
+ ULONG LineBreakCount;
+ SIZE_T Index;
+ SIZE_T LastIndex;
+ ULONG RealLeft;
+ ULONG RealTop;
+ ULONG X;
+ ULONG Y;
CHAR Temp[2];
TextLength = strlen(TextString);
@@ -393,7 +393,7 @@
VOID TuiDrawStatusText(PCSTR StatusText)
{
- SIZE_T i;
+ SIZE_T i;
TuiDrawText(0, UiScreenHeight-1, " ", ATTR(UiStatusBarFgColor,
UiStatusBarBgColor));
TuiDrawText(1, UiScreenHeight-1, StatusText, ATTR(UiStatusBarFgColor,
UiStatusBarBgColor));
@@ -504,7 +504,7 @@
VOID TuiSaveScreen(PUCHAR Buffer)
{
PUCHAR ScreenMemory = (PUCHAR)TextVideoBuffer;
- ULONG i;
+ ULONG i;
for (i=0; i < (UiScreenWidth * UiScreenHeight * 2); i++)
{
@@ -515,7 +515,7 @@
VOID TuiRestoreScreen(PUCHAR Buffer)
{
PUCHAR ScreenMemory = (PUCHAR)TextVideoBuffer;
- ULONG i;
+ ULONG i;
for (i=0; i < (UiScreenWidth * UiScreenHeight * 2); i++)
{
@@ -630,12 +630,11 @@
}
-
VOID TuiDrawProgressBarCenter(ULONG Position, ULONG Range, PCHAR ProgressText)
{
- ULONG Left, Top, Right, Bottom;
- ULONG Width = 50; // Allow for 50 "bars"
- ULONG Height = 2;
+ ULONG Left, Top, Right, Bottom;
+ ULONG Width = 50; // Allow for 50 "bars"
+ ULONG Height = 2;
Left = (UiScreenWidth - Width - 4) / 2;
Right = Left + Width + 3;
@@ -648,8 +647,8 @@
VOID TuiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position,
ULONG Range, PCHAR ProgressText)
{
- ULONG i;
- ULONG ProgressBarWidth = (Right - Left) - 3;
+ ULONG i;
+ ULONG ProgressBarWidth = (Right - Left) - 3;
// First make sure the progress bar text fits
UiTruncateStringEllipsis(ProgressText, ProgressBarWidth - 4);
Modified: trunk/reactos/boot/freeldr/freeldr/ui/tuimenu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/tu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/ui/tuimenu.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/ui/tuimenu.c [iso-8859-1] Sun Dec 9 15:01:51 2012
@@ -14,7 +14,8 @@
/* FUNCTIONS *****************************************************************/
BOOLEAN
-TuiDisplayMenu(PCSTR MenuItemList[],
+TuiDisplayMenu(PCSTR MenuTitle,
+ PCSTR MenuItemList[],
ULONG MenuItemCount,
ULONG DefaultMenuItem,
LONG MenuTimeOut,
@@ -41,6 +42,7 @@
//
// Setup the MENU_INFO structure
//
+ MenuInformation.MenuTitle = MenuTitle;
MenuInformation.MenuItemList = MenuItemList;
MenuInformation.MenuItemCount = MenuItemCount;
MenuInformation.MenuTimeRemaining = MenuTimeOut;
@@ -203,7 +205,7 @@
//
// Update the status bar
//
- UiVtbl.DrawStatusText("Use \x18\x19 to select, then press ENTER.");
+ UiVtbl.DrawStatusText("Use \x18 and \x19 to select, then press ENTER.");
//
// Draw the menu box
@@ -213,7 +215,11 @@
//
// Draw each line of the menu
//
- for (i = 0; i < MenuInfo->MenuItemCount; i++) TuiDrawMenuItem(MenuInfo, i);
+ for (i = 0; i < MenuInfo->MenuItemCount; i++)
+ {
+ TuiDrawMenuItem(MenuInfo, i);
+ }
+
VideoCopyOffScreenBufferToVRAM();
}
@@ -221,8 +227,7 @@
NTAPI
TuiDrawMenuBox(PUI_MENU_INFO MenuInfo)
{
- CHAR MenuLineText[80];
- CHAR TempString[80];
+ CHAR MenuLineText[80], TempString[80];
ULONG i;
//
@@ -237,7 +242,7 @@
D_VERT,
D_HORZ,
FALSE, // Filled
- TRUE, // Shadow
+ TRUE, // Shadow
ATTR(UiMenuFgColor, UiMenuBgColor));
}
@@ -284,7 +289,7 @@
// Display under the menu directly
//
UiDrawText(0,
- MenuInfo->Bottom + 3,
+ MenuInfo->Bottom + 4,
MenuLineText,
ATTR(UiMenuFgColor, UiMenuBgColor));
}
@@ -313,7 +318,7 @@
else
{
UiDrawText(0,
- MenuInfo->Bottom + 3,
+ MenuInfo->Bottom + 4,
MenuLineText,
ATTR(UiMenuFgColor, UiMenuBgColor));
}
Modified: trunk/reactos/boot/freeldr/freeldr/ui/ui.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/ui…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/ui/ui.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/ui/ui.c [iso-8859-1] Sun Dec 9 15:01:51 2012
@@ -23,8 +23,10 @@
DBG_DEFAULT_CHANNEL(UI);
-ULONG UiScreenWidth; // Screen Width
-ULONG UiScreenHeight; // Screen Height
+BOOLEAN UiMinimal = FALSE; // Tells us if we are using a minimal console-like UI
+
+ULONG UiScreenWidth; // Screen Width
+ULONG UiScreenHeight; // Screen Height
UCHAR UiStatusBarFgColor = COLOR_BLACK; // Status bar foreground color
UCHAR UiStatusBarBgColor = COLOR_CYAN; // Status bar background color
@@ -81,13 +83,13 @@
BOOLEAN UiInitialize(BOOLEAN ShowGui)
{
VIDEODISPLAYMODE UiDisplayMode; // Tells us if we are in text or graphics mode
- BOOLEAN UiMinimal = FALSE; // Tells us if we should use a minimal console-like UI
ULONG_PTR SectionId;
CHAR DisplayModeText[260];
CHAR SettingText[260];
ULONG Depth;
- if (!ShowGui) {
+ if (!ShowGui)
+ {
if (!UiVtbl.Initialize())
{
MachVideoSetDisplayMode(NULL, FALSE);
@@ -102,7 +104,7 @@
DisplayModeText[0] = '\0';
if (IniOpenSection("Display", &SectionId))
{
- if (! IniReadSettingByName(SectionId, "DisplayMode", DisplayModeText,
sizeof(DisplayModeText)))
+ if (!IniReadSettingByName(SectionId, "DisplayMode", DisplayModeText,
sizeof(DisplayModeText)))
{
DisplayModeText[0] = '\0';
}
@@ -116,7 +118,7 @@
MachVideoGetDisplaySize(&UiScreenWidth, &UiScreenHeight, &Depth);
if (VideoTextMode == UiDisplayMode)
- UiVtbl = UiMinimal ? MiniTuiVtbl : TuiVtbl;
+ UiVtbl = (UiMinimal ? MiniTuiVtbl : TuiVtbl);
else
UiVtbl = GuiVtbl;
@@ -222,44 +224,6 @@
UiFadeInBackdrop();
TRACE("UiInitialize() returning TRUE.\n");
- return TRUE;
-}
-
-BOOLEAN SetupUiInitialize(VOID)
-{
- CHAR DisplayModeText[260];
- ULONG Depth;
- SIZE_T Length;
-
-
- DisplayModeText[0] = '\0';
-
- MachVideoSetDisplayMode(DisplayModeText, TRUE);
- MachVideoGetDisplaySize(&UiScreenWidth, &UiScreenHeight, &Depth);
-
- UiVtbl = TuiVtbl;
- UiVtbl.Initialize();
-
- // Draw the backdrop and fade it in if special effects are enabled
- UiVtbl.FillArea(0,
- 0,
- UiScreenWidth - 1,
- UiScreenHeight - 2,
- 0,
- ATTR(UiBackdropFgColor, UiBackdropBgColor));
-
- UiDrawTime = FALSE;
- UiStatusBarBgColor = 7;
-
- Length = strlen("ReactOS " KERNEL_VERSION_STR " Setup");
- memset(DisplayModeText, 0xcd, Length + 2);
- DisplayModeText[Length + 2] = '\0';
-
- UiVtbl.DrawText(4, 1, "ReactOS " KERNEL_VERSION_STR " Setup",
ATTR(COLOR_GRAY, UiBackdropBgColor));
- UiVtbl.DrawText(3, 2, DisplayModeText, ATTR(COLOR_GRAY, UiBackdropBgColor));
-
- TRACE("UiInitialize() returning TRUE.\n");
-
return TRUE;
}
@@ -405,7 +369,7 @@
VOID UiShowMessageBoxesInSection(PCSTR SectionName)
{
- ULONG Idx;
+ ULONG Idx;
CHAR SettingName[80];
CHAR SettingValue[80];
PCHAR MessageBoxText;
@@ -455,7 +419,7 @@
VOID UiEscapeString(PCHAR String)
{
- ULONG Idx;
+ ULONG Idx;
for (Idx=0; Idx<strlen(String); Idx++)
{
@@ -479,9 +443,9 @@
}
}
-BOOLEAN UiDisplayMenu(PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem,
LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback
KeyPressFilter)
-{
- return UiVtbl.DisplayMenu(MenuItemList, MenuItemCount, DefaultMenuItem, MenuTimeOut,
SelectedMenuItem, CanEscape, KeyPressFilter);
+BOOLEAN UiDisplayMenu(PCSTR MenuTitle, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG
DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape,
UiMenuKeyPressFilterCallback KeyPressFilter)
+{
+ return UiVtbl.DisplayMenu(MenuTitle, MenuItemList, MenuItemCount, DefaultMenuItem,
MenuTimeOut, SelectedMenuItem, CanEscape, KeyPressFilter);
}
VOID UiFadeInBackdrop(VOID)
@@ -498,4 +462,73 @@
{
return UiVtbl.EditBox(MessageText, EditTextBuffer, Length);
}
+
+
+/* SETUP MODE *****************************************************************/
+
+VOID SetupUiDrawBackdrop(VOID)
+{
+ CHAR Underline[80];
+ SIZE_T Length;
+
+ // Draw the backdrop and fade it in if special effects are enabled
+ UiVtbl.FillArea(0, 0, UiScreenWidth - 1, UiScreenHeight - 2, 0,
+ ATTR(UiBackdropFgColor, UiBackdropBgColor));
+
+ Length = min( strlen("ReactOS " KERNEL_VERSION_STR " Setup"),
+ sizeof(Underline) - 1 );
+ memset(Underline, 0xcd, Length); // Underline title
+ Underline[Length] = '\0';
+
+ UiVtbl.DrawText(4, 1, "ReactOS " KERNEL_VERSION_STR " Setup",
ATTR(COLOR_GRAY, UiBackdropBgColor));
+ UiVtbl.DrawText(4, 2, Underline, ATTR(COLOR_GRAY, UiBackdropBgColor));
+
+ // Update the screen buffer
+ VideoCopyOffScreenBufferToVRAM();
+}
+
+BOOLEAN SetupUiInitialize(VOID)
+{
+ if (!UiMinimal)
+ {
+ ULONG Depth;
+
+ // Initialize the video
+ MachVideoSetDisplayMode(NULL, TRUE);
+ MachVideoGetDisplaySize(&UiScreenWidth, &UiScreenHeight, &Depth);
+
+ // Use Text UI with a modified backdrop and set display properties
+ UiVtbl = TuiVtbl;
+ UiVtbl.DrawBackdrop = SetupUiDrawBackdrop;
+
+ UiStatusBarFgColor = COLOR_BLACK;
+ UiStatusBarBgColor = COLOR_GRAY;
+ UiBackdropFgColor = COLOR_WHITE;
+ UiBackdropBgColor = COLOR_BLUE;
+ UiBackdropFillStyle = MEDIUM_FILL;
+ UiTitleBoxFgColor = COLOR_WHITE;
+ UiTitleBoxBgColor = COLOR_RED;
+ UiMessageBoxFgColor = COLOR_WHITE;
+ UiMessageBoxBgColor = COLOR_BLUE;
+ UiMenuFgColor = COLOR_WHITE;
+ UiMenuBgColor = COLOR_BLUE;
+ UiTextColor = COLOR_YELLOW;
+ UiSelectedTextColor = COLOR_BLACK;
+ UiSelectedTextBgColor = COLOR_GRAY;
+ UiEditBoxTextColor = COLOR_WHITE;
+ UiEditBoxBgColor = COLOR_BLACK;
+ UiUseSpecialEffects = FALSE;
+ UiDrawTime = FALSE;
+
+ UiVtbl.Initialize();
+
+ // Draw the backdrop
+ UiDrawBackdrop();
+ }
+
+ TRACE("SetupUiInitialize() returning TRUE.\n");
+
+ return TRUE;
+}
+
#endif
Modified: trunk/reactos/boot/freeldr/freeldr/windows/setupldr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/windows/setupldr.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/windows/setupldr.c [iso-8859-1] Sun Dec 9 15:01:51
2012
@@ -210,8 +210,8 @@
TRACE("BootOptions: '%s'\n", BootOptions);
- //SetupUiInitialize();
- UiDrawStatusText("");
+ SetupUiInitialize();
+ UiDrawStatusText("Setup is loading...");
/* Allocate and minimalistic-initialize LPB */
AllocateAndInitLPB(&LoaderBlock);
@@ -231,7 +231,7 @@
/* Get a list of boot drivers */
SetupLdrScanBootDrivers(&LoaderBlock->BootDriverListHead, InfHandle,
BootPath);
-
+ /* Load ReactOS */
LoadAndBootWindowsCommon(_WIN32_WINNT_WS03,
LoaderBlock,
BootOptions,