TouchGFX ScrollWheel widget index does not match UI
I have noticed what might be a bug in the updateItemCallbackHandler() in my screen's ViewBase file where the itemIndex consistently moves ahead 1 index when I swipe up.
/* Scroll Wheel Item Update response to swiping is generated by TouchGFX */
void ModeScreenViewBase::updateItemCallbackHandler(touchgfx::DrawableListItemsInterface* items, int16_t containerIndex, int16_t itemIndex)
{
if (items == &scrollWheelModeListItems)
{
touchgfx::Drawable* d = items->getDrawable(containerIndex);
ValuesMenu* cc = (ValuesMenu*)d;
scrollWheelModeUpdateItem(*cc, itemIndex);
}
else if (items == &scrollWheelModeSelectedListItems)
{
touchgfx::Drawable* d = items->getDrawable(containerIndex);
ValuesMenu* cc = (ValuesMenu*)d;
scrollWheelModeUpdateCenterItem(*cc, itemIndex);
}
}During debugging, I noticed my value for swiping down to decrement by 1 but swiping up increments by 1 twice initially. The function scrollWheelModeUpdateCenterItem(), which references itemIndex, is called twice when swiping up for after entering the screen or after swiping down.
Note: values in the scroll wheel are wildcard placeholders. The expected behavior is the string highlighted is supposed to match the center item in the scroll wheel. The text of the center item and my string match when swiping down. However, the string using the ViewBase index will be the next item in the scroll wheel.
/* Prints highlighted string */
Unicode::strncpy(textAreaSelectedModeBuffer, modeScreenList[itemIndex], TEXTAREASELECTEDMODE_SIZE-1);
ModeScreenViewBase::textAreaSelectedMode.setWildcard(textAreaSelectedModeBuffer);
ModeScreenViewBase::textAreaSelectedMode.invalidate();Additional Notes:
My Scroll Wheel animation and list appearance
The project is programmed onto a STM32429I-EVAL
