This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TM4C129XNCZAD:如何在运行时使菜单按钮可选

Guru**** 2873830 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1631476/tm4c129xnczad-how-to-make-a-menu-button-optional-at-run-time

器件型号: TM4C129XNCZAD

我有一组菜单按钮、定义如下。  我认为该结构需要在编译时设置、但我希望最后一个按钮仅在设置了某个变量(运行时)时可用。  我如何才能做到这一点?

 

//–42 面板 — 系统校准菜单=(CAL2_SCREEN )
//------------------------------------------------------------------------------------
tPushButtonWidget g_SystemCalibration1[]=

    RectangularButtonStruct (g_psPanels + 41、g_SystemCalibration1 + 1、0、
        &g_sKentec320x240x16_SSD2119、(BG_MIN_X + 5)、(BG_MIN_Y + 5)、180、30
        (PB_style_outline | PB_style_text_opaint | PB_style_text |
            PB_style_Fill | PB_style_release_notify)、
            ClrDarkBlue、ClrBlue、ClrWhite、ClrWhite、
            G_psFontCmss14b、“",“,0、0、0、0、 0、OnDisLevelCALBtnPress)、

    RectangularButtonStruct (g_psPanels + 41、g_SystemCalibration1 + 2、0、
        &g_sKentec320x240x16_SSD2119、(BG_MIN_X + 5)、(BG_MIN_Y + 40)、180、30
        (PB_style_outline | PB_style_text_opaint | PB_style_text |
          PB_style_Fill | PB_style_release_notify)、
          ClrDarkBlue、ClrBlue、ClrWhite、ClrWhite、
          G_psFontCmss14b、“",“,0、0、0、0、 0、OnLevelSNSensBtnPress)、

    RectangularButtonStruct (g_psPanels + 41、g_SystemCalibration1 + 3、0、
        &g_sKentec320x240x16_SSD2119、(BG_MIN_X + 5)、(BG_MIN_Y + 75)、180、30
        (PB_style_outline | PB_style_text_opaint | PB_style_text |
            PB_style_Fill | PB_style_release_notify)、
          ClrDarkBlue、ClrBlue、ClrWhite、ClrWhite、
            G_psFontCmss14b、“",“,0、0、0、0、 0、OnEnDisQuickStopAtLLBtnPress)、  

//搜索“g_SystemCalibration1 + 3“以在第 1 部分和第 2 部分之间来回移动
    RectangularButtonStruct (g_psPanels + 41、g_SystemCalibration1 + 4、0、         
        &g_sKentec320x240x16_SSD2119、(BG_MIN_X + 5)、(BG_MIN_Y + 110)、180、30
        (PB_style_outline | PB_style_text_opaint | PB_style_text |
            PB_style_Fill | PB_style_release_notify)、
          ClrDarkBlue、ClrBlue、ClrWhite、ClrWhite、
            G_psFontCmss14b、“",“,0、0、0、0、 0、OnSensorTypeChange)、      


    RectangularButtonStruct (g_psPanels + 41、g_SystemCalibration1 + 5、0、
     &g_sKentec320x240x16_SSD2119、(BG_MIN_X + 5)、(BG_MIN_Y + 145)、180、30
     (PB_style_outline | PB_style_text_opaint | PB_style_text |
       PB_style_Fill | PB_style_release_notify)、
       ClrDarkBlue、ClrBlue、ClrWhite、ClrWhite、
       G_psFontCmss14b、“自动模式延迟“、0、0、0、 0、OnAutoDelayBtnPress)、     


    RectangularButtonStruct (g_psPanels + 41、g_SystemCalibration1 + 6、0、
      &g_sKentec320x240x16_SSD2119、(BG_MIN_X + 5)、(BG_MIN_Y + 180)、180、30
      (PB_style_outline | PB_style_text_opaint | PB_style_text |
        PB_style_Fill | PB_style_release_notify)、
        ClrDarkBlue、ClrBlue、ClrWhite、ClrWhite、
        G_psFontCmss14b、“第一个通用板复位“、0、0、0、0、 FirstGenBoardReset)、     


    RectangularButtonStruct (g_psPanel + 41、0、0、
             &g_sKentec320x240x16_SSD2119、(BG_MAX_X –50)、(BG_MAX_Y - 50)、50、40、
             PB_style_IMG、0、0、0、0、0、0、 G_OnBackBtnpress Backward_Btn、g_OnBtnPress、g_OnBtnPress、0、0、0、0、Backward_Btn、
};