2019-11-05 02:26 AM
I can get scroll wheel selected item index:
/**
* @fn int ScrollWheelBase::getSelectedItem() const;
*
* @brief Gets selected item.
*
* Gets selected item. If an animation is in progress, the item that is being scrolled
* to is returned, not the item that happens to be flying by at the time.
*
* @return The selected item.
*/
int getSelectedItem() const;
But I Need programmatically set selected item
2019-11-05 03:58 AM
Please have a look at the code for Scroll Wheel. Notice how something is selected when the user touches or drags - I think you should be able to come up with something to select the item you want.
/Martin
2019-11-06 03:55 PM
I assume you're trying to have a button press invoke the scroll up and scroll down behaviour?
FWIW here's what we did to get that happening.
Having set up interactions in the designer such that soft- and/or hard-buttons invoke eg ViewBase::scrollDown() and ViewBase::scrollUp() methods, then in the View class have these methods do eg:
virtual void scrollDown()
{
presenter->incrItemIndex();
scrollWheel.animateToItem(presenter->getItemIndex(), 0);
}
virtual void scrollUp()
{
presenter->decrItemIndex();
scrollWheel.animateToItem(presenter->getItemIndex(), 0);
}
Cheers,
Andrew