[FREELDR]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 9 Dec 2012 15:01:51 +0000 (15:01 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 9 Dec 2012 15:01:51 +0000 (15:01 +0000)
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.

svn path=/trunk/; revision=57842

15 files changed:
reactos/boot/bootdata/bootcd.ini
reactos/boot/bootdata/livecd.ini
reactos/boot/freeldr/freeldr/arch/i386/custom.c
reactos/boot/freeldr/freeldr/bootmgr.c
reactos/boot/freeldr/freeldr/include/ui.h
reactos/boot/freeldr/freeldr/include/ui/noui.h
reactos/boot/freeldr/freeldr/include/ui/tui.h
reactos/boot/freeldr/freeldr/options.c
reactos/boot/freeldr/freeldr/ui/directui.c
reactos/boot/freeldr/freeldr/ui/minitui.c
reactos/boot/freeldr/freeldr/ui/noui.c
reactos/boot/freeldr/freeldr/ui/tui.c
reactos/boot/freeldr/freeldr/ui/tuimenu.c
reactos/boot/freeldr/freeldr/ui/ui.c
reactos/boot/freeldr/freeldr/windows/setupldr.c

index cf8062e..2c04ff2 100644 (file)
@@ -13,16 +13,11 @@ TitleBoxTextColor=White
 TitleBoxColor=Red\r
 MessageBoxTextColor=White\r
 MessageBoxColor=Blue\r
-MenuTextColor=Gray\r
-MenuColor=Black\r
-TextColor=Gray\r
+MenuTextColor=White\r
+MenuColor=Blue\r
+TextColor=Yellow\r
 SelectedTextColor=Black\r
 SelectedColor=Gray\r
-ShowTime=No\r
-MenuBox=No\r
-CenterMenu=No\r
-MinimalUI=Yes\r
-TimeText=Seconds until highlighted choice will be started automatically:   \r
 \r
 [Operating Systems]\r
 Setup="Setup"\r
index af4ec4f..6a208ce 100644 (file)
@@ -1,6 +1,6 @@
 [FREELOADER]\r
 DefaultOS=LiveCD_Debug\r
-TimeOut=3\r
+TimeOut=5\r
 \r
 [Display]\r
 TitleText=ReactOS LiveCD\r
index a53d423..973c326 100644 (file)
@@ -43,7 +43,13 @@ VOID OptionMenuCustomBoot(VOID)
        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;
index 6426eca..2295e50 100644 (file)
@@ -191,7 +191,14 @@ VOID RunLoader(VOID)
                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;
index 1b57fd9..9a87e21 100644 (file)
@@ -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      UCHAR   UiEditBoxBgColor;                                                               // Edit box text background color
 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 @@ extern        const CHAR      UiMonthNames[12][15];
 //
 ///////////////////////////////////////////////////////////////////////////////////////
 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 struct tagUI_MENU_INFO UI_MENU_INFO, *PUI_MENU_INFO;
 
 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 @@ typedef struct tagUIVTBL
        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;
 
index de027d7..f779db1 100644 (file)
@@ -35,14 +35,11 @@ UCHAR NoUiTextToFillStyle(PCSTR FillStyleText);
 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);
index ad7faa4..3262c12 100644 (file)
@@ -60,6 +60,8 @@ VOID  TuiFadeOut(VOID);                                                                               // Fades the screen out
 
 struct tagUI_MENU_INFO
 {
+       PCSTR           MenuTitle;
+
        PCSTR           *MenuItemList;
        ULONG           MenuItemCount;
        LONG            MenuTimeRemaining;
@@ -69,7 +71,6 @@ struct tagUI_MENU_INFO
        ULONG           Top;
        ULONG           Right;
        ULONG           Bottom;
-
 };
 
 VOID   NTAPI TuiCalcMenuBoxSize(PUI_MENU_INFO MenuInfo);
@@ -77,7 +78,7 @@ VOID  TuiDrawMenu(PUI_MENU_INFO MenuInfo);
 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)
index dc6e85c..23b9787 100644 (file)
@@ -101,7 +101,13 @@ VOID DoOptionsMenu(VOID)
        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;
