[FREELDR] Some enhancements for the UI code. (#1763)

- EditBox: Display the initial contents of the text buffer.
  This allows modifying already existing text in the passed buffer.

- Menu:
  * Make both MenuHeader and MenuFooter optional (but the latter is
    more "optional" than the former...).

  * Allow passing a user-provided "Context" structure to the key-press
    filter callback, and pass also the index of the menu item that has
    been selected.

- Minor formatting fixes.
This commit is contained in:
Hermès Bélusca-Maïto 2019-08-02 21:35:23 +02:00
parent 268cdf5702
commit 5d5b6a5600
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
13 changed files with 367 additions and 265 deletions

View file

@ -206,7 +206,11 @@ LONG GetTimeOut(VOID)
return TimeOut;
}
BOOLEAN MainBootMenuKeyPressFilter(ULONG KeyPress)
BOOLEAN
MainBootMenuKeyPressFilter(
IN ULONG KeyPress,
IN ULONG SelectedMenuItem,
IN PVOID Context OPTIONAL)
{
if (KeyPress == KEY_F8)
{
@ -309,7 +313,8 @@ VOID RunLoader(VOID)
TimeOut,
&SelectedOperatingSystem,
FALSE,
MainBootMenuKeyPressFilter))
MainBootMenuKeyPressFilter,
OperatingSystemList))
{
UiMessageBox("Press ENTER to reboot.");
goto Reboot;

View file

@ -53,14 +53,14 @@ VOID OptionMenuCustomBoot(VOID)
};
ULONG SelectedMenuItem;
if (!UiDisplayMenu("Please choose a boot method:", "",
if (!UiDisplayMenu("Please choose a boot method:", NULL,
FALSE,
CustomBootMenuList,
sizeof(CustomBootMenuList) / sizeof(CustomBootMenuList[0]),
0, -1,
&SelectedMenuItem,
TRUE,
NULL))
NULL, NULL))
{
/* The user pressed ESC */
return;

View file

@ -105,6 +105,7 @@ typedef struct tagUI_MENU_INFO
ULONG MenuItemCount;
LONG MenuTimeRemaining;
ULONG SelectedMenuItem;
PVOID Context;
ULONG Left;
ULONG Top;
@ -112,9 +113,26 @@ typedef struct tagUI_MENU_INFO
ULONG Bottom;
} UI_MENU_INFO, *PUI_MENU_INFO;
typedef BOOLEAN (*UiMenuKeyPressFilterCallback)(ULONG KeyPress);
typedef
BOOLEAN
(*UiMenuKeyPressFilterCallback)(
IN ULONG KeyPress,
IN ULONG SelectedMenuItem,
IN PVOID Context OPTIONAL);
BOOLEAN UiDisplayMenu(PCSTR MenuHeader, PCSTR MenuFooter, BOOLEAN ShowBootOptions, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter);
BOOLEAN
UiDisplayMenu(
IN PCSTR MenuHeader,
IN PCSTR MenuFooter OPTIONAL,
IN BOOLEAN ShowBootOptions,
IN PCSTR MenuItemList[],
IN ULONG MenuItemCount,
IN ULONG DefaultMenuItem,
IN LONG MenuTimeOut,
OUT PULONG SelectedMenuItem,
IN BOOLEAN CanEscape,
IN UiMenuKeyPressFilterCallback KeyPressFilter OPTIONAL,
IN PVOID Context OPTIONAL);
///////////////////////////////////////////////////////////////////////////////////////
//
@ -145,7 +163,19 @@ typedef struct tagUIVTBL
VOID (*FadeInBackdrop)(VOID);
VOID (*FadeOut)(VOID);
BOOLEAN (*DisplayMenu)(PCSTR MenuHeader, PCSTR MenuFooter, BOOLEAN ShowBootOptions, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter);
BOOLEAN (*DisplayMenu)(
IN PCSTR MenuHeader,
IN PCSTR MenuFooter OPTIONAL,
IN BOOLEAN ShowBootOptions,
IN PCSTR MenuItemList[],
IN ULONG MenuItemCount,
IN ULONG DefaultMenuItem,
IN LONG MenuTimeOut,
OUT PULONG SelectedMenuItem,
IN BOOLEAN CanEscape,
IN UiMenuKeyPressFilterCallback KeyPressFilter OPTIONAL,
IN PVOID Context OPTIONAL);
VOID (*DrawMenu)(PUI_MENU_INFO MenuInfo);
} UIVTBL, *PUIVTBL;

