Page 1 of 1

Button Controls

Posted: Tue Sep 11, 2018 7:30 am
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

Re: Button Controls

Posted: Tue Sep 11, 2018 12:33 pm
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

Re: Button Controls

Posted: Tue Sep 11, 2018 3:55 pm
by Haz
I am using protocol 2.12 as sent by the LCd I am using