Disable change value for grayout or readonly menu.

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

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12817 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
ydong10 2011-12-05 12:45:45 +00:00
parent 9386c41d1a
commit febca2e364
1 changed files with 7 additions and 2 deletions

View File

@ -2876,6 +2876,11 @@ UiDisplayMenu (
switch (Key.UnicodeChar) {
case CHAR_CARRIAGE_RETURN:
if(MenuOption->GrayOut || MenuOption->ReadOnly) {
ControlFlag = CfReadKey;
break;
}
ScreenOperation = UiSelect;
gDirection = 0;
break;
@ -2890,7 +2895,7 @@ UiDisplayMenu (
// If the screen has no menu items, and the user didn't select UiReset
// ignore the selection and go back to reading keys.
//
if(IsListEmpty (&gMenuOption)) {
if(IsListEmpty (&gMenuOption) || MenuOption->GrayOut || MenuOption->ReadOnly) {
ControlFlag = CfReadKey;
break;
}
@ -2943,7 +2948,7 @@ UiDisplayMenu (
}
ASSERT(MenuOption != NULL);
if (MenuOption->ThisTag->Operand == EFI_IFR_CHECKBOX_OP && !MenuOption->GrayOut) {
if (MenuOption->ThisTag->Operand == EFI_IFR_CHECKBOX_OP && !MenuOption->GrayOut && !MenuOption->ReadOnly) {
ScreenOperation = UiSelect;
}
}