cancel
Showing results for 
Search instead for 
Did you mean: 

Changing color of the circle using physical button

KM L.1
Associate II

Working on designing the GUI in such a way that need​ to change the color of the small circle to indicate the status and also to show the mode changes . If one mode is selected circle color should be green or else white ....... im trying to work on this but im unable to change the color. So if available please send me some examples..

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
GPa.1
Associate III

Hi!

Try with the following:

Create an interaction for the button with an Action -> Call new virtual function. Generate code and overwrite the function on the ScreenView.

void Screen1View::function1()

{

circle1Painter.setColor(touchgfx::Color::getColorFrom24BitRGB(125, 125, 255));

circle1.invalidate();

}

Don't forget to include:

#include <touchgfx/Color.hpp>

Regards. 

GP

View solution in original post

6 REPLIES 6
GPa.1
Associate III

Hi!

Try with the following:

Create an interaction for the button with an Action -> Call new virtual function. Generate code and overwrite the function on the ScreenView.

void Screen1View::function1()

{

circle1Painter.setColor(touchgfx::Color::getColorFrom24BitRGB(125, 125, 255));

circle1.invalidate();

}

Don't forget to include:

#include <touchgfx/Color.hpp>

Regards. 

GP

KM L.1
Associate II

Hi,

Thank you for your response!!

I tried with the code you have shared and its working fine as expected.

KM L.1
Associate II

Can you please help me out in splashing an image for 3 seconds in TFT LCD(the image should display for 3 seconds and then switch back to default screen).

Thank You

Komala

Martin KJELDSEN
Chief III

Is this your "splash-screen" ? you could also just have a dedicated screen to display that image, override handleTickEvent() in your view and when 3 seconds have passed, tell the presenter to go to a different screen.

/Martin

KM L.1
Associate II

Thank you Martin,

Its working fine now .. Thank you for your support.

KM L.1
Associate II

Hi Martin,

How do I scroll the values using hardware buttons as we are not using touch.

Should I need to use the scrollable container ?