Scroll Wheel items: Misalignment between what is seeing and where the code item is.
Hi all;
I have developed an application where there is a simple SrollWhell with a custom container, in which there is a icon and a number which content depend of the value of the current item selected, so that is my problem:
I see that the current item selected is changing sequentially following the scroll whell but the icon and number goes a step back from this.
Code:
This part is right: void ScreenSetSubsystemView::scrollWheellistSubsystemUpdateItem(MenuElement& item, int16_t itemIndex) {
currentItemSelected = scrollWheellistSubsystem.getSelectedItem();
where currentItemSelected is working fine
This part is what I wanted to fix:
void MenuElement::setIcon(int SubsystemType, int SegmentNumb) {
switch(SubsystemType)
{
case 0:
icon.setBitmap(Bitmap(BITMAP_GRIFO_140_150_ID));
Unicode::snprintf(textnumSegmentBuffer, TEXTNUMSEGMENT_SIZE, "%02d", SegmentNumb);
touchgfx_printf("SetIcon case 0 SubsystemType : %d, SegmentNumb : %d\n", SubsystemType, SegmentNumb);
textnumSegment.invalidate();
break;
case 1:
icon.setBitmap(Bitmap(BITMAP_PISCINA_BASE_140_150_ID));
Unicode::snprintf(textnumSegmentBuffer, TEXTNUMSEGMENT_SIZE, "%02d", SegmentNumb);
touchgfx_printf("SetIcon case 1 SubsystemType : %d, SegmentNumb : %d\n", SubsystemType, SegmentNumb);
textnumSegment.invalidate();
break;
case 2: .......
What happen is that, when the code is in case 1 , I can see that toucgfx show me correctly this case, but the icon.setBitmap is in the case 0 and so on with the rest o cases.
I was trying to fixe it using differente values for selected item offset and item margin but I won't find the way.
Thanks a lot for the help
Regards
Francisco García