index 2a9db37..5bc90bb 100644 (file)
@@ -52,11 +52,11 @@ BOOLEAN
 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 @@ UiTruncateStringEllipsis(IN PCHAR StringText,
                          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 @@ UiDrawMenuBox(IN PUI_MENU_INFO MenuInfo)
 
         /* Display under the menu directly */
         UiDrawText(0,
-                   MenuInfo->Bottom + 3,
+                   MenuInfo->Bottom + 4,
                    MenuLineText,
                    ATTR(UiMenuFgColor, UiMenuBgColor));
     }
@@ -288,7 +288,7 @@ UiDrawMenuBox(IN PUI_MENU_INFO MenuInfo)
 
         /* Draw this "empty" string to erase */
         UiDrawText(0,
-                   MenuInfo->Bottom + 3,
+                   MenuInfo->Bottom + 4,
                    MenuLineText,
                    ATTR(UiMenuFgColor, UiMenuBgColor));
     }
@@ -356,14 +356,13 @@ UiDrawMenu(IN PUI_MENU_INFO MenuInfo)
     /* 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 @@ UiDrawMenu(IN PUI_MENU_INFO MenuInfo)
     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 @@ UiCalcMenuBoxSize(IN PUI_MENU_INFO MenuInfo)
 }
 
 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 @@ UiDisplayMenu(IN PCSTR MenuItemList[],
     }
 
     /* Setup the MENU_INFO structure */
+    MenuInformation.MenuTitle = MenuTitle;
     MenuInformation.MenuItemList = MenuItemList;
     MenuInformation.MenuItemCount = MenuItemCount;
     MenuInformation.MenuTimeRemaining = MenuTimeOut;
index d38f7a5..e510304 100644 (file)
@@ -14,13 +14,8 @@ VOID MiniTuiDrawBackdrop(VOID)
        //
        // 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 @@ MiniTuiDrawMenu(PUI_MENU_INFO MenuInfo)
     //
     UiVtbl.DrawText(0,
                     MenuInfo->Top - 2,
-                    "Please select the operating system to start:",
+                    MenuInfo->MenuTitle,
                     ATTR(UiMenuFgColor, UiMenuBgColor));
 
     //
@@ -101,8 +96,7 @@ MiniTuiDrawMenu(PUI_MENU_INFO MenuInfo)
     //
     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 @@ MiniTuiDrawMenu(PUI_MENU_INFO MenuInfo)
     //
     // 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();
 }
 
index 433ddb7..a8ee952 100644 (file)
@@ -109,7 +109,7 @@ VOID NoUiFadeOut(VOID)
 //
 ///////////////////////////////////////////////////////////////////////////////////////
 
-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;
index bb4f9e3..9d458f4 100644 (file)
@@ -153,7 +153,7 @@ VOID TuiDrawBackdrop(VOID)
 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 TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar
 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 TuiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyl
 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 TuiDrawText(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr)
 
 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 TuiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR
 
 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 TuiUpdateDateTime(VOID)
 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 TuiSaveScreen(PUCHAR Buffer)
 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 TuiMessageBoxCritical(PCSTR MessageText)
 
 }
 
-
 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 TuiDrawProgressBarCenter(ULONG Position, ULONG Range, PCHAR ProgressText)
 
 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);
index 4ade923..861dd20 100644 (file)
@@ -14,7 +14,8 @@
 /* FUNCTIONS *****************************************************************/
 
 BOOLEAN
