cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F746G-DISCO, GFX, STM32CubeIDE

ADębs.1
Senior

I have a screen and two buttons.

With one I change the value, e.g. uint8_t sec. The other one changes the screen.

How to set that when sec = 0 it is impossible to change the screen. It could be changed with other sec values.

greetings

Andrzej

1 ACCEPTED SOLUTION

Accepted Solutions

Is this better or you prefer not a zip at all ?

View solution in original post

9 REPLIES 9
Romain DIELEMAN
ST Employee

Hi,

I suppose you are currently using an Interaction with as Action "Change screen" when the button is pressed ? If yes one way to do this could be to use for this same Interaction as Trigger a fake "Hardware button is clicked" instead of the button. You then create another Interaction with as Trigger the real button and as Action "Call new virtual function". Then in code you just need to overwrite this function in your <screen name>View.cpp with something like this for example:

void Screen1View::function_changeScreen()
{
    if (sec != 0 )
    {
        application().gotoScreen2ScreenNoTransition();
    }
}

I'll attach a small example.

/Romain

ADębs.1
Senior

Thank you. What can open this file?

Andrzej

It is just a zip file, so any zip tool can be used

/Romain

ADębs.1
Senior

Checking.

Andrzej

I do not know. I have an Acer laptop, Window 10, and I'm using the file explorer. I downloaded the program and saved it. He saved himself as blockTransition plik7Z. But in the exploiter, it slides to open as txt.

Andrzej

zip

Not a 7Z but a zip.

Andrzej

Is this better or you prefer not a zip at all ?

ADębs.1
Senior

Thank you.

Is OK

Andrzej