vfr.vfr

来自「EFI BIOS是Intel提出的下一代的BIOS标准。这里上传的Edk源代码是」· VFR 代码 · 共 623 行 · 第 1/2 页

VFR
623
字号
    //
    save defaults,
      formid  = 4,
      prompt  = STRING_TOKEN(STR_SAVE_DEFAULTS_PROMPT),
      help    = STRING_TOKEN(STR_SAVE_DEFAULTS_HELP),
      flags   = 0;
    //
    // Case with no flags
    //
    save defaults,
      formid  = 4,
      prompt  = STRING_TOKEN(STR_SAVE_DEFAULTS_PROMPT),
      help    = STRING_TOKEN(STR_SAVE_DEFAULTS_HELP),
      key     = 0;

    label LABEL_2_VALUE;

    grayoutif  ideqval MyIfrNVData.HowOldAreYouInYearsManual == 23 AND ideqval MyIfrNVData.SuppressGrayOutSomething == 0x1;
    numeric varid   = MyIfrNVData.HowOldAreYouInYears,   
            prompt  = STRING_TOKEN(STR_NUMERIC_PROMPT),
            help    = STRING_TOKEN(STR_NUMERIC_HELP2),
            minimum = 0,
            maximum = 243,
            step    = 3,
            default = 18,

    endnumeric;

    label LABEL_1_VALUE;

    //
    // Numeric with no step or default specified
    //
    numeric varid   = MyIfrNVData.HowTallAreYou, 
            prompt  = STRING_TOKEN(STR_NUMERIC_PROMPT1),
            help    = STRING_TOKEN(STR_NUMERIC_HELP3),
            minimum = 0,
            maximum = 190,
    //        step    = 1,       // Stepping of 1 if not specified
    //        default = minimum; // if not specified
    endnumeric;
    endif;

    string    varid    = MyIfrNVData.MyStringData,
              prompt   = STRING_TOKEN(STR_MY_STRING_PROMPT),
              help     = STRING_TOKEN(STR_MY_STRING_HELP),
              minsize  = 6,
              maxsize  = 0x14,
    endstring; 
        
    password  varid    = MyIfrNVData.WhatIsThePassword,
              prompt   = STRING_TOKEN(STR_PASSWORD_PROMPT),
              help     = STRING_TOKEN(STR_PASSWORD_HELP),
              minsize  = 6,
              maxsize  = 20, // new opcode 
              encoding = 1,
    endpassword; 
    password  varid    = MyIfrNVData.WhatIsThePassword2,
              prompt   = STRING_TOKEN(STR_PASSWORD_PROMPT),
              help     = STRING_TOKEN(STR_PASSWORD_HELP),
              minsize  = 6,
              maxsize  = 20, // new opcode 
              encoding = 1,
    endpassword; 
    //
    // Test with flags and key fields
    //
    password  varid    = MyIfrNVData.WhatIsThePassword,
              prompt   = STRING_TOKEN(STR_PASSWORD_PROMPT),
              help     = STRING_TOKEN(STR_PASSWORD_HELP),
              flags    = INTERACTIVE,
              key      = 0x2000,
              minsize  = 6,
              maxsize  = 20, // new opcode 
              encoding = 1,
    endpassword;

    goto 2, 
      prompt = STRING_TOKEN(STR_GOTO_FORM2), //SecondSetupPage  // this too has no end-op and basically it's a jump to a form ONLY
      help   = STRING_TOKEN(STR_GOTO_HELP);

    goto 3, 
      prompt = STRING_TOKEN(STR_GOTO_FORM3), //ThirdSetupPage  // this too has no end-op and basically it's a jump to a form ONLY
      help   = STRING_TOKEN(STR_GOTO_HELP);

  endform;

  form formid = 2,               // SecondSetupPage, 
       title = STRING_TOKEN(STR_FORM2_TITLE);  // note formid is a variable (for readability) (UINT16) - also added Form to the line to signify the Op-Code


    date    year varid  = Date.Year,    // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
            prompt      = STRING_TOKEN(STR_DATE_PROMPT),
            help        = STRING_TOKEN(STR_DATE_YEAR_HELP),
            minimum     = 1998,
            maximum     = 2099,
            step        = 1,
            default     = 2004,

            month varid = Date.Month,    // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
            prompt      = STRING_TOKEN(STR_DATE_PROMPT),
            help        = STRING_TOKEN(STR_DATE_MONTH_HELP),
            minimum     = 1,
            maximum     = 12,
            step        = 1,
            default     = 1,

            day varid   = Date.Day,          // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
            prompt      = STRING_TOKEN(STR_DATE_PROMPT),
            help        = STRING_TOKEN(STR_DATE_DAY_HELP),
            minimum     = 1,
            maximum     = 31,
            step        = 0x1,
            default     = 1,

    enddate;

    time    hour varid  = Time.Hours,         // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
            prompt      = STRING_TOKEN(STR_TIME_PROMPT),
            help        = STRING_TOKEN(STR_TIME_HOUR_HELP),
            minimum     = 0,
            maximum     = 23,
            step        = 1,
            default     = 0,

            minute varid  = Time.Minutes,       // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
            prompt        = STRING_TOKEN(STR_TIME_PROMPT),
            help          = STRING_TOKEN(STR_TIME_MINUTE_HELP),
            minimum       = 0,
            maximum       = 59,
            step          = 1,
            default       = 0,

            second varid  = Time.Seconds,       // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
            prompt        = STRING_TOKEN(STR_TIME_PROMPT),
            help          = STRING_TOKEN(STR_TIME_SECOND_HELP),
            minimum       = 0,
            maximum       = 59,
            step          = 1,
            default       = 0,

    endtime;

    date    year varid  = Date.Year,    // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
            prompt      = STRING_TOKEN(STR_DATE_PROMPT),
            help        = STRING_TOKEN(STR_DATE_YEAR_HELP),
            minimum     = 1939,
            maximum     = 2101,
            step        = 1,
            default     = 1964,

            month varid = Date.Month,    // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
            prompt      = STRING_TOKEN(STR_DATE_PROMPT),
            help        = STRING_TOKEN(STR_DATE_MONTH_HELP),
            minimum     = 1,
            maximum     = 12,
            step        = 1,
            default     = 1,

            day varid   = Date.Day,          // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
            prompt      = STRING_TOKEN(STR_DATE_PROMPT),
            help        = STRING_TOKEN(STR_DATE_DAY_HELP),
            minimum     = 1,
            maximum     = 31,
            step        = 0x1,
            default     = 1,

    enddate;

    time    hour varid  = Time.Hours,         // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
            prompt      = STRING_TOKEN(STR_TIME_PROMPT),
            help        = STRING_TOKEN(STR_TIME_HOUR_HELP),
            minimum     = 0,
            maximum     = 23,
            step        = 1,
            default     = 0,

            minute varid  = Time.Minutes,       // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
            prompt        = STRING_TOKEN(STR_TIME_PROMPT),
            help          = STRING_TOKEN(STR_TIME_MINUTE_HELP),
            minimum       = 0,
            maximum       = 59,
            step          = 1,
            default       = 0,

            second varid  = Time.Seconds,       // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
            prompt        = STRING_TOKEN(STR_TIME_PROMPT),
            help          = STRING_TOKEN(STR_TIME_SECOND_HELP),
            minimum       = 0,
            maximum       = 59,
            step          = 1,
            default       = 0,

    endtime;

    grayoutif 
      ideqval Date.Day == 21
      AND
      ideqval Date.Month == 8;
    
    hidden  value = 32, key = 0x7777;

    endif; // grayoutif

    suppressif
      ideqval Date.Day == 8
      AND
      ideqval Date.Month == 21; 
    
    hidden  value = 32, key = 0x7777;

    endif; // suppressif


    hidden  value = 32, key = 0x1234;

    inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
      ideqval MyIfrNVData.HowOldAreYouInYearsManual == 4
    endif;
     
    inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
      ideqvallist MyIfrNVData.HowOldAreYouInYearsManual == 1 2 3 4
    endif;

    inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
      ideqid MyIfrNVData.HowOldAreYouInYearsManual == MyIfrNVData.MyFavoriteNumber
    endif;

