Do the following enhancement for SetupBrowser:

1. Support Scroll up and down. When hit the top, the last page will be showed. When hit the bottom, the first page will be showed. 
  2. Show forms page by page based on the option (including unselected and selected). 
  3. Add PCD to configure whether TEXT statement is set to Grayout option. 


 



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11355 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4 2011-03-08 06:55:15 +00:00
parent 81da6ef925
commit 11232773ac
4 changed files with 227 additions and 161 deletions

View File

@ -302,6 +302,11 @@
# If FALSE, then unaligned I/O, MMIO, and PCI Configuration cycles through the PCI I/O Protocol are disabled. # If FALSE, then unaligned I/O, MMIO, and PCI Configuration cycles through the PCI I/O Protocol are disabled.
# The default value for this PCD is to disable support for unaligned PCI I/O Protocol requests. # The default value for this PCD is to disable support for unaligned PCI I/O Protocol requests.
gEfiMdeModulePkgTokenSpaceGuid.PcdUnalignedPciIoEnable|FALSE|BOOLEAN|0x0001003e gEfiMdeModulePkgTokenSpaceGuid.PcdUnalignedPciIoEnable|FALSE|BOOLEAN|0x0001003e
## This PCD specifies whether TEXT statement is always set to GrayOut statement in HII Form Browser.
# If TRUE, TEXT statement will always be set to GrayOut.
# If FALSE, TEXT statement will be set to GrayOut only when GrayOut condition is TRUE.
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserGrayOutTextStatement|FALSE|BOOLEAN|0x0001004f
[PcdsFeatureFlag.IA32, PcdsFeatureFlag.X64] [PcdsFeatureFlag.IA32, PcdsFeatureFlag.X64]
## ##

View File