-TuiDisplayMenu(PCSTR MenuItemList[],
+TuiDisplayMenu(PCSTR MenuTitle,
+               PCSTR MenuItemList[],
                ULONG MenuItemCount,
                ULONG DefaultMenuItem,
                LONG MenuTimeOut,
@@ -41,6 +42,7 @@ TuiDisplayMenu(PCSTR MenuItemList[],
     //
     // Setup the MENU_INFO structure
     //
+    MenuInformation.MenuTitle = MenuTitle;
     MenuInformation.MenuItemList = MenuItemList;
     MenuInformation.MenuItemCount = MenuItemCount;
     MenuInformation.MenuTimeRemaining = MenuTimeOut;
@@ -203,7 +205,7 @@ TuiDrawMenu(PUI_MENU_INFO MenuInfo)
     //
     // 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 @@ TuiDrawMenu(PUI_MENU_INFO MenuInfo)
     //
     // 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 @@ VOID
 NTAPI
 TuiDrawMenuBox(PUI_MENU_INFO MenuInfo)
 {
-    CHAR MenuLineText[80];
-    CHAR TempString[80];
+    CHAR MenuLineText[80], TempString[80];
     ULONG i;
 
     //
@@ -237,7 +242,7 @@ TuiDrawMenuBox(PUI_MENU_INFO MenuInfo)
                   D_VERT,
                   D_HORZ,
                   FALSE,        // Filled
-                  TRUE,        // Shadow
+                  TRUE,         // Shadow
                   ATTR(UiMenuFgColor, UiMenuBgColor));
     }
 
@@ -284,7 +289,7 @@ TuiDrawMenuBox(PUI_MENU_INFO MenuInfo)
             // Display under the menu directly
             //
             UiDrawText(0,
-                       MenuInfo->Bottom + 3,
+                       MenuInfo->Bottom + 4,
                        MenuLineText,
                        ATTR(UiMenuFgColor, UiMenuBgColor));
         }
@@ -313,7 +318,7 @@ TuiDrawMenuBox(PUI_MENU_INFO MenuInfo)
         else
         {
             UiDrawText(0,
-                       MenuInfo->Bottom + 3,
+                       MenuInfo->Bottom + 4,
                        MenuLineText,
                        ATTR(UiMenuFgColor, UiMenuBgColor));
         }
index b0f0f12..30e8740 100644 (file)
 
 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 @@ UIVTBL UiVtbl =
 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 @@ BOOLEAN UiInitialize(BOOLEAN ShowGui)
        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 @@ BOOLEAN UiInitialize(BOOLEAN ShowGui)
        MachVideoGetDisplaySize(&UiScreenWidth, &UiScreenHeight, &Depth);
 
        if (VideoTextMode == UiDisplayMode)
-               UiVtbl = UiMinimal ? MiniTuiVtbl : TuiVtbl;
+               UiVtbl = (UiMinimal ? MiniTuiVtbl : TuiVtbl);
        else
                UiVtbl = GuiVtbl;
 
@@ -225,44 +227,6 @@ BOOLEAN UiInitialize(BOOLEAN ShowGui)
        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;
-}
-
 VOID UiUnInitialize(PCSTR BootText)
 {
        UiDrawBackdrop();
@@ -405,7 +369,7 @@ VOID UiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG P
 
 VOID UiShowMessageBoxesInSection(PCSTR SectionName)
 {
-       ULONG           Idx;
+       ULONG   Idx;
        CHAR    SettingName[80];
        CHAR    SettingValue[80];
        PCHAR   MessageBoxText;
@@ -455,7 +419,7 @@ VOID UiShowMessageBoxesInSection(PCSTR SectionName)
 
 VOID UiEscapeString(PCHAR String)
 {
-       ULONG           Idx;
+       ULONG   Idx;
 
        for (Idx=0; Idx<strlen(String); Idx++)
        {
@@ -479,9 +443,9 @@ VOID UiTruncateStringEllipsis(PCHAR StringText, ULONG MaxChars)
        }
 }
 
-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)
 {
-       return UiVtbl.DisplayMenu(MenuItemList, MenuItemCount, DefaultMenuItem, MenuTimeOut, SelectedMenuItem, CanEscape, KeyPressFilter);
+       return UiVtbl.DisplayMenu(MenuTitle, MenuItemList, MenuItemCount, DefaultMenuItem, MenuTimeOut, SelectedMenuItem, CanEscape, KeyPressFilter);
 }
 
 VOID UiFadeInBackdrop(VOID)
@@ -498,4 +462,73 @@ BOOLEAN UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
 {
        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
index 60c218f..ebd1177 100644 (file)
@@ -210,8 +210,8 @@ VOID LoadReactOSSetup(VOID)
 
     TRACE("BootOptions: '%s'\n", BootOptions);
 
-    //SetupUiInitialize();
-    UiDrawStatusText("");
+    SetupUiInitialize();
+    UiDrawStatusText("Setup is loading...");
 
     /* Allocate and minimalistic-initialize LPB */
     AllocateAndInitLPB(&LoaderBlock);
@@ -231,7 +231,7 @@ VOID LoadReactOSSetup(VOID)
     /* Get a list of boot drivers */
     SetupLdrScanBootDrivers(&LoaderBlock->BootDriverListHead, InfHandle, BootPath);
 
-
+    /* Load ReactOS */
     LoadAndBootWindowsCommon(_WIN32_WINNT_WS03,
                              LoaderBlock,
                              BootOptions,