//    grayoutif 
//
// If the day is 31 AND months is any of the following 2, 4, 6, 9, 11
//
    inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
      ideqval Date.Day == 31 
      AND
      ideqvallist Date.Month == 2 4 6 9 11
    endif;

//
// If the day is 30 AND month is 2
//
    inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
      ideqval Date.Day == 30
      AND
      ideqval Date.Month == 2
    endif;

//
// If the day is 29 AND month is 2 AND it year is NOT a leapyear
//
    inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
      ideqval Date.Day == 0x1D
      AND
      ideqval Date.Month == 2 
      AND
      NOT
      ideqvallist Date.Year == 2004 2008 20012 20016 2020 2024 2028 2032 2036
    endif;

    checkbox varid    = MyIfrNVData.ChooseToActivateNuclearWeaponry,
            prompt   = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
            help     = STRING_TOKEN(STR_CHECK_BOX_HELP),  
            flags    = 1,
            key      = 0,
    endcheckbox;

    text  
      help = STRING_TOKEN(STR_TEXT_HELP),  
      text = STRING_TOKEN(STR_TEXT_TEXT_1);
    
    text 
      help   = STRING_TOKEN(STR_TEXT_HELP),  
      text   = STRING_TOKEN(STR_TEXT_TEXT_1),
      text   = STRING_TOKEN(STR_TEXT_TEXT_2),
      flags  = 0,
      key    = MY_TEXT_KEY;
         
    goto 1, 
      prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage  // this too has no end-op and basically it's a jump to a form ONLY
      help   = STRING_TOKEN(STR_GOTO_HELP);

  endform;

  form formid = 3, title = STRING_TOKEN(STR_FORM3_TITLE);  // note formid is a variable (for readability) (UINT16) - also added Form to the line to signify the Op-Code

    grayoutif  ideqval MyIfrNVData.SuppressGrayOutSomething == 0x1;
      text  
        help = STRING_TOKEN(STR_TEXT_HELP),  
        text = STRING_TOKEN(STR_TEXT_TEXT_1);
        
    endif; //end grayoutif
    
    text  
      help = STRING_TOKEN(STR_TEXT_HELP),  
      text = STRING_TOKEN(STR_TEXT_TEXT_1);
    
  endform;
  
  form formid = 4, title = STRING_TOKEN(STR_FORM3_TITLE);

  endform;

  form formid = 0x1234,            // Dynamically created page, 
       title = STRING_TOKEN(STR_DYNAMIC_TITLE);  // note formid is a variable (for readability) (UINT16) - also added Form to the line to signify the Op-Code

    label 0x1234;

  endform;

endformset;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?