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
FORM_BROWSER_STATEMENT *Question;\r
EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;\r
EFI_BROWSER_ACTION_REQUEST ActionRequest;\r
FORM_BROWSER_STATEMENT *Question;\r
EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;\r
EFI_BROWSER_ACTION_REQUEST ActionRequest;\r
\r
if (gMenuRefreshHead != NULL) {\r
\r
\r
if (gMenuRefreshHead != NULL) {\r
\r
for (Index = 0; OptionString[Index] == L' '; Index++)\r
;\r
\r
for (Index = 0; OptionString[Index] == L' '; Index++)\r
;\r
\r
+ PadString = AllocatePool (gOptionBlockWidth * sizeof (CHAR16));\r
+ SetMem16 (PadString, (gOptionBlockWidth - 1) * sizeof (CHAR16), CHAR_SPACE);\r
+ PadString[gOptionBlockWidth - 1] = 0;\r
+ PrintStringAt (MenuRefreshEntry->CurrentColumn, MenuRefreshEntry->CurrentRow, PadString);\r
+ FreePool (PadString);\r
PrintStringAt (MenuRefreshEntry->CurrentColumn, MenuRefreshEntry->CurrentRow, &OptionString[Index]);\r
FreePool (OptionString);\r
}\r
PrintStringAt (MenuRefreshEntry->CurrentColumn, MenuRefreshEntry->CurrentRow, &OptionString[Index]);\r
FreePool (OptionString);\r
}\r
//\r
if (gMenuRefreshHead != NULL) {\r
for (MenuRefreshEntry = gMenuRefreshHead; MenuRefreshEntry != NULL; MenuRefreshEntry = MenuRefreshEntry->Next) {\r
//\r
if (gMenuRefreshHead != NULL) {\r
for (MenuRefreshEntry = gMenuRefreshHead; MenuRefreshEntry != NULL; MenuRefreshEntry = MenuRefreshEntry->Next) {\r
- if (MenuOption->GrayOut) {\r
+ if (MenuRefreshEntry->MenuOption->GrayOut) {\r
MenuRefreshEntry->CurrentAttribute = FIELD_TEXT_GRAYED | FIELD_BACKGROUND;\r
} else { \r
MenuRefreshEntry->CurrentAttribute = PcdGet8 (PcdBrowserFieldTextColor) | FIELD_BACKGROUND;\r
MenuRefreshEntry->CurrentAttribute = FIELD_TEXT_GRAYED | FIELD_BACKGROUND;\r
} else { \r
MenuRefreshEntry->CurrentAttribute = PcdGet8 (PcdBrowserFieldTextColor) | FIELD_BACKGROUND;\r