cancel
Showing results for 
Search instead for 
Did you mean: 

How to read value of textArea?

EEuge
Senior

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...

4 REPLIES 4
MM..1
Chief II

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.

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 ?

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.

Alexandre RENOUX
Principal

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