\r
This library class defines a set of interfaces to customize Display module\r
\r
-Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials are licensed and made available under \r
-the terms and conditions of the BSD License that accompanies this distribution. \r
-The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php. \r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
#include "CustomizedDisplayLibInternal.h"\r
**/\r
\r
/**\r
- This funtion defines Page Frame and Backgroud. \r
- \r
- Based on the above layout, it will be responsible for HeaderHeight, FooterHeight, \r
- StatusBarHeight and Backgroud. And, it will reserve Screen for Statement. \r
+ This funtion defines Page Frame and Backgroud.\r
+\r
+ Based on the above layout, it will be responsible for HeaderHeight, FooterHeight,\r
+ StatusBarHeight and Backgroud. And, it will reserve Screen for Statement.\r
\r
@param[in] FormData Form Data to be shown in Page.\r
@param[out] ScreenForStatement Screen to be used for Statement. (Prompt, Value and Help)\r
- \r
+\r
@return Status\r
**/\r
EFI_STATUS\r
This function updates customized key panel's help information.\r
The library will prepare those Strings for the basic key, ESC, Enter, Up/Down/Left/Right, +/-.\r
and arrange them in Footer panel.\r
- \r
- @param[in] FormData Form Data to be shown in Page. FormData has the highlighted statement. \r
+\r
+ @param[in] FormData Form Data to be shown in Page. FormData has the highlighted statement.\r
@param[in] Statement The statement current selected.\r
@param[in] Selected Whether or not a tag be selected. TRUE means Enter has hit this question.\r
**/\r
{\r
UINTN SecCol;\r
UINTN ThdCol;\r
- UINTN LeftColumnOfHelp;\r
UINTN RightColumnOfHelp;\r
UINTN TopRowOfHelp;\r
UINTN BottomRowOfHelp;\r
SecCol = gScreenDimensions.LeftColumn + (gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn) / 3;\r
ThdCol = gScreenDimensions.LeftColumn + (gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn) / 3 * 2;\r
\r
+ //\r
+ // + 2 means leave 1 space before the first hotkey info.\r
+ //\r
StartColumnOfHelp = gScreenDimensions.LeftColumn + 2;\r
- LeftColumnOfHelp = gScreenDimensions.LeftColumn + 1;\r
RightColumnOfHelp = gScreenDimensions.RightColumn - 1;\r
TopRowOfHelp = gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - gFooterHeight + 1;\r
BottomRowOfHelp = gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - 2;\r
ColumnStr2 = gLibEmptyString;\r
ColumnStr3 = gLibEmptyString;\r
\r
+ //\r
+ // Clean the space at gScreenDimensions.LeftColumn + 1.\r
+ //\r
+ PrintStringAtWithWidth (StartColumnOfHelp - 1, BottomRowOfHelp, gLibEmptyString, 1);\r
+ PrintStringAtWithWidth (StartColumnOfHelp - 1, TopRowOfHelp, gLibEmptyString, 1);\r
+\r
if (Statement == NULL) {\r
//\r
// Print Key for Form without showable statement.\r
PrintStringAtWithWidth (StartColumnOfHelp, BottomRowOfHelp, gLibEmptyString, ColumnWidth1);\r
PrintStringAtWithWidth (SecCol, BottomRowOfHelp, gLibEmptyString, ColumnWidth2);\r
PrintStringAtWithWidth (StartColumnOfHelp, TopRowOfHelp, gLibEmptyString, ColumnWidth1);\r
- PrintStringAtWithWidth (ThdCol, BottomRowOfHelp, gEscapeString, ColumnWidth3);\r
+ if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {\r
+ ColumnStr3 = gEscapeString;\r
+ }\r
+ PrintStringAtWithWidth (ThdCol, BottomRowOfHelp, ColumnStr3, ColumnWidth3);\r
\r
return;\r
}\r
} else if (Statement->OpCode->OpCode == EFI_IFR_TIME_OP) {\r
TimeOp = (EFI_IFR_TIME *) Statement->OpCode;\r
HexDisplay = (TimeOp->Flags & EFI_IFR_DISPLAY_UINT_HEX) == EFI_IFR_DISPLAY_UINT_HEX;\r
- } \r
+ }\r
switch (Statement->OpCode->OpCode) {\r
case EFI_IFR_ORDERED_LIST_OP:\r
case EFI_IFR_ONE_OF_OP:\r
if ((Statement->OpCode->OpCode == EFI_IFR_DATE_OP) ||\r
(Statement->OpCode->OpCode == EFI_IFR_TIME_OP)) {\r
PrintAt (\r
- ColumnWidth1, \r
+ ColumnWidth1,\r
StartColumnOfHelp,\r
BottomRowOfHelp,\r
L"%c%c%c%c%s",\r
//\r
// If it is a selected numeric with manual input, display different message\r
//\r
- if ((Statement->OpCode->OpCode == EFI_IFR_NUMERIC_OP) || \r
+ if ((Statement->OpCode->OpCode == EFI_IFR_NUMERIC_OP) ||\r
(Statement->OpCode->OpCode == EFI_IFR_DATE_OP) ||\r
(Statement->OpCode->OpCode == EFI_IFR_TIME_OP)) {\r
ColumnStr2 = HexDisplay ? gHexNumericInput : gDecNumericInput;\r
\r
default:\r
break;\r
- } \r
+ }\r
}\r
\r
/**\r
Update status bar.\r
\r
- This function updates the status bar on the bottom of menu screen. It just shows StatusBar. \r
+ This function updates the status bar on the bottom of menu screen. It just shows StatusBar.\r
Original logic in this function should be splitted out.\r
\r
- @param[in] MessageType The type of message to be shown. InputError or Configuration Changed. \r
+ @param[in] MessageType The type of message to be shown. InputError or Configuration Changed.\r
@param[in] State Show or Clear Message.\r
**/\r
VOID\r
\r
default:\r
break;\r
- } \r
+ }\r
}\r
\r
/**\r
- Create popup window. It will replace CreateDialog(). \r
+ Create popup window. It will replace CreateDialog().\r
\r
This function draws OEM/Vendor specific pop up windows.\r
\r
@param[out] Key User Input Key\r
@param ... String to be shown in Popup. The variable argument list is terminated by a NULL.\r
- \r
+\r
**/\r
VOID\r
EFIAPI\r
VA_START (Marker, Key);\r
while ((String = VA_ARG (Marker, CHAR16 *)) != NULL) {\r
LineNum ++;\r
- \r
+\r
if ((LibGetStringWidth (String) / 2) > LargestString) {\r
LargestString = (LibGetStringWidth (String) / 2);\r
}\r
- } \r
+ }\r
VA_END (Marker);\r
\r
if ((LargestString + 2) > DimensionsWidth) {\r
LargestString = DimensionsWidth - 2;\r
}\r
- \r
+\r
CurrentAttribute = gST->ConOut->Mode->Attribute;\r
CursorVisible = gST->ConOut->Mode->CursorVisible;\r
gST->ConOut->EnableCursor (gST->ConOut, FALSE);\r
}\r
\r
/**\r
- Confirm how to handle the changed data. \r
- \r
+ Confirm how to handle the changed data.\r
+\r
@return Action BROWSER_ACTION_SUBMIT, BROWSER_ACTION_DISCARD or other values.\r
**/\r
UINTN\r
EFI_INPUT_KEY Key;\r
\r
gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);\r
- \r
+\r
YesResponse = gYesResponse[0];\r
NoResponse = gNoResponse[0];\r
- \r
+\r
//\r
// If NV flag is up, prompt user\r
//\r
((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) != (NoResponse | UPPER_LOWER_CASE_OFFSET)) &&\r
((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) != (YesResponse | UPPER_LOWER_CASE_OFFSET))\r
);\r
- \r
+\r
if (Key.ScanCode == SCAN_ESC) {\r
return BROWSER_ACTION_NONE;\r
} else if ((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) == (YesResponse | UPPER_LOWER_CASE_OFFSET)) {\r
/**\r
OEM specifies whether Setup exits Page by ESC key.\r
\r
- This function customized the behavior that whether Setup exits Page so that \r
+ This function customized the behavior that whether Setup exits Page so that\r
system able to boot when configuration is not changed.\r
\r
@retval TRUE Exits FrontPage\r
}\r
\r
/**\r
- Set Timeout value for a ceratain Form to get user response. \r
- \r
+ Set Timeout value for a ceratain Form to get user response.\r
+\r
This function allows to set timeout value on a ceratain form if necessary.\r
- If timeout is not zero, the form will exit if user has no response in timeout. \r
- \r
+ If timeout is not zero, the form will exit if user has no response in timeout.\r
+\r
@param[in] FormData Form Data to be shown in Page\r
\r
- @return 0 No timeout for this form. \r
+ @return 0 No timeout for this form.\r
@return > 0 Timeout value in 100 ns units.\r
**/\r
UINT64\r
}\r
\r
/**\r
- Prints a chracter to the default console, at\r
+ Prints a character to the default console, at\r
the supplied cursor position, using L"%c" format.\r
\r
@param Column The cursor position to print the string at. When it is -1, use current Position.\r
Clear Screen to the initial state.\r
**/\r
VOID\r
-EFIAPI \r
+EFIAPI\r
ClearDisplayPage (\r
VOID\r
)\r
)\r
{\r
HiiRemovePackages(mCDLStringPackHandle);\r
- \r
+\r
FreeLibStrings ();\r
\r
return EFI_SUCCESS;\r