[FREELDR]

- Menu titles --> Menu headers (see r57842).
- In the same way we introduced menu headers, introduce menu footers, therefore we add the possibility, in mini-tui,
  of showing or hiding the "For troubleshooting and advanced startup options for ReactOS, press F8." message, only
  useful for the main menu (the one which shows the list of available OSes installed on the system).

svn path=/trunk/; revision=58001
This commit is contained in:
Hermès Bélusca-Maïto 2012-12-24 23:03:11 +00:00
parent dcf5487663
commit f8917522e4
12 changed files with 45 additions and 45 deletions

View file

@ -43,7 +43,7 @@ VOID OptionMenuCustomBoot(VOID)
ULONG CustomBootMenuCount = sizeof(CustomBootMenuList) / sizeof(CustomBootMenuList[0]); ULONG CustomBootMenuCount = sizeof(CustomBootMenuList) / sizeof(CustomBootMenuList[0]);
ULONG SelectedMenuItem; ULONG SelectedMenuItem;
if (!UiDisplayMenu("Please choose a boot method:", if (!UiDisplayMenu("Please choose a boot method:", "",
CustomBootMenuList, CustomBootMenuList,
CustomBootMenuCount, CustomBootMenuCount,
0, -1, 0, -1,

View file

@ -266,12 +266,13 @@ VOID RunLoader(VOID)
for (;;) for (;;)
{ {
// Redraw the backdrop // Redraw the backdrop
UiDrawBackdrop(); UiDrawBackdrop();
// Show the operating system list menu // Show the operating system list menu
if (!UiDisplayMenu("Please select the operating system to start:", if (!UiDisplayMenu("Please select the operating system to start:",
"For troubleshooting and advanced startup options for "
"ReactOS, press F8.",
OperatingSystemDisplayNames, OperatingSystemDisplayNames,
OperatingSystemCount, OperatingSystemCount,
DefaultOperatingSystem, DefaultOperatingSystem,

View file

@ -87,12 +87,25 @@ VOID UiFadeOut(VOID); // Fades the screen out
// //
/////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////
struct tagUI_MENU_INFO; typedef struct tagUI_MENU_INFO
typedef struct tagUI_MENU_INFO UI_MENU_INFO, *PUI_MENU_INFO; {
PCSTR MenuHeader;
PCSTR MenuFooter;
PCSTR *MenuItemList;
ULONG MenuItemCount;
LONG MenuTimeRemaining;
ULONG SelectedMenuItem;
ULONG Left;
ULONG Top;
ULONG Right;
ULONG Bottom;
} UI_MENU_INFO, *PUI_MENU_INFO;
typedef BOOLEAN (*UiMenuKeyPressFilterCallback)(ULONG KeyPress); typedef BOOLEAN (*UiMenuKeyPressFilterCallback)(ULONG KeyPress);
BOOLEAN UiDisplayMenu(PCSTR MenuTitle, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter); BOOLEAN UiDisplayMenu(PCSTR MenuHeader, PCSTR MenuFooter, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter);
/////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////
// //
@ -122,7 +135,7 @@ typedef struct tagUIVTBL
VOID (*FadeInBackdrop)(VOID); VOID (*FadeInBackdrop)(VOID);
VOID (*FadeOut)(VOID); VOID (*FadeOut)(VOID);
BOOLEAN (*DisplayMenu)(PCSTR MenuTitle, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter); BOOLEAN (*DisplayMenu)(PCSTR MenuHeader, PCSTR MenuFooter, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter);
VOID (*DrawMenu)(PUI_MENU_INFO MenuInfo); VOID (*DrawMenu)(PUI_MENU_INFO MenuInfo);
} UIVTBL, *PUIVTBL; } UIVTBL, *PUIVTBL;

View file

@ -48,6 +48,6 @@ UCHAR GuiTextToFillStyle(PCSTR FillStyleText); // Converts the text fill into
// Menu Functions // Menu Functions
// //
/////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////
BOOLEAN GuiDisplayMenu(PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem); BOOLEAN GuiDisplayMenu(PCSTR MenuHeader, PCSTR MenuFooter, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem);
extern const UIVTBL GuiVtbl; extern const UIVTBL GuiVtbl;

View file

@ -41,5 +41,5 @@ VOID NoUiFadeOut(VOID);
// //
/////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////
BOOLEAN NoUiDisplayMenu(PCSTR MenuTitle, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter); BOOLEAN NoUiDisplayMenu(PCSTR MenuHeader, PCSTR MenuFooter, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter);
VOID NoUiDrawMenu(PUI_MENU_INFO MenuInfo); VOID NoUiDrawMenu(PUI_MENU_INFO MenuInfo);

View file

@ -58,27 +58,12 @@ VOID TuiFadeOut(VOID); // Fades the screen out
// //
/////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////
struct tagUI_MENU_INFO
{
PCSTR MenuTitle;
PCSTR *MenuItemList;
ULONG MenuItemCount;
LONG MenuTimeRemaining;
ULONG SelectedMenuItem;
ULONG Left;
ULONG Top;
ULONG Right;
ULONG Bottom;
};
VOID NTAPI TuiCalcMenuBoxSize(PUI_MENU_INFO MenuInfo); VOID NTAPI TuiCalcMenuBoxSize(PUI_MENU_INFO MenuInfo);
VOID TuiDrawMenu(PUI_MENU_INFO MenuInfo); VOID TuiDrawMenu(PUI_MENU_INFO MenuInfo);
VOID NTAPI TuiDrawMenuBox(PUI_MENU_INFO MenuInfo); VOID NTAPI TuiDrawMenuBox(PUI_MENU_INFO MenuInfo);
VOID NTAPI TuiDrawMenuItem(PUI_MENU_INFO MenuInfo, ULONG MenuItemNumber); VOID NTAPI TuiDrawMenuItem(PUI_MENU_INFO MenuInfo, ULONG MenuItemNumber);
ULONG NTAPI TuiProcessMenuKeyboardEvent(PUI_MENU_INFO MenuInfo, UiMenuKeyPressFilterCallback KeyPressFilter); ULONG NTAPI TuiProcessMenuKeyboardEvent(PUI_MENU_INFO MenuInfo, UiMenuKeyPressFilterCallback KeyPressFilter);
BOOLEAN TuiDisplayMenu(PCSTR MenuTitle, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter); BOOLEAN TuiDisplayMenu(PCSTR MenuHeader, PCSTR MenuFooter, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter);
/* Definitions for corners, depending on HORIZ and VERT */ /* Definitions for corners, depending on HORIZ and VERT */
#define UL (0xda) #define UL (0xda)

View file

@ -101,7 +101,7 @@ VOID DoOptionsMenu(VOID)
ULONG SelectedMenuItem; ULONG SelectedMenuItem;
CHAR DebugChannelString[100]; CHAR DebugChannelString[100];
if (!UiDisplayMenu("Select an option:", if (!UiDisplayMenu("Select an option:", "",
OptionsMenuList, OptionsMenuList,
OptionsMenuItemCount, OptionsMenuItemCount,
0, -1, 0, -1,

View file

@ -353,13 +353,13 @@ UiDrawMenu(IN PUI_MENU_INFO MenuInfo)
{ {
ULONG i; ULONG i;
/* No GUI status bar text, just minimal text. first to tell the user to choose */ /* No GUI status bar text, just minimal text. Show the menu header. */
UiDrawText(0, UiDrawText(0,
MenuInfo->Top - 2, MenuInfo->Top - 2,
MenuInfo->MenuTitle, MenuInfo->MenuHeader,
ATTR(UiMenuFgColor, UiMenuBgColor)); ATTR(UiMenuFgColor, UiMenuBgColor));
/* Now tell him how to choose */ /* Now tell the user how to choose */
UiDrawText(0, UiDrawText(0,
MenuInfo->Bottom + 1, MenuInfo->Bottom + 1,
"Use \x18 and \x19 to move the highlight to your choice.", "Use \x18 and \x19 to move the highlight to your choice.",
@ -369,11 +369,10 @@ UiDrawMenu(IN PUI_MENU_INFO MenuInfo)
"Press ENTER to choose.", "Press ENTER to choose.",
ATTR(UiMenuFgColor, UiMenuBgColor)); ATTR(UiMenuFgColor, UiMenuBgColor));
/* And offer F8 options */ /* And show the menu footer */
UiDrawText(0, UiDrawText(0,
UiScreenHeight - 4, UiScreenHeight - 4,
"For troubleshooting and advanced startup options for " MenuInfo->MenuFooter,
"ReactOS, press F8.",
ATTR(UiMenuFgColor, UiMenuBgColor)); ATTR(UiMenuFgColor, UiMenuBgColor));
/* Draw the menu box */ /* Draw the menu box */
@ -497,7 +496,8 @@ UiCalcMenuBoxSize(IN PUI_MENU_INFO MenuInfo)
} }
BOOLEAN BOOLEAN
UiDisplayMenu(IN PCSTR MenuTitle, UiDisplayMenu(IN PCSTR MenuHeader,
IN PCSTR MenuFooter,
IN PCSTR MenuItemList[], IN PCSTR MenuItemList[],
IN ULONG MenuItemCount, IN ULONG MenuItemCount,
IN ULONG DefaultMenuItem, IN ULONG DefaultMenuItem,
@ -520,7 +520,8 @@ UiDisplayMenu(IN PCSTR MenuTitle,
} }
/* Setup the MENU_INFO structure */ /* Setup the MENU_INFO structure */
MenuInformation.MenuTitle = MenuTitle; MenuInformation.MenuHeader = MenuHeader;
MenuInformation.MenuFooter = MenuFooter;
MenuInformation.MenuItemList = MenuItemList; MenuInformation.MenuItemList = MenuItemList;
MenuInformation.MenuItemCount = MenuItemCount; MenuInformation.MenuItemCount = MenuItemCount;
MenuInformation.MenuTimeRemaining = MenuTimeOut; MenuInformation.MenuTimeRemaining = MenuTimeOut;

View file

@ -83,16 +83,15 @@ MiniTuiDrawMenu(PUI_MENU_INFO MenuInfo)
UiDrawBackdrop(); UiDrawBackdrop();
// //
// No GUI status bar text, just minimal text. first to tell the user to // No GUI status bar text, just minimal text. Show the menu header.
// choose.
// //
UiVtbl.DrawText(0, UiVtbl.DrawText(0,
MenuInfo->Top - 2, MenuInfo->Top - 2,
MenuInfo->MenuTitle, MenuInfo->MenuHeader,
ATTR(UiMenuFgColor, UiMenuBgColor)); ATTR(UiMenuFgColor, UiMenuBgColor));
// //
// Now tell him how to choose // Now tell the user how to choose
// //
UiVtbl.DrawText(0, UiVtbl.DrawText(0,
MenuInfo->Bottom + 1, MenuInfo->Bottom + 1,
@ -104,12 +103,11 @@ MiniTuiDrawMenu(PUI_MENU_INFO MenuInfo)
ATTR(UiMenuFgColor, UiMenuBgColor)); ATTR(UiMenuFgColor, UiMenuBgColor));
// //
// And offer F8 options // And show the menu footer
// //
UiVtbl.DrawText(0, UiVtbl.DrawText(0,
UiScreenHeight - 4, UiScreenHeight - 4,
"For troubleshooting and advanced startup options for " MenuInfo->MenuFooter,
"ReactOS, press F8.",
ATTR(UiMenuFgColor, UiMenuBgColor)); ATTR(UiMenuFgColor, UiMenuBgColor));
// //

View file

@ -109,7 +109,7 @@ VOID NoUiFadeOut(VOID)
// //
/////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////
BOOLEAN NoUiDisplayMenu(PCSTR MenuTitle, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter) BOOLEAN NoUiDisplayMenu(PCSTR MenuHeader, PCSTR MenuFooter, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter)
{ {
*SelectedMenuItem = DefaultMenuItem; *SelectedMenuItem = DefaultMenuItem;
return TRUE; return TRUE;

View file

@ -14,7 +14,8 @@
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
BOOLEAN BOOLEAN
TuiDisplayMenu(PCSTR MenuTitle, TuiDisplayMenu(PCSTR MenuHeader,
PCSTR MenuFooter,
PCSTR MenuItemList[], PCSTR MenuItemList[],
ULONG MenuItemCount, ULONG MenuItemCount,
ULONG DefaultMenuItem, ULONG DefaultMenuItem,
@ -42,7 +43,8 @@ TuiDisplayMenu(PCSTR MenuTitle,
// //
// Setup the MENU_INFO structure // Setup the MENU_INFO structure
// //
MenuInformation.MenuTitle = MenuTitle; MenuInformation.MenuHeader = MenuHeader;
MenuInformation.MenuFooter = MenuFooter;
MenuInformation.MenuItemList = MenuItemList; MenuInformation.MenuItemList = MenuItemList;
MenuInformation.MenuItemCount = MenuItemCount; MenuInformation.MenuItemCount = MenuItemCount;
MenuInformation.MenuTimeRemaining = MenuTimeOut; MenuInformation.MenuTimeRemaining = MenuTimeOut;

View file

@ -442,9 +442,9 @@ VOID UiTruncateStringEllipsis(PCHAR StringText, ULONG MaxChars)
} }
} }
BOOLEAN UiDisplayMenu(PCSTR MenuTitle, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter) BOOLEAN UiDisplayMenu(PCSTR MenuHeader, PCSTR MenuFooter, 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); return UiVtbl.DisplayMenu(MenuHeader, MenuFooter, MenuItemList, MenuItemCount, DefaultMenuItem, MenuTimeOut, SelectedMenuItem, CanEscape, KeyPressFilter);
} }
VOID UiFadeInBackdrop(VOID) VOID UiFadeInBackdrop(VOID)