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
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
index ebe8fae..ca2ec3b 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
@@ -2876,6 +2876,11 @@
 

       switch (Key.UnicodeChar) {

       case CHAR_CARRIAGE_RETURN:

+        if(MenuOption->GrayOut || MenuOption->ReadOnly) {

+          ControlFlag = CfReadKey;

+          break;

+        }

+

         ScreenOperation = UiSelect;

         gDirection      = 0;

         break;

@@ -2890,7 +2895,7 @@
         // 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 @@
           }

           

           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;

           }

         }