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: How to make a menu button optional at run time

Part Number: TM4C129XNCZAD

I have a set of menu buttons defined as follows.  I believe this structure needs to be set up at compile time, but I want the last button to be available only when a certain variable is set (run time).  How can I accomplish this?

 

///-The 42nd panel- System Cal menu = (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_OPAQUE | PB_STYLE_TEXT |
                        PB_STYLE_FILL | PB_STYLE_RELEASE_NOTIFY),
                        ClrDarkBlue, ClrBlue, ClrWhite, ClrWhite,
                        g_psFontCmss14b, "", 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_OPAQUE | PB_STYLE_TEXT |
                    PB_STYLE_FILL | PB_STYLE_RELEASE_NOTIFY),
                    ClrDarkBlue, ClrBlue, ClrWhite, ClrWhite,
                    g_psFontCmss14b, "", 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_OPAQUE | PB_STYLE_TEXT |
                        PB_STYLE_FILL | PB_STYLE_RELEASE_NOTIFY),
                    ClrDarkBlue, ClrBlue, ClrWhite, ClrWhite,
                        g_psFontCmss14b, "", 0, 0, 0, 0, OnEnDisQuickStopAtLLBtnPress), 

// Search for "g_SystemCalibration1 + 3" to move back & forth between part 1 and part 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_OPAQUE | PB_STYLE_TEXT |
                        PB_STYLE_FILL | PB_STYLE_RELEASE_NOTIFY),
                    ClrDarkBlue, ClrBlue, ClrWhite, ClrWhite,
                        g_psFontCmss14b, "", 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_OPAQUE | PB_STYLE_TEXT |
              PB_STYLE_FILL | PB_STYLE_RELEASE_NOTIFY),
              ClrDarkBlue, ClrBlue, ClrWhite, ClrWhite,
              g_psFontCmss14b, "AUTO MODE DELAY", 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_OPAQUE | PB_STYLE_TEXT |
                PB_STYLE_FILL | PB_STYLE_RELEASE_NOTIFY),
                ClrDarkBlue, ClrBlue, ClrWhite, ClrWhite,
                g_psFontCmss14b, "1ST GEN BOARD RESET", 0, 0, 0, 0, FirstGenBoardReset),      


        RectangularButtonStruct(g_psPanels + 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_Backward_Btn, g_Backward_Btn, 0, 0, OnBackBtnPress),
};