Enable SetupBrowser to support multiple form class guid.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9680 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4 2010-01-06 06:41:09 +00:00
parent cb0a42901a
commit 4024517599
4 changed files with 33 additions and 14 deletions

View File

@ -208,7 +208,7 @@ DisplayPageFrame (
Buffer[Index] = Character;
}
if (gClassOfVfr == FORMSET_CLASS_FRONT_PAGE) {
if ((gClassOfVfr & FORMSET_CLASS_FRONT_PAGE) == FORMSET_CLASS_FRONT_PAGE) {
//
// ClearLines(0, LocalScreen.RightColumn, 0, BANNER_HEIGHT-1, BANNER_TEXT | BANNER_BACKGROUND);
//
@ -289,7 +289,7 @@ DisplayPageFrame (
KEYHELP_TEXT | KEYHELP_BACKGROUND
);
if (gClassOfVfr != FORMSET_CLASS_FRONT_PAGE) {
if ((gClassOfVfr & FORMSET_CLASS_FRONT_PAGE) != FORMSET_CLASS_FRONT_PAGE) {
ClearLines (
LocalScreen.LeftColumn,
LocalScreen.RightColumn,
@ -324,7 +324,7 @@ DisplayPageFrame (
Character = BOXDRAW_UP_LEFT;
PrintChar (Character);
if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
if ((gClassOfVfr & FORMSET_CLASS_PLATFORM_SETUP) == FORMSET_CLASS_PLATFORM_SETUP) {
//
// Print Bottom border line
// +------------------------------------------------------------------------------+
@ -472,7 +472,7 @@ DisplayForm (
StringPtr = GetToken (Selection->Form->FormTitle, Handle);
if (gClassOfVfr != FORMSET_CLASS_FRONT_PAGE) {
if ((gClassOfVfr & FORMSET_CLASS_FRONT_PAGE) != FORMSET_CLASS_FRONT_PAGE) {
gST->ConOut->SetAttribute (gST->ConOut, TITLE_TEXT | TITLE_BACKGROUND);
PrintStringAt (
(LocalScreen.RightColumn + LocalScreen.LeftColumn - GetStringWidth (StringPtr) / 2) / 2,
@ -685,7 +685,7 @@ UpdateKeyHelp (
ClearLines (LeftColumnOfHelp, RightColumnOfHelp, TopRowOfHelp, BottomRowOfHelp, KEYHELP_TEXT | KEYHELP_BACKGROUND);
if (!Selected) {
if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
if ((gClassOfVfr & FORMSET_CLASS_PLATFORM_SETUP) == FORMSET_CLASS_PLATFORM_SETUP) {
if (Selection->FormEditable) {
PrintStringAt (SecCol, TopRowOfHelp, gFunctionNineString);
PrintStringAt (ThdCol, TopRowOfHelp, gFunctionTenString);
@ -742,7 +742,7 @@ UpdateKeyHelp (
case EFI_IFR_CHECKBOX_OP:
ClearLines (LeftColumnOfHelp, RightColumnOfHelp, TopRowOfHelp, BottomRowOfHelp, KEYHELP_TEXT | KEYHELP_BACKGROUND);
if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
if ((gClassOfVfr & FORMSET_CLASS_PLATFORM_SETUP) == FORMSET_CLASS_PLATFORM_SETUP) {
if (Selection->FormEditable) {
PrintStringAt (SecCol, TopRowOfHelp, gFunctionNineString);
PrintStringAt (ThdCol, TopRowOfHelp, gFunctionTenString);
@ -763,7 +763,7 @@ UpdateKeyHelp (
ClearLines (LeftColumnOfHelp, RightColumnOfHelp, TopRowOfHelp, BottomRowOfHelp, KEYHELP_TEXT | KEYHELP_BACKGROUND);
if (!Selected) {
if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
if ((gClassOfVfr & FORMSET_CLASS_PLATFORM_SETUP) == FORMSET_CLASS_PLATFORM_SETUP) {
if (Selection->FormEditable) {
PrintStringAt (SecCol, TopRowOfHelp, gFunctionNineString);
PrintStringAt (ThdCol, TopRowOfHelp, gFunctionTenString);

View File

@ -277,7 +277,6 @@ SendForm (
InitializeBrowserStrings ();
gFunctionKeySetting = DEFAULT_FUNCTION_KEY_SETTING;
gClassOfVfr = FORMSET_CLASS_PLATFORM_SETUP;
//
// Ensure we are in Text mode
@ -942,6 +941,10 @@ ConfigRespToStorage (
break;
case EFI_HII_VARSTORE_NAME_VALUE:
StrPtr = StrStr (ConfigResp, L"PATH");
if (StrPtr == NULL) {
break;
}
StrPtr = StrStr (ConfigResp, L"&");
while (StrPtr != NULL) {
//
@ -2584,9 +2587,25 @@ InitializeFormSet (
return Status;
}
//
// Set VFR type by FormSet SubClass field
//
gClassOfVfr = FORMSET_CLASS_PLATFORM_SETUP;
if (FormSet->SubClass == EFI_FRONT_PAGE_SUBCLASS) {
gClassOfVfr = FORMSET_CLASS_FRONT_PAGE;
}
//
// Set VFR type by FormSet class guid
//
for (Index = 0; Index < 3; Index ++) {
if (CompareGuid (&FormSet->ClassGuid[Index], &gEfiHiiPlatformSetupFormsetGuid)) {
gClassOfVfr |= FORMSET_CLASS_PLATFORM_SETUP;
break;
}
}
if ((gClassOfVfr & FORMSET_CLASS_FRONT_PAGE) == FORMSET_CLASS_FRONT_PAGE) {
gFrontPageHandle = FormSet->HiiHandle;
}

View File

@ -193,8 +193,8 @@ typedef struct {
#define FORM_INCONSISTENT_VALIDATION 0
#define FORM_NO_SUBMIT_VALIDATION 1
#define FORMSET_CLASS_PLATFORM_SETUP 0
#define FORMSET_CLASS_FRONT_PAGE 1
#define FORMSET_CLASS_PLATFORM_SETUP 0x0001
#define FORMSET_CLASS_FRONT_PAGE 0x0002
typedef struct {
UINT8 Type;

View File

@ -1037,7 +1037,7 @@ UpdateStatusBar (
break;
case NV_UPDATE_REQUIRED:
if (gClassOfVfr != FORMSET_CLASS_FRONT_PAGE) {
if ((gClassOfVfr & FORMSET_CLASS_FRONT_PAGE) != FORMSET_CLASS_FRONT_PAGE) {
if (State) {
gST->ConOut->SetAttribute (gST->ConOut, INFO_TEXT);
PrintStringAt (
@ -1694,7 +1694,7 @@ UiDisplayMenu (
ZeroMem (&Key, sizeof (EFI_INPUT_KEY));
if (gClassOfVfr == FORMSET_CLASS_FRONT_PAGE) {
if ((gClassOfVfr & FORMSET_CLASS_FRONT_PAGE) == FORMSET_CLASS_FRONT_PAGE){
TopRow = LocalScreen.TopRow + FRONT_PAGE_HEADER_HEIGHT + SCROLL_ARROW_HEIGHT;
Row = LocalScreen.TopRow + FRONT_PAGE_HEADER_HEIGHT + SCROLL_ARROW_HEIGHT;
} else {
@ -2404,7 +2404,7 @@ UiDisplayMenu (
break;
case ' ':
if (gClassOfVfr != FORMSET_CLASS_FRONT_PAGE) {
if ((gClassOfVfr & FORMSET_CLASS_FRONT_PAGE) != FORMSET_CLASS_FRONT_PAGE) {
if (MenuOption->ThisTag->Operand == EFI_IFR_CHECKBOX_OP && !MenuOption->GrayOut) {
ScreenOperation = UiSelect;
}
@ -2686,7 +2686,7 @@ UiDisplayMenu (
break;
}
if (gClassOfVfr == FORMSET_CLASS_FRONT_PAGE) {
if ((gClassOfVfr & FORMSET_CLASS_FRONT_PAGE) == FORMSET_CLASS_FRONT_PAGE) {
//
// We never exit FrontPage, so skip the ESC
//