Updating Button Text And Colour
Posted: Wed Jul 03, 2019 2:03 pm
Hello,
Thanks for taking the time to read my dismal plea for help.
I am wanting to have a button change color and text once pressed.
Here's my code:
Ft_Gpu_CoCmd_FgColor(phost,0xB5B5B5);
Ft_App_WrCoCmd_Buffer(phost,TAG_MASK(1));
Ft_App_WrCoCmd_Buffer(phost,TAG(1));
Ft_Gpu_CoCmd_Button(phost,11, 407, 175, 60, 31, 0, "DO IT!");
Ft_App_WrCoCmd_Buffer(phost,TAG_MASK(0));
Above this code at the start of my function:
while(1)
{
tag = Ft_Gpu_Hal_Rd8(phost,REG_TOUCH_TAG);
if(tag==1) // was do it pressed?
{
Ft_Gpu_CoCmd_Dlstart(phost);
Ft_App_WrCoCmd_Buffer(phost,CLEAR(1,1,1)); //Buffer Clear
Ft_Gpu_CoCmd_FgColor(phost,0xE5E5C5);
Ft_Gpu_CoCmd_Button(phost,11, 407, 175, 60, 31, 0, "GO BACK");
Ft_App_WrCoCmd_Buffer(phost,DISPLAY());
Ft_Gpu_CoCmd_Swap(phost);
What I want is:
When user presses Do It! The button color changes, the text changes and Do It! does something.
It could be anything.
Thanks for your help.
Thanks for taking the time to read my dismal plea for help.
I am wanting to have a button change color and text once pressed.
Here's my code:
Ft_Gpu_CoCmd_FgColor(phost,0xB5B5B5);
Ft_App_WrCoCmd_Buffer(phost,TAG_MASK(1));
Ft_App_WrCoCmd_Buffer(phost,TAG(1));
Ft_Gpu_CoCmd_Button(phost,11, 407, 175, 60, 31, 0, "DO IT!");
Ft_App_WrCoCmd_Buffer(phost,TAG_MASK(0));
Above this code at the start of my function:
while(1)
{
tag = Ft_Gpu_Hal_Rd8(phost,REG_TOUCH_TAG);
if(tag==1) // was do it pressed?
{
Ft_Gpu_CoCmd_Dlstart(phost);
Ft_App_WrCoCmd_Buffer(phost,CLEAR(1,1,1)); //Buffer Clear
Ft_Gpu_CoCmd_FgColor(phost,0xE5E5C5);
Ft_Gpu_CoCmd_Button(phost,11, 407, 175, 60, 31, 0, "GO BACK");
Ft_App_WrCoCmd_Buffer(phost,DISPLAY());
Ft_Gpu_CoCmd_Swap(phost);
What I want is:
When user presses Do It! The button color changes, the text changes and Do It! does something.
It could be anything.
Thanks for your help.