View file

@ -49,6 +49,19 @@ UCHAR GuiTextToFillStyle(PCSTR FillStyleText); // Converts the
// Menu Functions
//
///////////////////////////////////////////////////////////////////////////////////////
BOOLEAN GuiDisplayMenu(PCSTR MenuHeader, PCSTR MenuFooter, BOOLEAN ShowBootOptions, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem);
BOOLEAN
GuiDisplayMenu(
IN PCSTR MenuHeader,
IN PCSTR MenuFooter OPTIONAL,
IN BOOLEAN ShowBootOptions,
IN PCSTR MenuItemList[],
IN ULONG MenuItemCount,
IN ULONG DefaultMenuItem,
IN LONG MenuTimeOut,
OUT PULONG SelectedMenuItem,
IN BOOLEAN CanEscape,
IN UiMenuKeyPressFilterCallback KeyPressFilter OPTIONAL,
IN PVOID Context OPTIONAL);
extern const UIVTBL GuiVtbl;

View file

@ -42,5 +42,18 @@ VOID NoUiFadeOut(VOID);
//
///////////////////////////////////////////////////////////////////////////////////////
BOOLEAN NoUiDisplayMenu(PCSTR MenuHeader, PCSTR MenuFooter, BOOLEAN ShowBootOptions, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter);
BOOLEAN
NoUiDisplayMenu(
IN PCSTR MenuHeader,
IN PCSTR MenuFooter OPTIONAL,
IN BOOLEAN ShowBootOptions,
IN PCSTR MenuItemList[],
IN ULONG MenuItemCount,
IN ULONG DefaultMenuItem,
IN LONG MenuTimeOut,
OUT PULONG SelectedMenuItem,
IN BOOLEAN CanEscape,
IN UiMenuKeyPressFilterCallback KeyPressFilter OPTIONAL,
IN PVOID Context OPTIONAL);
VOID NoUiDrawMenu(PUI_MENU_INFO MenuInfo);

View file

@ -59,12 +59,25 @@ VOID TuiFadeOut(VOID); // Fades the sc
//
///////////////////////////////////////////////////////////////////////////////////////
VOID NTAPI TuiCalcMenuBoxSize(PUI_MENU_INFO MenuInfo);
VOID TuiCalcMenuBoxSize(PUI_MENU_INFO MenuInfo);
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 MenuHeader, PCSTR MenuFooter, BOOLEAN ShowBootOptions, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter);
VOID TuiDrawMenuBox(PUI_MENU_INFO MenuInfo);
VOID TuiDrawMenuItem(PUI_MENU_INFO MenuInfo, ULONG MenuItemNumber);
ULONG TuiProcessMenuKeyboardEvent(PUI_MENU_INFO MenuInfo, UiMenuKeyPressFilterCallback KeyPressFilter);
BOOLEAN
TuiDisplayMenu(
IN PCSTR MenuHeader,
IN PCSTR MenuFooter OPTIONAL,
IN BOOLEAN ShowBootOptions,
IN PCSTR MenuItemList[],
IN ULONG MenuItemCount,
IN ULONG DefaultMenuItem,
IN LONG MenuTimeOut,
OUT PULONG SelectedMenuItem,
IN BOOLEAN CanEscape,
IN UiMenuKeyPressFilterCallback KeyPressFilter OPTIONAL,
IN PVOID Context OPTIONAL);
/* Definitions for corners, depending on HORIZ and VERT */
#define UL (0xda)

View file