@ -1,7 +1,7 @@
/** @file /** @file
Utility functions for UI presentation. Utility functions for UI presentation.
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR> Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -773,6 +773,7 @@ UpdateKeyHelp (
case EFI_IFR_TEXT_OP: case EFI_IFR_TEXT_OP:
case EFI_IFR_ACTION_OP: case EFI_IFR_ACTION_OP:
case EFI_IFR_RESET_BUTTON_OP: case EFI_IFR_RESET_BUTTON_OP:
case EFI_IFR_SUBTITLE_OP:
ClearLines (LeftColumnOfHelp, RightColumnOfHelp, TopRowOfHelp, BottomRowOfHelp, KEYHELP_TEXT | KEYHELP_BACKGROUND); ClearLines (LeftColumnOfHelp, RightColumnOfHelp, TopRowOfHelp, BottomRowOfHelp, KEYHELP_TEXT | KEYHELP_BACKGROUND);
if (!Selected) { if (!Selected) {
@ -785,7 +786,7 @@ UpdateKeyHelp (
} }
PrintAt (StartColumnOfHelp, BottomRowOfHelp, L"%c%c%s", ARROW_UP, ARROW_DOWN, gMoveHighlight); PrintAt (StartColumnOfHelp, BottomRowOfHelp, L"%c%c%s", ARROW_UP, ARROW_DOWN, gMoveHighlight);
if (Statement->Operand != EFI_IFR_TEXT_OP) { if (Statement->Operand != EFI_IFR_TEXT_OP && Statement->Operand != EFI_IFR_SUBTITLE_OP) {
PrintStringAt (SecCol, BottomRowOfHelp, gEnterString); PrintStringAt (SecCol, BottomRowOfHelp, gEnterString);
} }
} else { } else {

View File

@ -76,6 +76,7 @@
[FeaturePcd] [FeaturePcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserGrayOutTextStatement ## CONSUMES
[Pcd] [Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor ## CONSUMES

View File

@ -622,6 +622,15 @@ UiAddMenuOption (
MenuOption->IsQuestion = TRUE; MenuOption->IsQuestion = TRUE;
break; break;
case EFI_IFR_TEXT_OP:
if (FeaturePcdGet (PcdBrowserGrayOutTextStatement)) {
//
// Initializing GrayOut option as TRUE for Text setup options
// so that those options will be Gray in colour and un selectable.
//
MenuOption->GrayOut = TRUE;
}
default: default:
MenuOption->IsQuestion = FALSE; MenuOption->IsQuestion = FALSE;
break; break;
@ -1338,7 +1347,6 @@ ValueIsScroll (
) )
{ {
LIST_ENTRY *Temp; LIST_ENTRY *Temp;
UI_MENU_OPTION *MenuOption;
Temp = Direction ? CurrentPos->BackLink : CurrentPos->ForwardLink; Temp = Direction ? CurrentPos->BackLink : CurrentPos->ForwardLink;
@ -1346,14 +1354,7 @@ ValueIsScroll (
return TRUE; return TRUE;
} }
for (; Temp != &gMenuOption; Temp = Direction ? Temp->BackLink : Temp->ForwardLink) { return FALSE;
MenuOption = MENU_OPTION_FROM_LINK (Temp);
if (IsSelectable (MenuOption)) {
return FALSE;
}
}
return TRUE;
} }
@ -1364,6 +1365,7 @@ ValueIsScroll (
@param GoUp The navigation direction. TRUE: up, FALSE: down. @param GoUp The navigation direction. TRUE: up, FALSE: down.
@param CurrentPosition Current position. @param CurrentPosition Current position.
@param GapToTop Gap position to top or bottom.
@return The row distance from current MenuOption to next selectable MenuOption. @return The row distance from current MenuOption to next selectable MenuOption.
@ -1371,51 +1373,54 @@ ValueIsScroll (
INTN INTN
MoveToNextStatement ( MoveToNextStatement (
IN BOOLEAN GoUp, IN BOOLEAN GoUp,
IN OUT LIST_ENTRY **CurrentPosition IN OUT LIST_ENTRY **CurrentPosition,
IN UINTN GapToTop
) )
{ {
INTN Distance; INTN Distance;
LIST_ENTRY *Pos; LIST_ENTRY *Pos;
BOOLEAN HitEnd;
UI_MENU_OPTION *NextMenuOption; UI_MENU_OPTION *NextMenuOption;
UI_MENU_OPTION *PreMenuOption;
Distance = 0; Distance = 0;
Pos = *CurrentPosition; Pos = *CurrentPosition;
HitEnd = FALSE; PreMenuOption = MENU_OPTION_FROM_LINK (Pos);
while (TRUE) { while (TRUE) {
NextMenuOption = MENU_OPTION_FROM_LINK (Pos); NextMenuOption = MENU_OPTION_FROM_LINK (Pos);
if (GoUp && (PreMenuOption != NextMenuOption)) {
//
// Current Position doesn't need to be caculated when go up.
// Caculate distanct at first when go up
//
if ((UINTN) Distance + NextMenuOption->Skip > GapToTop) {
NextMenuOption = PreMenuOption;
break;
}
Distance += NextMenuOption->Skip;
}
if (IsSelectable (NextMenuOption)) { if (IsSelectable (NextMenuOption)) {
break; break;
} }
if ((GoUp ? Pos->BackLink : Pos->ForwardLink) == &gMenuOption) { if ((GoUp ? Pos->BackLink : Pos->ForwardLink) == &gMenuOption) {
HitEnd = TRUE; //
// Arrive at top.
//
Distance = -1;
break; break;
} }
Distance += NextMenuOption->Skip; if (!GoUp) {
Pos = (GoUp ? Pos->BackLink : Pos->ForwardLink); //
} // Caculate distanct at later when go down
//
if (HitEnd) { if ((UINTN) Distance + NextMenuOption->Skip > GapToTop) {
// NextMenuOption = PreMenuOption;
// If we hit end there is still no statement can be focused,
// we go backwards to find the statement can be focused.
//
Distance = 0;
Pos = *CurrentPosition;
while (TRUE) {
NextMenuOption = MENU_OPTION_FROM_LINK (Pos);
if (IsSelectable (NextMenuOption)) {
break; break;
} }
if ((!GoUp ? Pos->BackLink : Pos->ForwardLink) == &gMenuOption) { Distance += NextMenuOption->Skip;
ASSERT (FALSE);
break;
}
Distance -= NextMenuOption->Skip;
Pos = (!GoUp ? Pos->BackLink : Pos->ForwardLink);
} }
PreMenuOption = NextMenuOption;
Pos = (GoUp ? Pos->BackLink : Pos->ForwardLink);
} }
*CurrentPosition = &NextMenuOption->Link; *CurrentPosition = &NextMenuOption->Link;
@ -1634,6 +1639,7 @@ UiDisplayMenu (
BOOLEAN SavedValue; BOOLEAN SavedValue;
BOOLEAN UpArrow; BOOLEAN UpArrow;
BOOLEAN DownArrow; BOOLEAN DownArrow;
BOOLEAN InitializedFlag;
EFI_STATUS Status; EFI_STATUS Status;
EFI_INPUT_KEY Key; EFI_INPUT_KEY Key;
LIST_ENTRY *Link; LIST_ENTRY *Link;
@ -1725,8 +1731,9 @@ UiDisplayMenu (
} }
// //
// Get user's selection // Init option as the current user's selection
// //
InitializedFlag = TRUE;
NewPos = gMenuOption.ForwardLink; NewPos = gMenuOption.ForwardLink;
gST->ConOut->EnableCursor (gST->ConOut, FALSE); gST->ConOut->EnableCursor (gST->ConOut, FALSE);
@ -1799,8 +1806,7 @@ UiDisplayMenu (
Width = GetWidth (Statement, MenuOption->Handle); Width = GetWidth (Statement, MenuOption->Handle);
OriginalRow = Row; OriginalRow = Row;
if (Statement->Operand == EFI_IFR_REF_OP && if (Statement->Operand == EFI_IFR_REF_OP && MenuOption->Col >= 2) {
MenuOption->Col >= 2) {
// //
// Print Arrow for Goto button. // Print Arrow for Goto button.
// //
@ -2048,6 +2054,10 @@ UiDisplayMenu (
// NewPos: Current menu option that need to hilight // NewPos: Current menu option that need to hilight
// //
ControlFlag = CfUpdateHelpString; ControlFlag = CfUpdateHelpString;
if (InitializedFlag) {
InitializedFlag = FALSE;
MoveToNextStatement (FALSE, &NewPos, BottomRow - TopRow);
}
// //
// Repaint flag is normally reset when finish processing CfUpdateHelpString. Temporarily // Repaint flag is normally reset when finish processing CfUpdateHelpString. Temporarily
@ -2181,22 +2191,17 @@ UiDisplayMenu (
} }
// //
// This is only possible if we entered this page and the first menu option is // This is the current selected statement
// a "non-menu" item. In that case, force it UiDown
// //
MenuOption = MENU_OPTION_FROM_LINK (NewPos); MenuOption = MENU_OPTION_FROM_LINK (NewPos);
Statement = MenuOption->ThisTag;
Selection->Statement = Statement;
if (!IsSelectable (MenuOption)) { if (!IsSelectable (MenuOption)) {
ASSERT (ScreenOperation == UiNoOperation); Repaint = SavedValue;
ScreenOperation = UiDown; UpdateKeyHelp (Selection, MenuOption, FALSE);
ControlFlag = CfScreenOperation;
break; break;
} }
//
// This is the current selected statement
//
Statement = MenuOption->ThisTag;
Selection->Statement = Statement;
// //
// Record highlight for current menu // Record highlight for current menu
// //
@ -2305,12 +2310,12 @@ UiDisplayMenu (
case CfUpdateHelpString: case CfUpdateHelpString:
ControlFlag = CfPrepareToReadKey; ControlFlag = CfPrepareToReadKey;
if (Repaint || NewLine) { if (Repaint || NewLine) {
// //
// Don't print anything if it is a NULL help token // Don't print anything if it is a NULL help token
// //
ASSERT(MenuOption != NULL); ASSERT(MenuOption != NULL);
if (MenuOption->ThisTag->Help == 0) { if (MenuOption->ThisTag->Help == 0 || !IsSelectable (MenuOption)) {
StringPtr = L"\0"; StringPtr = L"\0";
} else { } else {
StringPtr = GetToken (MenuOption->ThisTag->Help, MenuOption->Handle); StringPtr = GetToken (MenuOption->ThisTag->Help, MenuOption->Handle);
@ -2484,20 +2489,6 @@ UiDisplayMenu (
ControlFlag = CfReadKey; ControlFlag = CfReadKey;
break; break;
} }
//
// if there is nothing logical to place a cursor on, just move on to wait for a key.
//
for (Link = gMenuOption.ForwardLink; Link != &gMenuOption; Link = Link->ForwardLink) {
NextMenuOption = MENU_OPTION_FROM_LINK (Link);
if (IsSelectable (NextMenuOption)) {
break;
}
}
if (Link == &gMenuOption) {
ControlFlag = CfPrepareToReadKey;
break;
}
} }
for (Index = 0; for (Index = 0;
@ -2808,47 +2799,47 @@ UiDisplayMenu (
case CfUiUp: case CfUiUp:
ControlFlag = CfCheckSelection; ControlFlag = CfCheckSelection;
SavedListEntry = TopOfScreen; SavedListEntry = NewPos;
ASSERT(NewPos != NULL); ASSERT(NewPos != NULL);
//
// Adjust Date/Time position before we advance forward.
//
AdjustDateAndTimePosition (TRUE, &NewPos);
if (NewPos->BackLink != &gMenuOption) { if (NewPos->BackLink != &gMenuOption) {
NewLine = TRUE; MenuOption = MENU_OPTION_FROM_LINK (NewPos);
// NewLine = TRUE;
// Adjust Date/Time position before we advance forward. NewPos = NewPos->BackLink;
//
AdjustDateAndTimePosition (TRUE, &NewPos);
//
// Caution that we have already rewind to the top, don't go backward in this situation.
//
if (NewPos->BackLink != &gMenuOption) {
NewPos = NewPos->BackLink;
}
Difference = MoveToNextStatement (TRUE, &NewPos);
PreviousMenuOption = MENU_OPTION_FROM_LINK (NewPos); PreviousMenuOption = MENU_OPTION_FROM_LINK (NewPos);
DistanceValue = PreviousMenuOption->Skip; DistanceValue = PreviousMenuOption->Skip;
Difference = 0;
// if (MenuOption->Row >= DistanceValue + TopRow) {
// Since the behavior of hitting the up arrow on a Date/Time op-code is intended Difference = MoveToNextStatement (TRUE, &NewPos, MenuOption->Row - TopRow - DistanceValue);
// to be one that back to the previous set of op-codes, we need to advance to the sencond }
// Date/Time op-code and leave the remaining logic in UiDown intact so the appropriate NextMenuOption = MENU_OPTION_FROM_LINK (NewPos);
// checking can be done.
//
DistanceValue += AdjustDateAndTimePosition (TRUE, &NewPos);
ASSERT (MenuOption != NULL); ASSERT (MenuOption != NULL);
if (Difference < 0) { if (Difference < 0) {
// //
// We want to goto previous MenuOption, but finally we go down. // We hit the begining MenuOption that can be focused
// it means that we hit the begining MenuOption that can be focused // so we simply scroll to the top.
// so we simply scroll to the top
// //
if (SavedListEntry != gMenuOption.ForwardLink) { if (TopOfScreen != gMenuOption.ForwardLink) {
TopOfScreen = gMenuOption.ForwardLink; TopOfScreen = gMenuOption.ForwardLink;
Repaint = TRUE; Repaint = TRUE;
} else {
//
// Scroll up to the last page when we have arrived at top page.
//
NewPos = &gMenuOption;
TopOfScreen = &gMenuOption;
MenuOption = MENU_OPTION_FROM_LINK (SavedListEntry);
ScreenOperation = UiPageUp;
ControlFlag = CfScreenOperation;
break;
} }
} else if ((INTN) MenuOption->Row - (INTN) DistanceValue - Difference < (INTN) TopRow) { } else if (MenuOption->Row < TopRow + DistanceValue + Difference) {
// //
// Previous focus MenuOption is above the TopOfScreen, so we need to scroll // Previous focus MenuOption is above the TopOfScreen, so we need to scroll
// //
@ -2856,27 +2847,30 @@ UiDisplayMenu (
Repaint = TRUE; Repaint = TRUE;
SkipValue = 0; SkipValue = 0;
OldSkipValue = 0; OldSkipValue = 0;
} else if (!IsSelectable (NextMenuOption)) {
//
// Continue to go up until scroll to next page or the selectable option is found.
//
ScreenOperation = UiUp;
ControlFlag = CfScreenOperation;
} }
// //
// If we encounter a Date/Time op-code set, rewind to the first op-code of the set. // If we encounter a Date/Time op-code set, rewind to the first op-code of the set.
// //
AdjustDateAndTimePosition (TRUE, &TopOfScreen); AdjustDateAndTimePosition (TRUE, &TopOfScreen);
AdjustDateAndTimePosition (TRUE, &NewPos);
MenuOption = MENU_OPTION_FROM_LINK (SavedListEntry);
UpdateStatusBar (INPUT_ERROR, MenuOption->ThisTag->QuestionFlags, FALSE); UpdateStatusBar (INPUT_ERROR, MenuOption->ThisTag->QuestionFlags, FALSE);
} else { } else {
SavedMenuOption = MenuOption; //
MenuOption = MENU_OPTION_FROM_LINK (NewPos); // Scroll up to the last page.
if (!IsSelectable (MenuOption)) { //
// NewPos = &gMenuOption;
// If we are at the end of the list and sitting on a text op, we need to more forward TopOfScreen = &gMenuOption;
// MenuOption = MENU_OPTION_FROM_LINK (SavedListEntry);
ScreenOperation = UiDown; ScreenOperation = UiPageUp;
ControlFlag = CfScreenOperation; ControlFlag = CfScreenOperation;
break;
}
MenuOption = SavedMenuOption;
} }
break; break;
@ -2893,38 +2887,59 @@ UiDisplayMenu (
NewLine = TRUE; NewLine = TRUE;
Repaint = TRUE; Repaint = TRUE;
Link = TopOfScreen; Link = TopOfScreen;
PreviousMenuOption = MENU_OPTION_FROM_LINK (Link); Index = BottomRow;
Index = BottomRow;
while ((Index >= TopRow) && (Link->BackLink != &gMenuOption)) { while ((Index >= TopRow) && (Link->BackLink != &gMenuOption)) {
Index = Index - PreviousMenuOption->Skip;
Link = Link->BackLink; Link = Link->BackLink;
PreviousMenuOption = MENU_OPTION_FROM_LINK (Link); PreviousMenuOption = MENU_OPTION_FROM_LINK (Link);
if (Index < PreviousMenuOption->Skip) {
Index = 0;
break;
}
Index = Index - PreviousMenuOption->Skip;
} }
if ((Link->BackLink == &gMenuOption) && (Index >= TopRow)) {
if (TopOfScreen == &gMenuOption) {
TopOfScreen = gMenuOption.ForwardLink;
NewPos = gMenuOption.BackLink;
MoveToNextStatement (TRUE, &NewPos, BottomRow - TopRow);
Repaint = FALSE;
} else if (TopOfScreen != Link) {
TopOfScreen = Link;
NewPos = Link;
MoveToNextStatement (FALSE, &NewPos, BottomRow - TopRow);
} else {
//
// Finally we know that NewPos is the last MenuOption can be focused.
//
Repaint = FALSE;
NewPos = Link;
MoveToNextStatement (FALSE, &NewPos, BottomRow - TopRow);
}
} else {
if (Index + 1 < TopRow) {
//
// Back up the previous option.
//
Link = Link->ForwardLink;
}
TopOfScreen = Link;
Difference = MoveToNextStatement (TRUE, &Link);
if (Difference > 0) {
// //
// The focus MenuOption is above the TopOfScreen // Move to the option in Next page.
//
if (TopOfScreen == &gMenuOption) {
NewPos = gMenuOption.BackLink;
MoveToNextStatement (TRUE, &NewPos, BottomRow - TopRow);
} else {
NewPos = Link;
MoveToNextStatement (FALSE, &NewPos, BottomRow - TopRow);
}
//
// There are more MenuOption needing scrolling up.
// //
TopOfScreen = Link; TopOfScreen = Link;
} else if (Difference < 0) { MenuOption = NULL;
//
// This happens when there is no MenuOption can be focused from
// Current MenuOption to the first MenuOption
//
TopOfScreen = gMenuOption.ForwardLink;
}
Index += Difference;
if (Index < TopRow) {
MenuOption = NULL;
}
if (NewPos == Link) {
Repaint = FALSE;
NewLine = FALSE;
} else {
NewPos = Link;
} }
// //
@ -2956,28 +2971,35 @@ UiDisplayMenu (
NextMenuOption = MENU_OPTION_FROM_LINK (Link); NextMenuOption = MENU_OPTION_FROM_LINK (Link);
} }
Index += MoveToNextStatement (FALSE, &Link); if ((Link->ForwardLink == &gMenuOption) && (Index <= BottomRow)) {
if (Index > BottomRow) {
//
// There are more MenuOption needing scrolling
//
TopOfScreen = Link;
MenuOption = NULL;
}
if (NewPos == Link && Index <= BottomRow) {
// //
// Finally we know that NewPos is the last MenuOption can be focused. // Finally we know that NewPos is the last MenuOption can be focused.
// //
NewLine = FALSE;
Repaint = FALSE; Repaint = FALSE;
MoveToNextStatement (TRUE, &Link, Index - TopRow);
} else { } else {
NewPos = Link; if (Index - 1 > BottomRow) {
//
// Back up the previous option.
//
Link = Link->BackLink;
}
//
// There are more MenuOption needing scrolling down.
//
TopOfScreen = Link;
MenuOption = NULL;
//
// Move to the option in Next page.
//
MoveToNextStatement (FALSE, &Link, BottomRow - TopRow);
} }
// //
// If we encounter a Date/Time op-code set, rewind to the first op-code of the set. // If we encounter a Date/Time op-code set, rewind to the first op-code of the set.
// Don't do this when we are already in the last page. // Don't do this when we are already in the last page.
// //
NewPos = Link;
AdjustDateAndTimePosition (TRUE, &TopOfScreen); AdjustDateAndTimePosition (TRUE, &TopOfScreen);
AdjustDateAndTimePosition (TRUE, &NewPos); AdjustDateAndTimePosition (TRUE, &NewPos);
break; break;
@ -2993,21 +3015,49 @@ UiDisplayMenu (
// the Date/Time op-code. // the Date/Time op-code.
// //
SavedListEntry = NewPos; SavedListEntry = NewPos;
DistanceValue = AdjustDateAndTimePosition (FALSE, &NewPos); AdjustDateAndTimePosition (FALSE, &NewPos);
if (NewPos->ForwardLink != &gMenuOption) { if (NewPos->ForwardLink != &gMenuOption) {
MenuOption = MENU_OPTION_FROM_LINK (NewPos); MenuOption = MENU_OPTION_FROM_LINK (NewPos);
NewLine = TRUE; NewLine = TRUE;
NewPos = NewPos->ForwardLink; NewPos = NewPos->ForwardLink;
DistanceValue += MoveToNextStatement (FALSE, &NewPos); Difference = 0;
if (BottomRow >= MenuOption->Row + MenuOption->Skip) {
Difference = MoveToNextStatement (FALSE, &NewPos, BottomRow - MenuOption->Row - MenuOption->Skip);
//
// We hit the end of MenuOption that can be focused
// so we simply scroll to the first page.
//
if (Difference < 0) {
//
// Scroll to the first page.
//
if (TopOfScreen != gMenuOption.ForwardLink) {
TopOfScreen = gMenuOption.ForwardLink;
Repaint = TRUE;
MenuOption = NULL;
} else {
MenuOption = MENU_OPTION_FROM_LINK (SavedListEntry);
}
NewPos = gMenuOption.ForwardLink;
MoveToNextStatement (FALSE, &NewPos, BottomRow - TopRow);
//
// If we are at the end of the list and sitting on a Date/Time op, rewind to the head.
//
AdjustDateAndTimePosition (TRUE, &TopOfScreen);
AdjustDateAndTimePosition (TRUE, &NewPos);
break;
}
}
NextMenuOption = MENU_OPTION_FROM_LINK (NewPos); NextMenuOption = MENU_OPTION_FROM_LINK (NewPos);
// //
// An option might be multi-line, so we need to reflect that data in the overall skip value // An option might be multi-line, so we need to reflect that data in the overall skip value
// //
UpdateOptionSkipLines (Selection, NextMenuOption, &OptionString, (UINTN) SkipValue); UpdateOptionSkipLines (Selection, NextMenuOption, &OptionString, (UINTN) SkipValue);
DistanceValue += NextMenuOption->Skip; DistanceValue = Difference + NextMenuOption->Skip;
Temp = MenuOption->Row + MenuOption->Skip + DistanceValue - 1; Temp = MenuOption->Row + MenuOption->Skip + DistanceValue - 1;
if ((MenuOption->Row + MenuOption->Skip == BottomRow + 1) && if ((MenuOption->Row + MenuOption->Skip == BottomRow + 1) &&
@ -3098,6 +3148,12 @@ UiDisplayMenu (
Repaint = TRUE; Repaint = TRUE;
OldSkipValue = SkipValue; OldSkipValue = SkipValue;
} else if (!IsSelectable (NextMenuOption)) {
//
// Continue to go down until scroll to next page or the selectable option is found.
//
ScreenOperation = UiDown;
ControlFlag = CfScreenOperation;
} }
MenuOption = MENU_OPTION_FROM_LINK (SavedListEntry); MenuOption = MENU_OPTION_FROM_LINK (SavedListEntry);
@ -3105,23 +3161,26 @@ UiDisplayMenu (
UpdateStatusBar (INPUT_ERROR, MenuOption->ThisTag->QuestionFlags, FALSE); UpdateStatusBar (INPUT_ERROR, MenuOption->ThisTag->QuestionFlags, FALSE);
} else { } else {
SavedMenuOption = MenuOption; //
MenuOption = MENU_OPTION_FROM_LINK (NewPos); // Scroll to the first page.
if (!IsSelectable (MenuOption)) { //
// if (TopOfScreen != gMenuOption.ForwardLink) {
// If we are at the end of the list and sitting on a text op, we need to more forward TopOfScreen = gMenuOption.ForwardLink;
// Repaint = TRUE;
ScreenOperation = UiUp; MenuOption = NULL;
ControlFlag = CfScreenOperation; } else {
break; MenuOption = MENU_OPTION_FROM_LINK (SavedListEntry);
} }
NewLine = TRUE;
MenuOption = SavedMenuOption; NewPos = gMenuOption.ForwardLink;
// MoveToNextStatement (FALSE, &NewPos, BottomRow - TopRow);
// If we are at the end of the list and sitting on a Date/Time op, rewind to the head.
//
AdjustDateAndTimePosition (TRUE, &NewPos);
} }
//
// If we are at the end of the list and sitting on a Date/Time op, rewind to the head.
//
AdjustDateAndTimePosition (TRUE, &TopOfScreen);
AdjustDateAndTimePosition (TRUE, &NewPos);
break; break;
case CfUiSave: case CfUiSave: