cancel
Showing results for 
Search instead for 
Did you mean: 

Where to define setAnimationEndedCallback for my scroolwheel I want to .getSelectedItem(); when the scroll wheel stop spinning but have had a hard time to define the callback

hjh
Associate III

i do not want to "presenter -> changeWPM(itemIndex);" when spinning but after spinning have ended ...

Please help or point me to the solution

class Screen1View : public Screen1ViewBase

{

public:

  Screen1View();

  virtual ~Screen1View() {}

  virtual void setupScreen();

  virtual void tearDownScreen();

  virtual void handleTickEvent();

  virtual void updateAsciiInView(char* CwChar);

  virtual void updateRealWpmInView(int RealWpmValue);

  virtual void SetLineProgress(int* value);

  virtual void scrollWheel1UpdateItem(wpmWheel& item, int16_t itemIndex)

  {

   item.setNumber(itemIndex);

  }

  virtual void scrollWheel1UpdateCenterItem(wpmWheel_Selected& item, int16_t itemIndex)

  {

   item.setNumber(itemIndex);

#ifndef SIMULATOR

presenter -> changeWPM(itemIndex);

  #endif

  }

Best regards

Hjalmar

1 REPLY 1
Yoann KLEIN
ST Employee

Hello @hjh​ ,

The example "Scroll Wheel and List Example", in TouchGFXDesigner can be very helpful for you.

For instance, in the MainView.cpp class, you can see the scrollWheelAnimateToHandler() method, which updates a wildcard value in a TextArea only when the user stopped spinning the ScrollWheel.

Let me know how it is going,

/Yoann

Yoann KLEIN
ST Software Developer | TouchGFX