cancel
Showing results for 
Search instead for 
Did you mean: 

ScrollWheel custom behavior by overriding setY does not work with use of "Selected Style Template"

rpatt
Associate

When using selected style template, the y values are not correct. If the selected menu is in the middle, the menu elements below the selected menu starts with new 0 y coordinates. How do you create circular scroll wheel in this condition

4 REPLIES 4
Romain DIELEMAN
ST Employee

Hi,

The scrollWheel widget with the "selected style " option enabled is a nightmare (to me) to work with when trying to modify the position :grinning_face_with_sweat:. The issue with it is that in reality it is using 3 scroll wheels: one above, one with the selected style, and one under it. I would suggest to use the normal scrollWheel and do the changes yourself to an item when it is supposed to be "selected". By that I mean if you wanted to have the items selected to have a red background or bigger font, then you have to do it through user code when it reaches a certain position.

It sounds annoying and difficult, but it should just be annoying depending on what you are trying to do ;)

/Romain

I did a quick demo a while back to show how to do a scrollWheel with a circular movement if you want an example. I dont know why but it doesn't work with TouchGFX 4.16 so use 4.15 if you have and look at the code.

/Romain

rpatt
Associate

Thank you for the answer Romain. Is there a roadmap to fix this issue from TouchGfx? By using your suggested method, you might lose some of the animation effects during movement of scroll wheel.

I could not get your code working with my TouchGfx 4.16. I managed to get it working by setting index of each element and index of current selected element within the class of the element. If the element is in 2nd half (after the selected item), I will add an extra height to its Y (half the screen height) during the X shift calculation. It works mostly, but I see some artifacts in animation.

Hi,

I doubt it is to be changed in the short term. What animation effects do you have in mind ? Technically you should still be able to do what you wish but it definitely requires more code unfortunately.

/Romain