2021-12-02 02:25 PM
I do
void Screen1View::updateAsciiInView(char* CwChar)
{
// add to txtbuffer
Unicode::strncpy(textAreaAsciiBuffer, CwChar, 1);
textAreaAscii.invalidate();
}
and that works fine ...my char i s displayed in the first position.
But i need to add it to the end so need something like
void Screen1View::updateAsciiInView(char* CwChar)
{
get the current textbuffer
add to the end of the buffer
Unicode::strncpy(textAreaAsciiBuffer, buffer, buffer length);
textAreaAscii.invalidate();
}
But how to do that ...
THANKS ;o)
Hjalmar
Solved! Go to Solution.
2021-12-03 05:46 AM
You could define a variable, e.g. bufferPosition and store the length of the recent buffer in it, as it is done in Keyboard.cpp/Keyboard.hpp (part of the widgets):
void Keyboard::setBuffer(Unicode::UnicodeChar* newBuffer, uint16_t newBufferSize)
{
buffer = newBuffer;
bufferSize = newBufferSize;
enteredText.setWildcard(buffer);
// Place cursor at end of string if we already have something
// in the edit buffer.
bufferPosition = Unicode::strlen(buffer);
}
Regards
/Peter
2021-12-03 05:46 AM
You could define a variable, e.g. bufferPosition and store the length of the recent buffer in it, as it is done in Keyboard.cpp/Keyboard.hpp (part of the widgets):
void Keyboard::setBuffer(Unicode::UnicodeChar* newBuffer, uint16_t newBufferSize)
{
buffer = newBuffer;
bufferSize = newBufferSize;
enteredText.setWildcard(buffer);
// Place cursor at end of string if we already have something
// in the edit buffer.
bufferPosition = Unicode::strlen(buffer);
}
Regards
/Peter
2021-12-03 11:53 AM
Thanks ....helped me a lot
Hjalmar
2021-12-06 07:42 AM
Great!
If the problem is resolved, please mark this topic as answered by selecting Select as best. This will help other users find that answer faster.
/Peter
2021-12-06 08:39 AM
hi thanks did that