cancel
Showing results for 
Search instead for 
Did you mean: 

change the screen in TouchGFX

FTrom
Associate II

I m stunding TouchGFX with X-Nucleo-GFX01M1 with an example provided by STm.

In a ScreenView.cpp I can see the following code (Im will copy only one part).

void Screen1View::handleKeyEvent(uint8_t key)
{
    if (animationState != ANIMATION_READY ||
            menuAnimationState != MENU_ANIMATION_READY)
    {
        return;
    }
 
    if (key == '6')
    {
        // Right
        menuSelectRight();

where menuSelectRight is

void Screen1View::menuSelectRight()
{
    menuAnimationState = MENU_ANIMATION_STEP_0;
    menuAnimationTickCounter = 0;
 
    menuAnimationDirectionLeft = false;
}

menuAnimationState is just a enum and menuAnimationDirectionLeft is a boolean.

Can someone expalain where is the function to trig to go in the anohter Screen?

What I found is application().gotoLI found only I found only application().gotoSCREENNAMENoTransition();

It is in Screen1View subclass of Screen1ViewBase whitch call FrontendApplication subclass of FrontendApplicationBase

So I modify the paramter of the class Screen1View that it will read, after many jumps and inherites , from FrontendApplicationBase?

Thanks in advance

Fausto

1 REPLY 1
Romain DIELEMAN
ST Employee

Hi,

Which demo did you base this on ? need a bit more context 😅. Try to see if there is a GoToScreen interaction set in the Interactions tab in TouchGFX Designer.

/Romain