summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-26 06:42:48 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-26 06:42:48 +0000
commit1744f689fff2be5a6e4faca44eb66e7a5c667a9a (patch)
tree25f7cd47951c52f9e2e670e3cab7cf8ed1211c1f
parentb1f8b9f69df4a077c2af41ffa88d7a7981c7192e (diff)
downloadedk2-1744f689fff2be5a6e4faca44eb66e7a5c667a9a.zip
edk2-1744f689fff2be5a6e4faca44eb66e7a5c667a9a.tar.gz
edk2-1744f689fff2be5a6e4faca44eb66e7a5c667a9a.tar.bz2
Sync patch r11355 from main trunk.
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/branches/UDK2010@12571 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Ui.c464
1 files changed, 268 insertions, 196 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
index 0b73fe2..6a08740 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
@@ -1248,9 +1248,7 @@ GetLineByWidth (
VOID
UpdateOptionSkipLines (
IN UI_MENU_SELECTION *Selection,
- IN UI_MENU_OPTION *MenuOption,
- OUT CHAR16 **OptionalString,
- IN UINTN SkipValue
+ IN UI_MENU_OPTION *MenuOption
)
{
UINTN Index;
@@ -1261,9 +1259,7 @@ UpdateOptionSkipLines (
CHAR16 *OptionString;
Row = 0;
- OptionString = *OptionalString;
- OutputString = NULL;
-
+ OptionString = NULL;
ProcessOptions (Selection, MenuOption, FALSE, &OptionString);
if (OptionString != NULL) {
@@ -1276,31 +1272,28 @@ UpdateOptionSkipLines (
// If there is more string to process print on the next row and increment the Skip value
//
if (StrLen (&OptionString[Index]) != 0) {
- if (SkipValue == 0) {
- Row++;
- //
- // Since the Number of lines for this menu entry may or may not be reflected accurately
- // since the prompt might be 1 lines and option might be many, and vice versa, we need to do
- // some testing to ensure we are keeping this in-sync.
- //
- // If the difference in rows is greater than or equal to the skip value, increase the skip value
- //
- if ((Row - OriginalRow) >= MenuOption->Skip) {
- MenuOption->Skip++;
- }
+ Row++;
+ //
+ // Since the Number of lines for this menu entry may or may not be reflected accurately
+ // since the prompt might be 1 lines and option might be many, and vice versa, we need to do
+ // some testing to ensure we are keeping this in-sync.
+ //
+ // If the difference in rows is greater than or equal to the skip value, increase the skip value
+ //
+ if ((Row - OriginalRow) >= MenuOption->Skip) {
+ MenuOption->Skip++;
}
}
FreePool (OutputString);
- if (SkipValue != 0) {
- SkipValue--;
- }
}
Row = OriginalRow;
}
- *OptionalString = OptionString;
+ if (OptionString != NULL) {
+ FreePool (OptionString);
+ }
}
@@ -1380,52 +1373,60 @@ ValueIsScroll (
**/
INTN
MoveToNextStatement (
+ IN UI_MENU_SELECTION *Selection,
IN BOOLEAN GoUp,
- IN OUT LIST_ENTRY **CurrentPosition
+ IN OUT LIST_ENTRY **CurrentPosition,
+ IN UINTN GapToTop
)
{
INTN Distance;
LIST_ENTRY *Pos;
- BOOLEAN HitEnd;
UI_MENU_OPTION *NextMenuOption;
+ UI_MENU_OPTION *PreMenuOption;
- Distance = 0;
- Pos = *CurrentPosition;
- HitEnd = FALSE;
+ Distance = 0;
+ Pos = *CurrentPosition;
+ PreMenuOption = MENU_OPTION_FROM_LINK (Pos);
while (TRUE) {
NextMenuOption = MENU_OPTION_FROM_LINK (Pos);
+ if (NextMenuOption->Row == 0) {
+ UpdateOptionSkipLines (Selection, NextMenuOption);
+ }
+
+ 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)) {
break;
}
if ((GoUp ? Pos->BackLink : Pos->ForwardLink) == &gMenuOption) {
- HitEnd = TRUE;
+ //
+ // Arrive at top.
+ //
+ Distance = -1;
break;
}
- Distance += NextMenuOption->Skip;
- Pos = (GoUp ? Pos->BackLink : Pos->ForwardLink);
- }
-
- if (HitEnd) {
- //
- // 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;
- }
- if ((!GoUp ? Pos->BackLink : Pos->ForwardLink) == &gMenuOption) {
- ASSERT (FALSE);
+ if (!GoUp) {
+ //
+ // Caculate distanct at later when go down
+ //
+ if ((UINTN) Distance + NextMenuOption->Skip > GapToTop) {
+ NextMenuOption = PreMenuOption;
break;
}
- Distance -= NextMenuOption->Skip;
- Pos = (!GoUp ? Pos->BackLink : Pos->ForwardLink);
+ Distance += NextMenuOption->Skip;
}
+ PreMenuOption = NextMenuOption;
+ Pos = (GoUp ? Pos->BackLink : Pos->ForwardLink);
}
*CurrentPosition = &NextMenuOption->Link;
@@ -1644,6 +1645,7 @@ UiDisplayMenu (
BOOLEAN SavedValue;
BOOLEAN UpArrow;
BOOLEAN DownArrow;
+ BOOLEAN InitializedFlag;
EFI_STATUS Status;
EFI_INPUT_KEY Key;
LIST_ENTRY *Link;
@@ -1737,6 +1739,7 @@ UiDisplayMenu (
//
// Get user's selection
//
+ InitializedFlag = TRUE;
NewPos = gMenuOption.ForwardLink;
gST->ConOut->EnableCursor (gST->ConOut, FALSE);
@@ -2037,6 +2040,10 @@ UiDisplayMenu (
// NewPos: Current menu option that need to hilight
//
ControlFlag = CfUpdateHelpString;
+ if (InitializedFlag) {
+ InitializedFlag = FALSE;
+ MoveToNextStatement (Selection, FALSE, &NewPos, BottomRow - TopRow);
+ }
//
// Repaint flag is normally reset when finish processing CfUpdateHelpString. Temporarily
@@ -2062,20 +2069,45 @@ UiDisplayMenu (
for (Index = TopRow; Index <= BottomRow && Link != NewPos;) {
SavedMenuOption = MENU_OPTION_FROM_LINK (Link);
Index += SavedMenuOption->Skip;
+ if (Link == TopOfScreen) {
+ Index -= OldSkipValue;
+ }
Link = Link->ForwardLink;
}
+ if (NewPos == Link) {
+ SavedMenuOption = MENU_OPTION_FROM_LINK (Link);
+ }
- if (Link != NewPos || Index > BottomRow) {
+ if (Link != NewPos || Index > BottomRow || (Link == NewPos && SavedMenuOption->Row + SavedMenuOption->Skip - 1 > BottomRow)) {
//
// NewPos is not in the current page, simply scroll page so that NewPos is in the end of the page
//
+ SavedMenuOption = MENU_OPTION_FROM_LINK (NewPos);
+ //
+ // SavedMenuOption->Row == 0 means the menu not show yet.
+ //
+ if (SavedMenuOption->Row == 0) {
+ UpdateOptionSkipLines (Selection, SavedMenuOption);
+ }
+
Link = NewPos;
- for (Index = TopRow; Index <= BottomRow; ) {
+ for (Index = TopRow + SavedMenuOption->Skip; Index <= BottomRow + 1; ) {
Link = Link->BackLink;
SavedMenuOption = MENU_OPTION_FROM_LINK (Link);
+ if (SavedMenuOption->Row == 0) {
+ UpdateOptionSkipLines (Selection, SavedMenuOption);
+ }
Index += SavedMenuOption->Skip;
}
- TopOfScreen = Link->ForwardLink;
+
+ SkipValue = Index - BottomRow - 1;
+ if (SkipValue > 0 && SkipValue < (INTN) SavedMenuOption->Skip) {
+ TopOfScreen = Link;
+ OldSkipValue = SkipValue;
+ } else {
+ SkipValue = 0;
+ TopOfScreen = Link->ForwardLink;
+ }
Repaint = TRUE;
NewLine = TRUE;
@@ -2170,23 +2202,18 @@ UiDisplayMenu (
}
//
- // This is only possible if we entered this page and the first menu option is
- // a "non-menu" item. In that case, force it UiDown
+ // This is the current selected statement
//
MenuOption = MENU_OPTION_FROM_LINK (NewPos);
+ Statement = MenuOption->ThisTag;
+ Selection->Statement = Statement;
if (!IsSelectable (MenuOption)) {
- ASSERT (ScreenOperation == UiNoOperation);
- ScreenOperation = UiDown;
- ControlFlag = CfScreenOperation;
+ Repaint = SavedValue;
+ UpdateKeyHelp (Selection, MenuOption, FALSE);
break;
}
//
- // This is the current selected statement
- //
- Statement = MenuOption->ThisTag;
- Selection->Statement = Statement;
- //
// Record highlight for current menu
//
CurrentMenu->QuestionId = Statement->QuestionId;
@@ -2295,7 +2322,7 @@ UiDisplayMenu (
// Don't print anything if it is a NULL help token
//
ASSERT(MenuOption != NULL);
- if (MenuOption->ThisTag->Help == 0) {
+ if (MenuOption->ThisTag->Help == 0 || !IsSelectable (MenuOption)) {
StringPtr = L"\0";
} else {
StringPtr = GetToken (MenuOption->ThisTag->Help, MenuOption->Handle);
@@ -2794,94 +2821,81 @@ UiDisplayMenu (
case CfUiUp:
ControlFlag = CfCheckSelection;
- SavedListEntry = TopOfScreen;
+ SavedListEntry = NewPos;
ASSERT(NewPos != NULL);
+ //
+ // Adjust Date/Time position before we advance forward.
+ //
+ AdjustDateAndTimePosition (TRUE, &NewPos);
if (NewPos->BackLink != &gMenuOption) {
- NewLine = TRUE;
- //
- // Adjust Date/Time position before we advance forward.
- //
- 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;
- }
-
- PreviousMenuOption = MENU_OPTION_FROM_LINK (NewPos);
- DistanceValue = PreviousMenuOption->Skip;
-
- //
- // Since the behavior of hitting the up arrow on a Date/Time op-code is intended
- // 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
- // checking can be done.
- //
- DistanceValue += AdjustDateAndTimePosition (TRUE, &NewPos);
-
- //
- // Check the previous menu entry to see if it was a zero-length advance. If it was,
- // don't worry about a redraw.
- //
- ASSERT(MenuOption != NULL);
- if ((INTN) MenuOption->Row - (INTN) DistanceValue < (INTN) TopRow) {
- Repaint = TRUE;
- TopOfScreen = NewPos;
- }
+ MenuOption = MENU_OPTION_FROM_LINK (NewPos);
+ ASSERT (MenuOption != NULL);
+ NewLine = TRUE;
+ NewPos = NewPos->BackLink;
- Difference = MoveToNextStatement (TRUE, &NewPos);
PreviousMenuOption = MENU_OPTION_FROM_LINK (NewPos);
- if (Difference > 0) {
- DistanceValue = Difference + PreviousMenuOption->Skip;
- } else {
- DistanceValue += PreviousMenuOption->Skip;
+ if (PreviousMenuOption->Row == 0) {
+ UpdateOptionSkipLines (Selection, PreviousMenuOption);
}
-
- if ((INTN) MenuOption->Row - (INTN) DistanceValue < (INTN) TopRow) {
- if (Difference > 0) {
- //
- // Previous focus MenuOption is above the TopOfScreen, so we need to scroll
- //
- TopOfScreen = NewPos;
- Repaint = TRUE;
- SkipValue = 0;
- OldSkipValue = 0;
- }
+ DistanceValue = PreviousMenuOption->Skip;
+ Difference = 0;
+ if (MenuOption->Row >= DistanceValue + TopRow) {
+ Difference = MoveToNextStatement (Selection, TRUE, &NewPos, MenuOption->Row - TopRow - DistanceValue);
}
+ NextMenuOption = MENU_OPTION_FROM_LINK (NewPos);
+
if (Difference < 0) {
//
- // We want to goto previous MenuOption, but finally we go down.
- // it means that we hit the begining MenuOption that can be focused
- // so we simply scroll to the top
+ // We hit the begining MenuOption that can be focused
+ // so we simply scroll to the top.
//
- if (SavedListEntry != gMenuOption.ForwardLink) {
+ if (TopOfScreen != gMenuOption.ForwardLink) {
TopOfScreen = gMenuOption.ForwardLink;
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 (MenuOption->Row < TopRow + DistanceValue + Difference) {
+ //
+ // Previous focus MenuOption is above the TopOfScreen, so we need to scroll
+ //
+ TopOfScreen = NewPos;
+ Repaint = TRUE;
+ SkipValue = 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.
//
AdjustDateAndTimePosition (TRUE, &TopOfScreen);
-
+ AdjustDateAndTimePosition (TRUE, &NewPos);
+ MenuOption = MENU_OPTION_FROM_LINK (SavedListEntry);
UpdateStatusBar (INPUT_ERROR, MenuOption->ThisTag->QuestionFlags, FALSE);
} else {
- SavedMenuOption = MenuOption;
- MenuOption = MENU_OPTION_FROM_LINK (NewPos);
- if (!IsSelectable (MenuOption)) {
- //
- // If we are at the end of the list and sitting on a text op, we need to more forward
- //
- ScreenOperation = UiDown;
- ControlFlag = CfScreenOperation;
- break;
- }
-
- MenuOption = SavedMenuOption;
+ //
+ // Scroll up to the last page.
+ //
+ NewPos = &gMenuOption;
+ TopOfScreen = &gMenuOption;
+ MenuOption = MENU_OPTION_FROM_LINK (SavedListEntry);
+ ScreenOperation = UiPageUp;
+ ControlFlag = CfScreenOperation;
}
break;
@@ -2898,38 +2912,62 @@ UiDisplayMenu (
NewLine = TRUE;
Repaint = TRUE;
Link = TopOfScreen;
- PreviousMenuOption = MENU_OPTION_FROM_LINK (Link);
- Index = BottomRow;
+ Index = BottomRow;
while ((Index >= TopRow) && (Link->BackLink != &gMenuOption)) {
- Index = Index - PreviousMenuOption->Skip;
Link = Link->BackLink;
PreviousMenuOption = MENU_OPTION_FROM_LINK (Link);
+ if (PreviousMenuOption->Row == 0) {
+ UpdateOptionSkipLines (Selection, PreviousMenuOption);
+ }
+ 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 (Selection, TRUE, &NewPos, BottomRow - TopRow);
+ Repaint = FALSE;
+ } else if (TopOfScreen != Link) {
+ TopOfScreen = Link;
+ NewPos = Link;
+ MoveToNextStatement (Selection, FALSE, &NewPos, BottomRow - TopRow);
+ } else {
+ //
+ // Finally we know that NewPos is the last MenuOption can be focused.
+ //
+ Repaint = FALSE;
+ NewPos = Link;
+ MoveToNextStatement (Selection, 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.
//
- TopOfScreen = Link;
- } else if (Difference < 0) {
+ if (TopOfScreen == &gMenuOption) {
+ NewPos = gMenuOption.BackLink;
+ MoveToNextStatement (Selection, TRUE, &NewPos, BottomRow - TopRow);
+ } else {
+ NewPos = Link;
+ MoveToNextStatement (Selection, FALSE, &NewPos, BottomRow - TopRow);
+ }
+
//
- // This happens when there is no MenuOption can be focused from
- // Current MenuOption to the first MenuOption
+ // There are more MenuOption needing scrolling up.
//
- TopOfScreen = gMenuOption.ForwardLink;
- }
- Index += Difference;
- if (Index < TopRow) {
- MenuOption = NULL;
- }
-
- if (NewPos == Link) {
- Repaint = FALSE;
- NewLine = FALSE;
- } else {
- NewPos = Link;
+ TopOfScreen = Link;
+ MenuOption = NULL;
}
//
@@ -2961,28 +2999,35 @@ UiDisplayMenu (
NextMenuOption = MENU_OPTION_FROM_LINK (Link);
}
- Index += MoveToNextStatement (FALSE, &Link);
- if (Index > BottomRow) {
+ if ((Link->ForwardLink == &gMenuOption) && (Index <= BottomRow)) {
//
- // There are more MenuOption needing scrolling
+ // Finally we know that NewPos is the last MenuOption can be focused.
+ //
+ Repaint = FALSE;
+ MoveToNextStatement (Selection, TRUE, &Link, Index - TopRow);
+ } else {
+ if (Index - 1 > BottomRow) {
+ //
+ // Back up the previous option.
+ //
+ Link = Link->BackLink;
+ }
+ //
+ // There are more MenuOption needing scrolling down.
//
TopOfScreen = Link;
MenuOption = NULL;
- }
- if (NewPos == Link && Index <= BottomRow) {
//
- // Finally we know that NewPos is the last MenuOption can be focused.
+ // Move to the option in Next page.
//
- NewLine = FALSE;
- Repaint = FALSE;
- } else {
- NewPos = Link;
+ MoveToNextStatement (Selection, FALSE, &Link, BottomRow - TopRow);
}
//
// 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.
//
+ NewPos = Link;
AdjustDateAndTimePosition (TRUE, &TopOfScreen);
AdjustDateAndTimePosition (TRUE, &NewPos);
break;
@@ -2998,20 +3043,49 @@ UiDisplayMenu (
// the Date/Time op-code.
//
SavedListEntry = NewPos;
- DistanceValue = AdjustDateAndTimePosition (FALSE, &NewPos);
+ AdjustDateAndTimePosition (FALSE, &NewPos);
if (NewPos->ForwardLink != &gMenuOption) {
MenuOption = MENU_OPTION_FROM_LINK (NewPos);
NewLine = TRUE;
NewPos = NewPos->ForwardLink;
+
+ Difference = 0;
+ if (BottomRow >= MenuOption->Row + MenuOption->Skip) {
+ Difference = MoveToNextStatement (Selection, 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 (Selection, 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);
- DistanceValue += NextMenuOption->Skip;
- DistanceValue += MoveToNextStatement (FALSE, &NewPos);
//
// 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);
+ DistanceValue = Difference + NextMenuOption->Skip;
Temp = MenuOption->Row + MenuOption->Skip + DistanceValue - 1;
if ((MenuOption->Row + MenuOption->Skip == BottomRow + 1) &&
@@ -3053,26 +3127,13 @@ UiDisplayMenu (
//
// If we have a remainder, skip that many more op-codes until we drain the remainder
//
- for (;
- Difference >= (INTN) SavedMenuOption->Skip;
- Difference = Difference - (INTN) SavedMenuOption->Skip
- ) {
+ while (Difference >= (INTN) SavedMenuOption->Skip) {
//
// Since the Difference is greater than or equal to this op-code's skip value, skip it
//
+ Difference = Difference - (INTN) SavedMenuOption->Skip;
TopOfScreen = TopOfScreen->ForwardLink;
SavedMenuOption = MENU_OPTION_FROM_LINK (TopOfScreen);
- if (Difference < (INTN) SavedMenuOption->Skip) {
- Difference = SavedMenuOption->Skip - Difference - 1;
- break;
- } else {
- if (Difference == (INTN) SavedMenuOption->Skip) {
- TopOfScreen = TopOfScreen->ForwardLink;
- SavedMenuOption = MENU_OPTION_FROM_LINK (TopOfScreen);
- Difference = SavedMenuOption->Skip - Difference;
- break;
- }
- }
}
//
// Since we will act on this op-code in the next routine, and increment the
@@ -3105,6 +3166,8 @@ UiDisplayMenu (
} else {
SkipValue++;
}
+ } else if (SavedMenuOption->Skip == 1) {
+ SkipValue = 0;
} else {
SkipValue = 0;
TopOfScreen = TopOfScreen->ForwardLink;
@@ -3113,6 +3176,12 @@ UiDisplayMenu (
Repaint = TRUE;
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);
@@ -3120,23 +3189,26 @@ UiDisplayMenu (
UpdateStatusBar (INPUT_ERROR, MenuOption->ThisTag->QuestionFlags, FALSE);
} else {
- SavedMenuOption = MenuOption;
- MenuOption = MENU_OPTION_FROM_LINK (NewPos);
- if (!IsSelectable (MenuOption)) {
- //
- // If we are at the end of the list and sitting on a text op, we need to more forward
- //
- ScreenOperation = UiUp;
- ControlFlag = CfScreenOperation;
- break;
- }
-
- MenuOption = SavedMenuOption;
//
- // If we are at the end of the list and sitting on a Date/Time op, rewind to the head.
+ // Scroll to the first page.
//
- AdjustDateAndTimePosition (TRUE, &NewPos);
+ if (TopOfScreen != gMenuOption.ForwardLink) {
+ TopOfScreen = gMenuOption.ForwardLink;
+ Repaint = TRUE;
+ MenuOption = NULL;
+ } else {
+ MenuOption = MENU_OPTION_FROM_LINK (SavedListEntry);
+ }
+ NewLine = TRUE;
+ NewPos = gMenuOption.ForwardLink;
+ MoveToNextStatement (Selection, 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;
case CfUiSave: