Question
TypedText is not replaced by the one in textBuffer
I am working on an Application where I am using a ScrollList which should serve as menu.
There is no touch so I control the behaviour by buttons.
Depended on the menu to show the content is predefined by text resources. However some content is dynamic such as a file list which I intent to display.
If I set the TypedText it is displayed correctly, but if I afterwards like to change the entry a a dynamic text, the TypedText is not cleared.
virtual void scrollListMenuUpdateItem(lstEntry& item, int16_t itemIndex)
{
:
// sometime a predefined text is displayed
item.setItemTypedText(T_MAIN_MENU_SETUP);
:
// in antoher case, a dynamic text should be displayed
item.setItemText(fileList[itemIndex].c_str());
:
// force redraw
item.invalidate();
}How can I flush the old text of the list items?
Here are the implementations of the methods:
void setItemTypedText(TypedTextId typedTextId)
{
text.setTypedText(TypedText(typedTextId));
}
void setItemText(const char* itemText)
{
touchgfx::Unicode::strncpy(textBuffer, itemText, TEXT_SIZE);
textBuffer[TEXT_SIZE-1] = 0;
}