Enable lock attribute for statement and form; show this attribute same as grayout.

Signed-off-by: ydong10
Reviewed-by: lgao4

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12721 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
ydong10 2011-11-16 05:23:38 +00:00
parent 85aa96cd54
commit f67c4382ed
6 changed files with 37 additions and 2 deletions

View File

@ -358,6 +358,7 @@ formset
minimum = 0,
maximum = 0xff,
step = 0,
locked,
endnumeric;
numeric varid = MyNameValueVar[1], // This numeric take NameValueVar1 as storage

View File

@ -2117,6 +2117,28 @@ ParseOpCodes (
CurrentForm->ModalForm = TRUE;
break;
//
// Lock tag, used by form and statement.
//
case EFI_IFR_LOCKED_OP:
//
// Get ScopeOpcode from top of stack
//
PopScope (&ScopeOpCode);
PushScope (ScopeOpCode);
switch (ScopeOpCode) {
case EFI_IFR_FORM_OP:
case EFI_IFR_FORM_MAP_OP:
ASSERT (CurrentForm != NULL);
CurrentForm->Locked = TRUE;
break;
default:
ASSERT (CurrentStatement != NULL);
CurrentStatement->Locked = TRUE;
}
break;
//
// Vendor specific
//

View File

@ -554,7 +554,7 @@ DisplayForm (
// We are NOT!! removing this StringPtr buffer via FreePool since it is being used in the menuoptions, we will do
// it in UiFreeMenu.
//
MenuOption = UiAddMenuOption (StringPtr, Selection->Handle, Statement, NumberOfLines, MenuItemCount);
MenuOption = UiAddMenuOption (StringPtr, Selection->Handle, Selection->Form, Statement, NumberOfLines, MenuItemCount);
MenuItemCount++;
if (MenuOption->IsQuestion && !MenuOption->ReadOnly) {

View File

@ -374,7 +374,7 @@ typedef struct {
EFI_DEFAULT_ID DefaultId; // for EFI_IFR_RESET_BUTTON
EFI_GUID RefreshGuid; // for EFI_IFR_REFRESH_ID
BOOLEAN Locked; // Whether this statement is locked.
//
// Get from IFR parsing
//
@ -425,6 +425,7 @@ typedef struct {
EFI_IMAGE_ID ImageId;
BOOLEAN ModalForm; // Whether this is a modal form.
BOOLEAN Locked; // Whether this form is locked.
BOOLEAN NvUpdateRequired; // Whether this form has NV update request.

View File

@ -577,6 +577,7 @@ UiWaitForSingleEvent (
@param String String description for this option.
@param Handle Hii handle for the package list.
@param Form The form this statement belong to.
@param Statement Statement of this Menu Option.
@param NumberOfLines Display lines for this Menu Option.
@param MenuItemCount The index for this Option in the Menu.
@ -588,6 +589,7 @@ UI_MENU_OPTION *
UiAddMenuOption (
IN CHAR16 *String,
IN EFI_HII_HANDLE Handle,
IN FORM_BROWSER_FORM *Form,
IN FORM_BROWSER_STATEMENT *Statement,
IN UINT16 NumberOfLines,
IN UINT16 MenuItemCount
@ -643,6 +645,13 @@ UiAddMenuOption (
MenuOption->GrayOut = Statement->GrayOutExpression->Result.Value.b;
}
//
// If the form or the question has the lock attribute, deal same as grayout.
//
if (Form->Locked || Statement->Locked) {
MenuOption->GrayOut = TRUE;
}
switch (Statement->Operand) {
case EFI_IFR_ORDERED_LIST_OP:
case EFI_IFR_ONE_OF_OP:

View File

@ -295,6 +295,7 @@ UiFreeRefreshList (
@param String String description for this option.
@param Handle Hii handle for the package list.
@param Form The form this statement belong to.
@param Statement Statement of this Menu Option.
@param NumberOfLines Display lines for this Menu Option.
@param MenuItemCount The index for this Option in the Menu.
@ -306,6 +307,7 @@ UI_MENU_OPTION *
UiAddMenuOption (
IN CHAR16 *String,
IN EFI_HII_HANDLE Handle,
IN FORM_BROWSER_FORM *Form,
IN FORM_BROWSER_STATEMENT *Statement,
IN UINT16 NumberOfLines,
IN UINT16 MenuItemCount