Skip to main content
ADębs.1
Senior
May 31, 2021
Solved

STM32F746G-DISCO, GFX, STM32CubeIDE

  • May 31, 2021
  • 9 replies
  • 1406 views

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

This topic has been closed for replies.
Best answer by Romain DIELEMAN

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

9 replies

Romain DIELEMAN
ST Employee
June 1, 2021

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
ADębs.1Author
Senior
June 1, 2021

Thank you. What can open this file?

Andrzej

Romain DIELEMAN
ST Employee
June 1, 2021

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

/Romain

ADębs.1
ADębs.1Author
Senior
June 1, 2021

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

ADębs.1
ADębs.1Author
Senior
June 1, 2021

Checking.

Andrzej

ADębs.1
ADębs.1Author
Senior
June 1, 2021

Thank you.

Is OK

Andrzej