2020-12-18 12:38 PM
Hello!
I have code, working with FatFS in system area of my project.
main.c
res = f_opendir(&dir, "0:/");
while(1)
{
res = f_readdir(&dir, &fileInfo);
if (res==FR_OK && fileInfo.fname[0])
{
fn = fileInfo.fname;
// ... some code
}
else break;
}
f_closedir(&dir);
And I have scrollList widget, where I want to show filelist.
How can I send list of filenames to widget by Model->Presenter->View ?
What can you advise for me?
Solved! Go to Solution.
2020-12-19 01:08 PM
Im not try this , but maybe
Unicode::fromUTF8((const uint8_t*)FileList[data],textArea1Buffer, 20);
textArea1.setWildcard(textArea1Buffer);
textArea1.invalidate();
2020-12-20 03:07 AM
Hello! All works very good.
But you forgot about one detail - after screen setup I need to close dir handle, and I need to open and close it every update of Item.
I added it, and all works very good.
2020-12-20 03:29 AM
Yes i write you need reset possition in dir, and you can try dir.index set before f_readdir, but other way is close and open dir =)
2020-12-20 06:02 AM
Thanks.
Next question.
I want work with scrolllist this way: touching and dragging -> scrolling the list of files, pressing (without drag) and releasing -> go to directory after releasing.
Question: how can i get Release event? Scrollist has onle 2 events - setItemSelectedCallback and setItemPressedCallback
2020-12-20 06:14 AM
Open new thread and mark here one reply as best
2020-12-20 06:15 AM
OK
2020-12-21 11:53 AM
Hello!
the scrollList1.itemChanged(itemIndex) function does not call scrollList1UpdateItem if the item with the itemIndex number is outside the scroll window. How to fix it?