Correct way of reset scrollwheel
I try to implement a multilevel menusystem with one scrollwheel-widget and pysical buttons.
I added a scrollwheel with 10 items(even if my menu has not 10 items in every level of hierachy) and want to manage the items on my own, as i want to use this scrollwheel to show every level of my menusystem
root
A
A0
A1
B
B0
B1
C
C0
C1But i'm having some troubles with foring the correct redraw of the scrollwheel.
I overloaded
void MenuLevel1View::scrollWheel1UpdateItem(menuItemNormal& item, int16_t itemIndex)
void MenuLevel1View::scrollWheel1UpdateCenterItem(menuItemSelected& item, int16_t itemIndex)
I can navigate trough my root menu level and the overloaded update functions are called and i see ABC in a list as expected.
When i want to switch to another menulevel i call a function to set the root of my scroolwheel to the new tree-node to show all it's leafes (set to C should show C0 and C1)
When i have selected "C" the itemindex of the scrollwheel is 2
I tried to call
scrollWheel1.invalidate();
scrollWheel1.initialize();
scrollWheel1.itemChanged(0);but no matter what i do the UpdateItem functions are always called with itemindex starting at the position which was last selected. So when i try to switch into the Level A it works because last itemindex is 0.
But on Level B or C it does not work as expected because the last itemindex is 1(B) or 2(C)
So when i switch into B B1 is selected. When i switch into C the element C2 is selected (which does not exist) I can then scroll up and i see the elements C0 & C1
So what do i have to do to force the redraw of all the scrollwheel list elements staring with itemindex 0?