@ -91,7 +91,7 @@ VOID DoOptionsMenu(VOID)
ULONG SelectedMenuItem;
CHAR DebugChannelString[100];
if (!UiDisplayMenu("Select an option:", "",
if (!UiDisplayMenu("Select an option:", NULL,
TRUE,
OptionsMenuList,
sizeof(OptionsMenuList) / sizeof(OptionsMenuList[0]),
@ -99,7 +99,7 @@ VOID DoOptionsMenu(VOID)
-1,
&SelectedMenuItem,
TRUE,
NULL))
NULL, NULL))
{
/* The user pressed ESC */
return;

View file

@ -274,7 +274,6 @@ UiTruncateStringEllipsis(IN PCHAR StringText,
}
VOID
NTAPI
UiDrawMenuBox(IN PUI_MENU_INFO MenuInfo)
{
CHAR MenuLineText[80], TempString[80];
@ -338,7 +337,6 @@ UiDrawMenuBox(IN PUI_MENU_INFO MenuInfo)
}
VOID
NTAPI
UiDrawMenuItem(IN PUI_MENU_INFO MenuInfo,
IN ULONG MenuItemNumber)
{
@ -380,10 +378,13 @@ UiDrawMenu(IN PUI_MENU_INFO MenuInfo)
ULONG i;
/* No GUI status bar text, just minimal text. Show the menu header. */
if (MenuInfo->MenuHeader)
{
UiDrawText(0,
MenuInfo->Top - 2,
MenuInfo->MenuHeader,
ATTR(UiMenuFgColor, UiMenuBgColor));
}
/* Now tell the user how to choose */
UiDrawText(0,
@ -396,10 +397,13 @@ UiDrawMenu(IN PUI_MENU_INFO MenuInfo)
ATTR(UiMenuFgColor, UiMenuBgColor));
/* And show the menu footer */
if (MenuInfo->MenuFooter)
{
UiDrawText(0,
UiScreenHeight - 4,
MenuInfo->MenuFooter,
ATTR(UiMenuFgColor, UiMenuBgColor));
}
/* Draw the menu box */
UiDrawMenuBox(MenuInfo);
@ -418,7 +422,6 @@ UiDrawMenu(IN PUI_MENU_INFO MenuInfo)
}
ULONG
NTAPI
UiProcessMenuKeyboardEvent(IN PUI_MENU_INFO MenuInfo,
IN UiMenuKeyPressFilterCallback KeyPressFilter)
{
@ -426,8 +429,9 @@ UiProcessMenuKeyboardEvent(IN PUI_MENU_INFO MenuInfo,
ULONG Selected, Count;
/* Check for a keypress */
if (MachConsKbHit())
{
if (!MachConsKbHit())
return 0; // None, bail out
/* Check if the timeout is not already complete */
if (MenuInfo->MenuTimeRemaining != -1)
{
@ -436,17 +440,17 @@ UiProcessMenuKeyboardEvent(IN PUI_MENU_INFO MenuInfo,
UiDrawMenuBox(MenuInfo);
}
/* Get the key */
/* Get the key (get the extended key if needed) */
KeyEvent = MachConsGetCh();
if (KeyEvent == KEY_EXTENDED)
KeyEvent = MachConsGetCh();
/* Is it extended? Then get the extended key */
if (!KeyEvent) KeyEvent = MachConsGetCh();
/*
* Call the supplied key filter callback function to see
* if it is going to handle this keypress.
*/
if ((KeyPressFilter) && (KeyPressFilter(KeyEvent)))
if (KeyPressFilter &&
KeyPressFilter(KeyEvent, MenuInfo->SelectedMenuItem, MenuInfo->Context))
{
/* It processed the key character, so redraw and exit */
UiDrawMenu(MenuInfo);
@ -508,14 +512,12 @@ UiProcessMenuKeyboardEvent(IN PUI_MENU_INFO MenuInfo,
/* Select new item and update video buffer */
UiDrawMenuItem(MenuInfo, MenuInfo->SelectedMenuItem);
}
}
/* Return the pressed key */
return KeyEvent;
}
VOID
NTAPI
UiCalcMenuBoxSize(IN PUI_MENU_INFO MenuInfo)
{
ULONG i, Width = 0, Height, Length;
@ -548,8 +550,9 @@ UiCalcMenuBoxSize(IN PUI_MENU_INFO MenuInfo)
}
BOOLEAN
UiDisplayMenu(IN PCSTR MenuHeader,
IN PCSTR MenuFooter,
UiDisplayMenu(
IN PCSTR MenuHeader,
IN PCSTR MenuFooter OPTIONAL,
IN BOOLEAN ShowBootOptions,
IN PCSTR MenuItemList[],
IN ULONG MenuItemCount,
@ -557,7 +560,8 @@ UiDisplayMenu(IN PCSTR MenuHeader,
IN LONG MenuTimeOut,
OUT PULONG SelectedMenuItem,
IN BOOLEAN CanEscape,
IN UiMenuKeyPressFilterCallback KeyPressFilter)
IN UiMenuKeyPressFilterCallback KeyPressFilter OPTIONAL,
IN PVOID Context OPTIONAL)
{
UI_MENU_INFO MenuInformation;
ULONG LastClockSecond;
@ -572,17 +576,16 @@ UiDisplayMenu(IN PCSTR MenuHeader,
*/
if (!MenuTimeOut && KeyPressFilter && MachConsKbHit())
{
/* Get the key */
/* Get the key (get the extended key if needed) */
KeyPress = MachConsGetCh();
if (KeyPress == KEY_EXTENDED)
KeyPress = MachConsGetCh();
/* Is it extended? Then get the extended key */
if (!KeyPress) KeyPress = MachConsGetCh();
/*
* Call the supplied key filter callback function to see
* if it is going to handle this keypress.
*/
if (KeyPressFilter(KeyPress))
if (KeyPressFilter(KeyPress, DefaultMenuItem, Context))
{
/* It processed the key character, cancel the timeout */
MenuTimeOut = -1;
@ -605,6 +608,7 @@ UiDisplayMenu(IN PCSTR MenuHeader,
MenuInformation.MenuItemCount = MenuItemCount;
MenuInformation.MenuTimeRemaining = MenuTimeOut;
MenuInformation.SelectedMenuItem = DefaultMenuItem;
MenuInformation.Context = Context;
/* Calculate the size of the menu box */
UiCalcMenuBoxSize(&MenuInformation);
@ -619,8 +623,7 @@ UiDisplayMenu(IN PCSTR MenuHeader,
while (TRUE)
{
/* Process key presses */
KeyPress = UiProcessMenuKeyboardEvent(&MenuInformation,
KeyPressFilter);
KeyPress = UiProcessMenuKeyboardEvent(&MenuInformation, KeyPressFilter);
/* Check for ENTER or ESC */
if (KeyPress == KEY_ENTER) break;

View file

@ -85,10 +85,13 @@ MiniTuiDrawMenu(PUI_MENU_INFO MenuInfo)
//
// No GUI status bar text, just minimal text. Show the menu header.
//
if (MenuInfo->MenuHeader)
{
UiVtbl.DrawText(0,
MenuInfo->Top - 2,
MenuInfo->MenuHeader,
ATTR(UiMenuFgColor, UiMenuBgColor));
}
//
// Now tell the user how to choose
@ -105,10 +108,13 @@ MiniTuiDrawMenu(PUI_MENU_INFO MenuInfo)
//
// And show the menu footer
//
if (MenuInfo->MenuFooter)
{
UiVtbl.DrawText(0,
UiScreenHeight - 4,
MenuInfo->MenuFooter,
ATTR(UiMenuFgColor, UiMenuBgColor));
}
//
// Draw the menu box

View file

@ -113,7 +113,19 @@ VOID NoUiFadeOut(VOID)
//
///////////////////////////////////////////////////////////////////////////////////////
BOOLEAN NoUiDisplayMenu(PCSTR MenuHeader, PCSTR MenuFooter, BOOLEAN ShowBootOptions, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter)
BOOLEAN
NoUiDisplayMenu(
IN PCSTR MenuHeader,
IN PCSTR MenuFooter OPTIONAL,
IN BOOLEAN ShowBootOptions,
IN PCSTR MenuItemList[],
IN ULONG MenuItemCount,
IN ULONG DefaultMenuItem,
IN LONG MenuTimeOut,
OUT PULONG SelectedMenuItem,
IN BOOLEAN CanEscape,
IN UiMenuKeyPressFilterCallback KeyPressFilter OPTIONAL,
IN PVOID Context OPTIONAL)
{
*SelectedMenuItem = DefaultMenuItem;
return TRUE;

View file

@ -631,11 +631,7 @@ VOID TuiMessageBoxCritical(PCSTR MessageText)
if (key == KEY_EXTENDED)
key = MachConsGetCh();
if(key == KEY_ENTER)
break;
else if(key == KEY_SPACE)
break;
else if(key == KEY_ESC)
if ((key == KEY_ENTER) || (key == KEY_SPACE) || (key == KEY_ESC))
break;
}
@ -645,7 +641,6 @@ VOID TuiMessageBoxCritical(PCSTR MessageText)
MachHwIdle();
}
}
VOID TuiDrawProgressBarCenter(ULONG Position, ULONG Range, PCHAR ProgressText)
@ -882,12 +877,16 @@ BOOLEAN TuiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
temp[j++] = MessageText[i];
}
EditBoxTextLength = 0;
EditBoxTextLength = (ULONG)strlen(EditTextBuffer) + 1;
EditBoxTextLength = min(EditBoxTextLength, Length);
EditBoxTextPosition = 0;
EditBoxLine = y2 - 2;
EditBoxStartX = x1 + 3;
EditBoxEndX = x2 - 3;
// Draw the edit box background and the text
UiFillArea(EditBoxStartX, EditBoxLine, EditBoxEndX, EditBoxLine, ' ', ATTR(UiEditBoxTextColor, UiEditBoxBgColor));
UiDrawText2(EditBoxStartX, EditBoxLine, EditBoxEndX - EditBoxStartX + 1, EditTextBuffer, ATTR(UiEditBoxTextColor, UiEditBoxBgColor));
// Show the cursor
EditBoxCursorX = EditBoxStartX;

View file

@ -14,16 +14,18 @@
/* FUNCTIONS *****************************************************************/
BOOLEAN
TuiDisplayMenu(PCSTR MenuHeader,
PCSTR MenuFooter,
BOOLEAN ShowBootOptions,
PCSTR MenuItemList[],
ULONG MenuItemCount,
ULONG DefaultMenuItem,
LONG MenuTimeOut,
ULONG* SelectedMenuItem,
BOOLEAN CanEscape,
UiMenuKeyPressFilterCallback KeyPressFilter)
TuiDisplayMenu(
IN PCSTR MenuHeader,
IN PCSTR MenuFooter OPTIONAL,
IN BOOLEAN ShowBootOptions,
IN PCSTR MenuItemList[],
IN ULONG MenuItemCount,
IN ULONG DefaultMenuItem,
IN LONG MenuTimeOut,
OUT PULONG SelectedMenuItem,
IN BOOLEAN CanEscape,
IN UiMenuKeyPressFilterCallback KeyPressFilter OPTIONAL,
IN PVOID Context OPTIONAL)
{
UI_MENU_INFO MenuInformation;
ULONG LastClockSecond;
@ -39,20 +41,17 @@ TuiDisplayMenu(PCSTR MenuHeader,
if (!MenuTimeOut && KeyPressFilter && MachConsKbHit())
{
//
// Get the key
// Get the key (get the extended key if needed)
//
KeyPress = MachConsGetCh();
//
// Is it extended? Then get the extended key
//
if (!KeyPress) KeyPress = MachConsGetCh();
if (KeyPress == KEY_EXTENDED)
KeyPress = MachConsGetCh();
//
// Call the supplied key filter callback function to see
// if it is going to handle this keypress.
//
if (KeyPressFilter(KeyPress))
if (KeyPressFilter(KeyPress, DefaultMenuItem, Context))
{
//
// It processed the key character, cancel the timeout
@ -83,6 +82,7 @@ TuiDisplayMenu(PCSTR MenuHeader,
MenuInformation.MenuItemCount = MenuItemCount;
MenuInformation.MenuTimeRemaining = MenuTimeOut;
MenuInformation.SelectedMenuItem = DefaultMenuItem;
MenuInformation.Context = Context;
//
// Calculate the size of the menu box
@ -107,8 +107,7 @@ TuiDisplayMenu(PCSTR MenuHeader,
//
// Process key presses
//
KeyPress = TuiProcessMenuKeyboardEvent(&MenuInformation,
KeyPressFilter);
KeyPress = TuiProcessMenuKeyboardEvent(&MenuInformation, KeyPressFilter);
//
// Check for ENTER or ESC
@ -169,7 +168,6 @@ TuiDisplayMenu(PCSTR MenuHeader,
}
VOID
NTAPI
TuiCalcMenuBoxSize(PUI_MENU_INFO MenuInfo)
{
ULONG i;
@ -269,7 +267,6 @@ TuiDrawMenu(PUI_MENU_INFO MenuInfo)
}
VOID
NTAPI
TuiDrawMenuBox(PUI_MENU_INFO MenuInfo)
{
CHAR MenuLineText[80], TempString[80];
@ -395,7 +392,6 @@ TuiDrawMenuBox(PUI_MENU_INFO MenuInfo)
}
VOID
NTAPI
TuiDrawMenuItem(PUI_MENU_INFO MenuInfo,
ULONG MenuItemNumber)
{
@ -477,7 +473,6 @@ TuiDrawMenuItem(PUI_MENU_INFO MenuInfo,
}
ULONG
NTAPI
TuiProcessMenuKeyboardEvent(PUI_MENU_INFO MenuInfo,
UiMenuKeyPressFilterCallback KeyPressFilter)
{
@ -487,8 +482,9 @@ TuiProcessMenuKeyboardEvent(PUI_MENU_INFO MenuInfo,
//
// Check for a keypress
//
if (MachConsKbHit())
{
if (!MachConsKbHit())
return 0; // None, bail out
//
// Check if the timeout is not already complete
//
@ -502,20 +498,18 @@ TuiProcessMenuKeyboardEvent(PUI_MENU_INFO MenuInfo,
}
//
// Get the key
// Get the key (get the extended key if needed)
//
KeyEvent = MachConsGetCh();
//
// Is it extended? Then get the extended key
//
if (!KeyEvent) KeyEvent = MachConsGetCh();
if (KeyEvent == KEY_EXTENDED)
KeyEvent = MachConsGetCh();
//
// Call the supplied key filter callback function to see
// if it is going to handle this keypress.
//
if ((KeyPressFilter) && (KeyPressFilter(KeyEvent)))
if (KeyPressFilter &&
KeyPressFilter(KeyEvent, MenuInfo->SelectedMenuItem, MenuInfo->Context))
{
//
// It processed the key character, so redraw and exit
@ -596,7 +590,6 @@ TuiProcessMenuKeyboardEvent(PUI_MENU_INFO MenuInfo,
TuiDrawMenuItem(MenuInfo, MenuInfo->SelectedMenuItem);
VideoCopyOffScreenBufferToVRAM();
}
}
//
// Return the pressed key

View file

@ -438,7 +438,7 @@ UiShowMessageBoxesInArgv(
ULONG LastIndex;
PCSTR ArgValue;
PCHAR MessageBoxText;
ULONG MessageBoxTextSize;
SIZE_T MessageBoxTextSize;
/* Find all the message box settings and run them */
for (LastIndex = 0;
@ -493,9 +493,24 @@ VOID UiTruncateStringEllipsis(PCHAR StringText, ULONG MaxChars)
}
}
BOOLEAN UiDisplayMenu(PCSTR MenuHeader, PCSTR MenuFooter, BOOLEAN ShowBootOptions, PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter)
BOOLEAN
UiDisplayMenu(
IN PCSTR MenuHeader,
IN PCSTR MenuFooter OPTIONAL,
IN BOOLEAN ShowBootOptions,
IN PCSTR MenuItemList[],
IN ULONG MenuItemCount,
IN ULONG DefaultMenuItem,
IN LONG MenuTimeOut,
OUT PULONG SelectedMenuItem,
IN BOOLEAN CanEscape,
IN UiMenuKeyPressFilterCallback KeyPressFilter OPTIONAL,
IN PVOID Context OPTIONAL)
{
return UiVtbl.DisplayMenu(MenuHeader, MenuFooter, ShowBootOptions, MenuItemList, MenuItemCount, DefaultMenuItem, MenuTimeOut, SelectedMenuItem, CanEscape, KeyPressFilter);
return UiVtbl.DisplayMenu(MenuHeader, MenuFooter, ShowBootOptions,
MenuItemList, MenuItemCount, DefaultMenuItem,
MenuTimeOut, SelectedMenuItem, CanEscape,
KeyPressFilter, Context);
}
VOID UiFadeInBackdrop(VOID)