How on EARTH do you change the text in the "textarea" programatically?????
As the subject says. searches over many hours have resulted in several different ways to do this, none of which work.
The CLOSEST ive gotten to a reaction out of a textbox outsode of some event is to break the rules, and *** with the autogenerated code. All that resulted in was getting the box to change to "??" which as crazy as it sounds, progress, because I have yet to figure out what methods to call to do this seemingly simple thing.
From the documentation:
touchgfx::Unicode::strncpy(textArea1Buffer, "string", TEXTAREA1_SIZE);
textArea1.resizeToCurrentText(); // optional, will resize the box to fit the text if it is too small
textArea1.invalidate();
This does absolutely nothing.
Again, from the documentation:
// With int/double/UnicodeChar*
touchgfx::Unicode::snprintf(textArea1Buffer,TEXTAREA1_SIZE,"My numbers %i %i", my_var_1, my_var_2 );
// With float
touchgfx::Unicode::snprintfFloat(textArea1Buffer,TEXTAREA1_SIZE,"My float %f", my_var_float );
textArea1.invalidate();
This does absolutely nothing.
And, again, from the documentation:
const uint8_t* Mystring = (const uint8_t*)"봉쥬르";
Unicode::fromUTF8(Mystring, textArea1Buffer, TEXTAREA1_SIZE);
textArea1.invalidate();
This does absolutely nothing.
What DOES SOMETHING outside of trying to change it in a 'tick' event is breaking the rules and changing the generated code but results in "??" being displayed:
testTextArea.setPosition(9, 47, 803, 124);
testTextArea.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
testTextArea.setLinespacing(0);
Unicode::snprintf(testTextAreaBuffer, TESTTEXTAREA_SIZE, "%s", "because i should not do this\0");//touchgfx::TypedText(T___SINGLEUSE_OYIT).getText());
testTextArea.setWildcard(testTextAreaBuffer);
testTextArea.setTypedText(touchgfx::TypedText(T___SINGLEUSE_ZPMF));
add(testTextArea);
What *SORT OF WORKS* but it's as hoaky as all getout.
"...View.cpp":
void ServiceView::handleTickEvent()
{
touchgfx::Unicode::strncpy(testTextAreaBuffer, TestTextBuffer, TESTTEXTAREA_SIZE);
testTextArea.resizeToCurrentText();
testTextArea.invalidate();
}
"...View.hpp":
Public:
virtual void handleTickEvent();
Unicode::UnicodeChar TestTextBuffer[50];
In some other place, like fired from main.c wrapped up in a function declared extern "C" in "...View.hpp/cpp":
Unicode::strncpy(TestTextBuffer, "This is a test", sizeof(TestTextBuffer) / sizeof(Unicode::UnicodeChar));
But this results in "T?is is a test", for example.
Or depending on the string I enter in there, some characters having a question mark in them.
Which leads me to some troubling observations that I can't see being correct...
1. All updates seem to have to happen in this tick event? That can't be.
2. Because of the above, which I can't believe is true.... I have to maintain some flag for each text item to make sure that it's not firing off a change *every single time* this tick is fired at whatever frequency it is fired.
How on earth is this supposed to be done? Do we REALLY have to change stuff in a "tick" event?? And why am i getting the seemingly random question marks? I need to change this from C... from events that occur based on either a hardware state change or something coming in via a data bus, etc.
What's the secret? Thanks all.
