Fix modal form display error.

Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14736 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Eric Dong 2013-09-28 04:51:32 +00:00 committed by ydong10
parent af047db78d
commit ae4f5746ef
1 changed files with 33 additions and 14 deletions

View File

@ -279,7 +279,10 @@ GetWidth (
// For modal form, clean the entire row.
//
if ((gFormData->Attribute & HII_DISPLAY_MODAL) != 0) {
return (UINT16)(gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn - gModalSkipColumn - SCROLL_ARROW_HEIGHT);
if (AdjustWidth != NULL) {
*AdjustWidth = LEFT_SKIPPED_COLUMNS;
}
return (UINT16)(gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn - 2 * (gModalSkipColumn + LEFT_SKIPPED_COLUMNS));
}
Size = 0;
@ -1999,9 +2002,12 @@ UiDisplayMenu (
if (!ValueIsScroll (TRUE, TopOfScreen)) {
UpArrow = TRUE;
}
PrintStringAtWithWidth(gStatementDimensions.LeftColumn, TopRow - 1, L"", gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn);
if ((FormData->Attribute & HII_DISPLAY_MODAL) != 0) {
PrintStringAtWithWidth(gStatementDimensions.LeftColumn + gModalSkipColumn, TopRow - 1, L"", gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn - 2 * gModalSkipColumn);
} else {
PrintStringAtWithWidth(gStatementDimensions.LeftColumn, TopRow - 1, L"", gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn);
}
if (UpArrow) {
gST->ConOut->SetAttribute (gST->ConOut, GetArrowColor ());
PrintCharAt (
@ -2036,14 +2042,24 @@ UiDisplayMenu (
SavedMenuOption = MenuOption;
SkipHighLight = TRUE;
}
DisplayOneMenu (MenuOption,
((FormData->Attribute & HII_DISPLAY_MODAL) != 0) ? LEFT_SKIPPED_COLUMNS + gModalSkipColumn : LEFT_SKIPPED_COLUMNS,
gStatementDimensions.LeftColumn,
Link == TopOfScreen ? SkipValue : 0,
BottomRow,
Link == NewPos && IsSelectable(MenuOption)
);
if ((FormData->Attribute & HII_DISPLAY_MODAL) != 0) {
DisplayOneMenu (MenuOption,
LEFT_SKIPPED_COLUMNS,
gStatementDimensions.LeftColumn + gModalSkipColumn,
Link == TopOfScreen ? SkipValue : 0,
BottomRow,
Link == NewPos && IsSelectable(MenuOption)
);
} else {
DisplayOneMenu (MenuOption,
LEFT_SKIPPED_COLUMNS,
gStatementDimensions.LeftColumn,
Link == TopOfScreen ? SkipValue : 0,
BottomRow,
Link == NewPos && IsSelectable(MenuOption)
);
}
//
// 3. Update the row info which will be used by next menu.
@ -2069,7 +2085,7 @@ UiDisplayMenu (
//
while (Row <= BottomRow) {
if ((FormData->Attribute & HII_DISPLAY_MODAL) != 0) {
PrintStringAtWithWidth(gStatementDimensions.LeftColumn, Row++, L"", gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn);
PrintStringAtWithWidth(gStatementDimensions.LeftColumn + gModalSkipColumn, Row++, L"", gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn - 2 * gModalSkipColumn);
} else {
PrintStringAtWithWidth(gStatementDimensions.LeftColumn, Row++, L"", gStatementDimensions.RightColumn - gHelpBlockWidth - gStatementDimensions.LeftColumn);
}
@ -2078,8 +2094,11 @@ UiDisplayMenu (
//
// 4. Print the down arrow row.
//
PrintStringAtWithWidth(gStatementDimensions.LeftColumn, BottomRow + 1, L"", gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn);
if ((FormData->Attribute & HII_DISPLAY_MODAL) != 0) {
PrintStringAtWithWidth(gStatementDimensions.LeftColumn + gModalSkipColumn, BottomRow + 1, L"", gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn - 2 * + gModalSkipColumn);
} else {
PrintStringAtWithWidth(gStatementDimensions.LeftColumn, BottomRow + 1, L"", gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn);
}
if (DownArrow) {
gST->ConOut->SetAttribute (gST->ConOut, GetArrowColor ());
PrintCharAt (