2024-06-25 01:55 AM
Hi!
I'm developing an application in the simulator, I'm stuck on one bug with the scrollWheel.
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:
Am I doing something wrong?
Thanks in advance.
2024-06-25 02:43 AM
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,
2024-09-02 02:29 AM
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,