Skip to main content
Zakba.1
Associate III
December 20, 2021
Question

move between variables in touch gfx using pushbutton.

  • December 20, 2021
  • 1 reply
  • 641 views

Hi

I have 10 variables(wildcards) on the screen and 4 pushbuttons(up,down,left,right). I need need to move between them and the chosen number become red. I know how to send variables and flags from the backend to the view through the MVP. my question is how to write the code for moving and changing the color of vars in the screen view?

I would appreciate any help. thank you in advance.

This topic has been closed for replies.

1 reply

Yoann KLEIN
ST Employee
February 18, 2022

Hello @Zakba.1​ ,

I worked on a project that implements a TextArea matrix (3*4 elements), and which enables the user to navigate through and select different items of this matrix.

Each of those items are wildcards and are set as numbers from 1 to 12 in the Screen1View.cpp setup method.

When the user navigates in the matrix, the new selected element font turns red and the previous one turns black again. There is also a cursor around the selected item that helps the user to locate more easily the element in the matrix.

I used a STM32G071 NUCLEO board for this project. It is equipped with a 4-directionnal joystick.

You will find the .zip project file attached to this post.

Please let me know if it helped you,

/Yoann

Yoann KLEINST Software Developer | TouchGFX