Button Controls

GTT TFT Support

Moderator: Mods

Post Reply
Haz
LCD Geek
Posts: 38
Joined: Wed Jun 28, 2017 8:52 am

Button Controls

Post by Haz »

I have an Image_Toggle (GTT2.5) object on my screen, and it has states like Toggled, Enabled and Selected. The enum shows
/*! enum eButtonState */
typedef enum eButtonState {
eButtonState_Up = 0, /*!< Up */
eButtonState_Down = 1, /*!< Down */
eButtonState_Disabled = 2, /*!< Disabled */
} eButtonState;

It seems I cannot disable the button in the down state? Meaning if i want to change the background pic to the down pic, without enabling the button for the user yet, it seems I cannot. When i run the Button down command, the button gets enabled.
Also when i need to disable the button, it seems I need to change the state to Up, then Disable. So sending 2 commands.

Is this the expected behavior? Do you have any sample code which help with detailed control of the Image buttons?

Thanks,
Haz

Daniel Divino
Matrix Orbital
Matrix Orbital
Posts: 247
Joined: Thu Sep 24, 2015 9:38 am

Re: Button Controls

Post by Daniel Divino »

Hi Haz,

As you know, there are only 3 states for buttons. As it's currently implemented, the disabled state will always be a grayed out version of the "Up" state, and we haven't implemented a disabled version of the "Down" state just yet.

A possible work around is to generate a bitmap for the disabled down state, and then you can manually switch between the "Up" disabled bitmap and the "Down" disabled bitmap whenever necessary using the gtt25_set_button_disabled_bitmap function.

Regarding your second issue with setting a button's state, I haven't been able to replicate the problem. During my testing, I found I was able to set the button's state from down to disabled to down once again successfully. Could you provide your firmware revision?

Cheers,
Daniel
Daniel Divino
Technical Support
Matrix Orbital

Haz
LCD Geek
Posts: 38
Joined: Wed Jun 28, 2017 8:52 am

Re: Button Controls

Post by Haz »

I am using protocol 2.12 as sent by the LCd I am using

Post Reply