Bug description:

When the menu is refresh type, and the old string is longer than new string, after refresh, some old string will still show.
The mainly change is:
  1. This change cleans the old string first and then paints the new string.
  2. Fixed old code checks grayout flag not correct.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11354 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
ydong10 2011-03-08 06:01:23 +00:00
parent 27f3015903
commit 81da6ef925
1 changed files with 7 additions and 1 deletions

View File

@ -342,6 +342,7 @@ RefreshForm (
FORM_BROWSER_STATEMENT *Question; FORM_BROWSER_STATEMENT *Question;
EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess; EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;
EFI_BROWSER_ACTION_REQUEST ActionRequest; EFI_BROWSER_ACTION_REQUEST ActionRequest;
CHAR16 *PadString;
if (gMenuRefreshHead != NULL) { if (gMenuRefreshHead != NULL) {
@ -373,6 +374,11 @@ RefreshForm (
for (Index = 0; OptionString[Index] == L' '; Index++) for (Index = 0; OptionString[Index] == L' '; Index++)
; ;
PadString = AllocatePool (gOptionBlockWidth * sizeof (CHAR16));
SetMem16 (PadString, (gOptionBlockWidth - 1) * sizeof (CHAR16), CHAR_SPACE);
PadString[gOptionBlockWidth - 1] = 0;
PrintStringAt (MenuRefreshEntry->CurrentColumn, MenuRefreshEntry->CurrentRow, PadString);
FreePool (PadString);
PrintStringAt (MenuRefreshEntry->CurrentColumn, MenuRefreshEntry->CurrentRow, &OptionString[Index]); PrintStringAt (MenuRefreshEntry->CurrentColumn, MenuRefreshEntry->CurrentRow, &OptionString[Index]);
FreePool (OptionString); FreePool (OptionString);
} }
@ -2209,7 +2215,7 @@ UiDisplayMenu (
// //
if (gMenuRefreshHead != NULL) { if (gMenuRefreshHead != NULL) {
for (MenuRefreshEntry = gMenuRefreshHead; MenuRefreshEntry != NULL; MenuRefreshEntry = MenuRefreshEntry->Next) { for (MenuRefreshEntry = gMenuRefreshHead; MenuRefreshEntry != NULL; MenuRefreshEntry = MenuRefreshEntry->Next) {
if (MenuOption->GrayOut) { if (MenuRefreshEntry->MenuOption->GrayOut) {
MenuRefreshEntry->CurrentAttribute = FIELD_TEXT_GRAYED | FIELD_BACKGROUND; MenuRefreshEntry->CurrentAttribute = FIELD_TEXT_GRAYED | FIELD_BACKGROUND;
} else { } else {
MenuRefreshEntry->CurrentAttribute = PcdGet8 (PcdBrowserFieldTextColor) | FIELD_BACKGROUND; MenuRefreshEntry->CurrentAttribute = PcdGet8 (PcdBrowserFieldTextColor) | FIELD_BACKGROUND;