2020-02-25 10:08 AM
Hello!
I put textArea to Screen.
Here is code from Screen1ViewBase.cpp
tempText.setXY(489, 143);
tempText.setColor(touchgfx::Color::getColorFrom24BitRGB(0, 0, 0));
tempText.setLinespacing(0);
Unicode::snprintf(tempTextBuffer, TEMPTEXT_SIZE, "%s", touchgfx::TypedText(T_TEXTID2).getText());
tempText.setWildcard(tempTextBuffer);
tempText.resizeToCurrentText();
tempText.setTypedText(touchgfx::TypedText(T_SINGLEUSEID9));
add(tempText);
in screen1Veiw.cpp I try to change text
void Screen1View::Show_HotEnd1_Temperature(uint32_t temp)
{
Unicode::snprintf(tempTextBuffer, 3, "%d", temp);
tempText.invalidate();
}
Be sure, function Show_HotEnd1_Temperature is called and "temp"is not null.
But text not changes. Only anothe videobuffer activates (don't ask me how I know it)
What's wrong?
May be problem with wildcards?
I load example from TOuchGFXDesigner, and look to the textArea's config
But when I try to config my own textArea, I can't see "wildcard" button
what's wrong?
2020-02-25 11:44 PM
Does tempText have a width? What you can do after updating the buffer is call
textArea.resizeToCurrentText();
Or, you can start with a fixed width. My guess is that the text area is being updated, but the width is 0. When you add a textarea with wildcard from the designer, resize to current text is default, and if there's no default text to start with, then that width is 0 - Never to be updated again unless you do it manually.
/Martin