1. The old refresh string code also update the time/date opcode. But for the reason that time/date opcode updates the string with the same size, so skip the refresh code for it.

2. Also, the clean old string action used save attribute with paint string action which makes the background show abnormal.  Now using the normal attribute to clean the old string.


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11359 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
ydong10 2011-03-10 02:28:15 +00:00
parent d12c6a5485
commit 487ef01803
1 changed files with 16 additions and 8 deletions

View File

@ -342,7 +342,6 @@ 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) {
@ -354,8 +353,6 @@ RefreshForm (
mHiiPackageListUpdated = FALSE; mHiiPackageListUpdated = FALSE;
do { do {
gST->ConOut->SetAttribute (gST->ConOut, MenuRefreshEntry->CurrentAttribute);
Selection = MenuRefreshEntry->Selection; Selection = MenuRefreshEntry->Selection;
Question = MenuRefreshEntry->MenuOption->ThisTag; Question = MenuRefreshEntry->MenuOption->ThisTag;
@ -374,11 +371,22 @@ 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); // If old Text is longer than new string, need to clean the old string before paint the newer.
PadString[gOptionBlockWidth - 1] = 0; // This option is no need for time/date opcode, because time/data opcode has fixed string length.
PrintStringAt (MenuRefreshEntry->CurrentColumn, MenuRefreshEntry->CurrentRow, PadString); //
FreePool (PadString); if ((MenuRefreshEntry->MenuOption->ThisTag->Operand != EFI_IFR_DATE_OP) &&
(MenuRefreshEntry->MenuOption->ThisTag->Operand != EFI_IFR_TIME_OP)) {
ClearLines (
MenuRefreshEntry->CurrentColumn,
MenuRefreshEntry->CurrentColumn + gOptionBlockWidth - 1,
MenuRefreshEntry->CurrentRow,
MenuRefreshEntry->CurrentRow,
PcdGet8 (PcdBrowserFieldTextColor) | FIELD_BACKGROUND
);
}
gST->ConOut->SetAttribute (gST->ConOut, MenuRefreshEntry->CurrentAttribute);
PrintStringAt (MenuRefreshEntry->CurrentColumn, MenuRefreshEntry->CurrentRow, &OptionString[Index]); PrintStringAt (MenuRefreshEntry->CurrentColumn, MenuRefreshEntry->CurrentRow, &OptionString[Index]);
FreePool (OptionString); FreePool (OptionString);
} }