X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FDisplayEngineDxe%2FFormDisplay.c;h=203b6b5138344ddeda6e0f704bd9709c3c5eb528;hb=c8d54a6d8dd259a28d02bf95ed7e48efb251e414;hp=e2c6b292255aebadad5918feda84fe7d57863839;hpb=ab369468265cd29a90b385a6e950eda3da16636d;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c index e2c6b29225..203b6b5138 100644 --- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c +++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c @@ -1,7 +1,7 @@ /** @file Entry and initialization module for the browser. -Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -699,6 +699,13 @@ ConvertStatementToMenu ( NestStatement = FORM_DISPLAY_ENGINE_STATEMENT_FROM_LINK (NestLink); NestLink = GetNextNode (&Statement->NestStatementList, NestLink); + // + // Skip the opcode not recognized by Display core. + // + if (NestStatement->OpCode->OpCode == EFI_IFR_GUID_OP) { + continue; + } + UiAddMenuOption (NestStatement, &MenuItemCount, TRUE); } } @@ -1531,6 +1538,7 @@ FindTopMenu ( } else { *TopOfScreen = FindTopOfScreenMenu(NewPos, BottomRow - TopRow - SavedMenuOption->Skip, &TmpValue); } + AdjustDateAndTimePosition(TRUE, TopOfScreen); *SkipValue = TmpValue; } @@ -1713,6 +1721,7 @@ HasOptionString ( @param SkipLine The skip line for this menu. @param BottomRow The bottom row for this form. @param Highlight Whether this menu will be highlight. + @param UpdateCol Whether need to update the column info for Date/Time. @retval EFI_SUCESSS Process the user selection success. @@ -1724,7 +1733,8 @@ DisplayOneMenu ( IN UINTN BeginCol, IN UINTN SkipLine, IN UINTN BottomRow, - IN BOOLEAN Highlight + IN BOOLEAN Highlight, + IN BOOLEAN UpdateCol ) { FORM_DISPLAY_ENGINE_STATEMENT *Statement; @@ -1773,7 +1783,7 @@ DisplayOneMenu ( // // Adjust option string for date/time opcode. // - ProcessStringForDateTime(MenuOption, OptionString, TRUE); + ProcessStringForDateTime(MenuOption, OptionString, UpdateCol); } Width = (UINT16) gOptionBlockWidth - 1; @@ -1798,8 +1808,9 @@ DisplayOneMenu ( } else { // // For date/ time, print the first and second past (year for date and second for time) - // - DisplayMenuString (MenuOption, MenuOption->OptCol, Row, OutputString, StrLen (OutputString), Highlight); + // The OutputString has a NARROW_CHAR or WIDE_CHAR at the begin of the string, + // so need to - 1 to remove it, otherwise, it will clean 1 extr char follow it. + DisplayMenuString (MenuOption, MenuOption->OptCol, Row, OutputString, StrLen (OutputString) - 1, Highlight); } } else { DisplayMenuString (MenuOption, MenuOption->OptCol, Row, OutputString, Width + 1, Highlight); @@ -2160,7 +2171,8 @@ UiDisplayMenu ( gStatementDimensions.LeftColumn + gModalSkipColumn, Link == TopOfScreen ? SkipValue : 0, BottomRow, - (BOOLEAN) ((Link == NewPos) && IsSelectable(MenuOption)) + (BOOLEAN) ((Link == NewPos) && IsSelectable(MenuOption)), + TRUE ); } else { Status = DisplayOneMenu (MenuOption, @@ -2168,8 +2180,9 @@ UiDisplayMenu ( gStatementDimensions.LeftColumn, Link == TopOfScreen ? SkipValue : 0, BottomRow, - (BOOLEAN) ((Link == NewPos) && IsSelectable(MenuOption)) - ); + (BOOLEAN) ((Link == NewPos) && IsSelectable(MenuOption)), + TRUE + ); } if (EFI_ERROR (Status)) { @@ -2272,6 +2285,7 @@ UiDisplayMenu ( gStatementDimensions.LeftColumn, Temp, BottomRow, + FALSE, FALSE ); } @@ -2293,7 +2307,8 @@ UiDisplayMenu ( gStatementDimensions.LeftColumn, Temp2, BottomRow, - TRUE + TRUE, + FALSE ); } break; @@ -2548,12 +2563,12 @@ UiDisplayMenu ( // If the screen has no menu items, and the user didn't select UiReset // ignore the selection and go back to reading keys. // + ASSERT(MenuOption != NULL); if(IsListEmpty (&gMenuOption) || MenuOption->GrayOut || MenuOption->ReadOnly) { ControlFlag = CfReadKey; break; } - ASSERT(MenuOption != NULL); Statement = MenuOption->ThisTag; if ((Statement->OpCode->OpCode == EFI_IFR_DATE_OP) || (Statement->OpCode->OpCode == EFI_IFR_TIME_OP) @@ -2736,7 +2751,8 @@ UiDisplayMenu ( case CfUiHotKey: ControlFlag = CfRepaint; - + + ASSERT (HotKey != NULL); gUserInput->Action = HotKey->Action; ControlFlag = CfExit; break; @@ -2774,16 +2790,16 @@ UiDisplayMenu ( NewLine = TRUE; SavedListEntry = NewPos; - ASSERT(NewPos != NULL); + + MenuOption = MENU_OPTION_FROM_LINK (NewPos); + ASSERT (MenuOption != NULL); + // // Adjust Date/Time position before we advance forward. // AdjustDateAndTimePosition (TRUE, &NewPos); - MenuOption = MENU_OPTION_FROM_LINK (NewPos); - ASSERT (MenuOption != NULL); - NewPos = NewPos->BackLink; // // Find next selectable menu or the first menu beyond current form. @@ -2855,7 +2871,7 @@ UiDisplayMenu ( // // First minus the menu of the top screen, it's value is SkipValue. // - if (SkipValue >= (INTN) (BottomRow - TopRow + 1)) { + if (SkipValue >= BottomRow - TopRow + 1) { // // SkipValue > (BottomRow - TopRow + 1) means current menu has more than one // form of options to be show, so just update the SkipValue to show the next