cancel
Showing results for 
Search instead for 
Did you mean: 

how to create rotary switch (round selector?) in TouchGFX?

SEMad
Associate III

Hi.

I want to use a round switch to switch between several mode for my application...

I mean something like this:

0693W00000NsIHKQA3.pngis it possible?

thanks.

3 REPLIES 3
Yoann KLEIN
ST Employee

Hello @SEMad​ ,

TouchGFX doesn't currently support this kind of widget, unfortunately.

So, you will have to create it yourself.

You can for example start from a Circle widget, adjust he Start & End Angle parameters, modify the code to detect the user finger location on the circle, in order to move the indicator accordingly to that. There is the documentation of this widget.

Otherwise, you can take a look to the Custom widget documentation, if you want to create a new component from scratch.

Hope that this helped,

/Yoann

Yoann KLEIN
ST Software Developer | TouchGFX

thanks for answer.

how can I detect the user finger location? is there any particular function for that? or... ?

Hello @SEMad​ ,

You will have to implement a ClickListener in your application.

To get some inspiration, you can check this post, it should help you understanding how to use it.

/Yoann

Yoann KLEIN
ST Software Developer | TouchGFX