cancel
Showing results for 
Search instead for 
Did you mean: 

ScrollWheel does'nt draw numbers until I move it

Iñaki_Bidasoro
Associate III

Hi!

I'm developing an application in the simulator, I'm stuck on one bug with the scrollWheel.

Iaki_Bidasoro_0-1719302738725.png

 

I have done these two scrollWheel that i update on their respective callbacks like this:

void Display_Stages::m_scroll_pressureUpdateItem (Item_To_Select &item, int16_t itemIndex)
{
  item.Update_Text (itemIndex);
}
void Display_Stages::m_scroll_pressureUpdateCenterItem (Selected_Item &item, int16_t itemIndex)
{
  item.Update_Text (itemIndex);
}

void Display_Stages::m_scroll_timeUpdateItem (Item_To_Select &item, int16_t itemIndex)
{
  item.Update_Text (itemIndex);
}
void Display_Stages::m_scroll_timeUpdateCenterItem (Selected_Item &item, int16_t itemIndex)
{

  item.Update_Text (itemIndex);
}

 

The problem is that when i make the widgets visible i do scroll.animateToItem (value) so that it can go where the value we want to modify is, and this works fine, but when its a new value and the  m_scroll_pressure.animateToItem (value) value =  0, as it is the same value that the position the widget is created in the callback doesn't trigger and it doesn't print a single number until i scroll a bit.

 

This is how it looks when bugged:

Iaki_Bidasoro_1-1719303260281.png


Am I doing something wrong? 

Thanks in advance.

2 REPLIES 2
GaetanGodart
ST Employee

Hello @Iñaki_Bidasoro ,

 

My first thought is that you don't invalidate.
Try something like:

void Display_Stages::m_scroll_pressureUpdateItem (Item_To_Select &item, int16_t itemIndex)
{
  item.Update_Text (itemIndex);
  pressureWheel.invalidate();
}
void Display_Stages::m_scroll_pressureUpdateCenterItem (Selected_Item &item, int16_t itemIndex)
{
  item.Update_Text (itemIndex);
  pressureWheel.invalidate();
}

void Display_Stages::m_scroll_timeUpdateItem (Item_To_Select &item, int16_t itemIndex)
{
  item.Update_Text (itemIndex);
  timeWheel.invalidate();
}
void Display_Stages::m_scroll_timeUpdateCenterItem (Selected_Item &item, int16_t itemIndex)
{

  item.Update_Text (itemIndex);
  timeWheel.invalidate();
}

(replace "pressureWheel" and "timeWheel" by the name of your scrollWheels).

 

If this comment solves your issue, I invite you to select it as "best answer".

If this doesn't solve your problem, I invite you to share your project in a 7z zipped file so I can try it myself.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)
GaetanGodart
ST Employee

Hello @Iñaki_Bidasoro ,

Have you been able to solve your problem?
If so, I invite you to select the most helpful comment as "best answer".

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)