2020-12-18 12:21 PM
Hello!
I have Scrollist with customcontainer, which contains textArea1 widget
I set text while working
Unicode::UnicodeChar buffer[20];
Unicode::strncpy(buffer, FileList[data], 20);
Unicode::snprintf(textArea1Buffer, 20, "%s", buffer);
textArea1.setWildcard(textArea1Buffer);
textArea1.invalidate();
How can I read text?
Please give me syntax of it, I tried getTypedText, but wothout success...
2020-12-19 10:31 AM
I mean you dont need read text, but on select you have item number , then text is same as you write to item in update function.
FileList[selectedItemNo]
And when you use list and custom containers i mean you dont have method to read textAreaBuffer back.
2020-12-19 10:40 AM
Good.
But what can I do if custom container was filled not by me, if was filled by some function?
You don't understand me.
I need to output the contents of the folder in the custom container.Theoretically, the files in it can be 65536 and the name length is up to 256 bytes. Creating a variable (as you advised me in the next topic) is not rational because of the large amount of memory. Therefore, I want to do this - read the file name using FatFs, output it to the custom container, and when selecting a file, read the value of the text placed in the custom container. So, thanks for the alternative advice, but I have to repeat my question - how to read text in textarea ?
2020-12-19 11:16 AM
Maybe you dont understand your code. You to textarea write only 20 chars, but full filename can be longer , then read it back is unusable.
But simple you can use, c++ and extend container class by string variable for store filename.
In TouchGFX is created N copies of custom container , where N is count of displayed lines or better say list items +2 (spare for scrolling up down)
Then realy in memory you have N*256 chars. You must write setter and getter methods and use it.
Other way i explain you in second your thread.
2020-12-20 09:37 PM
Hello EEuge,
Since your widget is a TextAreaWithOneWildcard, call getWildcard not getTypedText to get the content of your TextArea :
Unicode::strncpy(buffer, textToCopy.getWildcard(), 10);
When your question is answered, please close this topic by choosing Select as Best.
/Alexandre