2024-06-25 1: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 2: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 2: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,
2025-05-27 2:29 AM
Hello,
I'm stuck with the same problem. @Iñaki_Bidasoro, did you manage to solve it?
@GaetanGodart, your solution doesn't work for me. The ScrollWheel doesn't update unless I call animateToItem from a hardware button callback. Both scrollWheelMenuUpdateCenterItem and scrollWheelMenuUpdateItem are called, but they have no effect on the framebuffer.
It actually works in the simulator, so I suspect there might be a bug in the widget.
Regards,
Davide
2025-05-27 3:47 AM
Hello @Dadigno ,
The project you share have no ioc file so I cannot run it on a board.
If I create a new project with a board and import your GUI, I get errors.
Can you please share the full project with with the ioc file (so not just the TouchGFX folder but the "root" folder).
Regards,
2025-05-27 6:44 AM
The board is custom, so I don't think you can test it directly.
However, you can test this behavior in your own context with a simple scrollwheel. Take a look at my MenuView.cpp class.
2025-05-28 7:46 AM
Hello @Dadigno ,
It seems like I have to look at more than just the MenuView.cpp file to reproduce what you have.
It seems like you first do :
void MenuView::setupScreen()
{
MenuViewBase::setupScreen();
scrollWheelMenu.setNumberOfItems(presenter->getMenuNumberOfEntry()+1);
}
What happens if you invalidate the scrollWheel after that?
What happens if you call childgeometrychanged on your scrollWheel and then invalidate?
Regards,