2019-05-03 08:47 AM
Hi everyone,
i would remove or add a object in a scroll list
I try to use
paramScroll.remove(*paramScrollListItems.getDrawable(0));
paramScroll.add(*paramScrollListItems.getDrawable(5));
but it don't work.
paramScrollListItems is a DrawableListItems.
How can i do this function in a scroll list?
2019-05-07 12:35 AM
Hi @Community member,
Have you read this article on Scroll List? https://touchgfx.zendesk.com/hc/en-us/articles/360018095032-Scroll-List
/Martin
2019-05-09 12:29 AM
Yes, i read.
So if i want remove/add an object i must use the callback is invoked when an item has been clicked?
2019-05-13 06:09 AM
The way the callbacks work is allow you to select the next item to add/delete during scroll - This allows us to not allocate all items required for a list but only the visible ones.
2019-05-14 08:25 AM
This is max number of object in my list
paramScroll.setNumberOfItems(11);
instead this is the function linked with item -> updateItemCallback
paramScroll.setDrawables(paramScrollListItems, updateItemCallback);
i override updateItemCallback that it is called every time change sometime but i don't understand how i can add/remove object...
Can you write an example?
2019-05-15 11:49 PM
Hi @Community member,
Please check out the ScrollableList and Wheel example from within the designer. You'll see examples of how to set the update-item-callbacks in the baseclass and how to go about their implementation.
Hope that helps,
Martin
2019-05-16 02:57 AM
Hi Martin,
i understand how set attribute of item but i don't know how remove or add item from scrollList
void InkjetMenuView::paramScrollUpdateItem(RecordInkject& item, int16_t itemIndex)
{
switch (itemIndex)
{
case 0:
{
item.updateTextParam(T_PVFIRE);
item.updateTextValue(IPLINK_HeadData[headShow].vFire);
item.setId(0);
break;
}
...
i try to use
paramScroll.remove(item);
inside a function of scrollList but it doesn't work...
2019-05-16 03:57 AM
Hi again,
Just to be completely sure about what you're trying to do, could you visualize it? Drawing or otherwise. What's working for you and what isn't. Screenshots of your running application - What're you expecting? Thanks!
/Martin
2019-05-16 05:25 AM
This is my screen
If i use
if(itemIndex == 0)
paramScroll.remove(item);
I expecting that first line delete and i see scroll list without first object
so what do i wrong?
Thanks for help me.
2019-05-16 05:31 AM
Thanks. But what is the application doing when
if(itemIndex == 0)
paramScroll.remove(item);
.. is executed? You're scrolling?